diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/ResiTopicDefaultPageFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/ResiTopicDefaultPageFormDTO.java new file mode 100644 index 0000000000..a7a562743e --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/ResiTopicDefaultPageFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.resi.group.dto.topic.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description + * @ClassName ResiTopicDefaultPageFormDTO + * @Author wangc + * @date 2020.04.07 09:14 + */ +@Data +public class ResiTopicDefaultPageFormDTO implements Serializable{ + + private static final long serialVersionUID = 1L; + + /** + * 小组Id + * */ + @NotBlank(message = "小组Id不能为空") + private String groupId; + +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/ResiTopicDetailFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/ResiTopicDetailFormDTO.java new file mode 100644 index 0000000000..e0e1d85a99 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/ResiTopicDetailFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.resi.group.dto.topic.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description + * @ClassName ResiTopicDetailFormDTO + * @Author wangc + * @date 2020.04.07 09:07 + */ +@Data +public class ResiTopicDetailFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 话题Id + * */ + @NotBlank(message = "话题Id不能为空") + private String topicId; + +} diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java index b19c8f6623..b6746d07ad 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java @@ -5,9 +5,7 @@ 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.modules.topic.service.ResiTopicService; -import com.epmet.resi.group.dto.topic.form.ResiTopicOperationFormDTO; -import com.epmet.resi.group.dto.topic.form.ResiTopicPageFormDTO; -import com.epmet.resi.group.dto.topic.form.ResiTopicPublishFormDTO; +import com.epmet.resi.group.dto.topic.form.*; import com.epmet.resi.group.dto.topic.result.ResiTopicDetailResultDTO; import com.epmet.resi.group.dto.topic.result.ResiTopicInfoResultDTO; import org.springframework.beans.factory.annotation.Autowired; @@ -53,8 +51,9 @@ public class ResiTopicController { * @Date 2020.04.01 23:48 **/ @PostMapping("gettopicdetail") - public Result getTopicDetail(@LoginUser TokenDto tokenDto, @RequestParam("topicId") String topicId ){ - return topicService.getTopicDetail(tokenDto,topicId); + public Result getTopicDetail(@LoginUser TokenDto tokenDto, @RequestBody ResiTopicDetailFormDTO topicDetailFormDTO ){ + ValidatorUtils.validateEntity(topicDetailFormDTO); + return topicService.getTopicDetail(tokenDto,topicDetailFormDTO.getTopicId()); } /** @@ -74,14 +73,15 @@ public class ResiTopicController { /** * @Description 查看组内最近十条话题 * @Param tokenDto - * @Param groupId + * @Param ResiTopicDefaultPageFormDTO * @return Result> * @Author wangc * @Date 2020.04.02 00:01 **/ @PostMapping("getlatesttentopics") - Result> getLatestTenTopics(@LoginUser TokenDto tokenDto,@RequestParam("groupId") String groupId){ - return topicService.getLatestTenTopics(tokenDto,groupId); + Result> getLatestTenTopics(@LoginUser TokenDto tokenDto,@RequestBody ResiTopicDefaultPageFormDTO topicDefaultPageFormDTO){ + ValidatorUtils.validateEntity(topicDefaultPageFormDTO); + return topicService.getLatestTenTopics(tokenDto,topicDefaultPageFormDTO.getGroupId()); } /**