-
Notifications
You must be signed in to change notification settings - Fork 2
/
JqueryEasyUIData.java
executable file
·61 lines (50 loc) · 1.52 KB
/
JqueryEasyUIData.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import java.util.List;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.github.pagehelper.Page;
/**
*
* 说明:针对Jquery EasyUI 数据格式的处理
*
* @date 2015年4月9日
*
*/
public class JqueryEasyUIData {
private long total;
private List<?> rows;
private String moneyall;
public static String init(Page<?> page){
JqueryEasyUIData instance = new JqueryEasyUIData();
instance.setRows(page.getResult());
instance.setTotal(page.getTotal());
return JSON.toJSONString(instance, SerializerFeature.WriteDateUseDateFormat, SerializerFeature.WriteMapNullValue);
}
public static String init(Page<?> page,String money){
JqueryEasyUIData instance = new JqueryEasyUIData();
instance.setRows(page.getResult());
instance.setTotal(page.getTotal());
instance.setMoneyall(money);
return JSON.toJSONString(instance, SerializerFeature.WriteDateUseDateFormat, SerializerFeature.WriteMapNullValue);
}
public static String toJSON(Object o){
return JSON.toJSONString(o, SerializerFeature.WriteDateUseDateFormat, SerializerFeature.WriteMapNullValue);
}
public long getTotal() {
return total;
}
public void setTotal(long total) {
this.total = total;
}
public List<?> getRows() {
return rows;
}
public void setRows(List<?> rows) {
this.rows = rows;
}
public String getMoneyall() {
return moneyall;
}
public void setMoneyall(String moneyall) {
this.moneyall = moneyall;
}
}