| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 1c3940b commit ed7a9e8
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -194,10 +194,39 @@ public Object verifyURLList(@NotNull JSONObject request, @NotNull String urlList | |||
| 194 | 194 | } | |
| 195 | 195 | return null; | |
| 196 | 196 | } | |
| 197 | + | ||
| 198 | + | ||
| 199 | + /** | ||
| 200 | + * @param rq | ||
| 201 | + * @param momentId | ||
| 202 | + * @return | ||
| 203 | + * @throws Exception | ||
| 204 | + */ | ||
| 205 | + public int deleteCommentOfMoment(@NotNull JSONObject rq, @NotNull String momentId) throws Exception { | ||
| 206 | + long mid = rq.getLongValue(momentId); | ||
| 207 | + if (mid <= 0 || rq.getIntValue(JSONResponse.KEY_COUNT) <= 0) { | ||
| 208 | + return 0; | ||
| 209 | + } | ||
| 197 | 210 | ||
| 198 | - /**判断array是否为空 | ||
| 199 | - * @param request | ||
| 200 | - * @param array | ||
| 211 | + JSONRequest request = new JSONRequest(); | ||
| 212 | + | ||
| 213 | + //Comment<<<<<<<<<<<<<<<<<<<<<<<<<<<<< | ||
| 214 | + JSONRequest comment = new JSONRequest(); | ||
| 215 | + comment.put("momentId", mid); | ||
| 216 | + | ||
| 217 | + request.put("Comment", comment); | ||
| 218 | + //Comment>>>>>>>>>>>>>>>>>>>>>>>>>>>>> | ||
| 219 | + | ||
| 220 | + JSONObject rp = new DemoParser(RequestMethod.DELETE).setNoVerify(true).parseResponse(request); | ||
| 221 | + | ||
| 222 | + JSONObject c = rp.getJSONObject("Comment"); | ||
| 223 | + return c == null ? 0 : c.getIntValue(JSONResponse.KEY_COUNT); | ||
| 224 | + } | ||
| 225 | + | ||
| 226 | + | ||
| 227 | + /**删除评论的子评论 | ||
| 228 | + * @param rq | ||
| 229 | + * @param toId | ||
| 201 | 230 | * @return | |
| 202 | 231 | */ | |
| 203 | 232 | public int deleteChildComment(@NotNull JSONObject rq, @NotNull String toId) throws Exception { | |
@@ -213,8 +242,8 @@ public int deleteChildComment(@NotNull JSONObject rq, @NotNull String toId) thro | |||
| 213 | 242 | //Comment<<<<<<<<<<<<<<<<<<<<<<<<<<<<< | |
| 214 | 243 | JSONRequest comment = new JSONRequest(); | |
| 215 | 244 | comment.put("id{}", getChildCommentIdList(tid)); | |
| 216 | - request.put("Comment", comment); | ||
| 217 | 245 | ||
| 246 | + request.put("Comment", comment); | ||
| 218 | 247 | //Comment>>>>>>>>>>>>>>>>>>>>>>>>>>>>> | |
| 219 | 248 | ||
| 220 | 249 | JSONObject rp = new DemoParser(RequestMethod.DELETE).setNoVerify(true).parseResponse(request); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments