1
yangbin
2024-08-15 fc38e2635216775a80210d0df109dc6174d66813
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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);
    }
 
 
}