5 小时以前 9bad721754fe8bbe2e5f459d0706e0fefac569f3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package cn.iocoder.yudao.module.qcreport.controller.admin.aiimport;
 
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.qcreport.controller.admin.aiimport.vo.QcReportAiDraftReqVO;
import cn.iocoder.yudao.module.qcreport.controller.admin.aiimport.vo.QcReportAiDraftRespVO;
import cn.iocoder.yudao.module.qcreport.service.aiimport.QcReportAiImportService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
 
/**
 * 智能质检报告 AI 导入 Controller。
 * <p>
 * 只有一个端点,且<b>不接收文件</b>:文件先由前端传到 system 模块拿到 blobId,再连同组件清单一起提交。
 * 业务模块自建上传通道会绕开统一的存储配置与附件归属(见 file-upload.md),
 * 所以这里连 {@code MultipartFile} 都不出现在签名里。
 */
@Tag(name = "管理后台 - 智能质检报告 AI 导入")
@RestController
@RequestMapping("/qc-report/ai-import")
@Validated
public class QcReportAiImportController {
 
    @Resource
    private QcReportAiImportService aiImportService;
 
    @PostMapping("/draft")
    @Operation(summary = "识别文件生成模板草稿",
            description = "同步返回,不落库。识别出的只是草稿,需在设计器人工确认后由「保存」落为正式版本")
    @PreAuthorize("@ss.hasPermission('qc-report:template:ai-import')")
    public CommonResult<QcReportAiDraftRespVO> generateDraft(@Valid @RequestBody QcReportAiDraftReqVO reqVO) {
        return success(aiImportService.generateDraft(reqVO));
    }
 
}