Browse Source

话题语音

master
zhaoqifeng 5 years ago
parent
commit
ec6eda6930
  1. 2
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/CreateTopicFormDTO.java
  2. 14
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftServiceImpl.java

2
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/CreateTopicFormDTO.java

@ -62,7 +62,7 @@ public class CreateTopicFormDTO implements Serializable {
/** /**
* 图片附件 * 图片附件
*/ */
private List<FileDTO> imageList; private List<String> imageList;
/** /**
* 文件附件 * 文件附件
*/ */

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

@ -279,18 +279,18 @@ public class TopicDraftServiceImpl extends BaseServiceImpl<TopicDraftDao, TopicD
if(CollectionUtils.isNotEmpty(formDTO.getImageList())){ if(CollectionUtils.isNotEmpty(formDTO.getImageList())){
TopicDraftAttachmentDTO attachment = new TopicDraftAttachmentDTO(); TopicDraftAttachmentDTO attachment = new TopicDraftAttachmentDTO();
int sort = 0; int sort = 0;
for(FileDTO file : formDTO.getImageList()){ for(String url : formDTO.getImageList()){
attachment.setAttachmentUrl(file.getUrl()); attachment.setAttachmentUrl(url);
attachment.setTopicDraftId(topic.getId()); attachment.setTopicDraftId(topic.getId());
attachment.setCreatedBy(tokenDto.getUserId()); attachment.setCreatedBy(tokenDto.getUserId());
attachment.setAttachmentFormat(file.getUrl().substring(file.getUrl().lastIndexOf(".") + NumConstant.ONE).toLowerCase()); attachment.setAttachmentFormat(url.substring(url.lastIndexOf(".") + NumConstant.ONE).toLowerCase());
attachment.setSort(sort++); attachment.setSort(sort++);
attachment.setAttachmentType("image"); attachment.setAttachmentType("image");
topicDraftAttachmentService.save(attachment); topicDraftAttachmentService.save(attachment);
ImgTaskDTO task = new ImgTaskDTO(); ImgTaskDTO task = new ImgTaskDTO();
task.setDataId(attachment.getId()); task.setDataId(attachment.getId());
task.setUrl(file.getUrl()); task.setUrl(url);
imageDTOList.add(task); imageDTOList.add(task);
} }
} }
@ -671,11 +671,11 @@ public class TopicDraftServiceImpl extends BaseServiceImpl<TopicDraftDao, TopicD
if(CollectionUtils.isNotEmpty(formDTO.getImageList())){ if(CollectionUtils.isNotEmpty(formDTO.getImageList())){
ResiTopicAttachmentEntity attachment = new ResiTopicAttachmentEntity(); ResiTopicAttachmentEntity attachment = new ResiTopicAttachmentEntity();
int sort = 0; int sort = 0;
for(FileDTO file : formDTO.getImageList()){ for(String url : formDTO.getImageList()){
attachment.setAttachmentUrl(file.getUrl()); attachment.setAttachmentUrl(url);
attachment.setTopicId(topic.getId()); attachment.setTopicId(topic.getId());
attachment.setCreatedBy(tokenDto.getUserId()); attachment.setCreatedBy(tokenDto.getUserId());
attachment.setAttachmentFormat(file.getUrl().substring(file.getUrl().lastIndexOf(".") + NumConstant.ONE).toLowerCase()); attachment.setAttachmentFormat(url.substring(url.lastIndexOf(".") + NumConstant.ONE).toLowerCase());
attachment.setSort(sort++); attachment.setSort(sort++);
attachment.setAttachmentType("image"); attachment.setAttachmentType("image");
resiTopicAttachmentDao.insertOne(attachment); resiTopicAttachmentDao.insertOne(attachment);

Loading…
Cancel
Save