From 5c70ef62ea3bbd905c0a45d9b603b448c94df8f1 Mon Sep 17 00:00:00 2001 From: wangchao Date: Thu, 30 Apr 2020 16:41:40 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=94=BF=E5=BA=9C=E7=AB=AF=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E8=AF=9D=E9=A2=98=E5=88=97=E8=A1=A8=E5=92=8C=E5=B1=8F?= =?UTF-8?q?=E8=94=BD=E8=AF=9D=E9=A2=98=E5=88=97=E8=A1=A8=E5=B0=86=E5=8F=91?= =?UTF-8?q?=E5=B8=83=E6=97=B6=E9=97=B4=E4=BB=8E=E6=97=B6=E9=97=B4=E6=88=B3?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E6=94=B9=E4=B8=BA=E6=97=A5=E6=9C=9F=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E5=B9=B6=E4=BD=BF=E7=94=A8@JsonFormat=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/impl/ResiTopicServiceImpl.java | 4 ++-- .../dto/topic/result/GovHiddenTopicInfoResultDTO.java | 7 +++++-- .../group/dto/topic/result/GovTopicInfoResultDTO.java | 8 ++++++-- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiTopicServiceImpl.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiTopicServiceImpl.java index 9d5318b595..23dbd83fe9 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiTopicServiceImpl.java +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiTopicServiceImpl.java @@ -47,7 +47,7 @@ public class ResiTopicServiceImpl implements ResiTopicService { govTopic.setUserHeadPhoto(top.getReleaseUserHeadPhoto()); govTopic.setUserNickName(top.getReleaseUserName()); govTopic.setTopicId(top.getTopicId()); - govTopic.setTopicRealseTime(top.getReleaseTime().getTime()); + govTopic.setTopicRealseTime(top.getReleaseTime()); govTopic.setTopicFirstPhoto(top.getFirstPhoto()); topicsResult.add(govTopic); }); @@ -76,7 +76,7 @@ public class ResiTopicServiceImpl implements ResiTopicService { govTopic.setUserHeadPhoto(top.getReleaseUserHeadPhoto()); govTopic.setUserNickName(top.getReleaseUserName()); govTopic.setTopicId(top.getTopicId()); - govTopic.setTopicRealseTime(top.getReleaseTime().getTime()); + govTopic.setTopicRealseTime(top.getReleaseTime()); govTopic.setTopicFirstPhoto(top.getFirstPhoto()); govTopic.setTopicState(top.getStatus()); topicsResult.add(govTopic); diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/GovHiddenTopicInfoResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/GovHiddenTopicInfoResultDTO.java index ad5bcf4f61..6008f6c0eb 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/GovHiddenTopicInfoResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/GovHiddenTopicInfoResultDTO.java @@ -1,8 +1,10 @@ package com.epmet.resi.group.dto.topic.result; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import java.io.Serializable; +import java.util.Date; /** * @Description @@ -40,9 +42,10 @@ public class GovHiddenTopicInfoResultDTO implements Serializable { private String topicContent; /** - * 话题发布时间 时间戳 + * 话题发布时间 * */ - private Long topicRealseTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date topicRealseTime; /** * 话题的第一张图片地址 diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/GovTopicInfoResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/GovTopicInfoResultDTO.java index 296f4fcc36..d60a24382d 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/GovTopicInfoResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/GovTopicInfoResultDTO.java @@ -1,8 +1,11 @@ package com.epmet.resi.group.dto.topic.result; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import java.io.Serializable; +import java.util.Date; + /** * @Description @@ -40,9 +43,10 @@ public class GovTopicInfoResultDTO implements Serializable { private String topicContent; /** - * 话题发布时间 时间戳 + * 话题发布时间 * */ - private Long topicRealseTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date topicRealseTime; /** * 话题的第一张图片地址 From 2b5cba9897e9a8b5921cc6da5e5095f210abeb8d Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 30 Apr 2020 16:44:24 +0800 Subject: [PATCH 2/2] =?UTF-8?q?topiccomments=E6=8E=A5=E5=8F=A3=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ResiTopicCommentController.java | 42 +++++++++++++++++++ .../epmet/controller/ResiTopicController.java | 13 ------ 2 files changed, 42 insertions(+), 13 deletions(-) create mode 100644 epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiTopicCommentController.java diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiTopicCommentController.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiTopicCommentController.java new file mode 100644 index 0000000000..37ace59d99 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiTopicCommentController.java @@ -0,0 +1,42 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +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.GovCommentResultDTO; +import com.epmet.service.ResiTopicService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * @Description 话题评论相关接口 + * @Author yinzuomei + * @Date 2020/4/30 16:42 + */ +@RestController +@RequestMapping("topic") +public class ResiTopicCommentController { + @Autowired + private ResiTopicService resiTopicService; + /** + * @Description 政府端群组管理-获取某个话题的评论列表 + * @Param tokenDto + * @Param ResiQueryCommentFormDTO + * @return Result> + * @Author wangc + * @Date 2020.04.01 23:49 + **/ + @PostMapping("topiccomments") + Result> topicComments(@LoginUser TokenDto tokenDto, @RequestBody ResiQueryCommentFormDTO queryCommentFormDTO){ + ValidatorUtils.validateEntity(queryCommentFormDTO); + return resiTopicService.topicComments(queryCommentFormDTO); + } +} + diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiTopicController.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiTopicController.java index f821df15c9..6686e605f6 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiTopicController.java +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiTopicController.java @@ -70,19 +70,6 @@ public class ResiTopicController { return resiTopicService.topicDetail(topicDetailFormDTO); } - /** - * @Description 政府端群组管理-获取某个话题的评论列表 - * @Param tokenDto - * @Param ResiQueryCommentFormDTO - * @return Result> - * @Author wangc - * @Date 2020.04.01 23:49 - **/ - @PostMapping("topiccomments") - Result> topicComments(@LoginUser TokenDto tokenDto, @RequestBody ResiQueryCommentFormDTO queryCommentFormDTO){ - ValidatorUtils.validateEntity(queryCommentFormDTO); - return resiTopicService.topicComments(queryCommentFormDTO); - } }