package com.ruoyi.web.controller.app;

import com.fasterxml.jackson.annotation.JsonView;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.JsonViewProfile;
import com.ruoyi.ss.channel.domain.ChannelQuery;
import com.ruoyi.ss.channel.service.ChannelService;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wjh
 * 2024/4/15
 */
@RestController
@RequestMapping("/app/channel/recharge")
public class AppChannelController extends BaseController {

    @Autowired
    private ChannelService channelService;

    @ApiOperation("获取充值渠道列表")
    @JsonView(JsonViewProfile.App.class)
    @GetMapping("/enabledList")
    public AjaxResult getRechargeEnabledList(@RequestParam(required = false, defaultValue = "1") String platform) {
        ChannelQuery query = new ChannelQuery();
        query.setPlatform(platform);
        return success(channelService.selectEnabledRechargeList(query));
    }

}
