Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/8: CI/CD 테스트 및 dev 브랜치 최신화 #18

Merged
merged 3 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 53 additions & 1 deletion src/main/java/com/cmc/suppin/member/controller/MemberApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ public class MemberApi {

private final MemberCommandService memberCommandService;

// 회원가입
/**
* 회원가입
*/
@PostMapping("/join")
@Operation(summary = "회원가입 API", description = "request 파라미터 : id, password, name, phone, email")
public ApiResponse<MemberResponseDTO.JoinResultDTO> join(@RequestBody @Valid MemberRequestDTO.JoinDTO request) {
Expand Down Expand Up @@ -55,6 +57,9 @@ public ApiResponse<Void> deleteMember(@AuthenticationPrincipal MemberDetails mem
return ApiResponse.onSuccess(null, SuccessStatus.MEMBER_DELETE_SUCCESS);
}

/**
* TODO: 로그인, 로그아웃, 비밀번호 변경, 회원정보 상세 조회, 회원정보 수정 API
*/
// 로그인
@PostMapping("/login")
@Operation(summary = "로그인 API", description = "request : userId, password")
Expand All @@ -63,4 +68,51 @@ public ApiResponse<MemberResponseDTO.LoginResponseDTO> login(@RequestBody @Valid
return ApiResponse.onSuccess(response, SuccessStatus.MEMBER_LOGIN_SUCCESS);
}


// // 로그아웃
// @PostMapping("/logout")
// @Operation(summary = "로그아웃 API", description = "JWT 토큰을 헤더에 포함시켜 보내주시면 됩니다.")
// public ApiResponse<Void> logout(@AuthenticationPrincipal MemberDetails memberDetails) {
// if (memberDetails == null) {
// return ApiResponse.onFailure("403", "인증된 사용자만 로그아웃할 수 있습니다.", null);
// }
// memberCommandService.logout(memberDetails.getUserId());
// return ApiResponse.onSuccess(null, SuccessStatus.MEMBER_LOGOUT_SUCCESS);
// }
//
// // 비밀번호 변경
// @PutMapping("/changePassword")
// @Operation(summary = "비밀번호 변경 API", description = "request : userId, password, newPassword")
// public ApiResponse<Void> changePassword(@AuthenticationPrincipal MemberDetails memberDetails, @RequestBody @Valid MemberRequestDTO.ChangePasswordDTO request) {
// if (memberDetails == null) {
// return ApiResponse.onFailure("403", "인증된 사용자만 비밀번호를 변경할 수 있습니다.", null);
// }
// memberCommandService.changePassword(memberDetails.getUserId(), request);
// return ApiResponse.onSuccess(null, SuccessStatus.MEMBER_CHANGE_PASSWORD_SUCCESS);
// }
//
// // 회원정보 상세 조회(마이페이지)
// @GetMapping("/info")
// @Operation(summary = "회원정보 상세 조회 API", description = "JWT 토큰을 헤더에 포함시켜 보내주시면 됩니다.")
// public ApiResponse<MemberResponseDTO.MemberInfoDTO> getMemberInfo(@AuthenticationPrincipal MemberDetails memberDetails) {
// if (memberDetails == null) {
// return ApiResponse.onFailure("403", "인증된 사용자만 조회할 수 있습니다.", null);
// }
// Member member = memberCommandService.getMemberInfo(memberDetails.getUserId());
// return ApiResponse.onSuccess(MemberConverter.toMemberInfoDTO(member), SuccessStatus.MEMBER_INFO_SUCCESS);
// }
//
// // 회원정보 수정
// @PutMapping("/info/update")
// @Operation(summary = "회원정보 수정 API", description = "request : userId, name, phone, email")
// public ApiResponse<Void> updateMemberInfo(@AuthenticationPrincipal MemberDetails memberDetails, @RequestBody @Valid MemberRequestDTO.UpdateMemberInfoDTO request) {
// if (memberDetails == null) {
// return ApiResponse.onFailure("403", "인증된 사용자만 수정할 수 있습니다.", null);
// }
// memberCommandService.updateMemberInfo(memberDetails.getUserId(), request);
// return ApiResponse.onSuccess(null, SuccessStatus.MEMBER_UPDATE_SUCCESS);
// }

// TODO: 아이디 찾기, 비밀번호 찾기 API 구현 필요

}
4 changes: 3 additions & 1 deletion src/main/java/com/cmc/suppin/member/domain/Member.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,14 @@ public class Member extends BaseDateTimeEntity {
@Column(columnDefinition = "VARCHAR(30)", nullable = false)
private String email;

@Column(columnDefinition = "VARCHAR(20)", nullable = false)
@Column(columnDefinition = "VARCHAR(255)", nullable = false)
private String password;

@Column(columnDefinition = "VARCHAR(13)", nullable = false)
private String phoneNumber;

private Boolean termsAgree;

private String role;

// 추가된 생성자
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ spring:
driver-class-name: com.mysql.cj.jdbc.Driver
jpa:
hibernate:
ddl-auto: update
ddl-auto: create
properties:
hibernate:
dialect: org.hibernate.dialect.MySQL8Dialect
Expand Down
Loading