package vip.xiaonuo.money.controller;


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.MoneyCost;
import vip.xiaonuo.money.entity.MoneyProducePrice;
import vip.xiaonuo.money.entity.vo.MoneyProduceVo;
import vip.xiaonuo.money.param.MoneyInOutParam;
import vip.xiaonuo.money.service.IMoneyProducePriceService;

import java.util.List;

/**
 * <p>
 * 财务产品成本收入 前端控制器
 * </p>
 *
 * @author author
 * @since 2024-11-21
 */
@Api(tags = "产品控制器")
@ApiSupport(author = "SNOWY_TEAM", order = 1)
@RestController
@Validated
public class MoneyProducePriceController {

    @Autowired
    private IMoneyProducePriceService producePriceService;

    @ApiOperationSupport(order = 1)
    @ApiOperation("产品利润率")
    @PostMapping("/money-produce-price/listProduceProfit")
    public CommonResult<List<MoneyProducePrice>> listProduceProfit(@RequestBody MoneyInOutParam outParam) {
        return CommonResult.data(producePriceService.listProduceProfit(outParam));
    }

    @ApiOperationSupport(order = 1)
    @ApiOperation("成本和收入情况")
    @PostMapping("/money-produce-price/listProduce")
    public CommonResult<List<MoneyProduceVo>> listProduce(@RequestBody MoneyInOutParam outParam) {
        return CommonResult.data(producePriceService.listProduce(outParam));
    }
}
