为了加强实体类中,特殊字段类型的可读性和省去数据类型的转换,我们今天尝试把Int类型,例如状态这种整型字段换做枚举, 下面是旧代码
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("gdt_targeting")
@ApiModel(value="Targeting对象", description="定向数据")
public class Targeting extends BaseEntity {
@ApiModelProperty(value = "主键")
@TableId(value = "id", type = IdType.ID_WORKER)
private Long id;
@ApiModelProperty(value = "定向ID")
@TableField("targeting_id")
private Long targetingId;
@ApiModelProperty(value = "定向名称")
@TableField("targeting_name")
private String targetingName;
@ApiModelProperty(value = "定向所属广告主账号ID")
@TableField("account_id")
private Long accountId;
@ApiModel