From 2166c1a14f9629aa49a5f3bb849ce878df4c4892 Mon Sep 17 00:00:00 2001 From: yangbin <yangbin@qq.com> Date: 星期三, 28 八月 2024 17:23:25 +0800 Subject: [PATCH] 2 --- lxzn-module-ai/src/main/java/org/jeecg/modules/ai/controller/FilePdfInfoController.java | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 59 insertions(+), 0 deletions(-) diff --git a/lxzn-module-ai/src/main/java/org/jeecg/modules/ai/controller/FilePdfInfoController.java b/lxzn-module-ai/src/main/java/org/jeecg/modules/ai/controller/FilePdfInfoController.java new file mode 100644 index 0000000..cd3643a --- /dev/null +++ b/lxzn-module-ai/src/main/java/org/jeecg/modules/ai/controller/FilePdfInfoController.java @@ -0,0 +1,59 @@ +package org.jeecg.modules.ai.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.aspect.annotation.AutoLog; +import org.jeecg.common.system.base.controller.JeecgController; +import org.jeecg.modules.ai.entity.FileImgInfo; +import org.jeecg.modules.ai.entity.FilePdfInfo; +import org.jeecg.modules.ai.service.IFilePdfInfoService; +import org.jeecg.modules.ai.vo.FilePdfSelectVo; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * @author clown + * * @date 2024/8/7 + */ +@Slf4j +@Api(tags = "PDF鏂囦欢绠$悊") +@RestController +@RequestMapping("/ai/filePdf") +public class FilePdfInfoController extends JeecgController<FilePdfInfo, IFilePdfInfoService> { + + @AutoLog(value = "PDF鏂囦欢绠$悊-妫�绱㈡煡璇�") + @ApiOperation(value = "PDF鏂囦欢绠$悊-妫�绱㈡煡璇�", notes = "PDF鏂囦欢绠$悊-妫�绱㈡煡璇�") + @PutMapping(value = "/findImgList") + public Result<?> findImgPathList(@RequestBody FilePdfSelectVo vo) { + List<FileImgInfo> infos = service.findImgPathList(vo); + /*Thread.sleep();*/ + return Result.OK(infos); + } + + /* @AutoLog(value = "aiTest") + @ApiOperation(value = "aiTest", notes = "aiTest")*/ + @GetMapping(value = "/aiTest") + public Result<?> aiTest(String nameList) { + /* String name = "{\"id\":\"683a65fd-8feb-4446-ad32-714c4785f667\",\"messages\":[{\"role\":\"user\",\"content\":\"缁欐垜璁蹭釜鏁呬簨锛焅"}],\"stream\":true,\"max_tokens\":500}"; // JSON鏁版嵁 + String url = "https://836u458t54.vicp.fun/chat/test_chat"; + String aiPost = AiTestUils.sendJsonToHttpsPost(url, name);*/ + + String s = "\"data\": {\"id\": \"683a65fd-8feb-4446-ad32-714c4785f667\", \"created\": 1723105518, \"model\": \"YxCareer0.7\", \"choices\": [{\"index\": 0, \"delta\": {\"role\": \"assistant\", \"content\": \"\"}, \"finish_reason\": null}]}"; + System.out.println(s.replace("data:" ,"")); + return Result.OK(""); + } + + + @AutoLog(value = "PDF鏂囦欢鍒楄〃") + @ApiOperation(value = "PDF鏂囦欢鍒楄〃", notes = "PDF鏂囦欢鍒楄〃") + @GetMapping(value = "/filePdfList") + public Result<?> aiFindFiles() { + List<FilePdfInfo> infos = service.list(); + return Result.OK(infos); + } + + +} -- Gitblit v1.9.3