package com.sqx.modules.rechargeConfig.controller;


import com.sqx.common.utils.Result;
import com.sqx.modules.rechargeConfig.entity.RechargeConfig;
import com.sqx.modules.rechargeConfig.service.RechargeConfigService;
import io.swagger.annotations.Api;
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.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author wuchang
 * @since 2022-11-04
 */
@RestController
@RequestMapping("/app/rechargeConfig/")
@Api(value = "充值配置", tags = {"充值配置-管理端"})
public class AppRechargeConfigController {
    @Autowired
    private RechargeConfigService rechargeConfigService;


    @ApiOperation("获取充值配置详情")
    @GetMapping("getConfigInfo")
    public Result getConfigInfo(Long rechargeId) {
        return Result.success().put("data", rechargeConfigService.getRechargeConfigInfo(rechargeId));
    }

    @ApiOperation("获取充值配置列表")
    @GetMapping("getConfigInfoList")
    public Result getConfigInfoList(Integer page,Integer limit,RechargeConfig rechargeConfig){
        rechargeConfig.setIsEnable(1);
        return Result.success().put("data", rechargeConfigService.getConfigInfoList(page,limit,rechargeConfig));
    }
}

