
package com.tmerclub.cloud.platform.controller.platform;

import com.tmerclub.cloud.common.bean.Quick100;
import com.tmerclub.cloud.common.constant.Constant;
import com.tmerclub.cloud.common.response.ServerResponseEntity;
import com.tmerclub.cloud.platform.service.SysConfigService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
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 track
 */
@RestController("platSysConfigController")
@RequestMapping("/p/ua/sys_config")
@Tag(name = "plat-系统配置信息")
public class SysConfigController {

    @Autowired
    private SysConfigService sysConfigService;

    @GetMapping("/pay_settlement_type")
    @Operation(summary = "获取支付系统配置", description = "获取支付系统配置")
    public ServerResponseEntity<String> getPaySettlementType() {
        return ServerResponseEntity.success(sysConfigService.getValue(Constant.PAY_SETTLEMENT_CONFIG));
    }
    @GetMapping("/quick_100")
    @Operation(summary = "获取快递100配置", description = "获取快递100配置")
    public ServerResponseEntity<Boolean> getQuick100() {
        Quick100 quick100 = sysConfigService.getSysConfigObject(Constant.QUICK100_CONFIG, Quick100.class);
        return ServerResponseEntity.success(quick100.getIsPrint());
    }
}
