-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update: jwt exception 코드 및 공급자 관련 api 작성
- Loading branch information
1 parent
1ab717c
commit bf8344e
Showing
31 changed files
with
408 additions
and
94 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
src/main/java/com/gt/genti/adapter/in/web/CreatorController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package com.gt.genti.adapter.in.web; | ||
|
||
import static com.gt.genti.other.util.ApiUtils.*; | ||
|
||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.security.core.annotation.AuthenticationPrincipal; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.PutMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import com.gt.genti.dto.CreatorInfoResponseDto; | ||
import com.gt.genti.dto.UpdateAccountInfoRequestDto; | ||
import com.gt.genti.dto.UpdateCreatorStatusRequestDto; | ||
import com.gt.genti.dto.UpdateCreatorStatusResponseDto; | ||
import com.gt.genti.dto.UserInfoResponseDto; | ||
import com.gt.genti.other.annotation.ToBeUpdated; | ||
import com.gt.genti.other.aop.annotation.CheckUserIsQuit; | ||
import com.gt.genti.other.auth.UserDetailsImpl; | ||
import com.gt.genti.service.CreatorService; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
|
||
@RestController | ||
@RequestMapping("/api/creators") | ||
@RequiredArgsConstructor | ||
public class CreatorController { | ||
private final CreatorService creatorService; | ||
|
||
@GetMapping("") | ||
public ResponseEntity<ApiResult<CreatorInfoResponseDto>> getCreatorInfo( | ||
@AuthenticationPrincipal UserDetailsImpl userDetails) { | ||
return success(creatorService.getCreatorInfo(userDetails.getId())); | ||
} | ||
|
||
@PostMapping("/account") | ||
public ResponseEntity<ApiResult<Boolean>> updateAccountInfo( | ||
@AuthenticationPrincipal UserDetailsImpl userDetails, | ||
@RequestBody UpdateAccountInfoRequestDto updateAccountInfoRequestDto) { | ||
return success(creatorService.updateAccountInfo(userDetails.getId(), updateAccountInfoRequestDto)); | ||
} | ||
@PostMapping("/status") | ||
public ResponseEntity<ApiResult<UpdateCreatorStatusResponseDto>> updateCreatorStatus( | ||
@AuthenticationPrincipal UserDetailsImpl userDetails, | ||
@RequestBody UpdateCreatorStatusRequestDto updateCreatorStatusRequestDto) { | ||
return success(creatorService.updateCreatorStatus(userDetails.getId(), updateCreatorStatusRequestDto)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.gt.genti.domain.enums; | ||
|
||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@Getter | ||
@RequiredArgsConstructor | ||
public enum BankType implements ConvertableEnum { | ||
KB("국민은행"), | ||
SHINHAN("신한은행"), | ||
HANA("하나은행"), | ||
WOORI("우리은행"), | ||
IBK("기업은행"), | ||
SC("SC제일은행"), | ||
CITY("씨티은행"), | ||
NH("농협은행"), | ||
SH("수협은행"), | ||
|
||
K("케이뱅크"), | ||
KAKAOBANK("카카오뱅크"), | ||
TOSS("토스뱅크"), | ||
|
||
DAEGU("대구은행"), | ||
BUSAN("부산은행"), | ||
KYONGNAM("경남은행"), | ||
KWANGJU("광주은행"), | ||
JEONBUK("전북은행"), | ||
JEJU("제주은행"), | ||
NONE("NONE"); | ||
private final String stringValue; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/main/java/com/gt/genti/domain/enums/converter/BankTypeConverter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.gt.genti.domain.enums.converter; | ||
|
||
import com.gt.genti.domain.enums.BankType; | ||
import com.gt.genti.domain.enums.CameraAngle; | ||
|
||
import jakarta.persistence.Converter; | ||
|
||
@Converter | ||
public class BankTypeConverter extends DefaultStringAttributeConverter<BankType> { | ||
|
||
public BankTypeConverter() { | ||
super(BankType.class); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/main/java/com/gt/genti/dto/CreatorInfoResponseDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.gt.genti.dto; | ||
|
||
import com.gt.genti.domain.enums.BankType; | ||
|
||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
public class CreatorInfoResponseDto { | ||
Boolean workable; | ||
BankType bankType; | ||
String accountNumber; | ||
|
||
@Builder | ||
public CreatorInfoResponseDto(Boolean workable, BankType bankType, String accountNumber) { | ||
this.workable = workable; | ||
this.bankType = bankType; | ||
this.accountNumber = accountNumber; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.