From 9c12c715683b00ae0bebbcceb58030b5ada62ddd Mon Sep 17 00:00:00 2001 From: eric <465889110@qq.com> Date: Fri, 12 Sep 2025 13:30:43 +0800 Subject: [PATCH] no message --- pom.xml | 11 + .../pay/alipay/controller/ItemController.java | 262 +++++++++--------- .../controller/ItemOrderController.java | 64 ++--- .../AliPayOrderCloseController.java | 76 ++--- .../AliPayOrderFulfillmentController.java | 98 +++---- .../pay/controller/AliPaymentController.java | 140 +++++----- .../pay/controller/AlipayRentController.java | 58 ++-- .../pay/controller/PaymentController.java | 154 +++++----- src/main/resources/bootstrap.yml | 15 + 9 files changed, 452 insertions(+), 426 deletions(-) create mode 100644 src/main/resources/bootstrap.yml diff --git a/pom.xml b/pom.xml index 23578b5..2723211 100644 --- a/pom.xml +++ b/pom.xml @@ -85,6 +85,11 @@ spring-cloud-commons + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + org.projectlombok @@ -143,6 +148,12 @@ 8.0.33 + + org.apache.commons + commons-pool2 + 2.9.0 + + io.springfox diff --git a/src/main/java/com/sczx/pay/alipay/controller/ItemController.java b/src/main/java/com/sczx/pay/alipay/controller/ItemController.java index f05c0d4..9718a37 100644 --- a/src/main/java/com/sczx/pay/alipay/controller/ItemController.java +++ b/src/main/java/com/sczx/pay/alipay/controller/ItemController.java @@ -1,131 +1,131 @@ -package com.sczx.pay.alipay.controller; - -import com.alipay.api.domain.AppxCategoryVO; -import com.alipay.api.internal.util.StringUtils; -import com.alipay.api.response.AlipayOpenAppItemListQueryResponse; -import com.alipay.api.response.AlipayOpenAppItemQueryResponse; -import com.alipay.api.response.AlipayOpenAppItemTemplateQueryResponse; -import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; -import com.sczx.pay.alipay.po.RentRuleItem; -import com.sczx.pay.alipay.service.ItemService; -import com.sczx.pay.alipay.service.RentRuleItemService; -import com.sczx.pay.alipay.vo.ItemCreateRequest; -import com.sczx.pay.alipay.vo.OpenResponse; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - - -import java.util.List; -import java.util.Map; - - -@Api(tags = "普通商品模块") -@RestController -@RequestMapping(value = "/item") -public class ItemController { - - @Autowired - private ItemService itemService; - - @Autowired - private RentRuleItemService rentRuleItemService; - - /** - * 类目查询 - * 获取叶子节点商品类目列表 - */ - @ApiOperationSupport(order = 1) - @ApiOperation(value = "类目查询", notes = "获取叶子节点商品类目列表") - @GetMapping(value = "/category/list") - public OpenResponse> categoryList( - @ApiParam(value = "商品类型:1-售卖类(实物),2-租赁类(实物),3-付费充值/兑换类(虚拟)") @RequestParam String itemType, - @ApiParam(value = "类目状态,默认AUDIT_PASSED", example = "AUDIT_PASSED") @RequestParam(required = false) String catStatus) { - return itemService.getCategories(itemType, catStatus); - } - - /** - * 普通商品模板信息查询 - */ - @ApiOperationSupport(order = 2) - @ApiOperation(value = "普通商品模板信息查询") - @GetMapping(value = "/template/query") - public OpenResponse queryTemplate( - @ApiParam(value = "类目ID", required = true) @RequestParam String categoryId, - @ApiParam(value = "商品类型:1-售卖类(实物),2-租赁类(实物),3-付费充值/兑换类(虚拟)") @RequestParam(required = false) String itemType) { - return itemService.queryTemplate(categoryId, itemType); - } - - - - /** - * 租赁类(实物)商品创建 - */ - @ApiOperation(value = "租赁类(实物)商品创建") - @ApiOperationSupport(order = 4) - @PostMapping(value = "/rent/create") - public OpenResponse rentCreate(@RequestBody RentRuleItem request) { - return itemService.createRentItem(request); - } - - - @PostMapping(value = "/rent/modify") - public OpenResponse modifyCreate(@RequestBody RentRuleItem request) { - return itemService.modifyItem(request); - } - - @ApiOperation(value = "商品详情查询") - @ApiOperationSupport(order = 7) - @GetMapping(value = "/query") - public OpenResponse query(@ApiParam(value = "支付平台侧商品ID") @RequestParam(required = false) String itemId, - @ApiParam(value = "商家侧商品ID") @RequestParam(required = false) String outItemId, - @ApiParam(value = "是否查询编辑版本,默认为0", defaultValue = "0") @RequestParam(required = false) String needEditSpu) { - return itemService.queryItemDetail(itemId, outItemId, - StringUtils.isNumeric(needEditSpu) ? Long.parseLong(needEditSpu) : 0); - } - - /** - * 租赁类(实物)履约模板创建 - */ - @ApiOperation(value = "租赁类(实物)履约模板创建") - @ApiOperationSupport(order = 4) - @PostMapping(value = "/template/create") - public OpenResponse templateCreate() { - return itemService.syncDeliveryInfo(); - } - - /** - * 租赁类(实物)履约模板创建 - */ - @ApiOperation(value = "租赁类(实物)履约模板创建") - @ApiOperationSupport(order = 4) - @PostMapping(value = "/delivery/query") - public OpenResponse deliveryQuery() { - return itemService.deliveryInfoQuery(); - } - - @ApiOperation(value = "租赁类(实物)履约模板创建") - @ApiOperationSupport(order = 4) - @PostMapping(value = "/deliverytemplate/query") - public OpenResponse deliveryTemplateQuery() { - return itemService.deliveryTemplateQuery(); - } - - @ApiOperation(value = "租赁类(实物)履约模板创建") - @ApiOperationSupport(order = 4) - @PostMapping(value = "/shop/query") - public OpenResponse shopQuery() { - return itemService.shopQuery(); - } - - - @ApiOperation(value = "接收套餐数据并记录商品") - @GetMapping(value = "/sync/item") - public Map syncItem(@RequestParam(required = false) String brandId,@RequestParam(required = false) String carModelId, - @RequestParam(required = false) String carRuleId,@RequestParam(required = false) String batteryRuleId) { - return rentRuleItemService.syncItem(brandId, carModelId,carRuleId,batteryRuleId); - } - -} +//package com.sczx.pay.alipay.controller; +// +//import com.alipay.api.domain.AppxCategoryVO; +//import com.alipay.api.internal.util.StringUtils; +//import com.alipay.api.response.AlipayOpenAppItemListQueryResponse; +//import com.alipay.api.response.AlipayOpenAppItemQueryResponse; +//import com.alipay.api.response.AlipayOpenAppItemTemplateQueryResponse; +//import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +//import com.sczx.pay.alipay.po.RentRuleItem; +//import com.sczx.pay.alipay.service.ItemService; +//import com.sczx.pay.alipay.service.RentRuleItemService; +//import com.sczx.pay.alipay.vo.ItemCreateRequest; +//import com.sczx.pay.alipay.vo.OpenResponse; +//import io.swagger.annotations.Api; +//import io.swagger.annotations.ApiOperation; +//import io.swagger.annotations.ApiParam; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.web.bind.annotation.*; +// +// +//import java.util.List; +//import java.util.Map; +// +// +//@Api(tags = "普通商品模块") +//@RestController +//@RequestMapping(value = "/item") +//public class ItemController { +// +// @Autowired +// private ItemService itemService; +// +// @Autowired +// private RentRuleItemService rentRuleItemService; +// +// /** +// * 类目查询 +// * 获取叶子节点商品类目列表 +// */ +// @ApiOperationSupport(order = 1) +// @ApiOperation(value = "类目查询", notes = "获取叶子节点商品类目列表") +// @GetMapping(value = "/category/list") +// public OpenResponse> categoryList( +// @ApiParam(value = "商品类型:1-售卖类(实物),2-租赁类(实物),3-付费充值/兑换类(虚拟)") @RequestParam String itemType, +// @ApiParam(value = "类目状态,默认AUDIT_PASSED", example = "AUDIT_PASSED") @RequestParam(required = false) String catStatus) { +// return itemService.getCategories(itemType, catStatus); +// } +// +// /** +// * 普通商品模板信息查询 +// */ +// @ApiOperationSupport(order = 2) +// @ApiOperation(value = "普通商品模板信息查询") +// @GetMapping(value = "/template/query") +// public OpenResponse queryTemplate( +// @ApiParam(value = "类目ID", required = true) @RequestParam String categoryId, +// @ApiParam(value = "商品类型:1-售卖类(实物),2-租赁类(实物),3-付费充值/兑换类(虚拟)") @RequestParam(required = false) String itemType) { +// return itemService.queryTemplate(categoryId, itemType); +// } +// +// +// +// /** +// * 租赁类(实物)商品创建 +// */ +// @ApiOperation(value = "租赁类(实物)商品创建") +// @ApiOperationSupport(order = 4) +// @PostMapping(value = "/rent/create") +// public OpenResponse rentCreate(@RequestBody RentRuleItem request) { +// return itemService.createRentItem(request); +// } +// +// +// @PostMapping(value = "/rent/modify") +// public OpenResponse modifyCreate(@RequestBody RentRuleItem request) { +// return itemService.modifyItem(request); +// } +// +// @ApiOperation(value = "商品详情查询") +// @ApiOperationSupport(order = 7) +// @GetMapping(value = "/query") +// public OpenResponse query(@ApiParam(value = "支付平台侧商品ID") @RequestParam(required = false) String itemId, +// @ApiParam(value = "商家侧商品ID") @RequestParam(required = false) String outItemId, +// @ApiParam(value = "是否查询编辑版本,默认为0", defaultValue = "0") @RequestParam(required = false) String needEditSpu) { +// return itemService.queryItemDetail(itemId, outItemId, +// StringUtils.isNumeric(needEditSpu) ? Long.parseLong(needEditSpu) : 0); +// } +// +// /** +// * 租赁类(实物)履约模板创建 +// */ +// @ApiOperation(value = "租赁类(实物)履约模板创建") +// @ApiOperationSupport(order = 4) +// @PostMapping(value = "/template/create") +// public OpenResponse templateCreate() { +// return itemService.syncDeliveryInfo(); +// } +// +// /** +// * 租赁类(实物)履约模板创建 +// */ +// @ApiOperation(value = "租赁类(实物)履约模板创建") +// @ApiOperationSupport(order = 4) +// @PostMapping(value = "/delivery/query") +// public OpenResponse deliveryQuery() { +// return itemService.deliveryInfoQuery(); +// } +// +// @ApiOperation(value = "租赁类(实物)履约模板创建") +// @ApiOperationSupport(order = 4) +// @PostMapping(value = "/deliverytemplate/query") +// public OpenResponse deliveryTemplateQuery() { +// return itemService.deliveryTemplateQuery(); +// } +// +// @ApiOperation(value = "租赁类(实物)履约模板创建") +// @ApiOperationSupport(order = 4) +// @PostMapping(value = "/shop/query") +// public OpenResponse shopQuery() { +// return itemService.shopQuery(); +// } +// +// +// @ApiOperation(value = "接收套餐数据并记录商品") +// @GetMapping(value = "/sync/item") +// public Map syncItem(@RequestParam(required = false) String brandId,@RequestParam(required = false) String carModelId, +// @RequestParam(required = false) String carRuleId,@RequestParam(required = false) String batteryRuleId) { +// return rentRuleItemService.syncItem(brandId, carModelId,carRuleId,batteryRuleId); +// } +// +//} diff --git a/src/main/java/com/sczx/pay/alipay/controller/ItemOrderController.java b/src/main/java/com/sczx/pay/alipay/controller/ItemOrderController.java index 48c8f77..7b615cb 100644 --- a/src/main/java/com/sczx/pay/alipay/controller/ItemOrderController.java +++ b/src/main/java/com/sczx/pay/alipay/controller/ItemOrderController.java @@ -1,32 +1,32 @@ -package com.sczx.pay.alipay.controller; - - -import com.alipay.api.AlipayApiException; -import com.sczx.pay.alipay.service.RentOrderService; -import com.sczx.pay.alipay.vo.RentOrderCreateRequest; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import javax.servlet.http.HttpServletRequest; - -@Api(value = "租赁订单接口", tags = "租赁订单接口") -@Slf4j -@RestController -@RequestMapping("/rentorder") -public class ItemOrderController { - - @Autowired - private RentOrderService rentOrderService; - - @ApiOperation(value = "创建租赁订单") - @PostMapping("/create") - public String rentOrderCreate(RentOrderCreateRequest request) throws AlipayApiException { - return rentOrderService.rentOrderCreate(request).getBody(); - - } -} +//package com.sczx.pay.alipay.controller; +// +// +//import com.alipay.api.AlipayApiException; +//import com.sczx.pay.alipay.service.RentOrderService; +//import com.sczx.pay.alipay.vo.RentOrderCreateRequest; +//import io.swagger.annotations.Api; +//import io.swagger.annotations.ApiOperation; +//import lombok.extern.slf4j.Slf4j; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.web.bind.annotation.PostMapping; +//import org.springframework.web.bind.annotation.RequestMapping; +//import org.springframework.web.bind.annotation.RestController; +// +//import javax.servlet.http.HttpServletRequest; +// +//@Api(value = "租赁订单接口", tags = "租赁订单接口") +//@Slf4j +//@RestController +//@RequestMapping("/rentorder") +//public class ItemOrderController { +// +// @Autowired +// private RentOrderService rentOrderService; +// +// @ApiOperation(value = "创建租赁订单") +// @PostMapping("/create") +// public String rentOrderCreate(RentOrderCreateRequest request) throws AlipayApiException { +// return rentOrderService.rentOrderCreate(request).getBody(); +// +// } +//} diff --git a/src/main/java/com/sczx/pay/controller/AliPayOrderCloseController.java b/src/main/java/com/sczx/pay/controller/AliPayOrderCloseController.java index 32ce165..b8dc55a 100644 --- a/src/main/java/com/sczx/pay/controller/AliPayOrderCloseController.java +++ b/src/main/java/com/sczx/pay/controller/AliPayOrderCloseController.java @@ -1,38 +1,38 @@ -package com.sczx.pay.controller; - -import com.alipay.api.domain.AlipayCommerceRentOrderCloseModel; -import com.alipay.api.response.AlipayCommerceRentOrderCloseResponse; -import com.sczx.pay.service.AliPayOrderCloseService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -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; - - - -@Api(value = "支付宝租赁订单关闭接口", tags = "支付宝租赁订单关闭接口") -@Slf4j -@RestController -@RequestMapping("/alipay/orderClose") -public class AliPayOrderCloseController { - - @Autowired - private AliPayOrderCloseService aliPayOrderCloseService; - - /** - * 支付宝订单关闭接口 - */ - @ApiOperation(value = "支付宝订单关闭接口") - @PostMapping("/orderClose") - public AlipayCommerceRentOrderCloseResponse aliPayOrderClose(@RequestBody AlipayCommerceRentOrderCloseModel model) { - log.info("支付宝订单关闭接口请求: {}", model); - return aliPayOrderCloseService.aliPayOrderClose(model); - } - - - -} +//package com.sczx.pay.controller; +// +//import com.alipay.api.domain.AlipayCommerceRentOrderCloseModel; +//import com.alipay.api.response.AlipayCommerceRentOrderCloseResponse; +//import com.sczx.pay.service.AliPayOrderCloseService; +//import io.swagger.annotations.Api; +//import io.swagger.annotations.ApiOperation; +//import lombok.extern.slf4j.Slf4j; +//import org.springframework.beans.factory.annotation.Autowired; +//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; +// +// +// +//@Api(value = "支付宝租赁订单关闭接口", tags = "支付宝租赁订单关闭接口") +//@Slf4j +//@RestController +//@RequestMapping("/alipay/orderClose") +//public class AliPayOrderCloseController { +// +// @Autowired +// private AliPayOrderCloseService aliPayOrderCloseService; +// +// /** +// * 支付宝订单关闭接口 +// */ +// @ApiOperation(value = "支付宝订单关闭接口") +// @PostMapping("/orderClose") +// public AlipayCommerceRentOrderCloseResponse aliPayOrderClose(@RequestBody AlipayCommerceRentOrderCloseModel model) { +// log.info("支付宝订单关闭接口请求: {}", model); +// return aliPayOrderCloseService.aliPayOrderClose(model); +// } +// +// +// +//} diff --git a/src/main/java/com/sczx/pay/controller/AliPayOrderFulfillmentController.java b/src/main/java/com/sczx/pay/controller/AliPayOrderFulfillmentController.java index 06797a0..8893e03 100644 --- a/src/main/java/com/sczx/pay/controller/AliPayOrderFulfillmentController.java +++ b/src/main/java/com/sczx/pay/controller/AliPayOrderFulfillmentController.java @@ -1,49 +1,49 @@ -package com.sczx.pay.controller; - - -import com.alipay.api.domain.AlipayCommerceRentOrderFulfillmentFinishModel; -import com.alipay.api.response.AlipayCommerceRentOrderFulfillmentApproveResponse; -import com.alipay.api.domain.AlipayCommerceRentOrderFulfillmentApproveModel; -import com.alipay.api.response.AlipayCommerceRentOrderFulfillmentFinishResponse; -import com.sczx.pay.service.AliPayOrderFulfillmentService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -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; - - - -@Api(value = "支付宝订单履约接口", tags = "支付宝租赁履约接口") -@Slf4j -@RestController -@RequestMapping("/alipay/orderFulfillment") -public class AliPayOrderFulfillmentController { - - @Autowired - private AliPayOrderFulfillmentService aliPayOrderFulfillmentService; - - /** - * 支付宝订单履约审核接口 - */ - @ApiOperation(value = "支付宝订单履约审核接口") - @PostMapping("/approve") - public AlipayCommerceRentOrderFulfillmentApproveResponse aliPayOrderFulfillmentApprove(@RequestBody AlipayCommerceRentOrderFulfillmentApproveModel model) { - log.info("支付宝订单履约审核接口请求: {}", model); - return aliPayOrderFulfillmentService.aliPayOrderFulfillmentApprove(model); - } - - - /** - * 支付宝订单履约完成接口 - */ - @ApiOperation(value = "支付宝订单履约完成接口") - @PostMapping("/finish") - public AlipayCommerceRentOrderFulfillmentFinishResponse aliPayOrderFulfillmentFinish(@RequestBody AlipayCommerceRentOrderFulfillmentFinishModel model) { - log.info("支付宝订单履约审核接口请求: {}", model); - return aliPayOrderFulfillmentService.aliPayOrderFulfillmentFinish(model); - } -} +//package com.sczx.pay.controller; +// +// +//import com.alipay.api.domain.AlipayCommerceRentOrderFulfillmentFinishModel; +//import com.alipay.api.response.AlipayCommerceRentOrderFulfillmentApproveResponse; +//import com.alipay.api.domain.AlipayCommerceRentOrderFulfillmentApproveModel; +//import com.alipay.api.response.AlipayCommerceRentOrderFulfillmentFinishResponse; +//import com.sczx.pay.service.AliPayOrderFulfillmentService; +//import io.swagger.annotations.Api; +//import io.swagger.annotations.ApiOperation; +//import lombok.extern.slf4j.Slf4j; +//import org.springframework.beans.factory.annotation.Autowired; +//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; +// +// +// +//@Api(value = "支付宝订单履约接口", tags = "支付宝租赁履约接口") +//@Slf4j +//@RestController +//@RequestMapping("/alipay/orderFulfillment") +//public class AliPayOrderFulfillmentController { +// +// @Autowired +// private AliPayOrderFulfillmentService aliPayOrderFulfillmentService; +// +// /** +// * 支付宝订单履约审核接口 +// */ +// @ApiOperation(value = "支付宝订单履约审核接口") +// @PostMapping("/approve") +// public AlipayCommerceRentOrderFulfillmentApproveResponse aliPayOrderFulfillmentApprove(@RequestBody AlipayCommerceRentOrderFulfillmentApproveModel model) { +// log.info("支付宝订单履约审核接口请求: {}", model); +// return aliPayOrderFulfillmentService.aliPayOrderFulfillmentApprove(model); +// } +// +// +// /** +// * 支付宝订单履约完成接口 +// */ +// @ApiOperation(value = "支付宝订单履约完成接口") +// @PostMapping("/finish") +// public AlipayCommerceRentOrderFulfillmentFinishResponse aliPayOrderFulfillmentFinish(@RequestBody AlipayCommerceRentOrderFulfillmentFinishModel model) { +// log.info("支付宝订单履约审核接口请求: {}", model); +// return aliPayOrderFulfillmentService.aliPayOrderFulfillmentFinish(model); +// } +//} diff --git a/src/main/java/com/sczx/pay/controller/AliPaymentController.java b/src/main/java/com/sczx/pay/controller/AliPaymentController.java index fddcda1..5e17424 100644 --- a/src/main/java/com/sczx/pay/controller/AliPaymentController.java +++ b/src/main/java/com/sczx/pay/controller/AliPaymentController.java @@ -1,70 +1,70 @@ -package com.sczx.pay.controller; - -import com.sczx.pay.dto.*; -import com.sczx.pay.service.AlipayService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -@Api(value = "支付宝支付接口", tags = "支付宝支付接口") -@Slf4j -@RestController -@RequestMapping("/api/alipay") -public class AliPaymentController { - - @Autowired - private AlipayService alipayService; - - /** - * 支付宝统一下单接口 - */ - @ApiOperation(value = "支付宝统一下单接口") - @PostMapping("/unifiedOrder") - public AlipayCreateResponse aliPayUnifiedOrder(@RequestBody AlipayCreateRequest request) { - log.info("收到支付宝支付请求: {}", request); - return alipayService.unifiedOrder(request); - } - - /** - * 查询订单接口 - */ - @ApiOperation(value = "查询订单接口") - @GetMapping("/query/{outTradeNo}") - public AlipayQueryResponse alipayOrderQuery(@PathVariable String outTradeNo) { - log.info("收到支付宝订单查询请求, 订单号: {}", outTradeNo); - return alipayService.orderQuery(outTradeNo); - } - - /** - * 关闭订单接口 - */ - @ApiOperation(value = "关闭订单接口") - @PostMapping("/close") - public AlipayResponse alipayCloseOrder(@RequestBody AlipayCloseRequest request) { - log.info("收到支付宝关闭订单请求: {}", request); - return alipayService.closeOrder(request); - } - - /** - * 申请退款接口 - */ - @ApiOperation(value = "申请退款接口") - @PostMapping("/refund") - public AlipayResponse alipayRefund(@RequestBody AlipayRefundRequest request) { - log.info("收到支付宝退款请求: {}", request); - return alipayService.refund(request); - } - - /** - * 查询退款接口 - */ - @ApiOperation(value = "查询退款接口") - @PostMapping("/refundQuery") - public AlipayResponse alipayRefundQuery(@RequestBody AlipayRefundRequest request) { - log.info("收到支付宝退款查询请求: {}", request); - return alipayService.refundQuery(request); - } - -} +//package com.sczx.pay.controller; +// +//import com.sczx.pay.dto.*; +//import com.sczx.pay.service.AlipayService; +//import io.swagger.annotations.Api; +//import io.swagger.annotations.ApiOperation; +//import lombok.extern.slf4j.Slf4j; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.web.bind.annotation.*; +// +//@Api(value = "支付宝支付接口", tags = "支付宝支付接口") +//@Slf4j +//@RestController +//@RequestMapping("/api/alipay") +//public class AliPaymentController { +// +// @Autowired +// private AlipayService alipayService; +// +// /** +// * 支付宝统一下单接口 +// */ +// @ApiOperation(value = "支付宝统一下单接口") +// @PostMapping("/unifiedOrder") +// public AlipayCreateResponse aliPayUnifiedOrder(@RequestBody AlipayCreateRequest request) { +// log.info("收到支付宝支付请求: {}", request); +// return alipayService.unifiedOrder(request); +// } +// +// /** +// * 查询订单接口 +// */ +// @ApiOperation(value = "查询订单接口") +// @GetMapping("/query/{outTradeNo}") +// public AlipayQueryResponse alipayOrderQuery(@PathVariable String outTradeNo) { +// log.info("收到支付宝订单查询请求, 订单号: {}", outTradeNo); +// return alipayService.orderQuery(outTradeNo); +// } +// +// /** +// * 关闭订单接口 +// */ +// @ApiOperation(value = "关闭订单接口") +// @PostMapping("/close") +// public AlipayResponse alipayCloseOrder(@RequestBody AlipayCloseRequest request) { +// log.info("收到支付宝关闭订单请求: {}", request); +// return alipayService.closeOrder(request); +// } +// +// /** +// * 申请退款接口 +// */ +// @ApiOperation(value = "申请退款接口") +// @PostMapping("/refund") +// public AlipayResponse alipayRefund(@RequestBody AlipayRefundRequest request) { +// log.info("收到支付宝退款请求: {}", request); +// return alipayService.refund(request); +// } +// +// /** +// * 查询退款接口 +// */ +// @ApiOperation(value = "查询退款接口") +// @PostMapping("/refundQuery") +// public AlipayResponse alipayRefundQuery(@RequestBody AlipayRefundRequest request) { +// log.info("收到支付宝退款查询请求: {}", request); +// return alipayService.refundQuery(request); +// } +// +//} diff --git a/src/main/java/com/sczx/pay/controller/AlipayRentController.java b/src/main/java/com/sczx/pay/controller/AlipayRentController.java index f0f16c3..31f7744 100644 --- a/src/main/java/com/sczx/pay/controller/AlipayRentController.java +++ b/src/main/java/com/sczx/pay/controller/AlipayRentController.java @@ -1,29 +1,29 @@ -package com.sczx.pay.controller; - -import com.sczx.pay.dto.ali.rent.AlipayRentPayReq; -import com.sczx.pay.dto.ali.rent.AlipayRentPayResponse; -import com.sczx.pay.service.AlipayRentService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -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; - -@Api(value = "支付宝租赁订单支付接口", tags = "支付宝租赁订单支付接口") -@Slf4j -@RestController -@RequestMapping("/alipay/rent") -public class AlipayRentController { - - @Autowired - private AlipayRentService alipayRentService; - - @ApiOperation(value = "创建支付单") - @PostMapping("/pay") - public AlipayRentPayResponse pay(@RequestBody AlipayRentPayReq request) { - return alipayRentService.rentPay(request); - } -} +//package com.sczx.pay.controller; +// +//import com.sczx.pay.dto.ali.rent.AlipayRentPayReq; +//import com.sczx.pay.dto.ali.rent.AlipayRentPayResponse; +//import com.sczx.pay.service.AlipayRentService; +//import io.swagger.annotations.Api; +//import io.swagger.annotations.ApiOperation; +//import lombok.extern.slf4j.Slf4j; +//import org.springframework.beans.factory.annotation.Autowired; +//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; +// +//@Api(value = "支付宝租赁订单支付接口", tags = "支付宝租赁订单支付接口") +//@Slf4j +//@RestController +//@RequestMapping("/alipay/rent") +//public class AlipayRentController { +// +// @Autowired +// private AlipayRentService alipayRentService; +// +// @ApiOperation(value = "创建支付单") +// @PostMapping("/pay") +// public AlipayRentPayResponse pay(@RequestBody AlipayRentPayReq request) { +// return alipayRentService.rentPay(request); +// } +//} diff --git a/src/main/java/com/sczx/pay/controller/PaymentController.java b/src/main/java/com/sczx/pay/controller/PaymentController.java index 1382774..f3a645a 100644 --- a/src/main/java/com/sczx/pay/controller/PaymentController.java +++ b/src/main/java/com/sczx/pay/controller/PaymentController.java @@ -31,83 +31,83 @@ public class PaymentController { @Autowired private CompanyWechatConfigMapper companyWechatConfigMapper; - - /** - * 小程序统一下单接口 - */ - @PostMapping("/unifiedOrder") - public PaymentResponse unifiedOrder(@RequestBody PaymentRequest request) { - logger.info("收到支付请求: {}", request); - return wechatPayService.unifiedOrder(request); - } - - /** - * 查询订单接口 - */ - @GetMapping("/query/{companyId}/{outTradeNo}") - public Map orderQuery(@PathVariable Long companyId, @PathVariable String outTradeNo) { - logger.info("收到订单查询请求,公司ID: {}, 订单号: {}", companyId, outTradeNo); - try { - return wechatPayService.orderQuery(companyId, outTradeNo); - } catch (Exception e) { - logger.error("订单查询异常,公司ID: {}, 订单号: {}", companyId, outTradeNo, e); - Map errorResult = new HashMap<>(); - errorResult.put("return_code", "FAIL"); - errorResult.put("return_msg", "查询异常: " + e.getMessage()); - return errorResult; - } - } - - /** - * 关闭订单接口 - */ - @PostMapping("/close/{companyId}/{outTradeNo}") - public Map closeOrder(@PathVariable Long companyId, @PathVariable String outTradeNo) { - logger.info("收到关闭订单请求,公司ID: {}, 订单号: {}", companyId, outTradeNo); - try { - return wechatPayService.closeOrder(companyId, outTradeNo); - } catch (Exception e) { - logger.error("关闭订单异常,公司ID: {}, 订单号: {}", companyId, outTradeNo, e); - Map errorResult = new HashMap<>(); - errorResult.put("return_code", "FAIL"); - errorResult.put("return_msg", "关闭异常: " + e.getMessage()); - return errorResult; - } - } - - /** - * 申请退款接口 - */ - @PostMapping("/refund") - public Map refund(@RequestBody RefundRequest request) { - logger.info("收到退款请求: {}", request); - try { - return wechatPayService.refund(request); - } catch (Exception e) { - logger.error("退款异常,公司ID: {}, 订单号: {}", request.getCompanyId(), request.getOutTradeNo(), e); - Map errorResult = new HashMap<>(); - errorResult.put("return_code", "FAIL"); - errorResult.put("return_msg", "退款异常: " + e.getMessage()); - return errorResult; - } - } - - /** - * 查询退款接口 - */ - @GetMapping("/refundQuery/{companyId}") - public Map refundQuery(@PathVariable Long companyId, @RequestParam String outTradeNo) { - logger.info("收到退款查询请求,公司ID: {}, 订单号: {}", companyId, outTradeNo); - try { - return wechatPayService.refundQuery(companyId, outTradeNo); - } catch (Exception e) { - logger.error("退款查询异常,公司ID: {}, 订单号: {}", companyId, outTradeNo, e); - Map errorResult = new HashMap<>(); - errorResult.put("return_code", "FAIL"); - errorResult.put("return_msg", "退款查询异常: " + e.getMessage()); - return errorResult; - } - } +// +// /** +// * 小程序统一下单接口 +// */ +// @PostMapping("/unifiedOrder") +// public PaymentResponse unifiedOrder(@RequestBody PaymentRequest request) { +// logger.info("收到支付请求: {}", request); +// return wechatPayService.unifiedOrder(request); +// } +// +// /** +// * 查询订单接口 +// */ +// @GetMapping("/query/{companyId}/{outTradeNo}") +// public Map orderQuery(@PathVariable Long companyId, @PathVariable String outTradeNo) { +// logger.info("收到订单查询请求,公司ID: {}, 订单号: {}", companyId, outTradeNo); +// try { +// return wechatPayService.orderQuery(companyId, outTradeNo); +// } catch (Exception e) { +// logger.error("订单查询异常,公司ID: {}, 订单号: {}", companyId, outTradeNo, e); +// Map errorResult = new HashMap<>(); +// errorResult.put("return_code", "FAIL"); +// errorResult.put("return_msg", "查询异常: " + e.getMessage()); +// return errorResult; +// } +// } +// +// /** +// * 关闭订单接口 +// */ +// @PostMapping("/close/{companyId}/{outTradeNo}") +// public Map closeOrder(@PathVariable Long companyId, @PathVariable String outTradeNo) { +// logger.info("收到关闭订单请求,公司ID: {}, 订单号: {}", companyId, outTradeNo); +// try { +// return wechatPayService.closeOrder(companyId, outTradeNo); +// } catch (Exception e) { +// logger.error("关闭订单异常,公司ID: {}, 订单号: {}", companyId, outTradeNo, e); +// Map errorResult = new HashMap<>(); +// errorResult.put("return_code", "FAIL"); +// errorResult.put("return_msg", "关闭异常: " + e.getMessage()); +// return errorResult; +// } +// } +// +// /** +// * 申请退款接口 +// */ +// @PostMapping("/refund") +// public Map refund(@RequestBody RefundRequest request) { +// logger.info("收到退款请求: {}", request); +// try { +// return wechatPayService.refund(request); +// } catch (Exception e) { +// logger.error("退款异常,公司ID: {}, 订单号: {}", request.getCompanyId(), request.getOutTradeNo(), e); +// Map errorResult = new HashMap<>(); +// errorResult.put("return_code", "FAIL"); +// errorResult.put("return_msg", "退款异常: " + e.getMessage()); +// return errorResult; +// } +// } +// +// /** +// * 查询退款接口 +// */ +// @GetMapping("/refundQuery/{companyId}") +// public Map refundQuery(@PathVariable Long companyId, @RequestParam String outTradeNo) { +// logger.info("收到退款查询请求,公司ID: {}, 订单号: {}", companyId, outTradeNo); +// try { +// return wechatPayService.refundQuery(companyId, outTradeNo); +// } catch (Exception e) { +// logger.error("退款查询异常,公司ID: {}, 订单号: {}", companyId, outTradeNo, e); +// Map errorResult = new HashMap<>(); +// errorResult.put("return_code", "FAIL"); +// errorResult.put("return_msg", "退款查询异常: " + e.getMessage()); +// return errorResult; +// } +// } /** * 微信支付结果通知 diff --git a/src/main/resources/bootstrap.yml b/src/main/resources/bootstrap.yml new file mode 100644 index 0000000..c17f377 --- /dev/null +++ b/src/main/resources/bootstrap.yml @@ -0,0 +1,15 @@ +spring: + application: + name: sczx-order # 应用名称,对应 Nacos 配置的 dataId + cloud: + nacos: + server-addr: 115.190.8.52:8848 # Nacos 服务器地址 + config: + group: DEFAULT_GROUP # 配置分组 + file-extension: yaml # 配置文件格式 + timeout: 5000 # 配置读取超时时间 + # 添加共享配置 + shared-configs: + - data-id: shared-config.yaml + group: DEFAULT_GROUP + refresh: true # 是否支持动态刷新 \ No newline at end of file