package cn.stylefeng.workflow.instance.modular.export.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.export.service.InstanceExportService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@ApiResource(name = "流程实例导出excel")
public class InstanceExportController {

    @Resource
    private InstanceExportService instanceExportService;

    @GetResource(name = "流程实例导出excel", path = "/runtimeInstance/exportExcel")
    public ResponseData<?> exportExcel(@RequestParam("instanceId") Long instanceId) {
        instanceExportService.exportInstance(instanceId);
        return new SuccessResponseData<>();
    }

}
