wuxw7
2018-11-25 d7717df0f80aac77eec9ba0345ea7f4487143f75
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
package com.java110.entity.service;
 
import com.alibaba.fastjson.JSONObject;
 
import java.io.Serializable;
import java.util.Map;
 
/**
 * 页面请求数据封装
 * Created by wuxw on 2018/5/2.
 */
public class PageData implements Serializable {
 
    private String userId ;
 
    private String transactionId;
 
    private String requestTime;
 
    private String method;
 
    private String token;
 
    private Object serviceSMOImpl;
 
    private JSONObject param;
 
    private JSONObject meta;
 
    private JSONObject reqJson;
 
    private JSONObject resJson;
 
    private String code;
 
    private String message;
 
    private String responseTime;
 
    private JSONObject data;
 
    private Map<String,String> userInfo;
 
 
    public String getUserId() {
        return userId;
    }
 
    public void setUserId(String userId) {
        this.userId = userId;
    }
 
    public String getTransactionId() {
        return transactionId;
    }
 
    public PageData setTransactionId(String transactionId) {
        this.transactionId = transactionId;
        return this;
    }
 
    public String getRequestTime() {
        return requestTime;
    }
 
    public void setRequestTime(String requestTime) {
        this.requestTime = requestTime;
    }
 
    public String getMethod() {
        return method;
    }
 
    public void setMethod(String method) {
        this.method = method;
    }
 
    public JSONObject getParam() {
        return param;
    }
 
    public void setParam(JSONObject param) {
        this.param = param;
    }
 
    public JSONObject getMeta() {
        return meta;
    }
 
    public void setMeta(JSONObject meta) {
        this.meta = meta;
    }
 
    public JSONObject getReqJson() {
        return reqJson;
    }
 
    public void setReqJson(JSONObject reqJson) {
        this.reqJson = reqJson;
    }
 
    public JSONObject getResJson() {
        return resJson;
    }
 
    public void setResJson(JSONObject resJson) {
        this.resJson = resJson;
    }
 
    public void setResJson(String resJsonString) {
        this.resJson = JSONObject.parseObject(resJsonString);
    }
 
    public String getCode() {
        return code;
    }
 
    public void setCode(String code) {
        this.code = code;
    }
 
    public String getMessage() {
        return message;
    }
 
    public void setMessage(String message) {
        this.message = message;
    }
 
    public String getResponseTime() {
        return responseTime;
    }
 
    public void setResponseTime(String responseTime) {
        this.responseTime = responseTime;
    }
 
    public JSONObject getData() {
        return data;
    }
 
    public void setData(JSONObject data) {
        this.data = data;
    }
 
    public String getToken() {
        return token;
    }
 
    public void setToken(String token) {
        this.token = token;
    }
 
 
    public Map<String, String> getUserInfo() {
        return userInfo;
    }
 
    public void setUserInfo(Map<String, String> userInfo) {
        this.userInfo = userInfo;
    }
 
 
    public Object getServiceSMOImpl() {
        return serviceSMOImpl;
    }
 
    public void setServiceSMOImpl(Object serviceSMOImpl) {
        this.serviceSMOImpl = serviceSMOImpl;
    }
 
    public PageData builder(String requestJson) throws IllegalArgumentException{
        JSONObject reqJson = null;
        try {
            reqJson = JSONObject.parseObject(requestJson);
        }catch (Exception e){
            throw new IllegalArgumentException("请求参数错误",e);
        }
        this.setMeta(reqJson.getJSONObject("meta"));
        this.setMethod(this.getMeta().getString("method"));
        this.setRequestTime(this.getMeta().getString("requestTime"));
        this.setParam(reqJson.getJSONObject("param"));
        this.setReqJson(reqJson);
        return this;
    }
}