[api] UserController.java 컨벤션 맞춰 변경 및 개인정보 상세 추가
This commit is contained in:
@@ -28,7 +28,7 @@ public class AdminUserService {
|
|||||||
userDto.setUserRole(adminUserAddDto.getUserRole());
|
userDto.setUserRole(adminUserAddDto.getUserRole());
|
||||||
userDto.setUserType(adminUserAddDto.getUserType());
|
userDto.setUserType(adminUserAddDto.getUserType());
|
||||||
|
|
||||||
UserVo userVo = userService.insertUser(userDto);
|
UserVo userVo = userService.insertUserAdd(userDto);
|
||||||
|
|
||||||
AdminUserAddVo adminUserAddVo = new AdminUserAddVo();
|
AdminUserAddVo adminUserAddVo = new AdminUserAddVo();
|
||||||
adminUserAddVo.setResultCode(userVo.getResultCode());
|
adminUserAddVo.setResultCode(userVo.getResultCode());
|
||||||
|
|||||||
@@ -25,13 +25,14 @@ public class UserController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Operation(
|
@Operation(
|
||||||
summary = "사용자 회원가입",
|
summary = "사용자 회원가입"
|
||||||
description = "새로운 사용자를 등록합니다. 아이디 중복 시 오류를 반환합니다."
|
, description = "새로운 사용자를 등록합니다. 아이디 중복 시 오류를 반환합니다."
|
||||||
)
|
)
|
||||||
@PostMapping("/signup")
|
@PostMapping("/add")
|
||||||
public ResponseEntity<ApiResponse<UserVo>> signup(@Valid @RequestBody UserSignupForm userSignupForm) {
|
public ResponseEntity<ApiResponse<UserVo>> userAdd(
|
||||||
|
@Valid @RequestBody UserAddForm userAddForm
|
||||||
UserVo userVo = userService.insertUser(userSignupForm.toUserDto());
|
) {
|
||||||
|
UserVo userVo = userService.insertUserAdd(userAddForm.toDto());
|
||||||
|
|
||||||
if (userVo.getResultCode() == 2004) {
|
if (userVo.getResultCode() == 2004) {
|
||||||
return ApiResponse.entity(userVo, ApiResponseCode.CODE_2004, "아이디");
|
return ApiResponse.entity(userVo, ApiResponseCode.CODE_2004, "아이디");
|
||||||
@@ -41,125 +42,142 @@ public class UserController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Operation(
|
@Operation(
|
||||||
summary = "이전 회원 정보 조회",
|
summary = "이전 회원 정보 조회"
|
||||||
description = "이전 사이트의 회원 정보를 조회 후 list로 리턴합니다."
|
, description = "이전 사이트의 회원 정보를 조회 후 list로 리턴합니다."
|
||||||
)
|
)
|
||||||
@PostMapping("/migrationUserList")
|
@PostMapping("/migration/list")
|
||||||
public ResponseEntity<ApiResponse<MigrationUserVo>> migrationUserList(@Valid @RequestBody MigrationUserForm migrationUserForm) {
|
public ResponseEntity<ApiResponse<UserMigrationListVo>> userMigrationList(
|
||||||
|
@Valid @RequestBody UserMigrationListForm userMigrationListForm
|
||||||
|
) {
|
||||||
|
UserMigrationListVo userMigrationListVo = userService.selectUserMigrationList(userMigrationListForm.toDto());
|
||||||
|
|
||||||
MigrationUserVo result = userService.selectMigrationUserList(migrationUserForm.toUserDto());
|
boolean empty = (userMigrationListVo.getAlistUserList() == null || userMigrationListVo.getAlistUserList().isEmpty()) && (userMigrationListVo.getEltownUserList() == null || userMigrationListVo.getEltownUserList().isEmpty());
|
||||||
|
|
||||||
boolean empty = (result.getAlistUserList() == null || result.getAlistUserList().isEmpty()) && (result.getEltownUserList() == null || result.getEltownUserList().isEmpty());
|
|
||||||
|
|
||||||
if (empty) {
|
if (empty) {
|
||||||
return ApiResponse.entity(result, ApiResponseCode.CODE_2003);
|
return ApiResponse.entity(userMigrationListVo, ApiResponseCode.CODE_2003);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ApiResponse.entity(result, ApiResponseCode.CODE_2001, "이전 회원");
|
return ApiResponse.entity(userMigrationListVo, ApiResponseCode.CODE_2001, "이전 회원");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(
|
@Operation(
|
||||||
summary = "사용자 비밀번호 확인",
|
summary = "사용자 개인정보 조회"
|
||||||
description = "로그인한 사용자의 현재 비밀번호가 일치하는지 확인합니다."
|
, description = "로그인한 사용자의 개인정보를 조회합니다."
|
||||||
|
)
|
||||||
|
@GetMapping("/profile/view")
|
||||||
|
public ResponseEntity<ApiResponse<UserProfileViewVo>> userProfileView() {
|
||||||
|
UserProfileViewVo userProfileViewVo = userService.selectUserProfileView();
|
||||||
|
|
||||||
|
if (userProfileViewVo == null) {
|
||||||
|
UserProfileViewVo userProfileViewVo1 = new UserProfileViewVo();
|
||||||
|
return ApiResponse.entity(userProfileViewVo1, ApiResponseCode.CODE_2003);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ApiResponse.entity(userProfileViewVo, ApiResponseCode.CODE_2001, "개인정보");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(
|
||||||
|
summary = "사용자 비밀번호 확인"
|
||||||
|
, description = "로그인한 사용자의 현재 비밀번호가 일치하는지 확인합니다."
|
||||||
)
|
)
|
||||||
@PostMapping("/password/check")
|
@PostMapping("/password/check")
|
||||||
public ResponseEntity<ApiResponse<UserPasswordCheckVo>> passwordCheck(
|
public ResponseEntity<ApiResponse<UserPasswordCheckVo>> userPasswordCheck(
|
||||||
@Valid @RequestBody UserPasswordCheckForm userPasswordCheckForm
|
@Valid @RequestBody UserPasswordCheckForm userPasswordCheckForm
|
||||||
) {
|
) {
|
||||||
UserPasswordCheckVo result = userService.selectPasswordCheck(userPasswordCheckForm.toUserPasswordCheckDto());
|
UserPasswordCheckVo userPasswordCheckVo = userService.selectUserPasswordCheck(userPasswordCheckForm.toDto());
|
||||||
|
|
||||||
if (!result.isPasswordMatched()) {
|
if (!userPasswordCheckVo.isPasswordMatched()) {
|
||||||
if (result.getResultCode() == 4003) {
|
if (userPasswordCheckVo.getResultCode() == 4003) {
|
||||||
return ApiResponse.entity(result, ApiResponseCode.CODE_4001);
|
return ApiResponse.entity(userPasswordCheckVo, ApiResponseCode.CODE_4001);
|
||||||
} else if (result.getResultCode() == 2003) {
|
} else if (userPasswordCheckVo.getResultCode() == 2003) {
|
||||||
return ApiResponse.entity(result, ApiResponseCode.CODE_2003);
|
return ApiResponse.entity(userPasswordCheckVo, ApiResponseCode.CODE_2003);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ApiResponse.entity(result, ApiResponseCode.CODE_200);
|
return ApiResponse.entity(userPasswordCheckVo, ApiResponseCode.CODE_200);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(
|
@Operation(
|
||||||
summary = "사용자 비밀번호 수정",
|
summary = "사용자 비밀번호 수정"
|
||||||
description = "로그인한 사용자의 현재 비밀번호를 확인한 뒤 새 비밀번호로 변경합니다."
|
, description = "로그인한 사용자의 현재 비밀번호를 확인한 뒤 새 비밀번호로 변경합니다."
|
||||||
)
|
)
|
||||||
@PatchMapping("/password")
|
@PatchMapping("/password/modify")
|
||||||
public ResponseEntity<ApiResponse<UserPasswordChangeVo>> updatePassword(
|
public ResponseEntity<ApiResponse<UserPasswordModifyVo>> userPasswordModify(
|
||||||
@Valid @RequestBody UserPasswordChangeForm userPasswordChangeForm
|
@Valid @RequestBody UserPasswordModifyForm userPasswordModifyForm
|
||||||
) {
|
) {
|
||||||
UserPasswordChangeVo result = userService.updatePassword(userPasswordChangeForm.toUserPasswordChangeDto());
|
UserPasswordModifyVo userPasswordModifyVo = userService.updateUserPasswordModify(userPasswordModifyForm.toDto());
|
||||||
|
|
||||||
if (!result.isPasswordChanged()) {
|
if (!userPasswordModifyVo.isPasswordChanged()) {
|
||||||
if (result.getResultCode() == 4003 || result.getResultCode() == 4001) {
|
if (userPasswordModifyVo.getResultCode() == 4003 || userPasswordModifyVo.getResultCode() == 4001) {
|
||||||
return ApiResponse.entity(result, ApiResponseCode.CODE_4001);
|
return ApiResponse.entity(userPasswordModifyVo, ApiResponseCode.CODE_4001);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ApiResponse.entity(result, ApiResponseCode.CODE_2003);
|
return ApiResponse.entity(userPasswordModifyVo, ApiResponseCode.CODE_2003);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ApiResponse.entity(result, ApiResponseCode.CODE_2005, "비밀번호 변경");
|
return ApiResponse.entity(userPasswordModifyVo, ApiResponseCode.CODE_2005, "비밀번호 변경");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(
|
@Operation(
|
||||||
summary = "사용자 개인정보 수정",
|
summary = "사용자 개인정보 수정"
|
||||||
description = "로그인한 사용자의 현재 비밀번호를 확인한 뒤 이메일과 휴대폰 번호를 수정합니다."
|
, description = "로그인한 사용자의 현재 비밀번호를 확인한 뒤 이메일과 휴대폰 번호를 수정합니다."
|
||||||
)
|
)
|
||||||
@PatchMapping("/profile")
|
@PatchMapping("/profile/modify")
|
||||||
public ResponseEntity<ApiResponse<UserProfileUpdateVo>> updateProfile(
|
public ResponseEntity<ApiResponse<UserProfileModifyVo>> userProfileModify(
|
||||||
@Valid @RequestBody UserProfileUpdateForm userProfileUpdateForm
|
@Valid @RequestBody UserProfileModifyForm userProfileModifyForm
|
||||||
) {
|
) {
|
||||||
UserProfileUpdateVo result = userService.updateProfile(userProfileUpdateForm.toUserProfileUpdateDto());
|
UserProfileModifyVo userProfileModifyVo = userService.updateUserProfileModify(userProfileModifyForm.toDto());
|
||||||
|
|
||||||
if (!result.isProfileUpdated()) {
|
if (!userProfileModifyVo.isProfileUpdated()) {
|
||||||
if (result.getResultCode() == 4003 || result.getResultCode() == 4001) {
|
if (userProfileModifyVo.getResultCode() == 4003 || userProfileModifyVo.getResultCode() == 4001) {
|
||||||
return ApiResponse.entity(result, ApiResponseCode.CODE_4001);
|
return ApiResponse.entity(userProfileModifyVo, ApiResponseCode.CODE_4001);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ApiResponse.entity(result, ApiResponseCode.CODE_2003);
|
return ApiResponse.entity(userProfileModifyVo, ApiResponseCode.CODE_2003);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ApiResponse.entity(result, ApiResponseCode.CODE_2005, "개인정보 수정");
|
return ApiResponse.entity(userProfileModifyVo, ApiResponseCode.CODE_2005, "개인정보 수정");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(
|
@Operation(
|
||||||
summary = "사용자 탈퇴 상태 변경",
|
summary = "사용자 탈퇴 상태 변경"
|
||||||
description = "로그인한 사용자의 탈퇴 요청 또는 탈퇴 요청 철회를 처리합니다. P: 탈퇴대기, N: 탈퇴요청 철회"
|
, description = "로그인한 사용자의 탈퇴 요청 또는 탈퇴 요청 철회를 처리합니다. P: 탈퇴대기, N: 탈퇴요청 철회"
|
||||||
)
|
)
|
||||||
@PatchMapping("/withdraw")
|
@PatchMapping("/withdraw/modify")
|
||||||
public ResponseEntity<ApiResponse<UserWithdrawStatusVo>> updateWithdrawStatus(
|
public ResponseEntity<ApiResponse<UserWithdrawModifyVo>> userWithdrawModify(
|
||||||
@Valid @RequestBody UserWithdrawStatusForm userWithdrawStatusForm
|
@Valid @RequestBody UserWithdrawModifyForm userWithdrawModifyForm
|
||||||
) {
|
) {
|
||||||
UserWithdrawStatusVo result = userService.updateWithdrawStatus(userWithdrawStatusForm.toUserWithdrawStatusUpdateDto());
|
UserWithdrawModifyVo userWithdrawModifyVo = userService.updateUserWithdrawModify(userWithdrawModifyForm.toDto());
|
||||||
|
|
||||||
if (!result.isWithdrawStatusUpdated()) {
|
if (!userWithdrawModifyVo.isWithdrawStatusUpdated()) {
|
||||||
if (result.getResultCode() == 4003 || result.getResultCode() == 4001) {
|
if (userWithdrawModifyVo.getResultCode() == 4003 || userWithdrawModifyVo.getResultCode() == 4001) {
|
||||||
return ApiResponse.entity(result, ApiResponseCode.CODE_4001);
|
return ApiResponse.entity(userWithdrawModifyVo, ApiResponseCode.CODE_4001);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ApiResponse.entity(result, ApiResponseCode.CODE_2003);
|
return ApiResponse.entity(userWithdrawModifyVo, ApiResponseCode.CODE_2003);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ApiResponse.entity(result, ApiResponseCode.CODE_2005, "탈퇴 상태 변경");
|
return ApiResponse.entity(userWithdrawModifyVo, ApiResponseCode.CODE_2005, "탈퇴 상태 변경");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(
|
@Operation(
|
||||||
summary = "사용자 휴면 상태 변경",
|
summary = "사용자 휴면 상태 변경"
|
||||||
description = "로그인한 사용자의 휴면 처리 또는 휴면 해지를 처리합니다. Y: 휴면 회원, N: 휴면 해지"
|
, description = "로그인한 사용자의 휴면 처리 또는 휴면 해지를 처리합니다. Y: 휴면 회원, N: 휴면 해지"
|
||||||
)
|
)
|
||||||
@PatchMapping("/dormant")
|
@PatchMapping("/dormant/modify")
|
||||||
public ResponseEntity<ApiResponse<UserDormantStatusVo>> updateDormantStatus(
|
public ResponseEntity<ApiResponse<UserDormantModifyVo>> userDormantModify(
|
||||||
@Valid @RequestBody UserDormantStatusForm userDormantStatusForm
|
@Valid @RequestBody UserDormantModifyForm userDormantModifyForm
|
||||||
) {
|
) {
|
||||||
UserDormantStatusVo result = userService.updateDormantStatus(userDormantStatusForm.toUserDormantStatusUpdateDto());
|
UserDormantModifyVo userDormantModifyVo = userService.updateUserDormantModify(userDormantModifyForm.toDto());
|
||||||
|
|
||||||
if (!result.isDormantStatusUpdated()) {
|
if (!userDormantModifyVo.isDormantStatusUpdated()) {
|
||||||
if (result.getResultCode() == 4003 || result.getResultCode() == 4001) {
|
if (userDormantModifyVo.getResultCode() == 4003 || userDormantModifyVo.getResultCode() == 4001) {
|
||||||
return ApiResponse.entity(result, ApiResponseCode.CODE_4001);
|
return ApiResponse.entity(userDormantModifyVo, ApiResponseCode.CODE_4001);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ApiResponse.entity(result, ApiResponseCode.CODE_2003);
|
return ApiResponse.entity(userDormantModifyVo, ApiResponseCode.CODE_2003);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ApiResponse.entity(result, ApiResponseCode.CODE_2005, "휴면 상태 변경");
|
return ApiResponse.entity(userDormantModifyVo, ApiResponseCode.CODE_2005, "휴면 상태 변경");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+1
-1
@@ -5,7 +5,7 @@ import lombok.Setter;
|
|||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
public class UserDormantStatusDto {
|
public class UserDormantModifyDto {
|
||||||
private Integer userTokenIdx;
|
private Integer userTokenIdx;
|
||||||
private String dormantYn;
|
private String dormantYn;
|
||||||
}
|
}
|
||||||
+1
-1
@@ -5,7 +5,7 @@ import lombok.Setter;
|
|||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
public class UserPasswordChangeDto {
|
public class UserPasswordModifyDto {
|
||||||
private Integer userTokenIdx;
|
private Integer userTokenIdx;
|
||||||
private String currentPassword;
|
private String currentPassword;
|
||||||
private String newPassword;
|
private String newPassword;
|
||||||
+1
-1
@@ -5,7 +5,7 @@ import lombok.Setter;
|
|||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
public class UserProfileUpdateDto {
|
public class UserProfileModifyDto {
|
||||||
private Integer userTokenIdx;
|
private Integer userTokenIdx;
|
||||||
private String currentPassword;
|
private String currentPassword;
|
||||||
private String email;
|
private String email;
|
||||||
+1
-1
@@ -5,7 +5,7 @@ import lombok.Setter;
|
|||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
public class UserWithdrawStatusDto {
|
public class UserWithdrawModifyDto {
|
||||||
private Integer userTokenIdx;
|
private Integer userTokenIdx;
|
||||||
private String withdrawStatus;
|
private String withdrawStatus;
|
||||||
}
|
}
|
||||||
+16
-16
@@ -11,49 +11,49 @@ import lombok.Setter;
|
|||||||
@Setter
|
@Setter
|
||||||
@Getter
|
@Getter
|
||||||
@Schema(description = "회원 가입 요청 폼")
|
@Schema(description = "회원 가입 요청 폼")
|
||||||
public class UserSignupForm {
|
public class UserAddForm {
|
||||||
@Schema(
|
@Schema(
|
||||||
description = "사용자 아이디 (공백 불가)",
|
description = "사용자 아이디 (공백 불가)"
|
||||||
example = "test"
|
, example = "test"
|
||||||
)
|
)
|
||||||
@NotBlank(message = "아이디를 입력해주세요.")
|
@NotBlank(message = "아이디를 입력해주세요.")
|
||||||
private String id;
|
private String id;
|
||||||
|
|
||||||
@Schema(
|
@Schema(
|
||||||
description = "비밀번호 (8~64자, 영문 + 숫자 조합, 공백 불가)",
|
description = "비밀번호 (8~64자, 영문 + 숫자 조합, 공백 불가)"
|
||||||
example = "pass1234"
|
, example = "pass1234"
|
||||||
)
|
)
|
||||||
@NotBlank(message = "비밀번호를 입력해주세요.")
|
@NotBlank(message = "비밀번호를 입력해주세요.")
|
||||||
@Size(min = 8, max = 64, message = "비밀번호는 8~64자여야 합니다.")
|
@Size(min = 8, max = 64, message = "비밀번호는 8~64자여야 합니다.")
|
||||||
@Pattern(
|
@Pattern(
|
||||||
regexp = "^(?=.*[A-Za-z])(?=.*\\d)\\S+$",
|
regexp = "^(?=.*[A-Za-z])(?=.*\\d)\\S+$"
|
||||||
message = "비밀번호는 영문과 숫자를 포함하고 공백이 없어야 합니다."
|
, message = "비밀번호는 영문과 숫자를 포함하고 공백이 없어야 합니다."
|
||||||
)
|
)
|
||||||
private String password;
|
private String password;
|
||||||
|
|
||||||
@NotBlank(message = "사용자 권한(교사{CCM: 복합 캠퍼스 마스터, SCM:단일 캠퍼스 마스터, I: 교사}, 학생{R:정회원, E:수강생}")
|
@NotBlank(message = "사용자 권한(교사{CCM: 복합 캠퍼스 마스터, SCM:단일 캠퍼스 마스터, I: 교사}, 학생{R:정회원, E:수강생}")
|
||||||
@Pattern(
|
@Pattern(
|
||||||
regexp = "^(CCM|SCM|I|R|E)$",
|
regexp = "^(CCM|SCM|I|R|E)$"
|
||||||
message = "사용자 권한(교사{CCM: 복합 캠퍼스 마스터, SCM:단일 캠퍼스 마스터, I: 교사}, 학생{R:정회원, E:수강생})"
|
, message = "사용자 권한(교사{CCM: 복합 캠퍼스 마스터, SCM:단일 캠퍼스 마스터, I: 교사}, 학생{R:정회원, E:수강생})"
|
||||||
)
|
)
|
||||||
@Schema(
|
@Schema(
|
||||||
description = "사용자 권한(사용자 권한(교사{CCM: 복합 캠퍼스 마스터, SCM:단일 캠퍼스 마스터, I: 교사}, 학생{R:정회원, E:수강생})",
|
description = "사용자 권한(사용자 권한(교사{CCM: 복합 캠퍼스 마스터, SCM:단일 캠퍼스 마스터, I: 교사}, 학생{R:정회원, E:수강생})"
|
||||||
example = "I"
|
, example = "I"
|
||||||
)
|
)
|
||||||
private String userRole;
|
private String userRole;
|
||||||
|
|
||||||
@NotBlank(message = "사용자 타입(T:교사, S: 학생)")
|
@NotBlank(message = "사용자 타입(T:교사, S: 학생)")
|
||||||
@Pattern(
|
@Pattern(
|
||||||
regexp = "^(S|T)$",
|
regexp = "^(S|T)$"
|
||||||
message = "사용자 타입 S(학생), T(교사)만 가능합니다."
|
, message = "사용자 타입 S(학생), T(교사)만 가능합니다."
|
||||||
)
|
)
|
||||||
@Schema(
|
@Schema(
|
||||||
description = "사용자 타입(T:교사, S: 학생)",
|
description = "사용자 타입(T:교사, S: 학생)"
|
||||||
example = "T"
|
, example = "T"
|
||||||
)
|
)
|
||||||
private String userType;
|
private String userType;
|
||||||
|
|
||||||
public UserDto toUserDto() {
|
public UserDto toDto() {
|
||||||
UserDto userDto = new UserDto();
|
UserDto userDto = new UserDto();
|
||||||
userDto.setId(id.trim());
|
userDto.setId(id.trim());
|
||||||
userDto.setPassword(password);
|
userDto.setPassword(password);
|
||||||
+9
-9
@@ -1,6 +1,6 @@
|
|||||||
package com.alist.api.modules.user.form;
|
package com.alist.api.modules.user.form;
|
||||||
|
|
||||||
import com.alist.api.modules.user.dto.UserDormantStatusDto;
|
import com.alist.api.modules.user.dto.UserDormantModifyDto;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.Pattern;
|
import jakarta.validation.constraints.Pattern;
|
||||||
@@ -10,19 +10,19 @@ import lombok.Setter;
|
|||||||
@Schema(description = "사용자 휴면 상태 변경 요청 폼")
|
@Schema(description = "사용자 휴면 상태 변경 요청 폼")
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
public class UserDormantStatusForm {
|
public class UserDormantModifyForm {
|
||||||
@Schema(
|
@Schema(
|
||||||
description = "휴면 여부. Y: 휴면 회원, N: 휴면 해지",
|
description = "휴면 여부. Y: 휴면 회원, N: 휴면 해지"
|
||||||
example = "Y",
|
, example = "Y"
|
||||||
requiredMode = Schema.RequiredMode.REQUIRED
|
, requiredMode = Schema.RequiredMode.REQUIRED
|
||||||
)
|
)
|
||||||
@NotBlank(message = "휴면 여부는 필수입니다.")
|
@NotBlank(message = "휴면 여부는 필수입니다.")
|
||||||
@Pattern(regexp = "^[YN]$", message = "휴면 여부는 Y 또는 N만 가능합니다.")
|
@Pattern(regexp = "^[YN]$", message = "휴면 여부는 Y 또는 N만 가능합니다.")
|
||||||
private String dormantYn;
|
private String dormantYn;
|
||||||
|
|
||||||
public UserDormantStatusDto toUserDormantStatusUpdateDto() {
|
public UserDormantModifyDto toDto() {
|
||||||
UserDormantStatusDto userDormantStatusDto = new UserDormantStatusDto();
|
UserDormantModifyDto userDormantModifyDto = new UserDormantModifyDto();
|
||||||
userDormantStatusDto.setDormantYn(dormantYn);
|
userDormantModifyDto.setDormantYn(dormantYn);
|
||||||
return userDormantStatusDto;
|
return userDormantModifyDto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+4
-4
@@ -9,10 +9,10 @@ import lombok.Setter;
|
|||||||
@Setter
|
@Setter
|
||||||
@Getter
|
@Getter
|
||||||
@Schema(description = "이전회원 정보 조회")
|
@Schema(description = "이전회원 정보 조회")
|
||||||
public class MigrationUserForm {
|
public class UserMigrationListForm {
|
||||||
@Schema(
|
@Schema(
|
||||||
description = "사용자 아이디 (공백 불가)",
|
description = "사용자 아이디 (공백 불가)"
|
||||||
example = "test"
|
, example = "test"
|
||||||
)
|
)
|
||||||
@NotBlank(message = "아이디를 입력해주세요.")
|
@NotBlank(message = "아이디를 입력해주세요.")
|
||||||
private String id;
|
private String id;
|
||||||
@@ -20,7 +20,7 @@ public class MigrationUserForm {
|
|||||||
@NotBlank(message = "비밀번호를 입력해주세요.")
|
@NotBlank(message = "비밀번호를 입력해주세요.")
|
||||||
private String password;
|
private String password;
|
||||||
|
|
||||||
public UserDto toUserDto() {
|
public UserDto toDto() {
|
||||||
UserDto userDto = new UserDto();
|
UserDto userDto = new UserDto();
|
||||||
userDto.setId(id.trim());
|
userDto.setId(id.trim());
|
||||||
userDto.setPassword(password);
|
userDto.setPassword(password);
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
package com.alist.api.modules.user.form;
|
|
||||||
|
|
||||||
import com.alist.api.modules.user.dto.UserPasswordChangeDto;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import jakarta.validation.constraints.NotBlank;
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
|
|
||||||
@Schema(description = "사용자 비밀번호 수정 요청 폼")
|
|
||||||
@Getter
|
|
||||||
@Setter
|
|
||||||
public class UserPasswordChangeForm {
|
|
||||||
@Schema(
|
|
||||||
description = "현재 비밀번호",
|
|
||||||
example = "password1234",
|
|
||||||
requiredMode = Schema.RequiredMode.REQUIRED
|
|
||||||
)
|
|
||||||
@NotBlank(message = "현재 비밀번호는 필수입니다.")
|
|
||||||
private String currentPassword;
|
|
||||||
|
|
||||||
@Schema(
|
|
||||||
description = "새 비밀번호",
|
|
||||||
example = "newPassword1234",
|
|
||||||
requiredMode = Schema.RequiredMode.REQUIRED
|
|
||||||
)
|
|
||||||
@NotBlank(message = "새 비밀번호는 필수입니다.")
|
|
||||||
private String newPassword;
|
|
||||||
|
|
||||||
public UserPasswordChangeDto toUserPasswordChangeDto() {
|
|
||||||
UserPasswordChangeDto userPasswordChangeDto = new UserPasswordChangeDto();
|
|
||||||
userPasswordChangeDto.setCurrentPassword(currentPassword);
|
|
||||||
userPasswordChangeDto.setNewPassword(newPassword);
|
|
||||||
return userPasswordChangeDto;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -11,14 +11,14 @@ import lombok.Setter;
|
|||||||
@Setter
|
@Setter
|
||||||
public class UserPasswordCheckForm {
|
public class UserPasswordCheckForm {
|
||||||
@Schema(
|
@Schema(
|
||||||
description = "현재 비밀번호",
|
description = "현재 비밀번호"
|
||||||
example = "password1234",
|
, example = "password1234"
|
||||||
requiredMode = Schema.RequiredMode.REQUIRED
|
, requiredMode = Schema.RequiredMode.REQUIRED
|
||||||
)
|
)
|
||||||
@NotBlank(message = "비밀번호는 필수입니다.")
|
@NotBlank(message = "비밀번호는 필수입니다.")
|
||||||
private String password;
|
private String password;
|
||||||
|
|
||||||
public UserPasswordCheckDto toUserPasswordCheckDto() {
|
public UserPasswordCheckDto toDto() {
|
||||||
UserPasswordCheckDto userPasswordCheckDto = new UserPasswordCheckDto();
|
UserPasswordCheckDto userPasswordCheckDto = new UserPasswordCheckDto();
|
||||||
userPasswordCheckDto.setPassword(password);
|
userPasswordCheckDto.setPassword(password);
|
||||||
return userPasswordCheckDto;
|
return userPasswordCheckDto;
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package com.alist.api.modules.user.form;
|
||||||
|
|
||||||
|
import com.alist.api.modules.user.dto.UserPasswordModifyDto;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
@Schema(description = "사용자 비밀번호 수정 요청 폼")
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class UserPasswordModifyForm {
|
||||||
|
@Schema(
|
||||||
|
description = "현재 비밀번호"
|
||||||
|
, example = "password1234"
|
||||||
|
, requiredMode = Schema.RequiredMode.REQUIRED
|
||||||
|
)
|
||||||
|
@NotBlank(message = "현재 비밀번호는 필수입니다.")
|
||||||
|
private String currentPassword;
|
||||||
|
|
||||||
|
@Schema(
|
||||||
|
description = "새 비밀번호"
|
||||||
|
, example = "newPassword1234"
|
||||||
|
, requiredMode = Schema.RequiredMode.REQUIRED
|
||||||
|
)
|
||||||
|
@NotBlank(message = "새 비밀번호는 필수입니다.")
|
||||||
|
private String newPassword;
|
||||||
|
|
||||||
|
public UserPasswordModifyDto toDto() {
|
||||||
|
UserPasswordModifyDto userPasswordModifyDto = new UserPasswordModifyDto();
|
||||||
|
userPasswordModifyDto.setCurrentPassword(currentPassword);
|
||||||
|
userPasswordModifyDto.setNewPassword(newPassword);
|
||||||
|
return userPasswordModifyDto;
|
||||||
|
}
|
||||||
|
}
|
||||||
+11
-11
@@ -1,6 +1,6 @@
|
|||||||
package com.alist.api.modules.user.form;
|
package com.alist.api.modules.user.form;
|
||||||
|
|
||||||
import com.alist.api.modules.user.dto.UserProfileUpdateDto;
|
import com.alist.api.modules.user.dto.UserProfileModifyDto;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import jakarta.validation.constraints.Email;
|
import jakarta.validation.constraints.Email;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
@@ -10,11 +10,11 @@ import lombok.Setter;
|
|||||||
@Schema(description = "사용자 개인정보 수정 요청 폼")
|
@Schema(description = "사용자 개인정보 수정 요청 폼")
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
public class UserProfileUpdateForm {
|
public class UserProfileModifyForm {
|
||||||
@Schema(
|
@Schema(
|
||||||
description = "현재 비밀번호",
|
description = "현재 비밀번호"
|
||||||
example = "password1234",
|
, example = "password1234"
|
||||||
requiredMode = Schema.RequiredMode.REQUIRED
|
, requiredMode = Schema.RequiredMode.REQUIRED
|
||||||
)
|
)
|
||||||
@NotBlank(message = "현재 비밀번호는 필수입니다.")
|
@NotBlank(message = "현재 비밀번호는 필수입니다.")
|
||||||
private String currentPassword;
|
private String currentPassword;
|
||||||
@@ -26,11 +26,11 @@ public class UserProfileUpdateForm {
|
|||||||
@Schema(description = "휴대폰 번호. 수정할 때만 전달합니다.", example = "01012345678")
|
@Schema(description = "휴대폰 번호. 수정할 때만 전달합니다.", example = "01012345678")
|
||||||
private String hp;
|
private String hp;
|
||||||
|
|
||||||
public UserProfileUpdateDto toUserProfileUpdateDto() {
|
public UserProfileModifyDto toDto() {
|
||||||
UserProfileUpdateDto userProfileUpdateDto = new UserProfileUpdateDto();
|
UserProfileModifyDto userProfileModifyDto = new UserProfileModifyDto();
|
||||||
userProfileUpdateDto.setCurrentPassword(currentPassword);
|
userProfileModifyDto.setCurrentPassword(currentPassword);
|
||||||
userProfileUpdateDto.setEmail(email);
|
userProfileModifyDto.setEmail(email);
|
||||||
userProfileUpdateDto.setHp(hp);
|
userProfileModifyDto.setHp(hp);
|
||||||
return userProfileUpdateDto;
|
return userProfileModifyDto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+9
-9
@@ -1,6 +1,6 @@
|
|||||||
package com.alist.api.modules.user.form;
|
package com.alist.api.modules.user.form;
|
||||||
|
|
||||||
import com.alist.api.modules.user.dto.UserWithdrawStatusDto;
|
import com.alist.api.modules.user.dto.UserWithdrawModifyDto;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.Pattern;
|
import jakarta.validation.constraints.Pattern;
|
||||||
@@ -10,19 +10,19 @@ import lombok.Setter;
|
|||||||
@Schema(description = "사용자 탈퇴 상태 변경 요청 폼")
|
@Schema(description = "사용자 탈퇴 상태 변경 요청 폼")
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
public class UserWithdrawStatusForm {
|
public class UserWithdrawModifyForm {
|
||||||
@Schema(
|
@Schema(
|
||||||
description = "탈퇴 상태. P: 탈퇴대기, N: 탈퇴요청 철회",
|
description = "탈퇴 상태. P: 탈퇴대기, N: 탈퇴요청 철회"
|
||||||
example = "P",
|
, example = "P"
|
||||||
requiredMode = Schema.RequiredMode.REQUIRED
|
, requiredMode = Schema.RequiredMode.REQUIRED
|
||||||
)
|
)
|
||||||
@NotBlank(message = "탈퇴 상태는 필수입니다.")
|
@NotBlank(message = "탈퇴 상태는 필수입니다.")
|
||||||
@Pattern(regexp = "^[PN]$", message = "탈퇴 상태는 P 또는 N만 가능합니다.")
|
@Pattern(regexp = "^[PN]$", message = "탈퇴 상태는 P 또는 N만 가능합니다.")
|
||||||
private String withdrawStatus;
|
private String withdrawStatus;
|
||||||
|
|
||||||
public UserWithdrawStatusDto toUserWithdrawStatusUpdateDto() {
|
public UserWithdrawModifyDto toDto() {
|
||||||
UserWithdrawStatusDto userWithdrawStatusDto = new UserWithdrawStatusDto();
|
UserWithdrawModifyDto userWithdrawModifyDto = new UserWithdrawModifyDto();
|
||||||
userWithdrawStatusDto.setWithdrawStatus(withdrawStatus);
|
userWithdrawModifyDto.setWithdrawStatus(withdrawStatus);
|
||||||
return userWithdrawStatusDto;
|
return userWithdrawModifyDto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.alist.api.modules.user.mapper;
|
package com.alist.api.modules.user.mapper;
|
||||||
|
|
||||||
import com.alist.api.modules.user.dto.*;
|
import com.alist.api.modules.user.dto.*;
|
||||||
|
import com.alist.api.modules.user.vo.UserProfileViewVo;
|
||||||
import com.alist.api.modules.user.vo.UserVo;
|
import com.alist.api.modules.user.vo.UserVo;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
@@ -8,17 +9,19 @@ import org.apache.ibatis.annotations.Mapper;
|
|||||||
public interface UserMapper {
|
public interface UserMapper {
|
||||||
int selectDuplicateUserCount(UserDto userDto);
|
int selectDuplicateUserCount(UserDto userDto);
|
||||||
|
|
||||||
int insertUserSignup(UserDto userDto);
|
int insertUserAdd(UserDto userDto);
|
||||||
|
|
||||||
int insertUserTokenSignup(UserTokenDto userTokenDto);
|
int insertUserToken(UserTokenDto userTokenDto);
|
||||||
|
|
||||||
UserVo selectUserByUserTokenIdx(Integer userTokenIdx);
|
UserVo selectUserByUserTokenIdx(Integer userTokenIdx);
|
||||||
|
|
||||||
int updateUserPassword(UserPasswordChangeDto userPasswordChangeDto);
|
int updateUserPasswordModify(UserPasswordModifyDto userPasswordModifyDto);
|
||||||
|
|
||||||
int updateUserProfile(UserProfileUpdateDto userProfileUpdateDto);
|
int updateUserProfileModify(UserProfileModifyDto userProfileModifyDto);
|
||||||
|
|
||||||
int updateWithdrawStatus(UserWithdrawStatusDto userWithdrawStatusDto);
|
int updateUserWithdrawModify(UserWithdrawModifyDto userWithdrawModifyDto);
|
||||||
|
|
||||||
int updateDormantStatus(UserDormantStatusDto userDormantStatusDto);
|
int updateUserDormantModify(UserDormantModifyDto userDormantModifyDto);
|
||||||
|
|
||||||
|
UserProfileViewVo selectUserProfileView(Integer userTokenIdx);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,23 +36,23 @@ public class UserService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public UserVo insertUser(UserDto userDto) {
|
public UserVo insertUserAdd(UserDto userDto) {
|
||||||
UserVo result = new UserVo();
|
UserVo userVo = new UserVo();
|
||||||
result.setId(userDto.getId());
|
userVo.setId(userDto.getId());
|
||||||
result.setUserRole(userDto.getUserRole());
|
userVo.setUserRole(userDto.getUserRole());
|
||||||
result.setUserType(userDto.getUserType());
|
userVo.setUserType(userDto.getUserType());
|
||||||
|
|
||||||
// 중복체크
|
// 중복체크
|
||||||
if (userMapper.selectDuplicateUserCount(userDto) > 0) {
|
if (userMapper.selectDuplicateUserCount(userDto) > 0) {
|
||||||
result.setResultCode(2004);
|
userVo.setResultCode(2004);
|
||||||
return result;
|
return userVo;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 비밀번호 생성
|
// 비밀번호 생성
|
||||||
userDto.setNewPassword(passwordEncoder.encode(userDto.getPassword()));
|
userDto.setNewPassword(passwordEncoder.encode(userDto.getPassword()));
|
||||||
|
|
||||||
// 회원정보 입력
|
// 회원정보 입력
|
||||||
int resultCount = userMapper.insertUserSignup(userDto);
|
int resultCount = userMapper.insertUserAdd(userDto);
|
||||||
|
|
||||||
if (resultCount > 0) {
|
if (resultCount > 0) {
|
||||||
// user_api_key 생성
|
// user_api_key 생성
|
||||||
@@ -61,12 +61,12 @@ public class UserService {
|
|||||||
userTokenDto.setUserRole(userDto.getUserRole());
|
userTokenDto.setUserRole(userDto.getUserRole());
|
||||||
userTokenDto.setUserType(userDto.getUserType());
|
userTokenDto.setUserType(userDto.getUserType());
|
||||||
|
|
||||||
result.setUserIdx(userDto.getUserIdx());
|
userVo.setUserIdx(userDto.getUserIdx());
|
||||||
|
|
||||||
apiKeyWithRetry(userTokenDto);
|
apiKeyWithRetry(userTokenDto);
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return userVo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@@ -74,7 +74,7 @@ public class UserService {
|
|||||||
for (int i = 0; i < 5; i++) {
|
for (int i = 0; i < 5; i++) {
|
||||||
userTokenDto.setUserApiKey(ApiKeyGenerator.userApiKeyProc());
|
userTokenDto.setUserApiKey(ApiKeyGenerator.userApiKeyProc());
|
||||||
try {
|
try {
|
||||||
return userMapper.insertUserTokenSignup(userTokenDto);
|
return userMapper.insertUserToken(userTokenDto);
|
||||||
} catch (DuplicateKeyException e) {
|
} catch (DuplicateKeyException e) {
|
||||||
// 충돌이면 다시 생성
|
// 충돌이면 다시 생성
|
||||||
log.warn("Duplicate API key. retrying... userId={}", userTokenDto.getUserIdx());
|
log.warn("Duplicate API key. retrying... userId={}", userTokenDto.getUserIdx());
|
||||||
@@ -84,7 +84,7 @@ public class UserService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(readOnly = true)
|
@Transactional(readOnly = true)
|
||||||
public MigrationUserVo selectMigrationUserList(UserDto userDto) {
|
public UserMigrationListVo selectUserMigrationList(UserDto userDto) {
|
||||||
AlistUserDto alistUserDto = new AlistUserDto();
|
AlistUserDto alistUserDto = new AlistUserDto();
|
||||||
alistUserDto.setId(userDto.getId());
|
alistUserDto.setId(userDto.getId());
|
||||||
alistUserDto.setPassword(userDto.getPassword());
|
alistUserDto.setPassword(userDto.getPassword());
|
||||||
@@ -99,190 +99,201 @@ public class UserService {
|
|||||||
// eltown 조회
|
// eltown 조회
|
||||||
List<EltownUserVo> eltownUserList = eltownUserService.selectEltownUserList(eltownUserDto);
|
List<EltownUserVo> eltownUserList = eltownUserService.selectEltownUserList(eltownUserDto);
|
||||||
|
|
||||||
MigrationUserVo result = new MigrationUserVo();
|
UserMigrationListVo userMigrationListVo = new UserMigrationListVo();
|
||||||
|
|
||||||
result.setAlistUserList(alistUserList);
|
userMigrationListVo.setAlistUserList(alistUserList);
|
||||||
result.setEltownUserList(eltownUserList);
|
userMigrationListVo.setEltownUserList(eltownUserList);
|
||||||
|
|
||||||
return result;
|
return userMigrationListVo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(readOnly = true)
|
@Transactional(readOnly = true)
|
||||||
public UserPasswordCheckVo selectPasswordCheck(UserPasswordCheckDto userPasswordCheckDto) {
|
public UserProfileViewVo selectUserProfileView() {
|
||||||
UserPasswordCheckVo result = new UserPasswordCheckVo();
|
Integer userTokenIdx = SecurityUtil.getLoginUserTokenIdx();
|
||||||
|
|
||||||
|
if (userTokenIdx == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return userMapper.selectUserProfileView(userTokenIdx);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(readOnly = true)
|
||||||
|
public UserPasswordCheckVo selectUserPasswordCheck(UserPasswordCheckDto userPasswordCheckDto) {
|
||||||
|
UserPasswordCheckVo userPasswordCheckVo = new UserPasswordCheckVo();
|
||||||
|
|
||||||
Integer userTokenIdx = SecurityUtil.getLoginUserTokenIdx();
|
Integer userTokenIdx = SecurityUtil.getLoginUserTokenIdx();
|
||||||
userPasswordCheckDto.setUserTokenIdx(userTokenIdx);
|
userPasswordCheckDto.setUserTokenIdx(userTokenIdx);
|
||||||
|
|
||||||
if (userTokenIdx == null || userPasswordCheckDto.getPassword() == null) {
|
if (userTokenIdx == null || userPasswordCheckDto.getPassword() == null) {
|
||||||
result.setPasswordMatched(false);
|
userPasswordCheckVo.setPasswordMatched(false);
|
||||||
result.setResultCode(4003);
|
userPasswordCheckVo.setResultCode(4003);
|
||||||
return result;
|
return userPasswordCheckVo;
|
||||||
}
|
}
|
||||||
|
|
||||||
UserVo userVo = userMapper.selectUserByUserTokenIdx(userPasswordCheckDto.getUserTokenIdx());
|
UserVo userVo = userMapper.selectUserByUserTokenIdx(userPasswordCheckDto.getUserTokenIdx());
|
||||||
|
|
||||||
if (userVo == null || userVo.getPassword() == null) {
|
if (userVo == null || userVo.getPassword() == null) {
|
||||||
result.setPasswordMatched(false);
|
userPasswordCheckVo.setPasswordMatched(false);
|
||||||
result.setResultCode(2003);
|
userPasswordCheckVo.setResultCode(2003);
|
||||||
return result;
|
return userPasswordCheckVo;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean matched = passwordEncoder.matches(userPasswordCheckDto.getPassword(), userVo.getPassword());
|
boolean matched = passwordEncoder.matches(userPasswordCheckDto.getPassword(), userVo.getPassword());
|
||||||
|
|
||||||
if (!matched) {
|
if (!matched) {
|
||||||
result.setPasswordMatched(false);
|
userPasswordCheckVo.setPasswordMatched(false);
|
||||||
result.setResultCode(2003);
|
userPasswordCheckVo.setResultCode(2003);
|
||||||
return result;
|
return userPasswordCheckVo;
|
||||||
}
|
}
|
||||||
|
|
||||||
result.setPasswordMatched(true);
|
userPasswordCheckVo.setPasswordMatched(true);
|
||||||
result.setResultCode(200);
|
userPasswordCheckVo.setResultCode(200);
|
||||||
|
|
||||||
return result;
|
return userPasswordCheckVo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public UserPasswordChangeVo updatePassword(UserPasswordChangeDto userPasswordChangeDto) {
|
public UserPasswordModifyVo updateUserPasswordModify(UserPasswordModifyDto userPasswordModifyDto) {
|
||||||
UserPasswordChangeVo result = new UserPasswordChangeVo();
|
UserPasswordModifyVo userPasswordModifyVo = new UserPasswordModifyVo();
|
||||||
|
|
||||||
Integer userTokenIdx = SecurityUtil.getLoginUserTokenIdx();
|
Integer userTokenIdx = SecurityUtil.getLoginUserTokenIdx();
|
||||||
userPasswordChangeDto.setUserTokenIdx(userTokenIdx);
|
userPasswordModifyDto.setUserTokenIdx(userTokenIdx);
|
||||||
|
|
||||||
if (userTokenIdx == null
|
if (userTokenIdx == null
|
||||||
|| userPasswordChangeDto.getCurrentPassword() == null
|
|| userPasswordModifyDto.getCurrentPassword() == null
|
||||||
|| userPasswordChangeDto.getNewPassword() == null) {
|
|| userPasswordModifyDto.getNewPassword() == null) {
|
||||||
result.setPasswordChanged(false);
|
userPasswordModifyVo.setPasswordChanged(false);
|
||||||
result.setResultCode(4003);
|
userPasswordModifyVo.setResultCode(4003);
|
||||||
return result;
|
return userPasswordModifyVo;
|
||||||
}
|
}
|
||||||
|
|
||||||
UserVo userVo = userMapper.selectUserByUserTokenIdx(userTokenIdx);
|
UserVo userVo = userMapper.selectUserByUserTokenIdx(userTokenIdx);
|
||||||
|
|
||||||
if (userVo == null || userVo.getPassword() == null) {
|
if (userVo == null || userVo.getPassword() == null) {
|
||||||
result.setPasswordChanged(false);
|
userPasswordModifyVo.setPasswordChanged(false);
|
||||||
result.setResultCode(2003);
|
userPasswordModifyVo.setResultCode(2003);
|
||||||
return result;
|
return userPasswordModifyVo;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean matched = passwordEncoder.matches(
|
boolean matched = passwordEncoder.matches(
|
||||||
userPasswordChangeDto.getCurrentPassword(),
|
userPasswordModifyDto.getCurrentPassword(),
|
||||||
userVo.getPassword()
|
userVo.getPassword()
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!matched) {
|
if (!matched) {
|
||||||
result.setPasswordChanged(false);
|
userPasswordModifyVo.setPasswordChanged(false);
|
||||||
result.setResultCode(4001);
|
userPasswordModifyVo.setResultCode(4001);
|
||||||
return result;
|
return userPasswordModifyVo;
|
||||||
}
|
}
|
||||||
|
|
||||||
userPasswordChangeDto.setNewPassword(passwordEncoder.encode(userPasswordChangeDto.getNewPassword()));
|
userPasswordModifyDto.setNewPassword(passwordEncoder.encode(userPasswordModifyDto.getNewPassword()));
|
||||||
|
|
||||||
int updateCount = userMapper.updateUserPassword(userPasswordChangeDto);
|
int updateCount = userMapper.updateUserPasswordModify(userPasswordModifyDto);
|
||||||
|
|
||||||
result.setPasswordChanged(updateCount > 0);
|
userPasswordModifyVo.setPasswordChanged(updateCount > 0);
|
||||||
result.setResultCode(updateCount > 0 ? 2005 : 2003);
|
userPasswordModifyVo.setResultCode(updateCount > 0 ? 2005 : 2003);
|
||||||
|
|
||||||
return result;
|
return userPasswordModifyVo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public UserProfileUpdateVo updateProfile(UserProfileUpdateDto userProfileUpdateDto) {
|
public UserProfileModifyVo updateUserProfileModify(UserProfileModifyDto userProfileModifyDto) {
|
||||||
UserProfileUpdateVo result = new UserProfileUpdateVo();
|
UserProfileModifyVo userProfileModifyVo = new UserProfileModifyVo();
|
||||||
|
|
||||||
Integer userTokenIdx = SecurityUtil.getLoginUserTokenIdx();
|
Integer userTokenIdx = SecurityUtil.getLoginUserTokenIdx();
|
||||||
userProfileUpdateDto.setUserTokenIdx(userTokenIdx);
|
userProfileModifyDto.setUserTokenIdx(userTokenIdx);
|
||||||
|
|
||||||
if (userTokenIdx == null
|
if (userTokenIdx == null
|
||||||
|| userProfileUpdateDto.getCurrentPassword() == null
|
|| userProfileModifyDto.getCurrentPassword() == null
|
||||||
|| (userProfileUpdateDto.getEmail() == null && userProfileUpdateDto.getHp() == null)) {
|
|| (userProfileModifyDto.getEmail() == null && userProfileModifyDto.getHp() == null)) {
|
||||||
result.setProfileUpdated(false);
|
userProfileModifyVo.setProfileUpdated(false);
|
||||||
result.setResultCode(4003);
|
userProfileModifyVo.setResultCode(4003);
|
||||||
return result;
|
return userProfileModifyVo;
|
||||||
}
|
}
|
||||||
|
|
||||||
UserVo userVo = userMapper.selectUserByUserTokenIdx(userTokenIdx);
|
UserVo userVo = userMapper.selectUserByUserTokenIdx(userTokenIdx);
|
||||||
|
|
||||||
if (userVo == null || userVo.getPassword() == null) {
|
if (userVo == null || userVo.getPassword() == null) {
|
||||||
result.setProfileUpdated(false);
|
userProfileModifyVo.setProfileUpdated(false);
|
||||||
result.setResultCode(2003);
|
userProfileModifyVo.setResultCode(2003);
|
||||||
return result;
|
return userProfileModifyVo;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean matched = passwordEncoder.matches(
|
boolean matched = passwordEncoder.matches(
|
||||||
userProfileUpdateDto.getCurrentPassword(),
|
userProfileModifyDto.getCurrentPassword(),
|
||||||
userVo.getPassword()
|
userVo.getPassword()
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!matched) {
|
if (!matched) {
|
||||||
result.setProfileUpdated(false);
|
userProfileModifyVo.setProfileUpdated(false);
|
||||||
result.setResultCode(4001);
|
userProfileModifyVo.setResultCode(4001);
|
||||||
return result;
|
return userProfileModifyVo;
|
||||||
}
|
}
|
||||||
|
|
||||||
int updateCount = userMapper.updateUserProfile(userProfileUpdateDto);
|
int updateCount = userMapper.updateUserProfileModify(userProfileModifyDto);
|
||||||
|
|
||||||
result.setProfileUpdated(updateCount > 0);
|
userProfileModifyVo.setProfileUpdated(updateCount > 0);
|
||||||
result.setResultCode(updateCount > 0 ? 2005 : 2003);
|
userProfileModifyVo.setResultCode(updateCount > 0 ? 2005 : 2003);
|
||||||
|
|
||||||
return result;
|
return userProfileModifyVo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public UserWithdrawStatusVo updateWithdrawStatus(UserWithdrawStatusDto userWithdrawStatusDto) {
|
public UserWithdrawModifyVo updateUserWithdrawModify(UserWithdrawModifyDto userWithdrawModifyDto) {
|
||||||
UserWithdrawStatusVo result = new UserWithdrawStatusVo();
|
UserWithdrawModifyVo userWithdrawModifyVo = new UserWithdrawModifyVo();
|
||||||
|
|
||||||
Integer userTokenIdx = SecurityUtil.getLoginUserTokenIdx();
|
Integer userTokenIdx = SecurityUtil.getLoginUserTokenIdx();
|
||||||
userWithdrawStatusDto.setUserTokenIdx(userTokenIdx);
|
userWithdrawModifyDto.setUserTokenIdx(userTokenIdx);
|
||||||
|
|
||||||
if (userTokenIdx == null || userWithdrawStatusDto.getWithdrawStatus() == null) {
|
if (userTokenIdx == null || userWithdrawModifyDto.getWithdrawStatus() == null) {
|
||||||
result.setWithdrawStatusUpdated(false);
|
userWithdrawModifyVo.setWithdrawStatusUpdated(false);
|
||||||
result.setResultCode(4003);
|
userWithdrawModifyVo.setResultCode(4003);
|
||||||
return result;
|
return userWithdrawModifyVo;
|
||||||
}
|
}
|
||||||
|
|
||||||
String withdrawStatus = userWithdrawStatusDto.getWithdrawStatus();
|
String withdrawStatus = userWithdrawModifyDto.getWithdrawStatus();
|
||||||
|
|
||||||
if (!"P".equals(withdrawStatus) && !"N".equals(withdrawStatus)) {
|
if (!"P".equals(withdrawStatus) && !"N".equals(withdrawStatus)) {
|
||||||
result.setWithdrawStatusUpdated(false);
|
userWithdrawModifyVo.setWithdrawStatusUpdated(false);
|
||||||
result.setResultCode(4001);
|
userWithdrawModifyVo.setResultCode(4001);
|
||||||
return result;
|
return userWithdrawModifyVo;
|
||||||
}
|
}
|
||||||
|
|
||||||
int updateCount = userMapper.updateWithdrawStatus(userWithdrawStatusDto);
|
int updateCount = userMapper.updateUserWithdrawModify(userWithdrawModifyDto);
|
||||||
|
|
||||||
result.setWithdrawStatusUpdated(updateCount > 0);
|
userWithdrawModifyVo.setWithdrawStatusUpdated(updateCount > 0);
|
||||||
result.setResultCode(updateCount > 0 ? 2005 : 2003);
|
userWithdrawModifyVo.setResultCode(updateCount > 0 ? 2005 : 2003);
|
||||||
|
|
||||||
return result;
|
return userWithdrawModifyVo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public UserDormantStatusVo updateDormantStatus(UserDormantStatusDto userDormantStatusDto) {
|
public UserDormantModifyVo updateUserDormantModify(UserDormantModifyDto userDormantModifyDto) {
|
||||||
UserDormantStatusVo result = new UserDormantStatusVo();
|
UserDormantModifyVo userDormantModifyVo = new UserDormantModifyVo();
|
||||||
|
|
||||||
Integer userTokenIdx = SecurityUtil.getLoginUserTokenIdx();
|
Integer userTokenIdx = SecurityUtil.getLoginUserTokenIdx();
|
||||||
userDormantStatusDto.setUserTokenIdx(userTokenIdx);
|
userDormantModifyDto.setUserTokenIdx(userTokenIdx);
|
||||||
|
|
||||||
if (userTokenIdx == null || userDormantStatusDto.getDormantYn() == null) {
|
if (userTokenIdx == null || userDormantModifyDto.getDormantYn() == null) {
|
||||||
result.setDormantStatusUpdated(false);
|
userDormantModifyVo.setDormantStatusUpdated(false);
|
||||||
result.setResultCode(4003);
|
userDormantModifyVo.setResultCode(4003);
|
||||||
return result;
|
return userDormantModifyVo;
|
||||||
}
|
}
|
||||||
|
|
||||||
String dormantYn = userDormantStatusDto.getDormantYn();
|
String dormantYn = userDormantModifyDto.getDormantYn();
|
||||||
|
|
||||||
if (!"Y".equals(dormantYn) && !"N".equals(dormantYn)) {
|
if (!"Y".equals(dormantYn) && !"N".equals(dormantYn)) {
|
||||||
result.setDormantStatusUpdated(false);
|
userDormantModifyVo.setDormantStatusUpdated(false);
|
||||||
result.setResultCode(4001);
|
userDormantModifyVo.setResultCode(4001);
|
||||||
return result;
|
return userDormantModifyVo;
|
||||||
}
|
}
|
||||||
|
|
||||||
int updateCount = userMapper.updateDormantStatus(userDormantStatusDto);
|
int updateCount = userMapper.updateUserDormantModify(userDormantModifyDto);
|
||||||
|
|
||||||
result.setDormantStatusUpdated(updateCount > 0);
|
userDormantModifyVo.setDormantStatusUpdated(updateCount > 0);
|
||||||
result.setResultCode(updateCount > 0 ? 2005 : 2003);
|
userDormantModifyVo.setResultCode(updateCount > 0 ? 2005 : 2003);
|
||||||
|
|
||||||
return result;
|
return userDormantModifyVo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -8,7 +8,7 @@ import lombok.Setter;
|
|||||||
@Schema(description = "사용자 휴면 상태 변경 응답")
|
@Schema(description = "사용자 휴면 상태 변경 응답")
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
public class UserDormantStatusVo {
|
public class UserDormantModifyVo {
|
||||||
@Schema(description = "휴면 상태 변경 여부", example = "true")
|
@Schema(description = "휴면 상태 변경 여부", example = "true")
|
||||||
private boolean dormantStatusUpdated;
|
private boolean dormantStatusUpdated;
|
||||||
|
|
||||||
+1
-1
@@ -11,7 +11,7 @@ import java.util.List;
|
|||||||
@Schema(description = "이전 회원 조회 응답")
|
@Schema(description = "이전 회원 조회 응답")
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
public class MigrationUserVo {
|
public class UserMigrationListVo {
|
||||||
@Schema(description = "ALIST 이전 회원 목록")
|
@Schema(description = "ALIST 이전 회원 목록")
|
||||||
List<AlistUserVo> alistUserList;
|
List<AlistUserVo> alistUserList;
|
||||||
|
|
||||||
+1
-1
@@ -8,7 +8,7 @@ import lombok.Setter;
|
|||||||
@Schema(description = "사용자 비밀번호 수정 응답")
|
@Schema(description = "사용자 비밀번호 수정 응답")
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
public class UserPasswordChangeVo {
|
public class UserPasswordModifyVo {
|
||||||
@Schema(description = "비밀번호 수정 여부", example = "true")
|
@Schema(description = "비밀번호 수정 여부", example = "true")
|
||||||
private boolean passwordChanged;
|
private boolean passwordChanged;
|
||||||
|
|
||||||
+1
-1
@@ -8,7 +8,7 @@ import lombok.Setter;
|
|||||||
@Schema(description = "사용자 개인정보 수정 응답")
|
@Schema(description = "사용자 개인정보 수정 응답")
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
public class UserProfileUpdateVo {
|
public class UserProfileModifyVo {
|
||||||
@Schema(description = "개인정보 수정 여부", example = "true")
|
@Schema(description = "개인정보 수정 여부", example = "true")
|
||||||
private boolean profileUpdated;
|
private boolean profileUpdated;
|
||||||
|
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package com.alist.api.modules.user.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
@Schema(description = "사용자 개인정보 조회 응답")
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class UserProfileViewVo {
|
||||||
|
@Schema(description = "회원 PK", example = "1")
|
||||||
|
private Integer userIdx;
|
||||||
|
|
||||||
|
@Schema(description = "회원 아이디", example = "test")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@Schema(description = "이메일", example = "user@example.com")
|
||||||
|
private String email;
|
||||||
|
|
||||||
|
@Schema(description = "휴대폰 번호", example = "01012345678")
|
||||||
|
private String hp;
|
||||||
|
|
||||||
|
@Schema(description = "회원 권한 코드", example = "SCM")
|
||||||
|
private String userRole;
|
||||||
|
|
||||||
|
@Schema(description = "회원 유형 코드. T: 교사, S: 학생", example = "S")
|
||||||
|
private String userType;
|
||||||
|
}
|
||||||
+1
-1
@@ -8,7 +8,7 @@ import lombok.Setter;
|
|||||||
@Schema(description = "사용자 탈퇴 상태 변경 응답")
|
@Schema(description = "사용자 탈퇴 상태 변경 응답")
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
public class UserWithdrawStatusVo {
|
public class UserWithdrawModifyVo {
|
||||||
@Schema(description = "탈퇴 상태 변경 여부", example = "true")
|
@Schema(description = "탈퇴 상태 변경 여부", example = "true")
|
||||||
private boolean withdrawStatusUpdated;
|
private boolean withdrawStatusUpdated;
|
||||||
|
|
||||||
@@ -2,55 +2,6 @@
|
|||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
|
||||||
<mapper namespace="com.alist.api.modules.user.mapper.UserMapper">
|
<mapper namespace="com.alist.api.modules.user.mapper.UserMapper">
|
||||||
<insert id="insertUserSignup" useGeneratedKeys="true" keyProperty="userIdx">
|
|
||||||
/*UserMapper.insertUserSignup*/
|
|
||||||
insert into ALISTLMS.test_user (id, password, del_yn, create_at, update_at)
|
|
||||||
value (#{id}, #{newPassword}, 1, now(), now())
|
|
||||||
</insert>
|
|
||||||
<insert id="insertUserTokenSignup" useGeneratedKeys="true" keyProperty="userTokenIdx">
|
|
||||||
/*UserMapper.insertUserTokenSignup*/
|
|
||||||
insert into ALISTLMS.test_user_token (user_idx, user_api_key, user_role, user_type, created_at, updated_at)
|
|
||||||
value (#{userIdx}, #{userApiKey}, #{userRole}, #{userType}, now(), now())
|
|
||||||
</insert>
|
|
||||||
<update id="updateUserPassword">
|
|
||||||
/*UserMapper.updateUserPassword*/
|
|
||||||
UPDATE ALISTLMS.test_user ATU
|
|
||||||
INNER JOIN ALISTLMS.test_user_token ATUT ON ATUT.user_idx = ATU.user_idx
|
|
||||||
SET ATU.password = #{newPassword}
|
|
||||||
, ATU.update_at = now()
|
|
||||||
WHERE ATUT.user_token_idx = #{userTokenIdx}
|
|
||||||
AND ATU.del_yn = 1
|
|
||||||
</update>
|
|
||||||
<update id="updateUserProfile">
|
|
||||||
/*UserMapper.updateUserProfile*/
|
|
||||||
UPDATE ALISTLMS.test_user ATU
|
|
||||||
INNER JOIN ALISTLMS.test_user_token ATUT ON ATUT.user_idx = ATU.user_idx
|
|
||||||
SET ATU.update_at = now()
|
|
||||||
<if test="email != null and email != ''">
|
|
||||||
, ATU.email = #{email}
|
|
||||||
</if>
|
|
||||||
<if test="hp != null and hp != ''">
|
|
||||||
, ATU.hp = #{hp}
|
|
||||||
</if>
|
|
||||||
WHERE ATUT.user_token_idx = #{userTokenIdx}
|
|
||||||
AND ATU.del_yn = 1
|
|
||||||
</update>
|
|
||||||
<update id="updateWithdrawStatus">
|
|
||||||
/*UserMapper.updateWithdrawStatus*/
|
|
||||||
UPDATE ALISTLMS.test_user ATU
|
|
||||||
INNER JOIN ALISTLMS.test_user_token ATUT ON ATUT.user_idx = ATU.user_idx
|
|
||||||
SET ATU.withdraw_status = #{withdrawStatus}
|
|
||||||
, ATU.withdraw_at =
|
|
||||||
CASE
|
|
||||||
WHEN #{withdrawStatus} = 'P' THEN now()
|
|
||||||
WHEN #{withdrawStatus} = 'N' THEN NULL
|
|
||||||
ELSE ATU.withdraw_at
|
|
||||||
END
|
|
||||||
, ATU.update_at = now()
|
|
||||||
WHERE ATUT.user_token_idx = #{userTokenIdx}
|
|
||||||
AND ATU.del_yn = 1
|
|
||||||
AND ATU.withdraw_status != 'Y'
|
|
||||||
</update>
|
|
||||||
|
|
||||||
<select id="selectDuplicateUserCount" resultType="int">
|
<select id="selectDuplicateUserCount" resultType="int">
|
||||||
/*UserMapper.selectDuplicateUserCount*/
|
/*UserMapper.selectDuplicateUserCount*/
|
||||||
@@ -69,8 +20,77 @@
|
|||||||
AND ATU.del_yn = 1
|
AND ATU.del_yn = 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<update id="updateDormantStatus">
|
<select id="selectUserProfileView" resultType="com.alist.api.modules.user.vo.UserProfileViewVo">
|
||||||
/*UserMapper.updateDormantStatus*/
|
/*UserMapper.selectUserProfileView*/
|
||||||
|
SELECT ATU.user_idx
|
||||||
|
, ATU.id
|
||||||
|
, ATU.email
|
||||||
|
, ATU.hp
|
||||||
|
, ATUT.user_role
|
||||||
|
, ATUT.user_type
|
||||||
|
FROM ALISTLMS.test_user ATU
|
||||||
|
INNER JOIN ALISTLMS.test_user_token ATUT ON ATUT.user_idx = ATU.user_idx
|
||||||
|
WHERE ATUT.user_token_idx = #{userTokenIdx}
|
||||||
|
AND ATU.del_yn = 1
|
||||||
|
AND ATU.withdraw_status != 'Y'
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertUserAdd" useGeneratedKeys="true" keyProperty="userIdx">
|
||||||
|
/*UserMapper.insertUserAdd*/
|
||||||
|
insert into ALISTLMS.test_user (id, password, del_yn, create_at, update_at)
|
||||||
|
value (#{id}, #{newPassword}, 1, now(), now())
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<insert id="insertUserToken" useGeneratedKeys="true" keyProperty="userTokenIdx">
|
||||||
|
/*UserMapper.insertUserToken*/
|
||||||
|
insert into ALISTLMS.test_user_token (user_idx, user_api_key, user_role, user_type, created_at, updated_at)
|
||||||
|
value (#{userIdx}, #{userApiKey}, #{userRole}, #{userType}, now(), now())
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateUserPasswordModify">
|
||||||
|
/*UserMapper.updateUserPasswordModify*/
|
||||||
|
UPDATE ALISTLMS.test_user ATU
|
||||||
|
INNER JOIN ALISTLMS.test_user_token ATUT ON ATUT.user_idx = ATU.user_idx
|
||||||
|
SET ATU.password = #{newPassword}
|
||||||
|
, ATU.update_at = now()
|
||||||
|
WHERE ATUT.user_token_idx = #{userTokenIdx}
|
||||||
|
AND ATU.del_yn = 1
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="updateUserProfileModify">
|
||||||
|
/*UserMapper.updateUserProfileModify*/
|
||||||
|
UPDATE ALISTLMS.test_user ATU
|
||||||
|
INNER JOIN ALISTLMS.test_user_token ATUT ON ATUT.user_idx = ATU.user_idx
|
||||||
|
SET ATU.update_at = now()
|
||||||
|
<if test="email != null and email != ''">
|
||||||
|
, ATU.email = #{email}
|
||||||
|
</if>
|
||||||
|
<if test="hp != null and hp != ''">
|
||||||
|
, ATU.hp = #{hp}
|
||||||
|
</if>
|
||||||
|
WHERE ATUT.user_token_idx = #{userTokenIdx}
|
||||||
|
AND ATU.del_yn = 1
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="updateUserWithdrawModify">
|
||||||
|
/*UserMapper.updateUserWithdrawModify*/
|
||||||
|
UPDATE ALISTLMS.test_user ATU
|
||||||
|
INNER JOIN ALISTLMS.test_user_token ATUT ON ATUT.user_idx = ATU.user_idx
|
||||||
|
SET ATU.withdraw_status = #{withdrawStatus}
|
||||||
|
, ATU.withdraw_at =
|
||||||
|
CASE
|
||||||
|
WHEN #{withdrawStatus} = 'P' THEN now()
|
||||||
|
WHEN #{withdrawStatus} = 'N' THEN NULL
|
||||||
|
ELSE ATU.withdraw_at
|
||||||
|
END
|
||||||
|
, ATU.update_at = now()
|
||||||
|
WHERE ATUT.user_token_idx = #{userTokenIdx}
|
||||||
|
AND ATU.del_yn = 1
|
||||||
|
AND ATU.withdraw_status != 'Y'
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="updateUserDormantModify">
|
||||||
|
/*UserMapper.updateUserDormantModify*/
|
||||||
UPDATE ALISTLMS.test_user ATU
|
UPDATE ALISTLMS.test_user ATU
|
||||||
INNER JOIN ALISTLMS.test_user_token ATUT ON ATUT.user_idx = ATU.user_idx
|
INNER JOIN ALISTLMS.test_user_token ATUT ON ATUT.user_idx = ATU.user_idx
|
||||||
SET ATU.dormant_yn = #{dormantYn}
|
SET ATU.dormant_yn = #{dormantYn}
|
||||||
|
|||||||
Reference in New Issue
Block a user