package com.kxs.stat.biz.controller;


import com.kxs.common.security.annotation.Inner;
import com.kxs.stat.api.model.KxsLkbTrade;
import com.kxs.stat.biz.service.KxsLkbTradeService;
import com.kxs.stat.biz.service.KxsUserTradeService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.math.BigDecimal;

/**
 * 用户表(KxsSecurityUser)表控制层
 *
 * @author Pota1ovO
 * @since 2024-05-08
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("stat")
public class KxsStatController {

    private final KxsUserTradeService kxsUserTradeService;
    private final KxsLkbTradeService lkbTradeService;


    /**
     * 获取交易统计数据
     */
    @Inner
    @GetMapping("/getStatAmount")
    public BigDecimal getStatAmount(@RequestParam("month") String month) {
        return kxsUserTradeService.getStatAmount(month);
    }

    /**
     * 获取来客吧交易额
     */
    @Inner
    @PostMapping("/getLkbTradeAmt")
    public KxsLkbTrade getLkbTradeAmt(@RequestBody KxsLkbTrade param) {

        return lkbTradeService.getLkbTradeAmt(param);
    }


}

