feat(payment-app-admin): 新增支付渠道管理 Controller/Service

对齐 admin 端 PayProviderController, 新增 /app-admin/payment/pay-provider:
- list-by-provider: 按支付渠道分组查询(含支付方式+支持产品)
- switch-enabled: 切换支付渠道启停
- get: 查询单条渠道+方式详情

AppAdminPayProviderService 薄转发 admin 包 PayProviderService
This commit is contained in:
DaxPay Dev
2026-07-26 22:49:28 +08:00
parent a5723502e2
commit 5aa238f41e
2 changed files with 93 additions and 0 deletions

View File

@@ -0,0 +1,59 @@
package cn.daxpay.open.payment.app.admin.controller.masterdata.provider;
import cn.daxpay.open.payment.app.admin.service.masterdata.provider.AppAdminPayProviderService;
import cn.daxpay.open.payment.masterdata.result.provider.PayProviderGroupResult;
import cn.daxpay.open.payment.masterdata.result.provider.PayProviderMethodResult;
import cn.daxpay.open.platform.core.annotation.PermCode;
import cn.daxpay.open.platform.core.code.PermCodes;
import cn.daxpay.open.platform.core.rest.Res;
import cn.daxpay.open.platform.core.rest.result.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/// 运营移动端-支付渠道管理
@PermCode(menuCode = PermCodes.Payment.Platform.Provider.MENU)
@Validated
@Tag(name = "运营移动端-支付渠道管理")
@RestController
@RequestMapping("/app-admin/payment/pay-provider")
@RequiredArgsConstructor
public class AppAdminPayProviderController {
private final AppAdminPayProviderService payProviderService;
@PermCode(code = PermCodes.Action.VIEW)
@Operation(summary = "按支付渠道分组查询支付方式列表")
@GetMapping("/list-by-provider")
public Result<List<PayProviderGroupResult>> listByProvider() {
return Res.ok(payProviderService.listByProvider());
}
@PermCode(code = PermCodes.Action.MANAGE)
@Operation(summary = "切换支付渠道启停")
@PostMapping("/switch-enabled")
public Result<Void> switchEnabled(
@NotBlank(message = "{validation.field.product.notBlank}") String product,
@NotNull(message = "{validation.field.enabled.notNull}") Boolean enabled) {
payProviderService.switchEnabled(product, enabled);
return Res.ok();
}
@PermCode(code = PermCodes.Action.VIEW)
@Operation(summary = "查询单条支付渠道项")
@GetMapping("/get")
public Result<PayProviderMethodResult> get(
@NotBlank(message = "{validation.field.provider.notBlank}") String provider,
@NotBlank(message = "{validation.field.method.notBlank}") String method) {
return Res.ok(payProviderService.get(provider, method));
}
}

View File

@@ -0,0 +1,34 @@
package cn.daxpay.open.payment.app.admin.service.masterdata.provider;
import cn.daxpay.open.payment.admin.service.masterdata.provider.PayProviderService;
import cn.daxpay.open.payment.masterdata.result.provider.PayProviderGroupResult;
import cn.daxpay.open.payment.masterdata.result.provider.PayProviderMethodResult;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.List;
/// # 运营移动端-支付渠道服务
///
/// 转发至 [PayProviderService]
@Service
@RequiredArgsConstructor
public class AppAdminPayProviderService {
private final PayProviderService payProviderService;
/// 按支付渠道分组,返回各渠道下的支付方式
public List<PayProviderGroupResult> listByProvider() {
return payProviderService.listByProvider();
}
/// 切换支付渠道启停
public void switchEnabled(String product, Boolean enabled) {
payProviderService.switchEnabled(product, enabled);
}
/// 按支付渠道编码与支付方式编码查一条配置详情
public PayProviderMethodResult get(String providerCode, String methodCode) {
return payProviderService.get(providerCode, methodCode);
}
}