Skip to content

Commit d0ac51a

Browse files
committed
1.0.0版本更新
1 parent 7ea3d29 commit d0ac51a

File tree

5 files changed

+421
-0
lines changed

5 files changed

+421
-0
lines changed
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
/*
2+
* Copyright 2015-2102 RonCoo(http://www.roncoo.com) Group.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.roncoo.pay.common.core.entity;
17+
18+
import com.alibaba.fastjson.JSONObject;
19+
20+
/**
21+
* api请求正常返回结果,该实体作为API请求时,按照规范返回的实体. code 为返回码 msg 为返回描述 data 为返回的具体结果 Created
22+
* 龙果学院:www.roncoo.com
23+
* @author zenghao
24+
*/
25+
public class ApiCommonResultVo {
26+
27+
public ApiCommonResultVo(int code, String msg, Object data) {
28+
this.code = code;
29+
this.msg = msg;
30+
if (data != null) {
31+
this.data = data;
32+
}
33+
}
34+
35+
public ApiCommonResultVo(Object data) {
36+
this.code = 0;
37+
this.msg = "";
38+
if (data != null) {
39+
this.data = data;
40+
}
41+
}
42+
43+
/**
44+
* 返回码
45+
*/
46+
private int code;
47+
48+
/**
49+
* 返回描述
50+
*/
51+
private String msg = "";
52+
53+
/**
54+
* 返回数据
55+
*/
56+
private Object data = new Object();
57+
58+
public void setCode(int code) {
59+
this.code = code;
60+
}
61+
62+
public void setMsg(String msg) {
63+
this.msg = msg;
64+
}
65+
66+
public void setData(Object data) {
67+
this.data = data;
68+
}
69+
70+
public int getCode() {
71+
return code;
72+
}
73+
74+
public String getMsg() {
75+
return msg;
76+
}
77+
78+
public Object getData() {
79+
return data;
80+
}
81+
82+
public static void main(String[] args) {
83+
System.out.println(JSONObject.toJSONString(new ApiCommonResultVo(-1, "", null)));
84+
}
85+
}
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
/*
2+
* Copyright 2015-2102 RonCoo(http://www.roncoo.com) Group.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.roncoo.pay.common.core.entity;
17+
18+
import com.alibaba.fastjson.JSONObject;
19+
20+
import java.util.ArrayList;
21+
22+
/**
23+
* API请求,返回分页数据时,统一实体类,将返回的数据统一封装到该实体中,返回给客户端
24+
* 龙果学院:www.roncoo.com
25+
* @author zenghao
26+
*/
27+
public class ApiPageListResultVo {
28+
29+
/**
30+
* 返回码
31+
*/
32+
private int code;
33+
34+
/**
35+
* 返回描述
36+
*/
37+
private String msg = "";
38+
39+
/**
40+
* 返回分页数据,默认为0页0条
41+
*/
42+
private PageListVO data = new PageListVO(0,0,0,new ArrayList<rpObject>());
43+
44+
public void setCode(int code) {
45+
this.code = code;
46+
}
47+
48+
public void setMsg(String msg) {
49+
this.msg = msg;
50+
}
51+
52+
public void setData(PageListVO data) {
53+
this.data = data;
54+
}
55+
56+
public int getCode() {
57+
return code;
58+
}
59+
60+
public String getMsg() {
61+
return msg;
62+
}
63+
64+
public PageListVO getData() {
65+
return data;
66+
}
67+
68+
69+
70+
public static void main(String [] args ){
71+
72+
ApiPageListResultVo apiPageListResultVo = new ApiPageListResultVo();
73+
apiPageListResultVo.setCode(-1);
74+
apiPageListResultVo.setMsg("测试数据");
75+
76+
PageListVO pageListVO = new PageListVO(0,2,33,new ArrayList<Object>());
77+
78+
apiPageListResultVo.setData(pageListVO);
79+
80+
System.out.println(JSONObject.toJSONString(apiPageListResultVo));
81+
}
82+
83+
}
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
/*
2+
* Copyright 2015-2102 RonCoo(http://www.roncoo.com) Group.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.roncoo.pay.common.core.entity;
17+
18+
import java.util.ArrayList;
19+
import java.util.List;
20+
21+
/**
22+
* 返回的分页实体
23+
* 龙果学院:www.roncoo.com
24+
* @author zenghao
25+
*/
26+
public class PageListVO {
27+
28+
/** 总数量 **/
29+
private long total ;
30+
31+
/** 页码 **/
32+
private int page;
33+
34+
/** 每页条数 **/
35+
private int pageSize;
36+
37+
/** 分页数据 **/
38+
private List pageData = new ArrayList();
39+
40+
/**
41+
* 汇总数据
42+
*/
43+
private Object summary;
44+
45+
public PageListVO(long total , int page , int pageSize , List pageData){
46+
this.total = total;
47+
this.page = page;
48+
this.pageSize = pageSize;
49+
50+
if (pageData != null){
51+
this.pageData = pageData;
52+
}
53+
54+
}
55+
56+
public PageListVO(long total , int page , int pageSize , List pageData, Object summary){
57+
this.total = total;
58+
this.page = page;
59+
this.pageSize = pageSize;
60+
this.summary = summary;
61+
62+
if (pageData != null){
63+
this.pageData = pageData;
64+
}
65+
66+
}
67+
68+
public Object getSummary() {
69+
return summary;
70+
}
71+
72+
public void setSummary(Object summary) {
73+
this.summary = summary;
74+
}
75+
76+
public void setTotal(int total) {
77+
this.total = total;
78+
}
79+
80+
public void setPage(int page) {
81+
this.page = page;
82+
}
83+
84+
public void setPageSize(int pageSize) {
85+
this.pageSize = pageSize;
86+
}
87+
88+
public void setPageData(List pageData) {
89+
this.pageData = pageData;
90+
}
91+
92+
public long getTotal() {
93+
return total;
94+
}
95+
96+
public int getPage() {
97+
return page;
98+
}
99+
100+
public int getPageSize() {
101+
return pageSize;
102+
}
103+
104+
public List getPageData() {
105+
return pageData;
106+
}
107+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Copyright 2015-2102 RonCoo(http://www.roncoo.com) Group.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.roncoo.pay.common.core.entity;
17+
18+
import java.io.Serializable;
19+
20+
/**
21+
* 龙果学院:www.roncoo.com
22+
* @author zenghao
23+
*/
24+
public class rpObject extends Object implements Serializable {
25+
}

0 commit comments

Comments
 (0)