dev:代码规范
parent
051deb72b7
commit
293b215a5f
|
|
@ -109,10 +109,7 @@ public class PostQueryExe {
|
|||
}
|
||||
}
|
||||
|
||||
MultiResponse<PostCO> postCOResponse = new MultiResponse<>();
|
||||
postCOResponse.setData(postCOList);
|
||||
|
||||
return postCOResponse;
|
||||
return MultiResponse.of(postCOList);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -123,18 +120,16 @@ public class PostQueryExe {
|
|||
*/
|
||||
public SingleResponse<PostCO> execute(Long id) {
|
||||
SingleResponse<PostDO> postDO = postRepository.getInfoById(id);
|
||||
SingleResponse<PostCO> postCO = new SingleResponse<>();
|
||||
PostCO co = new PostCO();
|
||||
BeanUtils.copyProperties(postDO.getData(), co);
|
||||
postCO.setData(co);
|
||||
|
||||
// 查询部门名称
|
||||
DepartmentDO departmentDO = departmentRepository.getById(postDO.getData().getDepartmentId());
|
||||
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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue