package com.kxs.user.biz.controller.kxsapp;

import com.kxs.common.core.util.R;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.kxs.user.api.model.KxsShdScore;
import org.springdoc.core.annotations.ParameterObject;

import com.kxs.user.biz.service.KxsShdTradeAmtService;
import com.kxs.user.biz.service.KxsShdScoreService;

import org.springframework.web.bind.annotation.*;

import lombok.RequiredArgsConstructor;

/**
 * 用户相关(Shareholder)控制层
 *
 * @author 系统
 * @since 2024-05-07 11:42:35
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("shareholder")
public class ShareholderController {

    /**
     * 服务对象
     */
    private final KxsShdTradeAmtService kxsShdTradeAmtService;
    private final KxsShdScoreService kxsShdScoreService;



    /**
     * 股东大盘分红-获取分红奖池统计
     *
     * @param tradeMonth 交易月份
     * @return 股东大盘分红-获取分红奖池统计
     */
    @GetMapping("/getShareholderAmount")
    public R getShareholderAmount(@RequestParam("tradeMonth") String tradeMonth) {
        return R.ok(kxsShdTradeAmtService.getShareholderAmount(tradeMonth));
    }


    /**
     * 股东大盘分红-获取达标统计
     *
     * @param month 主键
     * @return 股东大盘分红-获取达标统计
     */
    @GetMapping("/getMyStandards")
    public R getMyStandards(@RequestParam("month") String month) {
        return R.ok(kxsShdScoreService.getMyStandards(month));
    }


    /**
     * 股东大盘分红-获取达标股东信息
     *
     * @param page 分页对象
     * @return 股东大盘分红-获取达标股东信息
     */
    @GetMapping("/getShareholderUserList")
    public R getShareholderUserList(@ParameterObject Page<KxsShdScore> page, @RequestParam("month") String month, @RequestParam("type") Integer type) {
        return R.ok(kxsShdScoreService.getShareholderUserList(page,month,type));
    }





}

