Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
Y
yzg-util
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
YZG
yzg-util
Commits
307737c5
Commit
307737c5
authored
Aug 14, 2019
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
常规BUG的修改
parent
c27c1a6b
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
61 additions
and
1 deletion
+61
-1
pom.xml
pom.xml
+7
-0
pom.xml
yzg-util-base/pom.xml
+5
-0
BaseVo.java
...il-base/src/main/java/com/yanzuoguang/util/vo/BaseVo.java
+3
-0
LogVo.java
...til-base/src/main/java/com/yanzuoguang/util/vo/LogVo.java
+14
-0
MapRow.java
...il-base/src/main/java/com/yanzuoguang/util/vo/MapRow.java
+5
-1
PageSizeData.java
...e/src/main/java/com/yanzuoguang/util/vo/PageSizeData.java
+6
-0
PageSizeReq.java
...se/src/main/java/com/yanzuoguang/util/vo/PageSizeReq.java
+8
-0
PageSizeReqVo.java
.../src/main/java/com/yanzuoguang/util/vo/PageSizeReqVo.java
+8
-0
ResponseResult.java
...src/main/java/com/yanzuoguang/util/vo/ResponseResult.java
+5
-0
No files found.
pom.xml
View file @
307737c5
...
...
@@ -30,6 +30,7 @@
<mysql.version>
6.0.6
</mysql.version>
<poi.version>
3.9
</poi.version>
<yzg.version>
1.0-SNAPSHOT
</yzg.version>
<swagger.version>
2.6.1
</swagger.version>
</properties>
<!--<scm>-->
...
...
@@ -66,6 +67,12 @@
<version>
${fastjson.version}
</version>
</dependency>
<dependency>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-swagger2
</artifactId>
<version>
${swagger.version}
</version>
</dependency>
<dependency>
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
...
...
yzg-util-base/pom.xml
View file @
307737c5
...
...
@@ -20,5 +20,10 @@
<groupId>
com.alibaba
</groupId>
<artifactId>
fastjson
</artifactId>
</dependency>
<dependency>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-swagger2
</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
yzg-util-base/src/main/java/com/yanzuoguang/util/vo/BaseVo.java
View file @
307737c5
package
com
.
yanzuoguang
.
util
.
vo
;
import
com.yanzuoguang.util.helper.JsonHelper
;
import
io.swagger.annotations.ApiModel
;
import
java.io.Serializable
;
/**
* 基本数据类
*
* @author 颜佐光
*/
@ApiModel
(
value
=
"系统对象接口模型,可以通过toString对对象进行JSON序列化"
)
public
class
BaseVo
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
2611225711795496063L
;
...
...
yzg-util-base/src/main/java/com/yanzuoguang/util/vo/LogVo.java
View file @
307737c5
package
com
.
yanzuoguang
.
util
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
/**
* 日志实例
*
* @author 颜佐光
*/
@ApiModel
(
value
=
"日志对象"
)
public
class
LogVo
extends
BaseVo
{
private
static
final
long
serialVersionUID
=
-
8629960247077620458L
;
...
...
@@ -11,41 +17,49 @@ public class LogVo extends BaseVo {
/**
* 日志id
*/
@ApiModelProperty
(
value
=
"日志Id"
,
required
=
true
,
example
=
"{{$uuid}}"
)
private
String
logId
;
/**
* 工程实例名
*/
@ApiModelProperty
(
value
=
"项目名称"
,
required
=
true
,
example
=
"tbd-order"
)
private
String
logSources
;
/**
* 请求接口地址
*/
@ApiModelProperty
(
value
=
"接口地址"
,
required
=
true
,
example
=
"/order/save"
)
private
String
interUrl
;
/**
* 请求内容
*/
@ApiModelProperty
(
value
=
"请求内容"
,
required
=
true
,
example
=
"{}"
)
private
String
content
;
/**
* 返回参数
*/
@ApiModelProperty
(
value
=
"返回结果"
,
required
=
true
,
example
=
"{}"
)
private
String
result
;
/**
* 接口处理状态,是否有异常
*/
@ApiModelProperty
(
value
=
"执行状态"
,
notes
=
"0表示成功,1表示失败"
,
required
=
true
,
example
=
"0"
)
private
int
status
;
/**
* 使用时间
*/
@ApiModelProperty
(
value
=
"执行耗时"
,
notes
=
"单位(毫秒)"
,
required
=
true
,
example
=
"20"
)
private
int
useTime
;
/**
* 创建时间
*/
@ApiModelProperty
(
value
=
"创建时间"
,
notes
=
"单位(毫秒)"
,
required
=
false
,
example
=
"1987-11-24 23:15:18"
)
private
String
createDate
;
public
String
getLogId
()
{
...
...
yzg-util-base/src/main/java/com/yanzuoguang/util/vo/MapRow.java
View file @
307737c5
package
com
.
yanzuoguang
.
util
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
java.util.HashMap
;
/**
* 行映射
*
* @author 颜佐光
*/
public
class
MapRow
extends
HashMap
<
String
,
Object
>
{
@ApiModel
(
value
=
"用于查询结果,根据数据库返回字段采用一定算法自动处理"
)
public
class
MapRow
extends
HashMap
<
String
,
Object
>
{
}
yzg-util-base/src/main/java/com/yanzuoguang/util/vo/PageSizeData.java
View file @
307737c5
package
com
.
yanzuoguang
.
util
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -8,17 +11,20 @@ import java.util.List;
*
* @author 颜佐光
*/
@ApiModel
(
value
=
"分页结果"
)
public
class
PageSizeData
<
T
extends
Object
>
extends
PageSizeReqVo
{
private
static
final
long
serialVersionUID
=
-
8424119556188973873L
;
/**
* 总记录数
*/
@ApiModelProperty
(
value
=
"总记录数"
,
required
=
true
,
example
=
"55"
)
private
int
pageTotal
=
-
1
;
/**
* 当前页的记录
*/
@ApiModelProperty
(
value
=
"当前页的数据"
,
required
=
true
)
private
List
<
T
>
list
=
new
ArrayList
<
T
>();
public
int
getPageTotal
()
{
...
...
yzg-util-base/src/main/java/com/yanzuoguang/util/vo/PageSizeReq.java
View file @
307737c5
package
com
.
yanzuoguang
.
util
.
vo
;
import
io.swagger.annotations.ApiModelProperty
;
/**
* 查询时分页请求接口
* @author 颜佐光
...
...
@@ -10,6 +12,7 @@ public interface PageSizeReq {
*
* @return 返回记录开始的编号
*/
@ApiModelProperty
(
value
=
"当前页的第一条序号"
,
required
=
true
,
example
=
"1"
)
int
getPageStart
();
/**
...
...
@@ -17,6 +20,7 @@ public interface PageSizeReq {
*
* @return 返回记录结束的编号
*/
@ApiModelProperty
(
value
=
"当前页的最后一条序号"
,
required
=
true
,
example
=
"20"
)
int
getPageEnd
();
/**
...
...
@@ -24,6 +28,7 @@ public interface PageSizeReq {
*
* @return 返回当前页数,不能小于1
*/
@ApiModelProperty
(
value
=
"第几页"
,
required
=
true
,
example
=
"1"
,
notes
=
"要查询第几页"
)
int
getPageIndex
();
/**
...
...
@@ -31,6 +36,7 @@ public interface PageSizeReq {
*
* @return 返回当前页数,不能小于1
*/
@ApiModelProperty
(
value
=
"每页多少条"
,
required
=
true
,
example
=
"20"
,
notes
=
"每页包含多少条数据"
)
int
getPageSize
();
/**
...
...
@@ -39,6 +45,7 @@ public interface PageSizeReq {
* @param index 设置当前第几页
* @return 当前对象
*/
@ApiModelProperty
(
value
=
"第几页"
,
required
=
true
,
example
=
"1"
,
notes
=
"要查询第几页"
)
PageSizeReq
setPageIndex
(
int
index
);
/**
...
...
@@ -47,5 +54,6 @@ public interface PageSizeReq {
* @param size 设置每页数据量
* @return 当前对象
*/
@ApiModelProperty
(
value
=
"每页多少条"
,
required
=
true
,
example
=
"20"
,
notes
=
"每页包含多少条数据"
)
PageSizeReq
setPageSize
(
int
size
);
}
yzg-util-base/src/main/java/com/yanzuoguang/util/vo/PageSizeReqVo.java
View file @
307737c5
package
com
.
yanzuoguang
.
util
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
/**
* 分页实现对象
*
* @author 颜佐光
*/
@ApiModel
(
value
=
"获取分页数据对象"
)
public
class
PageSizeReqVo
extends
BaseVo
implements
PageSizeReq
{
private
static
final
long
serialVersionUID
=
-
3933114440447495323L
;
/**
* 当前第几页
*/
@ApiModelProperty
(
value
=
"第几页"
,
required
=
true
,
example
=
"1"
,
notes
=
"要查询第几页"
)
private
int
pageIndex
=
1
;
/**
* 当前页面所包含的记录数量
*/
@ApiModelProperty
(
value
=
"每页多少条"
,
required
=
true
,
example
=
"20"
,
notes
=
"每页包含多少条数据"
)
private
int
pageSize
=
20
;
/**
...
...
@@ -42,6 +48,7 @@ public class PageSizeReqVo extends BaseVo implements PageSizeReq {
* @return 返回记录开始的编号
*/
@Override
@ApiModelProperty
(
value
=
"当前页的第一条序号"
,
required
=
true
,
example
=
"1"
)
public
int
getPageStart
()
{
int
pageIndex
=
this
.
pageIndex
>
0
?
this
.
pageIndex
:
1
;
return
(
pageIndex
-
1
)
*
this
.
pageSize
;
...
...
@@ -53,6 +60,7 @@ public class PageSizeReqVo extends BaseVo implements PageSizeReq {
* @return 返回记录结束的编号
*/
@Override
@ApiModelProperty
(
value
=
"当前页的最后一条序号"
,
required
=
true
,
example
=
"20"
)
public
int
getPageEnd
()
{
int
pageIndex
=
this
.
pageIndex
>
0
?
this
.
pageIndex
:
1
;
return
pageIndex
*
this
.
pageSize
;
...
...
yzg-util-base/src/main/java/com/yanzuoguang/util/vo/ResponseResult.java
View file @
307737c5
...
...
@@ -2,6 +2,7 @@ package com.yanzuoguang.util.vo;
import
com.yanzuoguang.util.contants.ResultConstants
;
import
com.yanzuoguang.util.helper.StringHelper
;
import
io.swagger.annotations.ApiModelProperty
;
/**
* 接口之间的通讯结果
...
...
@@ -15,21 +16,25 @@ public class ResponseResult<T> extends BaseVo {
/**
* 请求状态码
*/
@ApiModelProperty
(
value
=
"状态"
,
notes
=
"00表示成功,其他状态表示失败,具体含义参照具体实现接口"
,
required
=
true
,
example
=
"00"
)
private
String
code
;
/**
* 服务消息
*/
@ApiModelProperty
(
value
=
"消息"
,
notes
=
"提示错误消息等等"
,
required
=
true
,
example
=
"查询成功"
)
private
String
message
;
/**
* 返回数据
*/
@ApiModelProperty
(
value
=
"返回数据"
,
notes
=
"返回的具体数据"
,
required
=
true
)
private
T
data
;
/**
* 数据源,用于显示异常数据
*/
@ApiModelProperty
(
value
=
"异常时数据"
,
notes
=
"当抛出异常时的数据,通常和code进行组合"
,
required
=
true
)
private
Object
target
;
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment