@@ -48,34 +48,34 @@ public DemoFunctionParser(RequestMethod method, String tag, int version, JSONObj
48
48
super (method , tag , version , request , session );
49
49
}
50
50
51
- public Visitor <Long > getCurrentUser (@ NotNull JSONObject current ) {
51
+ public Visitor <Long > getCurrentUser (@ NotNull JSONObject curObj ) {
52
52
return DemoVerifier .getVisitor (getSession ());
53
53
}
54
54
55
- public Long getCurrentUserId (@ NotNull JSONObject current ) {
55
+ public Long getCurrentUserId (@ NotNull JSONObject curObj ) {
56
56
return DemoVerifier .getVisitorId (getSession ());
57
57
}
58
58
59
- public List <Long > getCurrentUserIdAsList (@ NotNull JSONObject current ) {
59
+ public List <Long > getCurrentUserIdAsList (@ NotNull JSONObject curObj ) {
60
60
List <Long > list = new ArrayList <>(1 );
61
61
list .add (DemoVerifier .getVisitorId (getSession ()));
62
62
return list ;
63
63
}
64
64
65
- public List <Long > getCurrentContactIdList (@ NotNull JSONObject current ) {
66
- Visitor <Long > user = getCurrentUser (current );
65
+ public List <Long > getCurrentContactIdList (@ NotNull JSONObject curObj ) {
66
+ Visitor <Long > user = getCurrentUser (curObj );
67
67
return user == null ? null : user .getContactIdList ();
68
68
}
69
69
70
70
71
71
/**
72
- * @param current
72
+ * @param curObj
73
73
* @param idList
74
74
* @return
75
75
* @throws Exception
76
76
*/
77
- public void verifyIdList (@ NotNull JSONObject current , @ NotNull String idList ) throws Exception {
78
- Object obj = current .get (idList );
77
+ public void verifyIdList (@ NotNull JSONObject curObj , @ NotNull String idList ) throws Exception {
78
+ Object obj = curObj .get (idList );
79
79
if (obj == null ) {
80
80
return ;
81
81
}
@@ -98,13 +98,13 @@ public void verifyIdList(@NotNull JSONObject current, @NotNull String idList) th
98
98
99
99
100
100
/**
101
- * @param current
101
+ * @param curObj
102
102
* @param urlList
103
103
* @return
104
104
* @throws Exception
105
105
*/
106
- public void verifyURLList (@ NotNull JSONObject current , @ NotNull String urlList ) throws Exception {
107
- Object obj = current .get (urlList );
106
+ public void verifyURLList (@ NotNull JSONObject curObj , @ NotNull String urlList ) throws Exception {
107
+ Object obj = curObj .get (urlList );
108
108
if (obj == null ) {
109
109
return ;
110
110
}
@@ -127,14 +127,14 @@ public void verifyURLList(@NotNull JSONObject current, @NotNull String urlList)
127
127
128
128
129
129
/**
130
- * @param current
130
+ * @param curObj
131
131
* @param momentId
132
132
* @return
133
133
* @throws Exception
134
134
*/
135
- public int deleteCommentOfMoment (@ NotNull JSONObject current , @ NotNull String momentId ) throws Exception {
136
- long mid = current .getLongValue (momentId );
137
- if (mid <= 0 || current .getIntValue (JSONResponse .KEY_COUNT ) <= 0 ) {
135
+ public int deleteCommentOfMoment (@ NotNull JSONObject curObj , @ NotNull String momentId ) throws Exception {
136
+ long mid = curObj .getLongValue (momentId );
137
+ if (mid <= 0 || curObj .getIntValue (JSONResponse .KEY_COUNT ) <= 0 ) {
138
138
return 0 ;
139
139
}
140
140
@@ -155,13 +155,13 @@ public int deleteCommentOfMoment(@NotNull JSONObject current, @NotNull String mo
155
155
156
156
157
157
/**删除评论的子评论
158
- * @param current
158
+ * @param curObj
159
159
* @param toId
160
160
* @return
161
161
*/
162
- public int deleteChildComment (@ NotNull JSONObject current , @ NotNull String toId ) throws Exception {
163
- long tid = current .getLongValue (toId );
164
- if (tid <= 0 || current .getIntValue (JSONResponse .KEY_COUNT ) <= 0 ) {
162
+ public int deleteChildComment (@ NotNull JSONObject curObj , @ NotNull String toId ) throws Exception {
163
+ long tid = curObj .getLongValue (toId );
164
+ if (tid <= 0 || curObj .getIntValue (JSONResponse .KEY_COUNT ) <= 0 ) {
165
165
return 0 ;
166
166
}
167
167
@@ -223,23 +223,23 @@ private JSONArray getChildCommentIdList(long tid) {
223
223
224
224
225
225
/**TODO 仅用来测试 "key-()":"getIdList()" 和 "key()":"getIdList()"
226
- * @param current
226
+ * @param curObj
227
227
* @return JSONArray 只能用JSONArray,用long[]会在SQLConfig解析崩溃
228
228
* @throws Exception
229
229
*/
230
- public JSONArray getIdList (@ NotNull JSONObject current ) {
230
+ public JSONArray getIdList (@ NotNull JSONObject curObj ) {
231
231
return new JSONArray (new ArrayList <Object >(Arrays .asList (12 , 15 , 301 , 82001 , 82002 , 38710 )));
232
232
}
233
233
234
234
235
235
/**TODO 仅用来测试 "key-()":"verifyAccess()"
236
- * @param current
236
+ * @param curObj
237
237
* @return
238
238
* @throws Exception
239
239
*/
240
- public Object verifyAccess (@ NotNull JSONObject current ) throws Exception {
241
- long userId = current .getLongValue (JSONRequest .KEY_USER_ID );
242
- String role = current .getString (JSONRequest .KEY_ROLE );
240
+ public Object verifyAccess (@ NotNull JSONObject curObj ) throws Exception {
241
+ long userId = curObj .getLongValue (JSONRequest .KEY_USER_ID );
242
+ String role = curObj .getString (JSONRequest .KEY_ROLE );
243
243
if (AbstractVerifier .OWNER .equals (role ) && userId != (Long ) DemoVerifier .getVisitorId (getSession ())) {
244
244
throw new IllegalAccessException ("登录用户与角色OWNER不匹配!" );
245
245
}
0 commit comments