package cn.stylefeng.team.project.modular.filing.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.PostResource;
import cn.stylefeng.team.project.modular.filing.pojo.generateform.GenerateFormRequest;
import cn.stylefeng.team.project.modular.filing.service.FormAutoGenerateService;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@ApiResource(name = "表单自动生成接口")
public class FormAutoGenerateController {

    @Resource
    private FormAutoGenerateService formAutoGenerateService;

    @PostResource(name = "自动生成表单", path = "/formAutoGenerate/doGenerate")
    public ResponseData<?> doGenerate(@RequestBody @Validated GenerateFormRequest generateFormRequest) {
        formAutoGenerateService.autoGenerateForm(generateFormRequest);
        return new SuccessResponseData<>();
    }

}
