Job.java 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * Copyright 2019-2020 Zheng Jie
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package me.zhengjie.dao.mybatis.entity;
  17. import io.swagger.annotations.ApiModelProperty;
  18. import lombok.Getter;
  19. import lombok.Setter;
  20. import me.zhengjie.base.BaseEntity;
  21. import javax.persistence.*;
  22. import javax.validation.constraints.NotBlank;
  23. import javax.validation.constraints.NotNull;
  24. import java.io.Serializable;
  25. import java.util.Objects;
  26. /**
  27. * @author Zheng Jie
  28. * @date 2019-03-29
  29. */
  30. @Entity
  31. @Getter
  32. @Setter
  33. @Table(name="sys_job")
  34. public class Job extends BaseEntity implements Serializable {
  35. @Id
  36. @Column(name = "job_id")
  37. @NotNull(groups = Update.class)
  38. @ApiModelProperty(value = "ID", hidden = true)
  39. @GeneratedValue(strategy = GenerationType.IDENTITY)
  40. private Long id;
  41. @NotBlank
  42. @ApiModelProperty(value = "岗位名称")
  43. private String name;
  44. @NotNull
  45. @ApiModelProperty(value = "岗位排序")
  46. private Long jobSort;
  47. @NotNull
  48. @ApiModelProperty(value = "是否启用")
  49. private Boolean enabled;
  50. @Override
  51. public boolean equals(Object o) {
  52. if (this == o) {
  53. return true;
  54. }
  55. if (o == null || getClass() != o.getClass()) {
  56. return false;
  57. }
  58. Job job = (Job) o;
  59. return Objects.equals(id, job.id);
  60. }
  61. @Override
  62. public int hashCode() {
  63. return Objects.hash(id);
  64. }
  65. }