Browse Source

评论先关接口

feature/yujt_analysisHomeChange
曲树通 5 years ago
parent
commit
0256fb59cd
  1. 33
      epdc-cloud-api/src/main/java/com/elink/esua/epdc/controller/ApiPropertyController.java
  2. 18
      epdc-cloud-api/src/main/java/com/elink/esua/epdc/feign/PropertyFeignClient.java
  3. 18
      epdc-cloud-api/src/main/java/com/elink/esua/epdc/feign/fallback/PropertyFeignClientFallback.java
  4. 32
      epdc-cloud-api/src/main/java/com/elink/esua/epdc/service/PropertyService.java
  5. 53
      epdc-cloud-api/src/main/java/com/elink/esua/epdc/service/impl/PropertyServiceImpl.java

33
epdc-cloud-api/src/main/java/com/elink/esua/epdc/controller/ApiPropertyController.java

@ -4,13 +4,15 @@ 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.utils.Result;
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
import com.elink.esua.epdc.dto.comment.TopicCommentFormDTO;
import com.elink.esua.epdc.dto.comment.TopicCommentStatementFormDTO;
import com.elink.esua.epdc.dto.comment.TopicCommentsFormDTO;
import com.elink.esua.epdc.dto.comment.result.EventCommentsResultDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcUserGroupInviteFormDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcUserGroupInviteResultDTO;
import com.elink.esua.epdc.dto.group.GroupSettingStateDTO;
import com.elink.esua.epdc.dto.group.form.*;
import com.elink.esua.epdc.dto.group.result.*;
import com.elink.esua.epdc.dto.project.form.ProjectListFormDTO;
import com.elink.esua.epdc.dto.topic.form.TopicChangeToIssueFormDTO;
import com.elink.esua.epdc.dto.topic.form.TopicCloseFormDTO;
import com.elink.esua.epdc.dto.topic.form.TopicListFormDTO;
import com.elink.esua.epdc.dto.topic.form.TopicSubmitFormDTO;
@ -19,7 +21,6 @@ import com.elink.esua.epdc.dto.topic.result.TopicListResultDTO;
import com.elink.esua.epdc.service.PropertyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
@ -249,4 +250,30 @@ public class ApiPropertyController {
public Result projectDetail(@LoginUser TokenDto userDetail, @PathVariable("propertyProjectId") String propertyProjectId) {
return propertyService.projectDetail(userDetail, propertyProjectId);
}
/**
* @author: qushutong
* @Date: 2020/5/14 16:48
* @Description:提交评论或回复接口
*/
@PostMapping("submit")
public Result submit(@LoginUser TokenDto userDetail, @RequestBody TopicCommentFormDTO topicCommentFormDTO) {
return propertyService.submit(userDetail, topicCommentFormDTO);
}
/**
* 评论/
*/
@PostMapping("statement")
public Result statement(@LoginUser TokenDto userDetail, @RequestBody TopicCommentStatementFormDTO topicCommentStatementFormDTO) {
return propertyService.statement(userDetail, topicCommentStatementFormDTO);
}
/**
* 评论列表
*/
@GetMapping("list")
public Result<EventCommentsResultDTO> listOfComments(@LoginUser TokenDto userDetail, TopicCommentsFormDTO topicCommentsFormDTO) {
return propertyService.listOfComments(userDetail, topicCommentsFormDTO);
}
}

18
epdc-cloud-api/src/main/java/com/elink/esua/epdc/feign/PropertyFeignClient.java

@ -2,9 +2,12 @@ package com.elink.esua.epdc.feign;
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.comment.TopicCommentFormDTO;
import com.elink.esua.epdc.dto.comment.TopicCommentStatementFormDTO;
import com.elink.esua.epdc.dto.comment.TopicCommentsFormDTO;
import com.elink.esua.epdc.dto.comment.result.EventCommentsResultDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcUserGroupInviteFormDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcUserGroupInviteResultDTO;
import com.elink.esua.epdc.dto.group.GroupSettingStateDTO;
import com.elink.esua.epdc.dto.group.form.*;
import com.elink.esua.epdc.dto.group.result.*;
import com.elink.esua.epdc.dto.project.form.ProjectDetailFormDTO;
@ -14,12 +17,10 @@ import com.elink.esua.epdc.dto.project.result.ProjectListResultDTO;
import com.elink.esua.epdc.dto.topic.form.*;
import com.elink.esua.epdc.dto.topic.result.TopicDetailResultDTO;
import com.elink.esua.epdc.dto.topic.result.TopicListResultDTO;
import com.elink.esua.epdc.feign.fallback.GroupFeignClientFallback;
import com.elink.esua.epdc.feign.fallback.PropertyFeignClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -225,7 +226,6 @@ public interface PropertyFeignClient {
/**
* 物业项目详情
*
* @return ProjectDetailResultDTO
* @params [formDto]
* @author ZHANGYUAN
@ -233,4 +233,14 @@ public interface PropertyFeignClient {
*/
@GetMapping(value = "property/epdc-app/project/detail", consumes = MediaType.APPLICATION_JSON_VALUE)
Result<ProjectDetailResultDTO> projectDetail(ProjectDetailFormDTO formDto);
@PostMapping(value = "property/epdc-app/comment/submit", consumes = MediaType.APPLICATION_JSON_VALUE)
Result submit(TopicCommentFormDTO commentFormDTO);
@PostMapping(value = "property/epdc-app/comment/statement", consumes = MediaType.APPLICATION_JSON_VALUE)
Result statement(TopicCommentStatementFormDTO commentStatementFormDTO);
@GetMapping(value = "property/epdc-app/comment/list", consumes = MediaType.APPLICATION_JSON_VALUE)
Result<EventCommentsResultDTO> listOfComments(TopicCommentsFormDTO formDto);
}

18
epdc-cloud-api/src/main/java/com/elink/esua/epdc/feign/fallback/PropertyFeignClientFallback.java

@ -3,6 +3,10 @@ package com.elink.esua.epdc.feign.fallback;
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant;
import com.elink.esua.epdc.commons.tools.utils.ModuleUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.comment.TopicCommentFormDTO;
import com.elink.esua.epdc.dto.comment.TopicCommentStatementFormDTO;
import com.elink.esua.epdc.dto.comment.TopicCommentsFormDTO;
import com.elink.esua.epdc.dto.comment.result.EventCommentsResultDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcUserGroupInviteFormDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcUserGroupInviteResultDTO;
import com.elink.esua.epdc.dto.group.GroupSettingStateDTO;
@ -123,4 +127,18 @@ public class PropertyFeignClientFallback implements PropertyFeignClient {
public Result<ProjectDetailResultDTO> projectDetail(ProjectDetailFormDTO formDto) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_PROPERTY_SERVER, "projectDetail", formDto);
}
public Result submit(TopicCommentFormDTO commentFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_GROUP_SERVER, "submit", commentFormDTO);
}
@Override
public Result statement(TopicCommentStatementFormDTO commentStatementFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_GROUP_SERVER, "statement", commentStatementFormDTO);
}
@Override
public Result<EventCommentsResultDTO> listOfComments(TopicCommentsFormDTO formDto) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_GROUP_SERVER, "listOfComments", formDto);
}
}

32
epdc-cloud-api/src/main/java/com/elink/esua/epdc/service/PropertyService.java

@ -1,22 +1,24 @@
package com.elink.esua.epdc.service;
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.utils.Result;
import com.elink.esua.epdc.dto.comment.TopicCommentFormDTO;
import com.elink.esua.epdc.dto.comment.TopicCommentStatementFormDTO;
import com.elink.esua.epdc.dto.comment.TopicCommentsFormDTO;
import com.elink.esua.epdc.dto.comment.result.EventCommentsResultDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcUserGroupInviteFormDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcUserGroupInviteResultDTO;
import com.elink.esua.epdc.dto.group.GroupSettingStateDTO;
import com.elink.esua.epdc.dto.group.form.*;
import com.elink.esua.epdc.dto.group.result.*;
import com.elink.esua.epdc.dto.project.form.ProjectListFormDTO;
import com.elink.esua.epdc.dto.project.result.ProjectDetailResultDTO;
import com.elink.esua.epdc.dto.project.result.ProjectListResultDTO;
import com.elink.esua.epdc.dto.topic.form.TopicChangeToIssueFormDTO;
import com.elink.esua.epdc.dto.topic.form.TopicCloseFormDTO;
import com.elink.esua.epdc.dto.topic.form.TopicListFormDTO;
import com.elink.esua.epdc.dto.topic.form.TopicSubmitFormDTO;
import com.elink.esua.epdc.dto.topic.result.TopicDetailResultDTO;
import com.elink.esua.epdc.dto.topic.result.TopicListResultDTO;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
@ -92,7 +94,7 @@ public interface PropertyService {
/**
* 添加成员列表
*
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List < com.elink.esua.epdc.dto.epdc.result.EpdcUserGroupInviteResultDTO>>
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List < com.elink.esua.epdc.dto.epdc.result.EpdcUserGroupInviteResultDTO>>
* @params [formDto]
* @author liuchuang
* @since 2019/10/23 16:40
@ -164,7 +166,7 @@ public interface PropertyService {
/**
* 话题列表
*
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List < com.elink.esua.epdc.dto.topic.result.TopicListResultDTO>>
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List < com.elink.esua.epdc.dto.topic.result.TopicListResultDTO>>
* @params [userDetail, formDto]
* @author liuchuang
* @since 2019/11/11 15:05
@ -174,7 +176,7 @@ public interface PropertyService {
/**
* 物业项目列表
*
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List < com.elink.esua.epdc.dto.topic.result.TopicListResultDTO>>
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List < com.elink.esua.epdc.dto.topic.result.TopicListResultDTO>>
* @params [userDetail, formDto]
* @author liuchuang
* @since 2019/11/11 15:05
@ -184,10 +186,26 @@ public interface PropertyService {
/**
* 物业项目详情
*
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List < com.elink.esua.epdc.dto.topic.result.TopicListResultDTO>>
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List < com.elink.esua.epdc.dto.topic.result.TopicListResultDTO>>
* @params [userDetail, formDto]
* @author liuchuang
* @since 2019/11/11 15:05
*/
Result<ProjectDetailResultDTO> projectDetail(TokenDto userDetail, String id);
/**
* 提交评论或回复接口
*/
Result submit(@LoginUser TokenDto userDetail, TopicCommentFormDTO topicCommentFormDTO);
/**
* 评论/
*/
Result statement(@LoginUser TokenDto userDetail, TopicCommentStatementFormDTO topicCommentStatementFormDTO);
/**
* 评论列表
*/
Result<EventCommentsResultDTO> listOfComments(TokenDto userDetail, TopicCommentsFormDTO topicCommentsFormDTO);
}

53
epdc-cloud-api/src/main/java/com/elink/esua/epdc/service/impl/PropertyServiceImpl.java

@ -1,18 +1,18 @@
package com.elink.esua.epdc.service.impl;
import com.elink.esua.epdc.async.WxMaSecCheckTask;
import com.elink.esua.epdc.common.token.dto.TokenDto;
import com.elink.esua.epdc.commons.tools.constant.NumConstant;
import com.elink.esua.epdc.commons.tools.enums.UserTagEnum;
import com.elink.esua.epdc.commons.tools.enums.YesOrNoEnum;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.ParentAndAllDeptDTO;
import com.elink.esua.epdc.dto.UploadToOssDTO;
import com.elink.esua.epdc.dto.enums.GroupStateEnum;
import com.elink.esua.epdc.dto.enums.GroupUserStateEnum;
import com.elink.esua.epdc.dto.comment.TopicCommentFormDTO;
import com.elink.esua.epdc.dto.comment.TopicCommentStatementFormDTO;
import com.elink.esua.epdc.dto.comment.TopicCommentsFormDTO;
import com.elink.esua.epdc.dto.comment.result.EventCommentsResultDTO;
import com.elink.esua.epdc.dto.enums.TopicStateEnum;
import com.elink.esua.epdc.dto.epdc.form.EpdcUserGroupInviteFormDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcUserGroupInviteResultDTO;
import com.elink.esua.epdc.dto.group.GroupSettingStateDTO;
import com.elink.esua.epdc.dto.group.form.*;
import com.elink.esua.epdc.dto.group.result.*;
import com.elink.esua.epdc.dto.project.form.ProjectDetailFormDTO;
@ -23,7 +23,6 @@ import com.elink.esua.epdc.dto.topic.form.*;
import com.elink.esua.epdc.dto.topic.result.TopicDetailResultDTO;
import com.elink.esua.epdc.dto.topic.result.TopicListResultDTO;
import com.elink.esua.epdc.feign.AdminFeignClient;
import com.elink.esua.epdc.feign.OssFeignClient;
import com.elink.esua.epdc.feign.PropertyFeignClient;
import com.elink.esua.epdc.service.PropertyService;
import com.elink.esua.epdc.utils.UserTagUtils;
@ -48,6 +47,10 @@ public class PropertyServiceImpl implements PropertyService {
private PropertyFeignClient propertyFeignClient;
@Autowired
private WxMaSecCheckTask wxMaSecCheckTask;
@Override
public Result<GroupDetailForMobileEndResultDTO> getGroupDetail(TokenDto userDetail, String id) {
if (null == userDetail) {
@ -222,4 +225,42 @@ public class PropertyServiceImpl implements PropertyService {
formDto.setGridId(userDetail.getGridId());
return propertyFeignClient.projectDetail(formDto);
}
@Override
public Result submit(TokenDto userDetail, TopicCommentFormDTO topicCommentFormDTO) {
if (null == userDetail) {
return new Result().error("获取用户信息失败");
}
// 上传内容安全检查
wxMaSecCheckTask.checkMessage(topicCommentFormDTO.getContent());
topicCommentFormDTO.setUserId(userDetail.getUserId());
topicCommentFormDTO.setUserName(userDetail.getNickname());
topicCommentFormDTO.setUserFace(userDetail.getFaceImg());
if (UserTagUtils.containIdentity(userDetail.getUserTagInfos(), UserTagEnum.PARTY_MEMBER)) {
topicCommentFormDTO.setPartyFlag(YesOrNoEnum.YES.value());
} else {
topicCommentFormDTO.setPartyFlag(YesOrNoEnum.NO.value());
}
return propertyFeignClient.submit(topicCommentFormDTO);
}
@Override
public Result statement(TokenDto userDetail, TopicCommentStatementFormDTO topicCommentStatementFormDTO) {
if (null == userDetail) {
return new Result<EventCommentsResultDTO>().error("获取用户信息失败");
}
topicCommentStatementFormDTO.setUseId(userDetail.getUserId());
topicCommentStatementFormDTO.setUserName(userDetail.getNickname());
return propertyFeignClient.statement(topicCommentStatementFormDTO);
}
@Override
public Result<EventCommentsResultDTO> listOfComments(TokenDto userDetail, TopicCommentsFormDTO topicCommentsFormDTO) {
if (null == userDetail) {
return new Result<EventCommentsResultDTO>().error("获取用户信息失败");
}
topicCommentsFormDTO.setUserId(userDetail.getUserId());
return propertyFeignClient.listOfComments(topicCommentsFormDTO);
}
}

Loading…
Cancel
Save