-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #177 from 9oormthon-univ/develop
Develop
- Loading branch information
Showing
6 changed files
with
143 additions
and
79 deletions.
There are no files selected for viewing
39 changes: 26 additions & 13 deletions
39
src/main/java/com/jangburich/domain/store/controller/PrepayController.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,32 +1,45 @@ | ||
package com.jangburich.domain.store.controller; | ||
|
||
import org.springframework.security.core.Authentication; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
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.RequestParam; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import com.jangburich.domain.store.dto.request.PrepayRequest; | ||
import com.jangburich.domain.store.service.PrepayService; | ||
import com.jangburich.global.payload.Message; | ||
import com.jangburich.global.payload.ResponseCustom; | ||
import com.jangburich.utils.parser.AuthenticationParser; | ||
|
||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.security.core.Authentication; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
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; | ||
|
||
@Tag(name = "Prepay", description = "Prepay API") | ||
@RestController | ||
@RequiredArgsConstructor | ||
@RequestMapping("/prepay") | ||
public class PrepayController { | ||
|
||
private final PrepayService prepayService; | ||
private final PrepayService prepayService; | ||
|
||
@Operation(summary = "์ ๊ฒฐ์ ", description = "ํ๊ณผ ๋งค์ฅ ์ ๊ฒฐ์ ๋ฅผ ์งํํฉ๋๋ค.") | ||
@PostMapping | ||
public ResponseCustom<Message> prepay(Authentication authentication, | ||
@RequestBody PrepayRequest prepayRequest) { | ||
return ResponseCustom.OK(prepayService.prepay(AuthenticationParser.parseUserId(authentication), prepayRequest)); | ||
} | ||
|
||
@Operation(summary = "์ ๊ฒฐ์ ", description = "ํ๊ณผ ๋งค์ฅ ์ ๊ฒฐ์ ๋ฅผ ์งํํฉ๋๋ค.") | ||
@PostMapping | ||
public ResponseCustom<Message> prepay(Authentication authentication, | ||
@RequestBody PrepayRequest prepayRequest) { | ||
return ResponseCustom.OK(prepayService.prepay(AuthenticationParser.parseUserId(authentication), prepayRequest)); | ||
} | ||
@Operation(summary = "์ ๊ฒฐ์ ์ ๋ณด ์กฐํ", description = "์ ๊ฒฐ์ ์งํํ๊ธฐ ์ํ ์ ๋ณด๋ฅผ ์กฐํํฉ๋๋ค.") | ||
@GetMapping("") | ||
public ResponseCustom<?> getPrepayInfo(Authentication authentication, | ||
@RequestParam(value = "storeId") Long storeId, | ||
@RequestParam(value = "teamId") Long teamId | ||
) { | ||
return ResponseCustom.OK( | ||
prepayService.getPrepayInfo(AuthenticationParser.parseUserId(authentication), storeId, teamId)); | ||
} | ||
} |
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
14 changes: 14 additions & 0 deletions
14
src/main/java/com/jangburich/domain/store/dto/response/PrepaymentInfoResponse.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,14 @@ | ||
package com.jangburich.domain.store.dto.response; | ||
|
||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.Setter; | ||
|
||
@Getter | ||
@Setter | ||
@RequiredArgsConstructor | ||
public class PrepaymentInfoResponse { | ||
private Long minPrepayAmount; | ||
private Integer wallet; | ||
private Integer remainPrepay; | ||
} |
2 changes: 1 addition & 1 deletion
2
...h/domain/store/dto/StoreTeamResponse.java โ ...store/dto/response/StoreTeamResponse.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
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