feat 接口订单和定时任务调整

This commit is contained in:
DaxPay
2024-05-17 18:03:52 +08:00
parent 9699661a1f
commit 4c6262be05
27 changed files with 486 additions and 188 deletions

View File

@@ -22,7 +22,7 @@ import java.util.Objects;
@RestController
@RequestMapping("/gateway/notice")
@RequiredArgsConstructor
public class PayGatewayNoticeController {
public class PayNoticeReceiverController {
@Operation(summary = "支付宝消息通知")
@PostMapping("/alipay")
@@ -35,4 +35,5 @@ public class PayGatewayNoticeController {
public Map<String, Objects> wechatPayNotice() {
return new HashMap<>();
}
}

View File

@@ -0,0 +1,79 @@
package cn.daxpay.single.gateway.controller;
import cn.daxpay.single.code.PaymentApiCode;
import cn.daxpay.single.param.payment.allocation.AllocationFinishParam;
import cn.daxpay.single.param.payment.allocation.AllocationStartParam;
import cn.daxpay.single.result.DaxResult;
import cn.daxpay.single.result.allocation.AllocationResult;
import cn.daxpay.single.service.annotation.PaymentApi;
import cn.daxpay.single.service.core.payment.allocation.service.AllocationReceiverService;
import cn.daxpay.single.service.core.payment.allocation.service.AllocationService;
import cn.daxpay.single.service.param.allocation.group.AllocationReceiverParam;
import cn.daxpay.single.util.DaxRes;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
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;
/**
* 分账控制器
* @author xxm
* @since 2024/5/17
*/
@Tag(name = "分账控制器")
@RestController
@RequestMapping("/unipay/allocation")
@RequiredArgsConstructor
public class UniAllocationController {
private final AllocationService allocationService;
private final AllocationReceiverService receiverService;
@PaymentApi(PaymentApiCode.ALLOCATION)
@Operation(summary = "触发分账接口")
@PostMapping("/open")
public DaxResult<AllocationResult> open(@RequestBody AllocationStartParam param){
return DaxRes.ok(allocationService.allocation(param));
}
@PaymentApi(PaymentApiCode.ALLOCATION_FINISH)
@Operation(summary = "分账完结接口")
@PostMapping("/finish")
public DaxResult<Void> finish(@RequestBody AllocationFinishParam param){
allocationService.finish(param);
return DaxRes.ok();
}
@PaymentApi(PaymentApiCode.ALLOCATION_RECEIVER_QUERY)
@Operation(summary = "分账接收方查询接口")
@PostMapping("/allocationReceiverQuery")
public DaxResult<Void> allocationReceiverQuery(@RequestBody AllocationReceiverParam param){
return DaxRes.ok();
}
@PaymentApi(PaymentApiCode.ALLOCATION_RECEIVER_ADD)
@Operation(summary = "添加分账接收方接口")
@PostMapping("/allocationReceiverAdd")
public DaxResult<Void> allocationReceiverAdd(@RequestBody AllocationReceiverParam param){
return DaxRes.ok();
}
@PaymentApi(PaymentApiCode.ALLOCATION_RECEIVER_REMOVE)
@Operation(summary = "删除分账接收方接口")
@PostMapping("/allocationReceiverRemove")
public DaxResult<Void> allocationReceiverRemove(@RequestBody AllocationReceiverParam param){
return DaxRes.ok();
}
@PaymentApi(PaymentApiCode.ALLOCATION_RECEIVER_QUERY)
@Operation(summary = "查询分账接收方接口")
@PostMapping("/allocationReceiverRemoveByGateway")
public DaxResult<Void> allocationReceiverRemoveByGateway(@RequestBody AllocationReceiverParam param){
return DaxRes.ok();
}
}

View File

@@ -2,21 +2,17 @@ package cn.daxpay.single.gateway.controller;
import cn.bootx.platform.common.core.annotation.IgnoreAuth;
import cn.daxpay.single.code.PaymentApiCode;
import cn.daxpay.single.param.payment.allocation.AllocationFinishParam;
import cn.daxpay.single.param.payment.allocation.AllocationStartParam;
import cn.daxpay.single.param.payment.pay.PayCloseParam;
import cn.daxpay.single.param.payment.pay.PayParam;
import cn.daxpay.single.param.payment.pay.PaySyncParam;
import cn.daxpay.single.param.payment.refund.RefundParam;
import cn.daxpay.single.param.payment.refund.RefundSyncParam;
import cn.daxpay.single.result.DaxResult;
import cn.daxpay.single.result.allocation.AllocationResult;
import cn.daxpay.single.result.pay.PayCloseResult;
import cn.daxpay.single.result.pay.PayResult;
import cn.daxpay.single.result.pay.RefundResult;
import cn.daxpay.single.result.pay.SyncResult;
import cn.daxpay.single.service.annotation.PaymentApi;
import cn.daxpay.single.service.core.payment.allocation.service.AllocationService;
import cn.daxpay.single.service.core.payment.close.service.PayCloseService;
import cn.daxpay.single.service.core.payment.pay.service.PayService;
import cn.daxpay.single.service.core.payment.refund.service.RefundService;
@@ -47,7 +43,6 @@ public class UniPayController {
private final PaySyncService paySyncService;
private final PayCloseService payCloseService;
private final RefundSyncService refundSyncService;
private final AllocationService allocationService;
@PaymentApi(PaymentApiCode.PAY)
@@ -85,21 +80,4 @@ public class UniPayController {
return DaxRes.ok(refundSyncService.sync(param));
}
@PaymentApi(PaymentApiCode.ALLOCATION)
@Operation(summary = "开启分账接口")
@PostMapping("/allocation")
public DaxResult<AllocationResult> allocation(@RequestBody AllocationStartParam param){
return DaxRes.ok(allocationService.allocation(param));
}
@PaymentApi(PaymentApiCode.ALLOCATION_FINISH)
@Operation(summary = "分账完结接口")
@PostMapping("/allocationFinish")
public DaxResult<Void> allocationFinish(@RequestBody AllocationFinishParam param){
allocationService.finish(param);
return DaxRes.ok();
}
}

View File

@@ -0,0 +1,34 @@
package cn.daxpay.single.gateway.controller;
import cn.daxpay.single.code.PaymentApiCode;
import cn.daxpay.single.param.payment.pay.PayParam;
import cn.daxpay.single.result.DaxResult;
import cn.daxpay.single.service.annotation.PaymentApi;
import cn.daxpay.single.util.DaxRes;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
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;
/**
* 对账相关接口
* @author xxm
* @since 2024/5/17
*/
@Tag(name = "对账接口处理器")
@RestController
@RequestMapping("/unipay/reconcile")
@RequiredArgsConstructor
public class UniReconcileController {
@PaymentApi(PaymentApiCode.PAY)
@Operation(summary = "下载指定日期的资金流水")
@PostMapping("/pay")
public DaxResult<?> down(@RequestBody PayParam payParam){
return DaxRes.ok();
}
}