Commit 307737c5 authored by yanzg's avatar yanzg

常规BUG的修改

parent c27c1a6b
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
<mysql.version>6.0.6</mysql.version> <mysql.version>6.0.6</mysql.version>
<poi.version>3.9</poi.version> <poi.version>3.9</poi.version>
<yzg.version>1.0-SNAPSHOT</yzg.version> <yzg.version>1.0-SNAPSHOT</yzg.version>
<swagger.version>2.6.1</swagger.version>
</properties> </properties>
<!--<scm>--> <!--<scm>-->
...@@ -66,6 +67,12 @@ ...@@ -66,6 +67,12 @@
<version>${fastjson.version}</version> <version>${fastjson.version}</version>
</dependency> </dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${swagger.version}</version>
</dependency>
<dependency> <dependency>
<groupId>mysql</groupId> <groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId> <artifactId>mysql-connector-java</artifactId>
......
...@@ -20,5 +20,10 @@ ...@@ -20,5 +20,10 @@
<groupId>com.alibaba</groupId> <groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId> <artifactId>fastjson</artifactId>
</dependency> </dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
</dependency>
</dependencies> </dependencies>
</project> </project>
\ No newline at end of file
package com.yanzuoguang.util.vo; package com.yanzuoguang.util.vo;
import com.yanzuoguang.util.helper.JsonHelper; import com.yanzuoguang.util.helper.JsonHelper;
import io.swagger.annotations.ApiModel;
import java.io.Serializable; import java.io.Serializable;
/** /**
* 基本数据类 * 基本数据类
*
* @author 颜佐光 * @author 颜佐光
*/ */
@ApiModel(value = "系统对象接口模型,可以通过toString对对象进行JSON序列化")
public class BaseVo implements Serializable { public class BaseVo implements Serializable {
private static final long serialVersionUID = -2611225711795496063L; private static final long serialVersionUID = -2611225711795496063L;
......
package com.yanzuoguang.util.vo; package com.yanzuoguang.util.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/** /**
* 日志实例 * 日志实例
*
* @author 颜佐光 * @author 颜佐光
*/ */
@ApiModel(value = "日志对象")
public class LogVo extends BaseVo { public class LogVo extends BaseVo {
private static final long serialVersionUID = -8629960247077620458L; private static final long serialVersionUID = -8629960247077620458L;
...@@ -11,41 +17,49 @@ public class LogVo extends BaseVo { ...@@ -11,41 +17,49 @@ public class LogVo extends BaseVo {
/** /**
* 日志id * 日志id
*/ */
@ApiModelProperty(value = "日志Id", required = true, example = "{{$uuid}}")
private String logId; private String logId;
/** /**
* 工程实例名 * 工程实例名
*/ */
@ApiModelProperty(value = "项目名称", required = true, example = "tbd-order")
private String logSources; private String logSources;
/** /**
* 请求接口地址 * 请求接口地址
*/ */
@ApiModelProperty(value = "接口地址", required = true, example = "/order/save")
private String interUrl; private String interUrl;
/** /**
* 请求内容 * 请求内容
*/ */
@ApiModelProperty(value = "请求内容", required = true, example = "{}")
private String content; private String content;
/** /**
* 返回参数 * 返回参数
*/ */
@ApiModelProperty(value = "返回结果", required = true, example = "{}")
private String result; private String result;
/** /**
* 接口处理状态,是否有异常 * 接口处理状态,是否有异常
*/ */
@ApiModelProperty(value = "执行状态", notes = "0表示成功,1表示失败", required = true, example = "0")
private int status; private int status;
/** /**
* 使用时间 * 使用时间
*/ */
@ApiModelProperty(value = "执行耗时", notes = "单位(毫秒)", required = true, example = "20")
private int useTime; private int useTime;
/** /**
* 创建时间 * 创建时间
*/ */
@ApiModelProperty(value = "创建时间", notes = "单位(毫秒)", required = false, example = "1987-11-24 23:15:18")
private String createDate; private String createDate;
public String getLogId() { public String getLogId() {
......
package com.yanzuoguang.util.vo; package com.yanzuoguang.util.vo;
import io.swagger.annotations.ApiModel;
import java.util.HashMap; import java.util.HashMap;
/** /**
* 行映射 * 行映射
*
* @author 颜佐光 * @author 颜佐光
*/ */
public class MapRow extends HashMap<String,Object> { @ApiModel(value = "用于查询结果,根据数据库返回字段采用一定算法自动处理")
public class MapRow extends HashMap<String, Object> {
} }
package com.yanzuoguang.util.vo; package com.yanzuoguang.util.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -8,17 +11,20 @@ import java.util.List; ...@@ -8,17 +11,20 @@ import java.util.List;
* *
* @author 颜佐光 * @author 颜佐光
*/ */
@ApiModel(value = "分页结果")
public class PageSizeData<T extends Object> extends PageSizeReqVo { public class PageSizeData<T extends Object> extends PageSizeReqVo {
private static final long serialVersionUID = -8424119556188973873L; private static final long serialVersionUID = -8424119556188973873L;
/** /**
* 总记录数 * 总记录数
*/ */
@ApiModelProperty(value = "总记录数", required = true, example = "55")
private int pageTotal = -1; private int pageTotal = -1;
/** /**
* 当前页的记录 * 当前页的记录
*/ */
@ApiModelProperty(value = "当前页的数据", required = true)
private List<T> list = new ArrayList<T>(); private List<T> list = new ArrayList<T>();
public int getPageTotal() { public int getPageTotal() {
......
package com.yanzuoguang.util.vo; package com.yanzuoguang.util.vo;
import io.swagger.annotations.ApiModelProperty;
/** /**
* 查询时分页请求接口 * 查询时分页请求接口
* @author 颜佐光 * @author 颜佐光
...@@ -10,6 +12,7 @@ public interface PageSizeReq { ...@@ -10,6 +12,7 @@ public interface PageSizeReq {
* *
* @return 返回记录开始的编号 * @return 返回记录开始的编号
*/ */
@ApiModelProperty(value = "当前页的第一条序号", required = true, example = "1")
int getPageStart(); int getPageStart();
/** /**
...@@ -17,6 +20,7 @@ public interface PageSizeReq { ...@@ -17,6 +20,7 @@ public interface PageSizeReq {
* *
* @return 返回记录结束的编号 * @return 返回记录结束的编号
*/ */
@ApiModelProperty(value = "当前页的最后一条序号", required = true, example = "20")
int getPageEnd(); int getPageEnd();
/** /**
...@@ -24,6 +28,7 @@ public interface PageSizeReq { ...@@ -24,6 +28,7 @@ public interface PageSizeReq {
* *
* @return 返回当前页数,不能小于1 * @return 返回当前页数,不能小于1
*/ */
@ApiModelProperty(value = "第几页", required = true, example = "1", notes = "要查询第几页")
int getPageIndex(); int getPageIndex();
/** /**
...@@ -31,6 +36,7 @@ public interface PageSizeReq { ...@@ -31,6 +36,7 @@ public interface PageSizeReq {
* *
* @return 返回当前页数,不能小于1 * @return 返回当前页数,不能小于1
*/ */
@ApiModelProperty(value = "每页多少条", required = true, example = "20", notes = "每页包含多少条数据")
int getPageSize(); int getPageSize();
/** /**
...@@ -39,6 +45,7 @@ public interface PageSizeReq { ...@@ -39,6 +45,7 @@ public interface PageSizeReq {
* @param index 设置当前第几页 * @param index 设置当前第几页
* @return 当前对象 * @return 当前对象
*/ */
@ApiModelProperty(value = "第几页", required = true, example = "1", notes = "要查询第几页")
PageSizeReq setPageIndex(int index); PageSizeReq setPageIndex(int index);
/** /**
...@@ -47,5 +54,6 @@ public interface PageSizeReq { ...@@ -47,5 +54,6 @@ public interface PageSizeReq {
* @param size 设置每页数据量 * @param size 设置每页数据量
* @return 当前对象 * @return 当前对象
*/ */
@ApiModelProperty(value = "每页多少条", required = true, example = "20", notes = "每页包含多少条数据")
PageSizeReq setPageSize(int size); PageSizeReq setPageSize(int size);
} }
package com.yanzuoguang.util.vo; package com.yanzuoguang.util.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/** /**
* 分页实现对象 * 分页实现对象
* *
* @author 颜佐光 * @author 颜佐光
*/ */
@ApiModel(value = "获取分页数据对象")
public class PageSizeReqVo extends BaseVo implements PageSizeReq { public class PageSizeReqVo extends BaseVo implements PageSizeReq {
private static final long serialVersionUID = -3933114440447495323L; private static final long serialVersionUID = -3933114440447495323L;
/** /**
* 当前第几页 * 当前第几页
*/ */
@ApiModelProperty(value = "第几页", required = true, example = "1", notes = "要查询第几页")
private int pageIndex = 1; private int pageIndex = 1;
/** /**
* 当前页面所包含的记录数量 * 当前页面所包含的记录数量
*/ */
@ApiModelProperty(value = "每页多少条", required = true, example = "20", notes = "每页包含多少条数据")
private int pageSize = 20; private int pageSize = 20;
/** /**
...@@ -42,6 +48,7 @@ public class PageSizeReqVo extends BaseVo implements PageSizeReq { ...@@ -42,6 +48,7 @@ public class PageSizeReqVo extends BaseVo implements PageSizeReq {
* @return 返回记录开始的编号 * @return 返回记录开始的编号
*/ */
@Override @Override
@ApiModelProperty(value = "当前页的第一条序号", required = true, example = "1")
public int getPageStart() { public int getPageStart() {
int pageIndex = this.pageIndex > 0 ? this.pageIndex : 1; int pageIndex = this.pageIndex > 0 ? this.pageIndex : 1;
return (pageIndex - 1) * this.pageSize; return (pageIndex - 1) * this.pageSize;
...@@ -53,6 +60,7 @@ public class PageSizeReqVo extends BaseVo implements PageSizeReq { ...@@ -53,6 +60,7 @@ public class PageSizeReqVo extends BaseVo implements PageSizeReq {
* @return 返回记录结束的编号 * @return 返回记录结束的编号
*/ */
@Override @Override
@ApiModelProperty(value = "当前页的最后一条序号", required = true, example = "20")
public int getPageEnd() { public int getPageEnd() {
int pageIndex = this.pageIndex > 0 ? this.pageIndex : 1; int pageIndex = this.pageIndex > 0 ? this.pageIndex : 1;
return pageIndex * this.pageSize; return pageIndex * this.pageSize;
......
...@@ -2,6 +2,7 @@ package com.yanzuoguang.util.vo; ...@@ -2,6 +2,7 @@ package com.yanzuoguang.util.vo;
import com.yanzuoguang.util.contants.ResultConstants; import com.yanzuoguang.util.contants.ResultConstants;
import com.yanzuoguang.util.helper.StringHelper; import com.yanzuoguang.util.helper.StringHelper;
import io.swagger.annotations.ApiModelProperty;
/** /**
* 接口之间的通讯结果 * 接口之间的通讯结果
...@@ -15,21 +16,25 @@ public class ResponseResult<T> extends BaseVo { ...@@ -15,21 +16,25 @@ public class ResponseResult<T> extends BaseVo {
/** /**
* 请求状态码 * 请求状态码
*/ */
@ApiModelProperty(value = "状态", notes = "00表示成功,其他状态表示失败,具体含义参照具体实现接口", required = true, example = "00")
private String code; private String code;
/** /**
* 服务消息 * 服务消息
*/ */
@ApiModelProperty(value = "消息", notes = "提示错误消息等等", required = true, example = "查询成功")
private String message; private String message;
/** /**
* 返回数据 * 返回数据
*/ */
@ApiModelProperty(value = "返回数据", notes = "返回的具体数据", required = true)
private T data; private T data;
/** /**
* 数据源,用于显示异常数据 * 数据源,用于显示异常数据
*/ */
@ApiModelProperty(value = "异常时数据", notes = "当抛出异常时的数据,通常和code进行组合", required = true)
private Object target; private Object target;
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment