优化部分接口。

This commit is contained in:
chenxudong 2024-12-30 10:28:48 +08:00
parent 5bcc20782e
commit b02ae363ab
4 changed files with 6 additions and 5 deletions

View File

@ -45,8 +45,8 @@ public class ProjectController {
}
@RequestMapping("modifyFolder")
public ElectromagneticResult<?> modifyFolder(@RequestParam String newFolderName, @RequestParam String id, @RequestParam String parentId) {
return edPrjService.modifyFolder(id, newFolderName, parentId);
public ElectromagneticResult<?> modifyFolder(@RequestParam String newFolderName, @RequestParam String id) {
return edPrjService.modifyFolder(id, newFolderName);
}
@RequestMapping("deleteFolder")

View File

@ -88,5 +88,5 @@ public interface EdPrjService {
* @param newFolderName
* @return
*/
ElectromagneticResult<?> modifyFolder(String id, String newFolderName, String parentId);
ElectromagneticResult<?> modifyFolder(String id, String newFolderName);
}

View File

@ -258,7 +258,7 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
try {
this.baseMapper.update(null, Wrappers.lambdaUpdate(EdFileInfo.class)
.set(EdFileInfo::getFileId, fileId)
.eq(EdFileInfo::getFileId, fileId)
.set(EdFileInfo::getEffectFlag, false));
this.baseMapper.update(null, Wrappers.lambdaUpdate(EdFileInfo.class)
.set(EdFileInfo::getEffectFlag, true)

View File

@ -362,8 +362,9 @@ public class EdPrjServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileInfo>
*/
@Override
@Transactional(rollbackFor = Exception.class)
public ElectromagneticResult<?> modifyFolder(String id, String newFolderName, String parentId) {
public ElectromagneticResult<?> modifyFolder(String id, String newFolderName) {
try {
String parentId = this.baseMapper.selectById(id).getParentId();
// 首先检查同层是否有同名目录
if (commonService.checkSameFolder(parentId, newFolderName)) {
String info = "存在同名子集,禁止修改";