package com.ytpm.lemonios.controller;

import com.ytpm.agent.param.DitchListForIosParam;
import com.ytpm.agent.param.DitchListParam;
import com.ytpm.agent.view.AgentDitchView;
import com.ytpm.general.RepMessage;
import com.ytpm.general.Result;
import com.ytpm.lemonios.service.DitchService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@Api(tags = "渠道类型管理模块")
@RestController
@RequestMapping("/ditch")
public class DitchController {

    @Resource
    private DitchService agentDitchService;

    /**
     * 获取渠道类型列表
     */
    @ApiOperation("获取渠道类型列表")
    @PostMapping("/list")
    public Result<List<AgentDitchView>> list(@RequestBody DitchListForIosParam param) {
        param.setAppId(param.getAppId());
        DitchListParam ditchListParam = new DitchListParam();
        ditchListParam.setAppId(param.getAppId());
        return Result.resultOk(RepMessage.QUERY_SUCCESS, agentDitchService.ditchList(ditchListParam));
    }

}
