reajustement secteur decoupage perimetre
This commit is contained in:
@@ -70,34 +70,34 @@ public class UserController {
|
||||
}
|
||||
}
|
||||
|
||||
// @PostMapping("/change-password")
|
||||
// @PreAuthorize("hasAuthority('UPDATE_USER')")
|
||||
// public ResponseEntity<?> changeUserPassword(@RequestBody Login login) {
|
||||
// try {
|
||||
// userService.updatePassword(login.getUsername(), login.getPassword());
|
||||
// return new ResponseEntity<>(
|
||||
// new ApiResponse<>(true, "Votre mot de passe à été modifiée avec succès."),
|
||||
// HttpStatus.OK
|
||||
// );
|
||||
// } catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||
// logger.error(e.getLocalizedMessage());
|
||||
// return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
|
||||
// } catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
|
||||
// FileStorageException e) {
|
||||
// logger.error(e.getLocalizedMessage());
|
||||
// return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
|
||||
// } catch (NullPointerException e) {
|
||||
// logger.error(e.getLocalizedMessage());
|
||||
// return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
|
||||
// } catch (Exception e) {
|
||||
// logger.error(e.getLocalizedMessage());
|
||||
// return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
@PostMapping("/change-password")
|
||||
@PreAuthorize("hasAuthority('UPDATE_USER')")
|
||||
public ResponseEntity<?> changeUserPassword(@RequestBody Login login) {
|
||||
try {
|
||||
userService.updatePassword(login.getUsername(), login.getPassword());
|
||||
return new ResponseEntity<>(
|
||||
new ApiResponse<>(true, "Votre mot de passe à été modifiée avec succès."),
|
||||
HttpStatus.OK
|
||||
);
|
||||
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||
logger.error(e.getLocalizedMessage());
|
||||
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
|
||||
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
|
||||
FileStorageException e) {
|
||||
logger.error(e.getLocalizedMessage());
|
||||
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
|
||||
} catch (NullPointerException e) {
|
||||
logger.error(e.getLocalizedMessage());
|
||||
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getLocalizedMessage());
|
||||
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/change-my-password")
|
||||
@PreAuthorize("hasAuthority('UPDATE_USER')")
|
||||
@PreAuthorize("hasAuthority('CHANGE_MY_PASSWORD')")
|
||||
public ResponseEntity<?> changeMyPassword(@CurrentUser UserPrincipal currentUser, @RequestBody Login login) {
|
||||
try {
|
||||
User user = currentUser.getUser() ;
|
||||
|
||||
@@ -3,6 +3,7 @@ package io.gmss.fiscad.enums;
|
||||
public enum UserRole {
|
||||
VALIDE_ENQUETE,
|
||||
APPROVAL_AVIS,
|
||||
CHANGE_MY_PASSWORD,
|
||||
CREATE_ARRONDISSEMENT,
|
||||
READ_ARRONDISSEMENT,
|
||||
UPDATE_ARRONDISSEMENT,
|
||||
|
||||
@@ -24,7 +24,7 @@ public class UserPaylaodWeb {
|
||||
private Long structureId;
|
||||
private String structureCode;
|
||||
private String structureNom;
|
||||
private Boolean actif;
|
||||
private Boolean active;
|
||||
private Boolean resetPassword;
|
||||
|
||||
public UserPaylaodWeb(Long id,
|
||||
@@ -36,7 +36,7 @@ public class UserPaylaodWeb {
|
||||
Long structureId,
|
||||
String structureCode,
|
||||
String structureNom,
|
||||
Boolean actif,
|
||||
Boolean active,
|
||||
Boolean resetPassword) {
|
||||
this.id = id;
|
||||
this.nom = nom;
|
||||
@@ -47,7 +47,7 @@ public class UserPaylaodWeb {
|
||||
this.structureId = structureId;
|
||||
this.structureCode = structureCode;
|
||||
this.structureNom = structureNom;
|
||||
this.actif = actif;
|
||||
this.active = active;
|
||||
this.resetPassword = resetPassword;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
spring.profiles.active=${SPRING_PROFILES_ACTIVE}
|
||||
#spring.profiles.active=${SPRING_PROFILES_ACTIVE}
|
||||
#spring.profiles.active=abomey
|
||||
#spring.profiles.active=test
|
||||
spring.profiles.active=test
|
||||
spring.jpa.properties.hibernate.id.new_generator_mappings=false
|
||||
spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true
|
||||
spring.jpa.open-in-view=false
|
||||
|
||||
Reference in New Issue
Block a user