mirror of
https://gitee.com/dromara/dax-pay
synced 2026-08-09 22:45:58 +08:00
refactor(payment): 沙箱环境开关查询接口返回值简化为裸布尔(Result<Boolean>)
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
package cn.daxpay.open.payment.masterdata.controller.admin.product;
|
||||
|
||||
import cn.daxpay.open.platform.common.config.properties.PlatformConfigProperties;
|
||||
import cn.daxpay.open.platform.core.annotation.PermCode;
|
||||
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 lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/// # 支付环境全局配置查询
|
||||
///
|
||||
/// 沙箱环境开关由配置文件控制(daxpay.platform.config.sandbox-enabled), 运行时只读。
|
||||
@Tag(name = "支付环境全局配置查询")
|
||||
@RestController
|
||||
@RequestMapping("/admin/pay-env")
|
||||
@RequiredArgsConstructor
|
||||
public class PayEnvConfigController {
|
||||
|
||||
private final PlatformConfigProperties platformConfigProperties;
|
||||
|
||||
@Operation(summary = "查询沙箱环境开关状态")
|
||||
@GetMapping("/sandbox-enabled")
|
||||
public Result<Boolean> getSandboxEnabled() {
|
||||
return Res.ok(platformConfigProperties.isSandboxEnabled());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user