MCPcopy Create free account
hub / github.com/diyhi/bbs / CommentController

Class CommentController

src/main/java/cms/controller/frontend/CommentController.java:22–251  ·  view source on GitHub ↗

前台评论控制器

Source from the content-addressed store, hash-verified

20 * 前台评论控制器
21 */
22@RestController("frontendCommentController")
23public class CommentController {
24 @Resource
25 CommentClientService commentClientService;
26 @Resource
27 FileComponent fileComponent;
28
29 /**
30 * 评论分页
31 * @param page 页码
32 * @param topicId 话题Id
33 * @param commentId 评论Id
34 * @param request 请求信息
35 * @return
36 */
37 @DynamicRouteTarget(route = DynamicRouteEnum.CUSTOM_6010300)
38 public PageView<Comment> commentPage(Integer page, Long topicId, Long commentId,HttpServletRequest request){
39 return commentClientService.getCommentPage(page,topicId, commentId,request);
40 }
41
42 /**
43 * 添加评论表单
44 * @return
45 */
46 @DynamicRouteTarget(route = DynamicRouteEnum.CUSTOM_6010600)
47 public Map<String,Object> addCommentUI(){
48 return commentClientService.getAddCommentViewModel();
49 }
50
51
52 /**
53 * 评论 添加
54 * @param topicId 话题Id
55 * @param content 评论内容
56 * @param isMarkdown 是否使用Markdown
57 * @param markdownContent Markdown内容
58 * @param captchaKey 验证码键
59 * @param captchaValue 验证码值
60 * @param request 请求信息
61 * @return
62 */
63 @DynamicRouteTarget(route = DynamicRouteEnum.DEFAULT_1010500)
64 @RequestMapping(value="/user/control/comment/add", method= RequestMethod.POST)
65 public ClientRequestResult add(Long topicId, String content, Boolean isMarkdown, String markdownContent,
66 String captchaKey, String captchaValue,
67 HttpServletRequest request){
68 commentClientService.addComment(topicId, content, isMarkdown, markdownContent,
69 captchaKey, captchaValue,request);
70 return ClientRequestResult.success();
71 }
72
73 /**
74 * 引用评论表单
75 * @param commentId 评论Id
76 * @return
77 */
78 @DynamicRouteTarget(route = DynamicRouteEnum.CUSTOM_6010700)
79 public Map<String,Object> quoteCommentUI(Long commentId){

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…