From eefd9a71fc1b6df3ad60194f43d1fca8aef38f21 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Wed, 22 Feb 2023 22:38:16 +0800 Subject: [PATCH] =?UTF-8?q?pay=EF=BC=9A=E9=BB=98=E8=AE=A4=E7=A6=81?= =?UTF-8?q?=E7=94=A8=20pay=20=E6=A8=A1=E5=9D=97=EF=BC=8C=E8=BF=9B=E4=B8=80?= =?UTF-8?q?=E6=AD=A5=E6=8F=90=E5=8D=87=E5=90=AF=E5=8A=A8=E9=80=9F=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yudao-server/pom.xml | 10 +-- .../shop/controller/admin/package-info.java | 4 - .../app/AppShopOrderController.java | 73 ------------------- .../app/vo/AppShopOrderCreateRespVO.java | 20 ----- .../yudao/module/shop/package-info.java | 9 --- .../framework/ui/core/AdminUiController.java | 11 --- .../src/main/resources/application-local.yaml | 2 +- 7 files changed, 6 insertions(+), 123 deletions(-) delete mode 100644 yudao-server/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/package-info.java delete mode 100644 yudao-server/src/main/java/cn/iocoder/yudao/module/shop/controller/app/AppShopOrderController.java delete mode 100644 yudao-server/src/main/java/cn/iocoder/yudao/module/shop/controller/app/vo/AppShopOrderCreateRespVO.java delete mode 100644 yudao-server/src/main/java/cn/iocoder/yudao/module/shop/package-info.java delete mode 100644 yudao-server/src/main/java/cn/iocoder/yudao/server/framework/ui/core/AdminUiController.java diff --git a/yudao-server/pom.xml b/yudao-server/pom.xml index 86399b2f1..52de36fc0 100644 --- a/yudao-server/pom.xml +++ b/yudao-server/pom.xml @@ -54,11 +54,11 @@ - - cn.iocoder.boot - yudao-module-pay-biz - ${revision} - + + + + + diff --git a/yudao-server/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/package-info.java b/yudao-server/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/package-info.java deleted file mode 100644 index 624b6c614..000000000 --- a/yudao-server/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * 占位 - */ -package cn.iocoder.yudao.module.shop.controller.admin; diff --git a/yudao-server/src/main/java/cn/iocoder/yudao/module/shop/controller/app/AppShopOrderController.java b/yudao-server/src/main/java/cn/iocoder/yudao/module/shop/controller/app/AppShopOrderController.java deleted file mode 100644 index ef209d765..000000000 --- a/yudao-server/src/main/java/cn/iocoder/yudao/module/shop/controller/app/AppShopOrderController.java +++ /dev/null @@ -1,73 +0,0 @@ -package cn.iocoder.yudao.module.shop.controller.app; - -import cn.iocoder.yudao.framework.common.pojo.CommonResult; -import cn.iocoder.yudao.module.pay.api.notify.dto.PayOrderNotifyReqDTO; -import cn.iocoder.yudao.module.pay.api.notify.dto.PayRefundNotifyReqDTO; -import cn.iocoder.yudao.module.pay.service.order.PayOrderService; -import cn.iocoder.yudao.module.pay.api.order.dto.PayOrderCreateReqDTO; -import cn.iocoder.yudao.module.pay.util.PaySeqUtils; -import cn.iocoder.yudao.module.shop.controller.app.vo.AppShopOrderCreateRespVO; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import lombok.extern.slf4j.Slf4j; -import org.springframework.validation.annotation.Validated; -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 javax.annotation.Resource; -import javax.validation.Valid; -import java.time.LocalDateTime; - -import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -import static cn.iocoder.yudao.framework.common.util.servlet.ServletUtils.getClientIP; - -@Tag(name = "用户 APP - 商城订单") -@RestController -@RequestMapping("/shop/order") -@Validated -@Slf4j -public class AppShopOrderController { - - @Resource - private PayOrderService payOrderService; - - @PostMapping("/create") - @Operation(summary = "创建商城订单") -// @PreAuthenticated // TODO 暂时不加登陆验证,前端暂时没做好 - public CommonResult create() { - // 假装创建商城订单 - Long shopOrderId = System.currentTimeMillis(); - - // 创建对应的支付订单 - PayOrderCreateReqDTO reqDTO = new PayOrderCreateReqDTO(); - reqDTO.setAppId(6L); - reqDTO.setUserIp(getClientIP()); - reqDTO.setMerchantOrderId(PaySeqUtils.genMerchantOrderNo()); - reqDTO.setSubject("标题:" + shopOrderId); - reqDTO.setBody("内容:" + shopOrderId); - reqDTO.setAmount(200); // 单位:分 - reqDTO.setExpireTime(LocalDateTime.now().plusDays(1)); - Long payOrderId = payOrderService.createPayOrder(reqDTO); - - // 拼接返回 - return success(AppShopOrderCreateRespVO.builder().id(shopOrderId) - .payOrderId(payOrderId).build()); - } - - @PostMapping("/pay-notify") - @Operation(summary = "支付回调") - public CommonResult payNotify(@RequestBody @Valid PayOrderNotifyReqDTO reqVO) { - log.info("[payNotify][回调成功]"); - return success(true); - } - - @PostMapping("/refund-notify") - @Operation(summary = "退款回调") - public CommonResult refundNotify(@RequestBody @Valid PayRefundNotifyReqDTO reqVO) { - log.info("[refundNotify][回调成功]"); - return success(true); - } - -} diff --git a/yudao-server/src/main/java/cn/iocoder/yudao/module/shop/controller/app/vo/AppShopOrderCreateRespVO.java b/yudao-server/src/main/java/cn/iocoder/yudao/module/shop/controller/app/vo/AppShopOrderCreateRespVO.java deleted file mode 100644 index 0a8c30b36..000000000 --- a/yudao-server/src/main/java/cn/iocoder/yudao/module/shop/controller/app/vo/AppShopOrderCreateRespVO.java +++ /dev/null @@ -1,20 +0,0 @@ -package cn.iocoder.yudao.module.shop.controller.app.vo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; - -@Schema(description = "用户 APP - 商城订单创建 Response VO") -@Data -@Builder -@AllArgsConstructor -public class AppShopOrderCreateRespVO { - - @Schema(description = "商城订单编号", required = true, example = "1024") - private Long id; - - @Schema(description = "支付订单编号", required = true, example = "2048") - private Long payOrderId; - -} diff --git a/yudao-server/src/main/java/cn/iocoder/yudao/module/shop/package-info.java b/yudao-server/src/main/java/cn/iocoder/yudao/module/shop/package-info.java deleted file mode 100644 index f088370dd..000000000 --- a/yudao-server/src/main/java/cn/iocoder/yudao/module/shop/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -/** - * shop 包下,我们放商城业务 - * 例如说:商品、订单等等 - * 注意,目前仅仅作为 demo 演示,对接 pay 支付系统 - * - * 缩写:shop - */ -// TODO 芋艿:后续会迁移到 yudao-module-mall-trade 下 -package cn.iocoder.yudao.module.shop; diff --git a/yudao-server/src/main/java/cn/iocoder/yudao/server/framework/ui/core/AdminUiController.java b/yudao-server/src/main/java/cn/iocoder/yudao/server/framework/ui/core/AdminUiController.java deleted file mode 100644 index 00cacc175..000000000 --- a/yudao-server/src/main/java/cn/iocoder/yudao/server/framework/ui/core/AdminUiController.java +++ /dev/null @@ -1,11 +0,0 @@ -package cn.iocoder.yudao.server.framework.ui.core; - -import org.springframework.boot.web.servlet.error.ErrorController; - -//@Controller -//@RequestMapping("/admin-ui/") -public class AdminUiController implements ErrorController { - -// public String - -} diff --git a/yudao-server/src/main/resources/application-local.yaml b/yudao-server/src/main/resources/application-local.yaml index 6c804b0f7..baa26647e 100644 --- a/yudao-server/src/main/resources/application-local.yaml +++ b/yudao-server/src/main/resources/application-local.yaml @@ -78,7 +78,7 @@ spring: # Quartz 配置项,对应 QuartzProperties 配置类 spring: quartz: - auto-startup: true # 本地开发环境,尽量不要开启 Job + auto-startup: false # 本地开发环境,尽量不要开启 Job scheduler-name: schedulerName # Scheduler 名字。默认为 schedulerName job-store-type: jdbc # Job 存储器类型。默认为 memory 表示内存,可选 jdbc 使用数据库。 wait-for-jobs-to-complete-on-shutdown: true # 应用关闭时,是否等待定时任务执行完成。默认为 false ,建议设置为 true