Compare commits
3 Commits
83abbd18f1
...
a22b20aab7
| Author | SHA1 | Date |
|---|---|---|
|
|
a22b20aab7 | |
|
|
821f4adfc1 | |
|
|
346b971481 |
|
|
@ -176,4 +176,17 @@ public class RepoEdFileInfoController {
|
||||||
String userId = UserThreadLocal.getUserId();
|
String userId = UserThreadLocal.getUserId();
|
||||||
return ElectromagneticResultUtil.success(edFileInfoService.addFavorite(userId, id));
|
return ElectromagneticResultUtil.success(edFileInfoService.addFavorite(userId, id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 从收藏夹移除
|
||||||
|
*
|
||||||
|
* @param id 文件id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/removeCollection")
|
||||||
|
@UserOperation(value = "从收藏夹移除文件", modelName = UserOperationModuleEnum.USER_PRJ)
|
||||||
|
public ElectromagneticResult<?> removeFavorite(@RequestParam String id) {
|
||||||
|
String userId = UserThreadLocal.getUserId();
|
||||||
|
return ElectromagneticResultUtil.success(edFileInfoService.removeFavorite(userId, id));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,11 @@ public class EdTagLibraryServiceImpl extends ServiceImpl<EdTagLibraryMapper, EdT
|
||||||
tag.setType(TagTypeEnum.TAG.getCode()); // 标签
|
tag.setType(TagTypeEnum.TAG.getCode()); // 标签
|
||||||
tag.setTagName(tagName);
|
tag.setTagName(tagName);
|
||||||
tag.setOrderBy(maxOrder + 1); // 默认排序
|
tag.setOrderBy(maxOrder + 1); // 默认排序
|
||||||
tag.setIsPublished(PublishEnum.UNPUBLISHED.getCode()); // 默认未发布
|
|
||||||
|
// 判断标签组有无发布,若发布,则标签已发布,若未发布,则标签未发布
|
||||||
|
int isPublished = this.getById(parentId).getIsPublished();
|
||||||
|
tag.setIsPublished(isPublished);
|
||||||
|
|
||||||
tag.setCreatedBy(createdBy);
|
tag.setCreatedBy(createdBy);
|
||||||
boolean isSuccess = this.save(tag);
|
boolean isSuccess = this.save(tag);
|
||||||
if (isSuccess) {
|
if (isSuccess) {
|
||||||
|
|
@ -198,6 +202,8 @@ public class EdTagLibraryServiceImpl extends ServiceImpl<EdTagLibraryMapper, EdT
|
||||||
}
|
}
|
||||||
// 删除本身
|
// 删除本身
|
||||||
boolean isDeleted = this.removeById(tagId);
|
boolean isDeleted = this.removeById(tagId);
|
||||||
|
// 删除本身的关联关系
|
||||||
|
fileTagRelationMapper.delete(new LambdaQueryWrapper<FileTagRelation>().eq(FileTagRelation::getTagId, tagId));
|
||||||
if (isDeleted) {
|
if (isDeleted) {
|
||||||
UserThreadLocal.setSuccessInfo("", tagId, StrFormatter.format("删除了标签 {} ", tag.getTagName()));
|
UserThreadLocal.setSuccessInfo("", tagId, StrFormatter.format("删除了标签 {} ", tag.getTagName()));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue