pay:默认禁用 pay 模块,进一步提升启动速度

This commit is contained in:
YunaiV 2023-02-22 22:38:16 +08:00
parent 14893c4cff
commit eefd9a71fc
7 changed files with 6 additions and 123 deletions

View File

@ -54,11 +54,11 @@
<!-- <version>${revision}</version>-->
<!-- </dependency>-->
<!-- 支付服务 -->
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-module-pay-biz</artifactId>
<version>${revision}</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>cn.iocoder.boot</groupId>-->
<!-- <artifactId>yudao-module-pay-biz</artifactId>-->
<!-- <version>${revision}</version>-->
<!-- </dependency>-->
<!-- 微信公众号模块。默认注释,保证编译速度 -->
<!-- <dependency>-->

View File

@ -1,4 +0,0 @@
/**
* 占位
*/
package cn.iocoder.yudao.module.shop.controller.admin;

View File

@ -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<AppShopOrderCreateRespVO> 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<Boolean> payNotify(@RequestBody @Valid PayOrderNotifyReqDTO reqVO) {
log.info("[payNotify][回调成功]");
return success(true);
}
@PostMapping("/refund-notify")
@Operation(summary = "退款回调")
public CommonResult<Boolean> refundNotify(@RequestBody @Valid PayRefundNotifyReqDTO reqVO) {
log.info("[refundNotify][回调成功]");
return success(true);
}
}

View File

@ -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;
}

View File

@ -1,9 +0,0 @@
/**
* shop 包下我们放商城业务
* 例如说商品订单等等
* 注意目前仅仅作为 demo 演示对接 pay 支付系统
*
* 缩写shop
*/
// TODO 芋艿后续会迁移到 yudao-module-mall-trade
package cn.iocoder.yudao.module.shop;

View File

@ -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
}

View File

@ -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