package vip.xiaonuo.money.controller;


import com.alibaba.fastjson.JSONObject;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
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 vip.xiaonuo.common.pojo.CommonResult;
import vip.xiaonuo.money.entity.MoneyIncome;
import vip.xiaonuo.money.entity.vo.MoneyIncomeVo;
import vip.xiaonuo.money.param.MoneyIncomeAddParam;
import vip.xiaonuo.money.param.MoneyIncomeParam;
import vip.xiaonuo.money.param.MoneyOverdueParam;
import vip.xiaonuo.money.service.IMoneyIncomeService;

import java.util.List;

/**
 * <p>
 * 财务收入达成 前端控制器
 * </p>
 *
 * @author author
 * @since 2024-11-21
 */
@RequestMapping("/money-income")
@Api(tags = "收入达成控制器")
@ApiSupport(author = "wang", order = 1)
@RestController
@Validated
public class MoneyIncomeController {

    @Autowired
    private IMoneyIncomeService incomeService;

    @ApiOperationSupport(order = 1)
    @ApiOperation("总览")
    @PostMapping("/money-overdue/getMoneyIncome")
    public CommonResult<MoneyIncomeVo> getMoneyIncome(@RequestBody MoneyIncomeParam incomeParam) {
        return CommonResult.data(incomeService.getMoneyIncome(incomeParam));
    }

    @ApiOperationSupport(order = 2)
    @ApiOperation("图表")
    @PostMapping("/money-overdue/MoneyIncomeList")
    public CommonResult<List<MoneyIncome>> MoneyIncomeList(@RequestBody MoneyIncomeParam incomeParam) {
        return CommonResult.data(incomeService.MoneyIncomeList(incomeParam));
    }

    @ApiOperationSupport(order = 3)
    @ApiOperation("添加")
    @PostMapping("/money-overdue/add")
    public CommonResult add(@RequestBody MoneyIncomeAddParam addParam) {
        return incomeService.add(addParam);
    }
}
