1、完善DeptServiceImpl单元测试覆盖率90%;2、新增security mock能力;3、移除postservice相关代码;4、移除部分无用模块的单测代码;

This commit is contained in:
gaoqr
2025-09-10 16:54:02 +08:00
parent ecae82b507
commit 283759c90d
32 changed files with 586 additions and 1643 deletions
@@ -1,7 +1,6 @@
package com.cf.imes.module.system.api.dept;
import com.cf.imes.framework.common.pojo.CommonResult;
import com.cf.imes.framework.common.util.collection.CollectionUtils;
import com.cf.imes.module.system.api.dept.dto.DeptRespDTO;
import com.cf.imes.module.system.enums.ApiConstants;
import io.swagger.v3.oas.annotations.Operation;
@@ -12,11 +11,6 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
@FeignClient(name = ApiConstants.NAME) // TODO 晨丰:fallbackFactory =
@Tag(name = "RPC 服务 - 部门")
public interface DeptApi {
@@ -28,30 +22,9 @@ public interface DeptApi {
@Parameter(name = "id", description = "部门编号", example = "1024", required = true)
CommonResult<DeptRespDTO> getDept(@RequestParam("id") Long id);
@GetMapping(PREFIX + "/list")
@Operation(summary = "获得部门信息数组")
@Parameter(name = "ids", description = "部门编号数组", example = "1,2", required = true)
CommonResult<List<DeptRespDTO>> getDeptList(@RequestParam("ids") Collection<Long> ids);
@GetMapping(PREFIX + "/valid")
@Operation(summary = "校验部门是否合法")
@Parameter(name = "ids", description = "部门编号数组", example = "1,2", required = true)
CommonResult<Boolean> validateDeptList(@RequestParam("ids") Collection<Long> ids);
@GetMapping(PREFIX + "/legitimacy/{deptId}")
@Operation(summary = "校验部门是否合法")
@Parameter(name = "id", description = "部门编号", example = "1024", required = true)
CommonResult<Boolean> validateDept(@PathVariable("deptId") Long deptId);
/**
* 获得指定编号的部门 Map
*
* @param ids 部门编号数组
* @return 部门 Map
*/
default Map<Long, DeptRespDTO> getDeptMap(Set<Long> ids) {
List<DeptRespDTO> list = getDeptList(ids).getCheckedData();
return CollectionUtils.convertMap(list, DeptRespDTO::getId);
}
}
@@ -1,25 +0,0 @@
package com.cf.imes.module.system.api.dept;
import com.cf.imes.framework.common.pojo.CommonResult;
import com.cf.imes.module.system.enums.ApiConstants;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.Collection;
@FeignClient(name = ApiConstants.NAME) // TODO 晨丰:fallbackFactory =
@Tag(name = "RPC 服务 - 岗位")
public interface PostApi {
String PREFIX = ApiConstants.PREFIX + "/post";
@GetMapping(PREFIX + "/valid")
@Operation(summary = "校验岗位是否合法")
@Parameter(name = "ids", description = "岗位编号数组", example = "1,2", required = true)
CommonResult<Boolean> validPostList(@RequestParam("ids") Collection<Long> ids);
}