package com.ruoyi.web.controller.app;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain.enums.config.ConfigKey;
import com.ruoyi.system.service.ISysConfigService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 系统配置接口
 * @author wjh
 * 2024/3/26
 */
@RestController
@RequestMapping("/app/config")
public class AppConfigController {

    @Autowired
    private ISysConfigService sysConfigService;

    @ApiOperation("获取充值服务费费率")
    @GetMapping("/serviceFeeRate")
    public AjaxResult serviceFeeRate() {
        return AjaxResult.success(sysConfigService.getBigDecimal(ConfigKey.SERVICE_FEE_RATE));
    }

    @ApiOperation("获取提现服务费费率")
    @GetMapping("/withdrawServiceFeeRate")
    public AjaxResult withdrawServiceFeeRate() {
        return AjaxResult.success(sysConfigService.getBigDecimal(ConfigKey.WITHDRAW_SERVICE_FEE_RATE));
    }

    @ApiOperation("获取微信小程序敏感内容是否展示标志")
    @GetMapping("/wa")
    public AjaxResult wa() {
        return AjaxResult.success(sysConfigService.getBoolean(ConfigKey.WECHAT_APPROVAL));
    }

}
