-
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 #7 from lotteon2/hotfix/develop
Hotfix/develop
- Loading branch information
Showing
11 changed files
with
95 additions
and
74 deletions.
There are no files selected for viewing
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
33 changes: 15 additions & 18 deletions
33
src/main/java/kr/bb/payment/controller/clientcontroller/OrderClientController.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,49 +1,46 @@ | ||
package kr.bb.payment.controller.clientcontroller; | ||
|
||
import bloomingblooms.response.SuccessResponse; | ||
import java.time.LocalDateTime; | ||
import kr.bb.payment.dto.request.KakaopayApproveRequestDto; | ||
import kr.bb.payment.dto.request.KakaopayReadyRequestDto; | ||
import kr.bb.payment.dto.response.KakaopayReadyResponseDto; | ||
import kr.bb.payment.service.KakaopayService; | ||
import kr.bb.payment.service.PaymentService; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.http.HttpStatus; | ||
import org.springframework.http.ResponseEntity; | ||
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; | ||
import org.springframework.web.client.RestTemplate; | ||
|
||
@RestController | ||
@RequestMapping("/client") | ||
@RequiredArgsConstructor | ||
public class OrderClientController { | ||
|
||
private final PaymentService paymentService; | ||
private final KakaopayService kakaopayService; | ||
|
||
@PostMapping("/ready") | ||
public ResponseEntity<SuccessResponse<KakaopayReadyResponseDto>> payReady( | ||
public SuccessResponse<KakaopayReadyResponseDto> payReady( | ||
@RequestBody KakaopayReadyRequestDto readyRequestDto) { | ||
|
||
KakaopayReadyResponseDto responseDto = kakaopayService.kakaoPayReady(readyRequestDto); | ||
|
||
return ResponseEntity.ok() | ||
.body( | ||
SuccessResponse.<KakaopayReadyResponseDto>builder() | ||
.code(String.valueOf(HttpStatus.OK.value())) | ||
.message(HttpStatus.OK.name()) | ||
.data(responseDto) | ||
.build()); | ||
return SuccessResponse.<KakaopayReadyResponseDto>builder() | ||
.data(responseDto) | ||
.message(HttpStatus.OK.name()) | ||
.build(); | ||
} | ||
|
||
@PostMapping("/approve") | ||
public ResponseEntity<SuccessResponse<Void>> payApprove(@RequestBody KakaopayApproveRequestDto approveRequestDto){ | ||
public SuccessResponse<LocalDateTime> payApprove( | ||
@RequestBody KakaopayApproveRequestDto approveRequestDto) { | ||
|
||
kakaopayService.kakaoPayApprove(approveRequestDto); | ||
LocalDateTime paymentDateTime = kakaopayService.kakaoPayApprove(approveRequestDto); | ||
|
||
return ResponseEntity.ok().body(SuccessResponse.<Void>builder() | ||
.code(String.valueOf(HttpStatus.OK.value())) | ||
.message(HttpStatus.OK.name()) | ||
.build()); | ||
return SuccessResponse.<LocalDateTime>builder() | ||
.data(paymentDateTime) | ||
.message(HttpStatus.OK.name()) | ||
.build(); | ||
} | ||
} |
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,20 @@ | ||
server: | ||
port: 8100 | ||
spring: | ||
mvc: | ||
pathmatch: | ||
matching-strategy: ant_path_matcher | ||
application: | ||
name: product-service | ||
config: | ||
activate: | ||
on-profile: dev | ||
import: optional:configserver:http://config-service:8888 | ||
management: | ||
endpoints: | ||
web: | ||
exposure: | ||
include: | ||
- "refresh" | ||
- "bus-refresh" | ||
- "health" |
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,22 +1,20 @@ | ||
server: | ||
port: 8100 | ||
spring: | ||
h2: | ||
console: | ||
enabled: true | ||
path: /h2-console | ||
datasource: | ||
driver-class-name: org.h2.Driver | ||
url: jdbc:h2:mem:payment-service;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false;MODE=MySQL | ||
jpa: | ||
hibernate: | ||
ddl-auto: create | ||
generate-ddl: true | ||
defer-datasource-initialization: true | ||
properties: | ||
hibernate: | ||
format_sql: true | ||
|
||
|
||
kakao: | ||
admin: e217481aeaeb6c14f8f10912b441f961 | ||
endpoint: | ||
apigateway-service: http://localhost:3000 | ||
mvc: | ||
pathmatch: | ||
matching-strategy: ant_path_matcher | ||
application: | ||
name: product-service | ||
config: | ||
activate: | ||
on-profile: local | ||
import: optional:configserver:http://localhost:8888 | ||
management: | ||
endpoints: | ||
web: | ||
exposure: | ||
include: | ||
- "refresh" | ||
- "bus-refresh" | ||
- "health" |
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,20 @@ | ||
server: | ||
port: 8100 | ||
spring: | ||
mvc: | ||
pathmatch: | ||
matching-strategy: ant_path_matcher | ||
application: | ||
name: product-service | ||
config: | ||
activate: | ||
on-profile: prod | ||
import: optional:configserver:http://config-service:8888 | ||
management: | ||
endpoints: | ||
web: | ||
exposure: | ||
include: | ||
- "refresh" | ||
- "bus-refresh" | ||
- "health" |
This file was deleted.
Oops, something went wrong.