clean and formate code

This commit is contained in:
chenxudong 2024-12-18 17:53:43 +08:00
parent be51f2d250
commit 0c1062f9b8
18 changed files with 75 additions and 52 deletions

View File

@ -8,5 +8,4 @@ import org.springframework.web.bind.annotation.RestController;
public class EdFileInfoController {
}

View File

@ -11,7 +11,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
@RestController
@RequestMapping("/data/ed/permission")

View File

@ -1,6 +1,7 @@
package com.electromagnetic.industry.software.manage.controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/data/ed/role")

View File

@ -2,7 +2,8 @@ package com.electromagnetic.industry.software.manage.pojo.models;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import lombok.experimental.FieldNameConstants;

View File

@ -1,7 +1,10 @@
package com.electromagnetic.industry.software.manage.pojo.models;
import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.time.LocalDateTime;
@Data

View File

@ -9,12 +9,14 @@ public interface EdFileInfoService {
/**
* 创建一个新的工程
*
* @param prjName 新的工程名
*/
ElectromagneticResult<?> createNewPrj(String prjName);
/**
* 修改项目名称
*
* @param prjId
* @param newPrjName
* @return
@ -23,6 +25,7 @@ public interface EdFileInfoService {
/**
* 删除一个项目做逻辑删除
*
* @param prjId
* @return
*/
@ -30,6 +33,7 @@ public interface EdFileInfoService {
/**
* 添加子集
*
* @param parentId
* @param folderName
* @return
@ -38,12 +42,14 @@ public interface EdFileInfoService {
/**
* 查询所有项目
*
* @return
*/
ElectromagneticResult<?> queryAllPrjInfo();
/**
* 子集拖拽重排序
*
* @param folderResortDTOList
* @return
*/
@ -51,6 +57,7 @@ public interface EdFileInfoService {
/**
* 项目发布
*
* @param prjId
* @return
*/
@ -58,6 +65,7 @@ public interface EdFileInfoService {
/**
* 删除子集
*
* @param fileId
* @return
*/
@ -65,6 +73,7 @@ public interface EdFileInfoService {
/**
* 层级沿用
*
* @param sourceId
* @param targetId
* @return
@ -73,6 +82,7 @@ public interface EdFileInfoService {
/**
* 修改子集名称
*
* @param id
* @param newFolderName
* @return

View File

@ -7,6 +7,7 @@ public interface PermissionService {
/**
* 查询当前用户在当前目录的功能权限
*
* @param userId
* @param fileId
* @return

View File

@ -32,7 +32,6 @@ import com.electromagnetic.industry.software.manage.service.EDDataService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.io.InputStreamResource;
import org.springframework.http.HttpHeaders;

View File

@ -18,7 +18,10 @@ import com.electromagnetic.industry.software.common.enums.EleDataStatusEnum;
import com.electromagnetic.industry.software.common.enums.EleDataTypeEnum;
import com.electromagnetic.industry.software.common.exception.BizException;
import com.electromagnetic.industry.software.common.resp.ElectromagneticResult;
import com.electromagnetic.industry.software.common.util.*;
import com.electromagnetic.industry.software.common.util.EleCommonUtil;
import com.electromagnetic.industry.software.common.util.EleLog;
import com.electromagnetic.industry.software.common.util.ElectromagneticResultUtil;
import com.electromagnetic.industry.software.common.util.UserThreadLocal;
import com.electromagnetic.industry.software.manage.mapper.EdFileInfoMapper;
import com.electromagnetic.industry.software.manage.pojo.models.EdFileInfo;
import com.electromagnetic.industry.software.manage.pojo.req.FolderResortDTO;
@ -39,15 +42,13 @@ import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import static com.electromagnetic.industry.software.common.cons.ElectromagneticConstants.*;
import static com.electromagnetic.industry.software.common.cons.ElectromagneticConstants.MYSQL_FILE_PATH_SPLIT;
@Service
public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileInfo> implements EdFileInfoService {
private final EleLog log = new EleLog(EdFileInfoServiceImpl.class);
private static final String PRJ_PARENT_ID = "0";
private final EleLog log = new EleLog(EdFileInfoServiceImpl.class);
@Resource
private Environment environment;
@ -68,6 +69,7 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
/**
* 创建一个新的工程
*
* @param prjName 新的工程名
*/
@Override
@ -132,6 +134,7 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
/**
* 修改项目名称
*
* @param prjId
* @param newPrjName
* @return

View File

@ -1,7 +1,6 @@
package com.electromagnetic.industry.software.manage.service.serviceimpl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.electromagnetic.industry.software.common.enums.FilePermission;
import com.electromagnetic.industry.software.common.util.UserThreadLocal;
import com.electromagnetic.industry.software.manage.mapper.RolePermissionMapper;
@ -27,6 +26,7 @@ public class PermissionServiceImpl implements PermissionService {
/**
* 查询当前用户在当前目录的功能权限
*
* @param userId
* @param fileId
* @return

View File

@ -4,12 +4,19 @@
<mapper namespace="com.electromagnetic.industry.software.manage.mapper.EdFileInfoMapper">
<select id="maxPrjId" resultType="java.lang.String">
select max(id) from ed_file_info where length(id) = 6
select max(id)
from ed_file_info
where length(id) = 6
</select>
<select id="selectAllAdminFolder"
resultType="com.electromagnetic.industry.software.manage.pojo.models.EdFileInfo">
select id, file_name, parent_id, sort, file_path from ed_file_info where length(id) = 6 and effect_flag = 1 and data_type = 0 and file_path like concat(#{prjId}, '%')
select id, file_name, parent_id, sort, file_path
from ed_file_info
where length(id) = 6
and effect_flag = 1
and data_type = 0
and file_path like concat(#{prjId}, '%')
</select>
</mapper>

View File

@ -1,7 +1,6 @@
package com.electromagnetic.industry.software.common.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 是否删除枚举

View File

@ -25,16 +25,6 @@ public enum FilePermission {
this.description = description;
}
// 获取权限代码
public String getCode() {
return code;
}
// 获取权限描述
public String getDescription() {
return description;
}
// 根据 code 查找对应的枚举
public static FilePermission fromCode(String code) {
for (FilePermission permission : FilePermission.values()) {
@ -53,5 +43,15 @@ public enum FilePermission {
}
return codes;
}
// 获取权限代码
public String getCode() {
return code;
}
// 获取权限描述
public String getDescription() {
return description;
}
}

View File

@ -22,6 +22,7 @@ public class EleLog {
public void warn(String msg) {
logger.warn(msg);
}
public void error(String msg) {
logger.error(msg);
}