Browse Source

政府端话题接口返参修改

dev_shibei_match
wangchao 5 years ago
parent
commit
bab73910b6
  1. 10
      epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiTopicController.java
  2. 11
      epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/ResiTopicService.java
  3. 60
      epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiTopicServiceImpl.java
  4. 44
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/comment/result/GovCommentResultDTO.java
  5. 56
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/GovTopicInfoResultDTO.java

10
epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiTopicController.java

@ -5,11 +5,11 @@ import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.resi.group.dto.comment.form.ResiQueryCommentFormDTO;
import com.epmet.resi.group.dto.comment.result.ResiCommentResultDTO;
import com.epmet.resi.group.dto.comment.result.GovCommentResultDTO;
import com.epmet.resi.group.dto.topic.form.ResiTopicDetailFormDTO;
import com.epmet.resi.group.dto.topic.form.ResiTopicPageFormDTO;
import com.epmet.resi.group.dto.topic.result.GovTopicInfoResultDTO;
import com.epmet.resi.group.dto.topic.result.ResiTopicDetailResultDTO;
import com.epmet.resi.group.dto.topic.result.ResiTopicInfoResultDTO;
import com.epmet.service.ResiTopicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
@ -34,7 +34,7 @@ public class ResiTopicController {
* @Date 2020.04.01 16:45
**/
@PostMapping("hiddenlist")
Result<List<ResiTopicInfoResultDTO>> hiddenList(@LoginUser TokenDto tokenDto, @RequestBody ResiTopicPageFormDTO topicPageFormDTO){
Result<List<GovTopicInfoResultDTO>> hiddenList(@LoginUser TokenDto tokenDto, @RequestBody ResiTopicPageFormDTO topicPageFormDTO){
topicPageFormDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(topicPageFormDTO);
return resiTopicService.hiddenList(topicPageFormDTO);
@ -49,7 +49,7 @@ public class ResiTopicController {
* @Date 2020.04.01 10:36
**/
@PostMapping("alltopics")
Result<List<ResiTopicInfoResultDTO>> allTopics(@LoginUser TokenDto tokenDto,@RequestBody ResiTopicPageFormDTO topicPageFormDTO){
Result<List<GovTopicInfoResultDTO>> allTopics(@LoginUser TokenDto tokenDto,@RequestBody ResiTopicPageFormDTO topicPageFormDTO){
topicPageFormDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(topicPageFormDTO);
return resiTopicService.allTopics(topicPageFormDTO);
@ -78,7 +78,7 @@ public class ResiTopicController {
* @Date 2020.04.01 23:49
**/
@PostMapping("topiccomments")
Result<List<ResiCommentResultDTO>> topicComments(@LoginUser TokenDto tokenDto,@RequestBody ResiQueryCommentFormDTO queryCommentFormDTO){
Result<List<GovCommentResultDTO>> topicComments(@LoginUser TokenDto tokenDto, @RequestBody ResiQueryCommentFormDTO queryCommentFormDTO){
ValidatorUtils.validateEntity(queryCommentFormDTO);
return resiTopicService.topicComments(queryCommentFormDTO);
}

11
epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/ResiTopicService.java

@ -2,12 +2,11 @@ package com.epmet.service;
import com.epmet.commons.tools.utils.Result;
import com.epmet.resi.group.dto.comment.form.ResiQueryCommentFormDTO;
import com.epmet.resi.group.dto.comment.result.ResiCommentResultDTO;
import com.epmet.resi.group.dto.comment.result.GovCommentResultDTO;
import com.epmet.resi.group.dto.topic.form.ResiTopicDetailFormDTO;
import com.epmet.resi.group.dto.topic.form.ResiTopicPageFormDTO;
import com.epmet.resi.group.dto.topic.result.GovTopicInfoResultDTO;
import com.epmet.resi.group.dto.topic.result.ResiTopicDetailResultDTO;
import com.epmet.resi.group.dto.topic.result.ResiTopicInfoResultDTO;
import org.springframework.web.bind.annotation.PostMapping;
import java.util.List;
@ -21,7 +20,7 @@ public interface ResiTopicService {
* @Author wangc
* @Date 2020.04.01 16:45
**/
Result<List<ResiTopicInfoResultDTO>> hiddenList(ResiTopicPageFormDTO topicPageFormDTO);
Result<List<GovTopicInfoResultDTO>> hiddenList(ResiTopicPageFormDTO topicPageFormDTO);
/**
* @Description 政府端群组管理-查看历史话题(分页,允许状态筛选)
@ -31,7 +30,7 @@ public interface ResiTopicService {
* @Author wangc
* @Date 2020.04.01 10:36
**/
Result<List<ResiTopicInfoResultDTO>> allTopics(ResiTopicPageFormDTO topicPageFormDTO);
Result<List<GovTopicInfoResultDTO>> allTopics(ResiTopicPageFormDTO topicPageFormDTO);
/**
* @Description 政府端群组管理-获取话题详情
@ -51,7 +50,7 @@ public interface ResiTopicService {
* @Author wangc
* @Date 2020.04.01 23:49
**/
Result<List<ResiCommentResultDTO>> topicComments(ResiQueryCommentFormDTO queryCommentFormDTO);
Result<List<GovCommentResultDTO>> topicComments(ResiQueryCommentFormDTO queryCommentFormDTO);
}

60
epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiTopicServiceImpl.java

@ -4,15 +4,18 @@ import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.feign.ResiGroupFeignClient;
import com.epmet.resi.group.dto.comment.form.ResiQueryCommentFormDTO;
import com.epmet.resi.group.dto.comment.result.GovCommentResultDTO;
import com.epmet.resi.group.dto.comment.result.ResiCommentResultDTO;
import com.epmet.resi.group.dto.topic.form.ResiTopicDetailFormDTO;
import com.epmet.resi.group.dto.topic.form.ResiTopicPageFormDTO;
import com.epmet.resi.group.dto.topic.result.GovTopicInfoResultDTO;
import com.epmet.resi.group.dto.topic.result.ResiTopicDetailResultDTO;
import com.epmet.resi.group.dto.topic.result.ResiTopicInfoResultDTO;
import com.epmet.service.ResiTopicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
@Service
@ -30,10 +33,26 @@ public class ResiTopicServiceImpl implements ResiTopicService {
* @Date 2020.04.01 16:45
**/
@Override
public Result<List<ResiTopicInfoResultDTO>> hiddenList(ResiTopicPageFormDTO topicPageFormDTO) {
public Result<List<GovTopicInfoResultDTO>> hiddenList(ResiTopicPageFormDTO topicPageFormDTO) {
topicPageFormDTO.setPageNo(NumConstant.ONE);
topicPageFormDTO.setPageSize(NumConstant.MAX);
return resiGroupFeignClient.getHiddenTopicGov(topicPageFormDTO);
Result<List<ResiTopicInfoResultDTO>> topics = resiGroupFeignClient.getHiddenTopicGov(topicPageFormDTO);
List<GovTopicInfoResultDTO> topicsResult = new ArrayList<>();
if(topics.success() && null != topics.getData() && topics.getData().size() > NumConstant.ZERO) {
topics.getData().forEach(top -> {
GovTopicInfoResultDTO govTopic = new GovTopicInfoResultDTO();
govTopic.setTopicContent(top.getTopicContent());
govTopic.setUserId(top.getUserId());
govTopic.setUserHeadPhoto(top.getReleaseUserHeadPhoto());
govTopic.setUserNickName(top.getReleaseUserName());
govTopic.setTopicId(top.getTopicId());
govTopic.setTopicRealseTime(top.getReleaseTime().getTime());
govTopic.setTopicFirstPhoto(top.getFirstPhoto());
topicsResult.add(govTopic);
});
}
return new Result<List<GovTopicInfoResultDTO>>().ok(topicsResult);
}
/**
@ -45,8 +64,23 @@ public class ResiTopicServiceImpl implements ResiTopicService {
* @Date 2020.04.01 10:36
**/
@Override
public Result<List<ResiTopicInfoResultDTO>> allTopics(ResiTopicPageFormDTO topicPageFormDTO) {
return resiGroupFeignClient.getPastTopicListGov(topicPageFormDTO);
public Result<List<GovTopicInfoResultDTO>> allTopics(ResiTopicPageFormDTO topicPageFormDTO) {
Result<List<ResiTopicInfoResultDTO>> topics = resiGroupFeignClient.getPastTopicListGov(topicPageFormDTO);
List<GovTopicInfoResultDTO> topicsResult = new ArrayList<>();
if(topics.success() && null != topics.getData() && topics.getData().size() > NumConstant.ZERO) {
topics.getData().forEach(top -> {
GovTopicInfoResultDTO govTopic = new GovTopicInfoResultDTO();
govTopic.setTopicContent(top.getTopicContent());
govTopic.setUserId(top.getUserId());
govTopic.setUserHeadPhoto(top.getReleaseUserHeadPhoto());
govTopic.setUserNickName(top.getReleaseUserName());
govTopic.setTopicId(top.getTopicId());
govTopic.setTopicRealseTime(top.getReleaseTime().getTime());
govTopic.setTopicFirstPhoto(top.getFirstPhoto());
topicsResult.add(govTopic);
});
}
return new Result<List<GovTopicInfoResultDTO>>().ok(topicsResult);
}
/**
@ -71,7 +105,21 @@ public class ResiTopicServiceImpl implements ResiTopicService {
* @Date 2020.04.01 23:49
**/
@Override
public Result<List<ResiCommentResultDTO>> topicComments(ResiQueryCommentFormDTO queryCommentFormDTO) {
return resiGroupFeignClient.getCommentListOfTopicGov(queryCommentFormDTO);
public Result<List<GovCommentResultDTO>> topicComments(ResiQueryCommentFormDTO queryCommentFormDTO) {
Result<List<ResiCommentResultDTO>> comments = resiGroupFeignClient.getCommentListOfTopicGov(queryCommentFormDTO);
List<GovCommentResultDTO> commentsResult = new ArrayList<>();
if(comments.success() && null != comments.getData() && comments.getData().size() > NumConstant.ZERO){
comments.getData().forEach(com -> {
GovCommentResultDTO govComment = new GovCommentResultDTO();
govComment.setCommentId(com.getCommentId());
govComment.setCommentContent(com.getCommentContent());
govComment.setCommentUserHeadPhoto(com.getCommentUserHeadPhoto());
govComment.setCommentUserName(com.getCommentUserName());
govComment.setCommentTime(com.getCommentTime());
commentsResult.add(govComment);
});
}
return new Result<List<GovCommentResultDTO>>().ok(commentsResult);
}
}

44
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/comment/result/GovCommentResultDTO.java

@ -0,0 +1,44 @@
package com.epmet.resi.group.dto.comment.result;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @Description
* @ClassName GovCommentResultDTO
* @Auth wangc
* @Date 2020-04-30 13:07
*/
@Data
public class GovCommentResultDTO implements Serializable {
private static final long serialVersionUID = -6141574797811146831L;
/**
* 评论Id
* */
private String commentId;
/**
* 评论内容
* */
private String commentContent;
/**
* 评论者头像
* */
private String commentUserHeadPhoto;
/**
* 评论者姓名
* */
private String commentUserName;
/**
* 评论时间 yyyy-MM-dd HH:mm
* */
@JSONField(format="yyyy-MM-dd HH:mm")
private Date commentTime;
}

56
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/GovTopicInfoResultDTO.java

@ -0,0 +1,56 @@
package com.epmet.resi.group.dto.topic.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description
* @ClassName GovTopicInfoResultDTO
* @Auth wangc
* @Date 2020-04-30 13:08
*/
@Data
public class GovTopicInfoResultDTO implements Serializable {
private static final long serialVersionUID = -3495808492616727671L;
/**
* 作者的Id
* */
private String userId;
/**
* 用户头像
* */
private String userHeadPhoto;
/**
* 用户昵称
* */
private String userNickName;
/**
* 话题Id
* */
private String topicId;
/**
* 话题内容
* */
private String topicContent;
/**
* 话题发布时间 时间戳
* */
private Long topicRealseTime;
/**
* 话题的第一张图片地址
* */
private String topicFirstPhoto;
/**
* 话题的状态
* */
private String topicState;
}
Loading…
Cancel
Save