package com.ym.mec.web.controller;


import com.ym.mec.biz.dal.vo.ProxyDividendInfoVo;
import com.ym.mec.biz.dal.vo.ProxyDividendVo;
import com.ym.mec.biz.service.TenantProxyDividendService;
import com.ym.mec.common.controller.BaseController;
import com.ym.mec.common.entity.HttpResponseResult;
import com.ym.mec.common.page.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

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

/**
 * 代理商分润表(TenantProxyDividend)表控制层
 *
 * @author hgw
 * @since 2022-04-22 14:08:18
 */
@Api(tags = "代理商分润表")
@RestController
@RequestMapping("/tenantProxyDividend")
public class TenantProxyDividendController extends BaseController {
    /**
     * 服务对象
     */
    @Resource
    private TenantProxyDividendService tenantProxyDividendService;

    @ApiOperation("代理商分润汇总查询")
    @PostMapping(value = "/queryProxyDividend")
    public HttpResponseResult<ProxyDividendVo> queryProxyDividend() {
        return succeed(tenantProxyDividendService.queryProxyDividend());
    }

    @ApiImplicitParams({
            @ApiImplicitParam(name = "proxyId", dataType = "Integer", value = "代理商id"),
            @ApiImplicitParam(name = "recommenderId", dataType = "Integer", value = "推荐人id"),
            @ApiImplicitParam(name = "startData", dataType = "String", value = "开始日期 年月日"),
            @ApiImplicitParam(name = "endData", dataType = "String", value = "结束日期 年月日"),
            @ApiImplicitParam(name = "page", dataType = "Integer", value = "页数"),
            @ApiImplicitParam(name = "rows", dataType = "Integer", value = "每页数量"),
    })
    @ApiOperation("代理商分润明细查询")
    @PostMapping(value = "/queryProxyDividendInfo")
    public HttpResponseResult<PageInfo<ProxyDividendInfoVo>> queryProxyDividendInfo(@RequestBody Map<String, Object> param) {
        return succeed(tenantProxyDividendService.queryProxyDividendInfo(param));
    }

}

