package cn.stylefeng.workflow.instance.modular.stat.demo.controller;

import cn.stylefeng.roses.kernel.rule.pojo.response.ResponseData;
import cn.stylefeng.roses.kernel.rule.pojo.response.SuccessResponseData;
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
import cn.stylefeng.workflow.instance.modular.stat.demo.pojo.BaoxiaoStatResult;
import cn.stylefeng.workflow.instance.modular.stat.demo.service.DemoInstanceStatService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@ApiResource(name = "流程统计，报销统计的示例")
public class DemoStatController {

    @Resource
    private DemoInstanceStatService demoInstanceStatService;

    @GetResource(name = "获取报销流程的统计", path = "/instanceStat/demo/getBaoxiaoStat")
    public ResponseData<List<BaoxiaoStatResult>> getBaoxiaoStat(@RequestParam("days") Integer days) {
        return new SuccessResponseData<>(demoInstanceStatService.getBaoxiaoStat(days));
    }

}
