-
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.
refactor: 돈길 생성 API Mapper 레이어 생성하여 리팩토링 #232
- Loading branch information
1 parent
04ad05e
commit 03ca19f
Showing
2 changed files
with
38 additions
and
11 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
src/main/java/com/ceos/bankids/controller/ChallengeController.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 |
---|---|---|
@@ -1,5 +1,38 @@ | ||
package com.ceos.bankids.controller; | ||
|
||
import com.ceos.bankids.config.CommonResponse; | ||
import com.ceos.bankids.domain.User; | ||
import com.ceos.bankids.dto.ChallengeDTO; | ||
import com.ceos.bankids.mapper.ChallengeMapper; | ||
import com.ceos.bankids.mapper.request.ChallengeRequest; | ||
import io.swagger.annotations.ApiOperation; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.security.core.annotation.AuthenticationPrincipal; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@Slf4j | ||
@RestController | ||
@RequestMapping("/challenge") | ||
@RequiredArgsConstructor | ||
public class ChallengeController { | ||
|
||
private final ChallengeMapper challengeMapper; | ||
|
||
@ApiOperation(value = "돈길 생성") | ||
@PostMapping(produces = "application/json; charset=utf-8") | ||
public CommonResponse<ChallengeDTO> postChallenge(@AuthenticationPrincipal User authUser, | ||
@RequestBody | ||
ChallengeRequest challengeRequest) { | ||
|
||
log.info("api = 돈길 생성, req = {}", challengeRequest); | ||
|
||
ChallengeDTO challengeDTO = challengeMapper.postChallenge(authUser, challengeRequest); | ||
|
||
return CommonResponse.onSuccess(challengeDTO); | ||
} | ||
|
||
} |
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