将demo迁移到module模块中

pull/8091/head
JEECG 2025-04-07 14:09:17 +08:00
parent 4f2f1d6265
commit 9fd4c3b3d2
221 changed files with 119 additions and 636 deletions

View File

@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>jeecg-boot-parent</artifactId>
<artifactId>jeecg-boot-module</artifactId>
<groupId>org.jeecgframework.boot</groupId>
<version>3.7.4</version>
</parent>

View File

@ -0,0 +1,95 @@
package org.jeecg.modules.demo.gpt.controller;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.chatgpt.service.AiChatService;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
//update-begin---author:chenrui ---date:20240110 for[QQYUN-5509]AI生成表结构和软文------------
/**
* @Description: chatGpt
* @Author: chenrui
* @Date: 2024/1/9 16:30
*/
@Tag(name = "AI接口")
@RestController
@RequestMapping("/test/ai")
@Slf4j
public class AiController {
private static final String CACHE_PREFIX = "ai:resp:";
@Autowired
AiChatService aiChatService;
/**
* AI
* @param descr
* @return
* @author chenrui
* @date 2024/1/9 20:12
*/
@AutoLog(value = "通过AI生成模块表设计")
@PostMapping(value = "/gen/schema/modules")
@Operation(summary = "通过AI生成模块表设计")
public Result<String> genSchemaModules(@RequestParam(name = "prompt", required = true) String prompt) {
String result = aiChatService.genSchemaModules(prompt);
return Result.ok(result);
}
/**
* AI
* @param descr
* @return
* @author chenrui
* @date 2024/1/9 20:12
*/
@AutoLog(value = "通过AI生成软文")
@PostMapping(value = "/gen/article")
@Operation(summary = "通过AI生成软文")
public Result<String> genArticle(@RequestParam(name = "prompt", required = true) String prompt) {
String result = aiChatService.genArticleWithMd(prompt);
return Result.ok(result);
}
/**
* AI
* @param message
* @return
* @author chenrui
* @date 2024/1/15 19:11
*/
@AutoLog(value = "向AI提问")
@PostMapping(value = "/completions")
@Operation(summary = "向AI提问")
public Result<?> completions(@RequestParam(name = "message", required = true) String message) {
String result = aiChatService.completions(message);
return Result.ok(result);
}
/**
* AI
* @param prompt
* @return
* @author chenrui
* @date 2024/1/15 19:11
*/
@AutoLog(value = "让AI生成图片")
@PostMapping(value = "/gen/image")
@Operation(summary = "让AI生成图片")
public Result<?> genImage(@RequestParam(name = "prompt", required = true) String prompt) {
String result = aiChatService.imageGenerate(prompt);
return Result.ok(result);
}
}
//update-end---author:chenrui ---date:20240110 for//update-begin---author:chenrui ---date:20240110 for[QQYUN-5509]AI生成表结构和软文------------------------

Some files were not shown because too many files have changed in this diff Show More