package com.sckw.payment.controller;

import com.sckw.core.web.response.HttpResult;
import com.sckw.payment.model.vo.req.FinanceCount;
import com.sckw.payment.service.WorkbenchService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * 工作台
 *
 * @author xucaiqin
 * @date 2023-08-28 15:36:48
 */
@Tag(name = "工作台", description = "提供工作台相关数据接口")
@Validated
@RestController
@RequestMapping("/workbench")
@Slf4j
public class WorkbenchController {
    @Resource
    private WorkbenchService workbenchService;

    /**
     * 财务数据统计
     *
     * @param financeCount 财务统计参数
     * @return 财务统计数据
     */
    @Operation(summary = "财务数据统计", description = "根据条件统计财务数据")
    @PostMapping("finance")
    public HttpResult finance(@Valid @RequestBody FinanceCount financeCount) {
        return HttpResult.ok(workbenchService.financeCount(financeCount));
    }

}