diff --git a/myoss-starter-core/pom.xml b/myoss-starter-core/pom.xml index 26becc4..59664b7 100644 --- a/myoss-starter-core/pom.xml +++ b/myoss-starter-core/pom.xml @@ -78,6 +78,12 @@ commons-text true + + io.swagger + swagger-annotations + ${swagger.version} + true + \ No newline at end of file diff --git a/myoss-starter-core/src/main/java/app/myoss/cloud/core/lang/dto/DictItem.java b/myoss-starter-core/src/main/java/app/myoss/cloud/core/lang/dto/DictItem.java index 86c7bc0..8f23959 100644 --- a/myoss-starter-core/src/main/java/app/myoss/cloud/core/lang/dto/DictItem.java +++ b/myoss-starter-core/src/main/java/app/myoss/cloud/core/lang/dto/DictItem.java @@ -32,27 +32,33 @@ * @since 2018年5月9日 下午4:33:50 */ @Data +@io.swagger.annotations.ApiModel("封装字典选项值") public class DictItem implements Serializable { private static final long serialVersionUID = -4979428360062313584L; /** * 值 */ + @io.swagger.annotations.ApiModelProperty("值") private T value; /** * 代码 */ + @io.swagger.annotations.ApiModelProperty("代码") private String code; /** * 名称 */ + @io.swagger.annotations.ApiModelProperty("名称") private String name; /** * 描述信息 */ + @io.swagger.annotations.ApiModelProperty("描述信息") private String desc; /** * 扩展信息 */ + @io.swagger.annotations.ApiModelProperty("扩展信息") private Map extraInfo; /** diff --git a/myoss-starter-core/src/main/java/app/myoss/cloud/core/lang/dto/Page.java b/myoss-starter-core/src/main/java/app/myoss/cloud/core/lang/dto/Page.java index defa601..e074f67 100644 --- a/myoss-starter-core/src/main/java/app/myoss/cloud/core/lang/dto/Page.java +++ b/myoss-starter-core/src/main/java/app/myoss/cloud/core/lang/dto/Page.java @@ -37,6 +37,7 @@ @Accessors(chain = true) @Data @EqualsAndHashCode +@io.swagger.annotations.ApiModel("封装分页查询参数") public class Page implements Serializable { /** * 默认的每页条数为:20 @@ -51,30 +52,40 @@ public class Page implements Serializable { /** * 每页条数 */ + @io.swagger.annotations.ApiModelProperty("每页条数") private int pageSize = DEFAULT_PAGE_SIZE; /** * 第几页,在MySQL中是从0开始,使用的时候需要减一 */ + @io.swagger.annotations.ApiModelProperty("第几页,在MySQL中是从0开始,使用的时候需要减一") private int pageNum = DEFAULT_PAGE_NUM; /** * 记录总数 */ + @io.swagger.annotations.ApiModelProperty("记录总数") private int totalCount = 0; /** * 分页查询条件参数 */ + @io.swagger.annotations.ApiModelProperty(value = "分页查询条件参数", notes = "泛型") private T param; /** * 分页排序字段 */ + @io.swagger.annotations.ApiModelProperty("分页排序字段") private Sort sort; /** * 结果列表数据 */ + @io.swagger.annotations.ApiModelProperty(value = "结果列表数据", notes = "泛型") private List value; + @io.swagger.annotations.ApiModelProperty("是否成功") private boolean success = true; + @io.swagger.annotations.ApiModelProperty("扩展信息") private String errorMsg; + @io.swagger.annotations.ApiModelProperty("错误代码") private String errorCode; + @io.swagger.annotations.ApiModelProperty("扩展信息") private Map extraInfo; /** diff --git a/myoss-starter-core/src/main/java/app/myoss/cloud/core/lang/dto/Result.java b/myoss-starter-core/src/main/java/app/myoss/cloud/core/lang/dto/Result.java index 07ef33d..ca8fa18 100644 --- a/myoss-starter-core/src/main/java/app/myoss/cloud/core/lang/dto/Result.java +++ b/myoss-starter-core/src/main/java/app/myoss/cloud/core/lang/dto/Result.java @@ -38,12 +38,18 @@ @Accessors(chain = true) @Data @EqualsAndHashCode +@io.swagger.annotations.ApiModel("封装方法返回参数") public class Result implements Serializable { private static final long serialVersionUID = -8699167988071027834L; + @io.swagger.annotations.ApiModelProperty(value = "结果值", notes = "泛型") private T value; + @io.swagger.annotations.ApiModelProperty("是否成功") private boolean success = true; + @io.swagger.annotations.ApiModelProperty("错误代码") private String errorCode; + @io.swagger.annotations.ApiModelProperty("错误信息") private String errorMsg; + @io.swagger.annotations.ApiModelProperty("扩展信息") private Map extraInfo; /** diff --git a/pom.xml b/pom.xml index c567432..c154da7 100644 --- a/pom.xml +++ b/pom.xml @@ -55,6 +55,7 @@ 2.1.11-RC1 ${revision} + 1.6.2 \ No newline at end of file