Skip to content

Commit 08c8d12

Browse files
committed
feature: 增加 swagger 注解
1 parent 7ae1485 commit 08c8d12

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

pom.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>app.myoss.cloud</groupId>
88
<artifactId>myoss-spring-boot-parent</artifactId>
9-
<version>2020.0.0.RELEASE</version>
9+
<version>2021.0.0.RELEASE</version>
1010
</parent>
1111

1212
<groupId>app.myoss.cloud.mybatis</groupId>
@@ -116,5 +116,11 @@
116116
<scope>test</scope>
117117
</dependency>
118118
<!-- test end -->
119+
120+
<dependency>
121+
<groupId>io.swagger</groupId>
122+
<artifactId>swagger-annotations</artifactId>
123+
<optional>true</optional>
124+
</dependency>
119125
</dependencies>
120126
</project>

src/main/java/app/myoss/cloud/mybatis/repository/entity/AuditEntity.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
* @author Jerry.Chen
3232
* @since 2018年5月9日 下午2:10:02
3333
*/
34+
@io.swagger.annotations.ApiModel("审计实体基类,包含审计的字段")
3435
@Accessors(chain = true)
3536
@EqualsAndHashCode(callSuper = true)
3637
@Data
@@ -47,6 +48,7 @@ public class AuditEntity extends LogicDeleteEntity {
4748
* Database Column Remarks: 创建者
4849
* </p>
4950
*/
51+
@io.swagger.annotations.ApiModelProperty("创建者")
5052
@com.alibaba.fastjson.annotation.JSONField(label = LABEL_AUDIT_ENTITY)
5153
@Column(name = "creator", nullable = false, fillRule = { FillRule.INSERT })
5254
private String creator;
@@ -57,6 +59,7 @@ public class AuditEntity extends LogicDeleteEntity {
5759
* Database Column Remarks: 修改者
5860
* </p>
5961
*/
62+
@io.swagger.annotations.ApiModelProperty("修改者")
6063
@com.alibaba.fastjson.annotation.JSONField(label = LABEL_AUDIT_ENTITY)
6164
@Column(name = "modifier", nullable = false, fillRule = { FillRule.INSERT, FillRule.UPDATE })
6265
private String modifier;
@@ -67,6 +70,7 @@ public class AuditEntity extends LogicDeleteEntity {
6770
* Database Column Remarks: 创建时间
6871
* </p>
6972
*/
73+
@io.swagger.annotations.ApiModelProperty("创建时间")
7074
@com.alibaba.fastjson.annotation.JSONField(label = LABEL_AUDIT_ENTITY)
7175
@Column(name = "gmt_created", nullable = false, fillRule = { FillRule.INSERT })
7276
private Date gmtCreated;
@@ -77,6 +81,7 @@ public class AuditEntity extends LogicDeleteEntity {
7781
* Database Column Remarks: 修改时间
7882
* </p>
7983
*/
84+
@io.swagger.annotations.ApiModelProperty("修改时间")
8085
@com.alibaba.fastjson.annotation.JSONField(label = LABEL_AUDIT_ENTITY)
8186
@Column(name = "gmt_modified", nullable = false, fillRule = { FillRule.INSERT, FillRule.UPDATE })
8287
private Date gmtModified;

src/main/java/app/myoss/cloud/mybatis/repository/entity/AuditIdEntity.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
* @author Jerry.Chen
3232
* @since 2018年5月9日 下午2:15:14
3333
*/
34+
@io.swagger.annotations.ApiModel("审计实体基类,包含审计的字段,增加了主键id字段")
3435
@Accessors(chain = true)
3536
@EqualsAndHashCode(callSuper = true)
3637
@Data
@@ -46,6 +47,7 @@ public class AuditIdEntity<I extends Serializable> extends AuditEntity implement
4647
* <p>
4748
* Database Column Remarks: 主键id
4849
*/
50+
@io.swagger.annotations.ApiModelProperty("主键id")
4951
@Column(primaryKey = true)
5052
private I id;
5153

src/main/java/app/myoss/cloud/mybatis/repository/entity/LogicDeleteEntity.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
* @author Jerry.Chen
3030
* @since 2018年5月9日 下午2:20:26
3131
*/
32+
@io.swagger.annotations.ApiModel("逻辑删除实体基类")
3233
@Accessors(chain = true)
3334
@Data
3435
public class LogicDeleteEntity implements BaseEntity {
@@ -44,6 +45,7 @@ public class LogicDeleteEntity implements BaseEntity {
4445
* Database Column Remarks: 是否删除
4546
* </p>
4647
*/
48+
@io.swagger.annotations.ApiModelProperty("是否删除")
4749
@com.alibaba.fastjson.annotation.JSONField(label = LABEL_LOGIC_DELETE_ENTITY)
4850
@Column(name = "is_deleted", nullable = false, fillRule = {
4951
FillRule.INSERT }, logicDelete = true, logicDeleteValue = MyossConstants.Y, logicUnDeleteValue = MyossConstants.N)

0 commit comments

Comments
 (0)