注解这个想到什么些什么,有些写很浅显,不深入,如果需要详细了解可以一个一个查百度。
@TableName("")
@TableName这个注解是用来放数据库中相应的表名的。
@TableName("one_table")
public class OneTableEntity extends DataEntity {
/**
* 表id
*/
private String OneTableThingId;
/**
* 表名
*/
private String OneTableThingName;
}
@TableField(value = “”)
@TableField这个注解是用来告知表中名和程序取名不一致的情况用的,例如:表中名字是union_project_id,而程序中取名:unionProjectStageId。原本若取名unionProjectId,框架是可以根据驼峰规则自动注入/匹配到的,但因为取名有时候有必要不同,所以需要用这个注解。
@TableName("one_table")
public class OneTableEntity extends DataEntity {
/**
* 表id
*/
@TableField(value = "one_table_thing_id")
private String OneTableThingId;
/**
* 表名
*/
@TableField(value = "one_table_thing_name")
private String OneTableThingName;
/**
* 这样就可以把表中字段为union_project_id匹配到unionProjectStageId
*/
@TableField(value = "union_project_id")
private String unionProjectStageId;
}
@Data、@ApiModel、@ApiModelProperty
@Data这个注解加载类上面,简单说就是加了以后省去了自己写 get方法和set方法。
@ApiModel(value = “请求resp”) 这个注解简单说就是给前端看得到的说明Swagger UI上能显示出来表示这个类是干嘛用的
@ApiModelProperty(value = “公司id”)这个注解简单说就是给前端能看到的字段说明,告诉这个字段是干嘛的。
@Data
@ApiModel(value = "请求resp")
public class ApplyReq {
@ApiModelProperty(value = "公司id")
private String partaId;
@ApiModelProperty(value = "项目id")
private String projectId;
}