import org.onap.portal.domain.db.fn.FnUser;
import org.onap.portal.domain.dto.PortalRestResponse;
import org.onap.portal.domain.dto.PortalRestStatusEnum;
import org.onap.portal.domain.db.fn.FnUser;
import org.onap.portal.domain.dto.PortalRestResponse;
import org.onap.portal.domain.dto.PortalRestStatusEnum;
-import org.onap.portal.domain.dto.ProfileDetail;
-import org.onap.portal.service.fn.FnUserService;
+import org.onap.portal.domain.dto.transport.ProfileDetail;
+import org.onap.portal.service.user.FnUserService;
import org.onap.portal.validation.DataValidator;
import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.onap.portalsdk.core.onboarding.util.CipherUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.onap.portal.validation.DataValidator;
import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.onap.portalsdk.core.onboarding.util.CipherUtil;
import org.springframework.beans.factory.annotation.Autowired;
public PortalRestResponse<ProfileDetail> getLoggedinUser(Principal principal) {
PortalRestResponse<ProfileDetail> portalRestResponse = null;
try {
public PortalRestResponse<ProfileDetail> getLoggedinUser(Principal principal) {
PortalRestResponse<ProfileDetail> portalRestResponse = null;
try {
- @RequestMapping(value = {
- "/portalApi/modifyLoggedinUser"}, method = RequestMethod.PUT, produces = "application/json")
+ @PutMapping(value = {"/portalApi/modifyLoggedinUser"}, produces = MediaType.APPLICATION_JSON_VALUE)
public PortalRestResponse<String> modifyLoggedinUser(Principal principal,
@RequestBody ProfileDetail profileDetail) {
PortalRestResponse<String> portalRestResponse = null;
public PortalRestResponse<String> modifyLoggedinUser(Principal principal,
@RequestBody ProfileDetail profileDetail) {
PortalRestResponse<String> portalRestResponse = null;
- portalRestResponse = new PortalRestResponse<>(PortalRestStatusEnum.ERROR, dataValidator.getConstraintViolationsString(profileDetail), null);
+ portalRestResponse = new PortalRestResponse<>(PortalRestStatusEnum.ERROR,
+ dataValidator.getConstraintViolationsString(profileDetail), null);
logger.error(EELFLoggerDelegate.errorLogger, "modifyLoggedinUser failed", errorMsg);
} else {
FnUser user = userService.loadUserByUsername(principal.getName());
logger.error(EELFLoggerDelegate.errorLogger, "modifyLoggedinUser failed", errorMsg);
} else {
FnUser user = userService.loadUserByUsername(principal.getName());
user.setMiddleName(profileDetail.getMiddleName());
user.setLoginId(profileDetail.getLoginId());
if (!HIDDEN_DEFAULT_PASSWORD.equals(profileDetail.getLoginPassword())) {
user.setMiddleName(profileDetail.getMiddleName());
user.setLoginId(profileDetail.getLoginId());
if (!HIDDEN_DEFAULT_PASSWORD.equals(profileDetail.getLoginPassword())) {
- user.setLoginPwd(CipherUtil.encryptPKC(profileDetail.getLoginPassword(), "AGLDdG4D04BKm2IxIWEr8o==!"));
+ user.setLoginPwd(CipherUtil
+ .encryptPKC(profileDetail.getLoginPassword(), "AGLDdG4D04BKm2IxIWEr8o==!"));
// Update user info in the session
portalRestResponse = new PortalRestResponse<>(PortalRestStatusEnum.OK, "success", null);
}
// Update user info in the session
portalRestResponse = new PortalRestResponse<>(PortalRestStatusEnum.OK, "success", null);
}