|
@@ -742,19 +742,44 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public UserVO getinformation(long userId) {
|
|
|
+ public UserDTO getInformation(long userId) {
|
|
|
+ UserDTO userDTO=new UserDTO();
|
|
|
Optional<UserPO> userPO = userDao.findById(userId);
|
|
|
if (userPO.isPresent()) {
|
|
|
UserVO userVO = new UserVO();
|
|
|
+ userVO.setPhotoUrl(userPO.get().getPhotoUrl());
|
|
|
userVO.setName(userPO.get().getName());
|
|
|
userVO.setUserName(userPO.get().getUserName());
|
|
|
+ userVO.setUnit(userPO.get().getUnit());
|
|
|
userVO.setGender(userPO.get().getGender());
|
|
|
- userVO.setEmail(userPO.get().getEmail());
|
|
|
- return userVO;
|
|
|
+ userVO.setBirthday(userPO.get().getBirthday());
|
|
|
+ userVO.setProvince(userPO.get().getProvince());
|
|
|
+ userVO.setCity(userPO.get().getCity());
|
|
|
+ userVO.setCounty(userPO.get().getCounty());
|
|
|
+ userVO.setDetailedAddress(userPO.get().getDetailedAddress());
|
|
|
+ userVO.setPersonalCompetence(userPO.get().getPersonalCompetence());
|
|
|
+ userDTO.setUserVO(userVO);
|
|
|
+ return userDTO;
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public UserDTO updateInformation(long userId, UserVO userVO) {
|
|
|
+ Optional<UserPO> userPO = userDao.findById(userId);
|
|
|
+ userPO.get().setUnit(userVO.getUnit());
|
|
|
+ userPO.get().setGender(userVO.getGender());
|
|
|
+ userPO.get().setBirthday(userVO.getBirthday());
|
|
|
+ userPO.get().setProvince(userVO.getProvince());
|
|
|
+ userPO.get().setCity(userVO.getCity());
|
|
|
+ userPO.get().setCounty(userVO.getCounty());
|
|
|
+ userPO.get().setDetailedAddress(userVO.getDetailedAddress());
|
|
|
+ userPO.get().setPersonalCompetence(userVO.getPersonalCompetence());
|
|
|
+ userDao.save(userPO.get());
|
|
|
+ this.getInformation(userId);
|
|
|
+ return this.getInformation(userId);
|
|
|
+ }
|
|
|
+
|
|
|
private ProjectOperationControl initProjectPermission(CrowdTestProject project, User user) {
|
|
|
ProjectOperationControl operationControl = new ProjectOperationControl();
|
|
|
if (user == null)
|