dev:代码规范

main
SondonYong 2025-11-24 17:53:11 +08:00
parent 051deb72b7
commit 293b215a5f
1 changed files with 3 additions and 8 deletions

View File

@ -109,10 +109,7 @@ public class PostQueryExe {
} }
} }
MultiResponse<PostCO> postCOResponse = new MultiResponse<>(); return MultiResponse.of(postCOList);
postCOResponse.setData(postCOList);
return postCOResponse;
} }
/** /**
@ -123,18 +120,16 @@ public class PostQueryExe {
*/ */
public SingleResponse<PostCO> execute(Long id) { public SingleResponse<PostCO> execute(Long id) {
SingleResponse<PostDO> postDO = postRepository.getInfoById(id); SingleResponse<PostDO> postDO = postRepository.getInfoById(id);
SingleResponse<PostCO> postCO = new SingleResponse<>();
PostCO co = new PostCO(); PostCO co = new PostCO();
BeanUtils.copyProperties(postDO.getData(), co); BeanUtils.copyProperties(postDO.getData(), co);
postCO.setData(co);
// 查询部门名称 // 查询部门名称
DepartmentDO departmentDO = departmentRepository.getById(postDO.getData().getDepartmentId()); DepartmentDO departmentDO = departmentRepository.getById(postDO.getData().getDepartmentId());
if(departmentDO != null) { if(departmentDO != null) {
postCO.getData().setDepartmentName(departmentDO.getName()); co.setDepartmentName(departmentDO.getName());
} }
return postCO; return SingleResponse.of(co);
} }
public List<PostCO> listByPostIds(Collection<Long> collection) { public List<PostCO> listByPostIds(Collection<Long> collection) {