14 changed files with 281 additions and 0 deletions
@ -0,0 +1,28 @@ |
|||
package com.elink.esua.epdc.dto.comment; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* |
|||
* 话题评论、评论支持反对数据 |
|||
* |
|||
* @Author:liuchuang |
|||
* @Date:2019/11/12 14:17 |
|||
*/ |
|||
@Data |
|||
public class EpdcCommentsAndAttitudeFromTopicFormDTO implements Serializable { |
|||
private static final long serialVersionUID = 8779307899428155354L; |
|||
|
|||
/** |
|||
* 评论 |
|||
*/ |
|||
private List<EventCommentDTO> comments; |
|||
|
|||
/** |
|||
* 表态 |
|||
*/ |
|||
private List<EventCommentUserAttitudeDTO> attitudes; |
|||
} |
@ -0,0 +1,53 @@ |
|||
package com.elink.esua.epdc.modules.async; |
|||
|
|||
import com.elink.esua.epdc.dto.comment.EpdcCommentsAndAttitudeFromTopicFormDTO; |
|||
import com.elink.esua.epdc.dto.comment.EventCommentDTO; |
|||
import com.elink.esua.epdc.dto.comment.EventCommentUserAttitudeDTO; |
|||
import com.elink.esua.epdc.dto.topic.form.TopicReviewFormDTO; |
|||
import com.elink.esua.epdc.modules.comment.service.TopicCommentService; |
|||
import com.elink.esua.epdc.modules.feign.EventFeignClient; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.scheduling.annotation.Async; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* |
|||
* 话题转议题异步处理操作 |
|||
* |
|||
* @Author:liuchuang |
|||
* @Date:2019/11/12 13:31 |
|||
*/ |
|||
@Component |
|||
public class TopicChangeToIssueTask { |
|||
|
|||
@Autowired |
|||
private TopicCommentService topicCommentService; |
|||
|
|||
@Autowired |
|||
private EventFeignClient eventFeignClient; |
|||
|
|||
/** |
|||
* |
|||
* 拷贝评论、评论的支持反对到事件 |
|||
* |
|||
* @params [topicId] |
|||
* @return void |
|||
* @author liuchuang |
|||
* @since 2019/11/12 13:32 |
|||
*/ |
|||
@Async |
|||
public void copyCommentsAndAttitudeToEvents(TopicReviewFormDTO formDto) { |
|||
// 获取话题下所有评论
|
|||
List<EventCommentDTO> comments = topicCommentService.listCommentForEvent(formDto); |
|||
// 获取话题下所有评论的表态
|
|||
List<EventCommentUserAttitudeDTO> attitudes = topicCommentService.listCommentAttitudeForEvent(formDto.getTopicId()); |
|||
|
|||
EpdcCommentsAndAttitudeFromTopicFormDTO eventFormDto = new EpdcCommentsAndAttitudeFromTopicFormDTO(); |
|||
eventFormDto.setComments(comments); |
|||
eventFormDto.setAttitudes(attitudes); |
|||
|
|||
eventFeignClient.receiveTopicCommentAndAttitude(eventFormDto); |
|||
} |
|||
} |
Loading…
Reference in new issue