|
|
@ -2,11 +2,13 @@ package com.elink.esua.epdc.controller; |
|
|
|
|
|
|
|
import com.elink.esua.epdc.common.token.dto.TokenDto; |
|
|
|
import com.elink.esua.epdc.commons.tools.annotation.LoginUser; |
|
|
|
import com.elink.esua.epdc.commons.tools.enums.BehaviorEnum; |
|
|
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
|
|
|
import com.elink.esua.epdc.dto.comment.CommentStatementFormDTO; |
|
|
|
import com.elink.esua.epdc.dto.comment.form.CommentFormDTO; |
|
|
|
import com.elink.esua.epdc.dto.comment.form.EventCommentsFormDTO; |
|
|
|
import com.elink.esua.epdc.dto.comment.result.EventCommentsResultDTO; |
|
|
|
import com.elink.esua.epdc.pointcommons.tools.annotation.RecordUserBehavior; |
|
|
|
import com.elink.esua.epdc.service.CommentService; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
@ -24,21 +26,80 @@ public class ApiCommentController { |
|
|
|
private CommentService commentService; |
|
|
|
|
|
|
|
/** |
|
|
|
* 提交评论或回复接口 |
|
|
|
* 提交议题评论 |
|
|
|
* @param userDetail |
|
|
|
* @param commentFormDTO |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@PostMapping("submit") |
|
|
|
public Result submit(@LoginUser TokenDto userDetail, @RequestBody CommentFormDTO commentFormDTO) { |
|
|
|
@PostMapping("issueCom") |
|
|
|
@RecordUserBehavior(behavior = BehaviorEnum.ISSUE_COMMENT,referenceId = "#{commentFormDTO.getIssueId}",userId = "#{userDetail.getUserId}") |
|
|
|
public Result issueCom(@LoginUser TokenDto userDetail, @RequestBody CommentFormDTO commentFormDTO) { |
|
|
|
return commentService.submit(userDetail,commentFormDTO); |
|
|
|
} |
|
|
|
/** |
|
|
|
* 提交议题回复接口 |
|
|
|
* @param userDetail |
|
|
|
* @param commentFormDTO |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@PostMapping("issueComReply") |
|
|
|
@RecordUserBehavior(behavior = BehaviorEnum.ISSUE_COMMENT_REPLY,referenceId = "#{commentFormDTO.getIssueId}",userId = "#{userDetail.getUserId}") |
|
|
|
public Result issueComReply(@LoginUser TokenDto userDetail, @RequestBody CommentFormDTO commentFormDTO) { |
|
|
|
return commentService.submit(userDetail,commentFormDTO); |
|
|
|
} |
|
|
|
/** |
|
|
|
* 提交项目评论接口 |
|
|
|
* @param userDetail |
|
|
|
* @param commentFormDTO |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@PostMapping("itemCom") |
|
|
|
@RecordUserBehavior(behavior = BehaviorEnum.PROJECT_COMMENT,referenceId = "#{commentFormDTO.getItemId}",userId = "#{userDetail.getUserId}") |
|
|
|
public Result itemCom(@LoginUser TokenDto userDetail, @RequestBody CommentFormDTO commentFormDTO) { |
|
|
|
return commentService.submit(userDetail,commentFormDTO); |
|
|
|
} |
|
|
|
/** |
|
|
|
* 提交项目回复接口 |
|
|
|
* @param userDetail |
|
|
|
* @param commentFormDTO |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@PostMapping("itemComReply") |
|
|
|
@RecordUserBehavior(behavior = BehaviorEnum.PROJECT_COMMENT_REPLY,referenceId = "#{commentFormDTO.getItemId}",userId = "#{userDetail.getUserId}") |
|
|
|
public Result itemComReply(@LoginUser TokenDto userDetail, @RequestBody CommentFormDTO commentFormDTO) { |
|
|
|
return commentService.submit(userDetail,commentFormDTO); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 评论(赞/踩) |
|
|
|
* 议题评论点赞 |
|
|
|
*/ |
|
|
|
@PostMapping("issueComLike") |
|
|
|
@RecordUserBehavior(behavior = BehaviorEnum.ISSUE_COMMENT_SUPPORT,referenceId = "#{commentStatementFormDTO.getIssueId}",userId = "#{userDetail.getUserId}") |
|
|
|
public Result issueComLike(@LoginUser TokenDto userDetail, @RequestBody CommentStatementFormDTO commentStatementFormDTO) { |
|
|
|
return commentService.statement(userDetail,commentStatementFormDTO); |
|
|
|
} |
|
|
|
/** |
|
|
|
* 议题评论点踩 |
|
|
|
*/ |
|
|
|
@PostMapping("issueComUnlike") |
|
|
|
@RecordUserBehavior(behavior = BehaviorEnum.ISSUE_COMMENT_OPPOSITION,referenceId = "#{commentStatementFormDTO.getIssueId}",userId = "#{userDetail.getUserId}") |
|
|
|
public Result issueComUnlike(@LoginUser TokenDto userDetail, @RequestBody CommentStatementFormDTO commentStatementFormDTO) { |
|
|
|
return commentService.statement(userDetail,commentStatementFormDTO); |
|
|
|
} |
|
|
|
/** |
|
|
|
* 项目评论点赞 |
|
|
|
*/ |
|
|
|
@PostMapping("itemComLike") |
|
|
|
@RecordUserBehavior(behavior = BehaviorEnum.PROJECT_COMMENT_SUPPORT,referenceId = "#{commentStatementFormDTO.getItemId}",userId = "#{userDetail.getUserId}") |
|
|
|
public Result itemComLike(@LoginUser TokenDto userDetail, @RequestBody CommentStatementFormDTO commentStatementFormDTO) { |
|
|
|
return commentService.statement(userDetail,commentStatementFormDTO); |
|
|
|
} |
|
|
|
/** |
|
|
|
* 项目评论点踩 |
|
|
|
*/ |
|
|
|
@PostMapping("statement") |
|
|
|
public Result statement(@LoginUser TokenDto userDetail, @RequestBody CommentStatementFormDTO commentStatementFormDTO) { |
|
|
|
@PostMapping("itemComUnlike") |
|
|
|
@RecordUserBehavior(behavior = BehaviorEnum.PROJECT_COMMENT_OPPOSITION,referenceId = "#{commentStatementFormDTO.getItemId}",userId = "#{userDetail.getUserId}") |
|
|
|
public Result itemComUnlike(@LoginUser TokenDto userDetail, @RequestBody CommentStatementFormDTO commentStatementFormDTO) { |
|
|
|
return commentService.statement(userDetail,commentStatementFormDTO); |
|
|
|
} |
|
|
|
/** |
|
|
|