| | |
| | | package cc.mrbird.febs.ai.controller.productQuestion; |
| | | |
| | | import cc.mrbird.febs.ai.entity.AiProductPoint; |
| | | import cc.mrbird.febs.ai.entity.AiProductQuestion; |
| | | import cc.mrbird.febs.ai.req.AiProductQuestionAiDto; |
| | | import cc.mrbird.febs.ai.service.AiProductQuestionService; |
| | | import cc.mrbird.febs.common.annotation.ControllerEndpoint; |
| | | import cc.mrbird.febs.common.controller.BaseController; |
| | |
| | | |
| | | @GetMapping("list") |
| | | public FebsResponse list(AiProductQuestion dto, QueryRequest request) { |
| | | String companyId = getCurrentUserCompanyId(); |
| | | dto.setCompanyId(companyId); |
| | | |
| | | Map<String, Object> data = getDataTable(aiProductQuestionService.listInPage(dto, request)); |
| | | return new FebsResponse().success().data(data); |
| | |
| | | @ControllerEndpoint(operation = "新增", exceptionMessage = "操作失败") |
| | | public FebsResponse add(@RequestBody @Valid AiProductQuestion dto) { |
| | | |
| | | String companyId = getCurrentUserCompanyId(); |
| | | dto.setCompanyId(companyId); |
| | | return aiProductQuestionService.add(dto); |
| | | } |
| | | |
| | | @PostMapping("aiAdd") |
| | | @ControllerEndpoint(operation = "AI生成题目", exceptionMessage = "操作失败") |
| | | public FebsResponse aiAdd(@RequestBody @Valid AiProductQuestionAiDto dto) { |
| | | |
| | | String companyId = getCurrentUserCompanyId(); |
| | | dto.setCompanyId(companyId); |
| | | return aiProductQuestionService.aiAdd(dto); |
| | | } |
| | | |
| | | @PostMapping("update") |
| | |
| | | @GetMapping(value = "/questionTree") |
| | | public FebsResponse questionTree() { |
| | | |
| | | return new FebsResponse().success().data(aiProductQuestionService.questionTree()); |
| | | |
| | | String companyId = getCurrentUserCompanyId(); |
| | | return new FebsResponse().success().data(aiProductQuestionService.questionTree(companyId)); |
| | | } |
| | | } |