|
|
|
@ -70,7 +70,8 @@ public class TagService {
|
|
|
|
|
tagDTO.setChildTagCount(tagStatistic.getChildTagCount());
|
|
|
|
|
tagDTO.setJournalRefCount(tagStatistic.getJournalRefCount());
|
|
|
|
|
tagDTO.setSongRefCount(tagStatistic.getSongRefCount());
|
|
|
|
|
tagDTO.setImage(TagS3Service.TAG_RESOURCE_PREFIX + TagS3Service.TAG_KEY_PREFIX + tag.getImage());
|
|
|
|
|
tagDTO.setImage(null == tag.getImage() ? null : TagS3Service.TAG_RESOURCE_PREFIX + TagS3Service.TAG_KEY_PREFIX + tag.getImage());
|
|
|
|
|
tagDTO.setThumbnail(null == tag.getThumbnail() ? null : TagS3Service.TAG_RESOURCE_PREFIX + TagS3Service.TAG_KEY_PREFIX + tag.getThumbnail());
|
|
|
|
|
Tag parentTag = parentTagMap.get(tagDTO.getParentId());
|
|
|
|
|
if (Objects.nonNull(parentTag)) {
|
|
|
|
|
tagDTO.setParentNameCh(parentTag.getNameCh());
|
|
|
|
@ -117,6 +118,16 @@ public class TagService {
|
|
|
|
|
tag.setImage(image);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (null != createReq.getThumbnail() && !createReq.getThumbnail().isEmpty()) {
|
|
|
|
|
String thumbnail = tagS3Service.moveTagImageFromTempDir(
|
|
|
|
|
createReq.getThumbnail(), tag.getId()
|
|
|
|
|
);
|
|
|
|
|
if (null == thumbnail) {
|
|
|
|
|
Result.failed("缩略图更新失败");
|
|
|
|
|
}
|
|
|
|
|
tag.setThumbnail(thumbnail);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// UserInfo userInfo = RequestContext.get();
|
|
|
|
|
// tag.setCreatorId(userInfo.getId());
|
|
|
|
@ -167,6 +178,19 @@ public class TagService {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (null == updateReq.getThumbnail()) {
|
|
|
|
|
tag.setThumbnail(null);
|
|
|
|
|
} else {
|
|
|
|
|
if (updateReq.getThumbnail().contains(TagS3Service.TEMP_KEY_PREFIX)) {
|
|
|
|
|
srcKey = updateReq.getThumbnail().substring(updateReq.getThumbnail().indexOf(TagS3Service.TEMP_KEY_PREFIX));
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotBlank(srcKey)) {
|
|
|
|
|
tag.setThumbnail(
|
|
|
|
|
tagS3Service.moveTagImageFromTempDir(updateReq.getThumbnail(), id)
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tagDao.save(tag);
|
|
|
|
|
}
|
|
|
|
@ -183,6 +207,8 @@ public class TagService {
|
|
|
|
|
Tag tag = tagOptional.get();
|
|
|
|
|
TagDTO tagDTO = new TagDTO();
|
|
|
|
|
BeanUtils.copyProperties(tag, tagDTO);
|
|
|
|
|
tagDTO.setImage(null == tag.getImage() ? null : TagS3Service.TAG_RESOURCE_PREFIX + TagS3Service.TAG_KEY_PREFIX + tag.getImage());
|
|
|
|
|
tagDTO.setThumbnail(null == tag.getThumbnail() ? null : TagS3Service.TAG_RESOURCE_PREFIX + TagS3Service.TAG_KEY_PREFIX + tag.getThumbnail());
|
|
|
|
|
|
|
|
|
|
TagStatistic tagStatistic = queryTagStatistic(tag.getId());
|
|
|
|
|
tagDTO.setChildTagCount(tagStatistic.getChildTagCount());
|
|
|
|
|