|
@@ -231,9 +231,25 @@ public class UserController extends ControllerSupport {
|
|
|
*/
|
|
|
@ApiOperation(value = "按id查询用户", notes = "id查询")
|
|
|
@GetMapping("/{id}")
|
|
|
- public UserEntity getUserById(@PathVariable long id) {
|
|
|
- UserEntity user = userRepo.findOne(id);
|
|
|
- return user;
|
|
|
+ public UserDomain getUserById(@PathVariable long id) {
|
|
|
+ UserEntity userEntity = userRepo.findOne(id);
|
|
|
+
|
|
|
+ UserDomain bean = new UserDomain();
|
|
|
+ bean.setId(userEntity.getId());
|
|
|
+ bean.setLoginName(userEntity.getLoginName());
|
|
|
+ bean.setName(userEntity.getName());
|
|
|
+ bean.setRootOrgId(userEntity.getRootOrgId());
|
|
|
+ bean.setUpdateTime(userEntity.getUpdateTime());
|
|
|
+ bean.setCreationTime(userEntity.getCreationTime());
|
|
|
+ bean.setOrgId(userEntity.getOrgId());
|
|
|
+ if (null != bean.getOrgId()) {
|
|
|
+ OrgEntity org = orgRepo.findOne(Long.valueOf(bean.getOrgId()));
|
|
|
+ if (null != org) {
|
|
|
+ bean.setOrgName(org.getName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ bean.setEnable(userEntity.getEnable());
|
|
|
+ return bean;
|
|
|
}
|
|
|
|
|
|
/**
|