Browse Source

分享话题id获取信息

dev
zxc 5 years ago
parent
commit
bbff6bec14
  1. 11
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/TopicVisitFormDTO.java
  2. 1
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/TopicShareLinkRecordController.java
  3. 6
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicShareLinkRecordServiceImpl.java

11
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/TopicVisitFormDTO.java

@ -2,6 +2,7 @@ package com.epmet.resi.group.dto.topic.form;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable; import java.io.Serializable;
/** /**
@ -13,17 +14,11 @@ public class TopicVisitFormDTO implements Serializable {
private static final long serialVersionUID = -7231684507046042401L; private static final long serialVersionUID = -7231684507046042401L;
/** public interface TopicVisitForm{}
* 当点击右上角三个点分享时传参为topicId点击页面内的分享时传参为inviteId
*/
/** /**
* 分享ID * 分享ID
*/ */
@NotBlank(message = "分享ID不能为空",groups = {TopicVisitForm.class})
private String shareLinkId; private String shareLinkId;
/**
* 话题ID
*/
private String topicId;
} }

1
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/TopicShareLinkRecordController.java

@ -104,6 +104,7 @@ public class TopicShareLinkRecordController {
*/ */
@PostMapping("visit") @PostMapping("visit")
public Result<TopicVisitResultDTO> topicVisit(@RequestBody TopicVisitFormDTO formDTO,@LoginUser TokenDto tokenDto){ public Result<TopicVisitResultDTO> topicVisit(@RequestBody TopicVisitFormDTO formDTO,@LoginUser TokenDto tokenDto){
ValidatorUtils.validateEntity(formDTO, TopicVisitFormDTO.TopicVisitForm.class);
return new Result<TopicVisitResultDTO>().ok(topicShareLinkRecordService.topicVisit(formDTO,tokenDto)); return new Result<TopicVisitResultDTO>().ok(topicShareLinkRecordService.topicVisit(formDTO,tokenDto));
} }

6
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicShareLinkRecordServiceImpl.java

@ -155,8 +155,6 @@ public class TopicShareLinkRecordServiceImpl extends BaseServiceImpl<TopicShareL
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public TopicVisitResultDTO topicVisit(TopicVisitFormDTO formDTO, TokenDto tokenDto) { public TopicVisitResultDTO topicVisit(TopicVisitFormDTO formDTO, TokenDto tokenDto) {
String topicId = null;
if (StringUtils.isNotBlank(formDTO.getShareLinkId())){
// 点击页面上的分享时 // 点击页面上的分享时
TopicShareLinkRecordEntity linkRecord = baseDao.selectById(formDTO.getShareLinkId()); TopicShareLinkRecordEntity linkRecord = baseDao.selectById(formDTO.getShareLinkId());
if (null == linkRecord){ if (null == linkRecord){
@ -169,9 +167,7 @@ public class TopicShareLinkRecordServiceImpl extends BaseServiceImpl<TopicShareL
entity.setShareLinkRecId(formDTO.getShareLinkId()); entity.setShareLinkRecId(formDTO.getShareLinkId());
entity.setIsInviteRegister(NumConstant.ONE); entity.setIsInviteRegister(NumConstant.ONE);
visitRecordDao.insert(entity); visitRecordDao.insert(entity);
topicId = linkRecord.getTopicId(); TopicVisitResultDTO result = baseDao.selectTopicInfoById(linkRecord.getTopicId());
}else topicId = formDTO.getTopicId();
TopicVisitResultDTO result = baseDao.selectTopicInfoById(topicId);
if (null == result){ if (null == result){
throw new RenException(TopicShareConstant.NOT_EXIST_TOPIC_INFO); throw new RenException(TopicShareConstant.NOT_EXIST_TOPIC_INFO);
} }

Loading…
Cancel
Save