diff --git a/prompto-lab-app/pom.xml b/prompto-lab-app/pom.xml index 99bd24b..43abca9 100644 --- a/prompto-lab-app/pom.xml +++ b/prompto-lab-app/pom.xml @@ -1,20 +1,136 @@ - + 4.0.0 - io.github.timemachinelab - PromptoLab - 0.0.1-SNAPSHOT + org.springframework.boot + spring-boot-starter-parent + 2.7.18 + - - prompto-lab-app - + io.github.timemachinelab + Promptolab + 0.0.1-SNAPSHOT + Promptolab + 提示词工程 - 17 - 17 - UTF-8 + 17 + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-webflux + + + org.projectlombok + lombok + + + org.springframework.boot + spring-boot-starter-data-jpa + + + org.springframework.boot + spring-boot-starter-validation + + + org.postgresql + postgresql + runtime + + + org.springframework.boot + spring-boot-starter-test + test + + + com.fasterxml.jackson.core + jackson-databind + + + com.vladmihalcea + hibernate-types-55 + 2.16.3 + + + + dev.langchain4j + langchain4j + 0.29.1 + + + dev.langchain4j + langchain4j-open-ai + 0.29.1 + + + + org.springframework.boot + spring-boot-starter-data-redis + + + org.apache.commons + commons-pool2 + + + + com.github.spullara.mustache.java + compiler + 0.9.10 + + + + cn.hutool + hutool-core + 5.8.25 + + + + org.springframework.boot + spring-boot-starter-mail + + + + + cn.dev33 + sa-token-spring-boot-starter + 1.35.0.RC + + + + cn.dev33 + sa-token-redis-jackson + 1.35.0.RC + + + + commons-codec + commons-codec + + + + com.github.ulisesbocchio + jasypt-spring-boot-starter + 3.0.3 + + + + com.alibaba + fastjson + 2.0.57 + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + \ No newline at end of file diff --git a/prompto-lab-app/src/main/java/io/github/timemachinelab/Main.java b/prompto-lab-app/src/main/java/io/github/timemachinelab/Main.java deleted file mode 100644 index 515ca47..0000000 --- a/prompto-lab-app/src/main/java/io/github/timemachinelab/Main.java +++ /dev/null @@ -1,17 +0,0 @@ -package io.github.timemachinelab; - -//TIP To Run code, press or -// click the icon in the gutter. -public class Main { - public static void main(String[] args) { - //TIP Press with your caret at the highlighted text - // to see how IntelliJ IDEA suggests fixing it. - System.out.printf("Hello and welcome!"); - - for (int i = 1; i <= 5; i++) { - //TIP Press to start debugging your code. We have set one breakpoint - // for you, but you can always add more by pressing . - System.out.println("i = " + i); - } - } -} \ No newline at end of file diff --git a/prompto-lab-app/src/main/java/io/github/timemachinelab/PromptolabApplication.java b/prompto-lab-app/src/main/java/io/github/timemachinelab/PromptolabApplication.java new file mode 100644 index 0000000..03811ac --- /dev/null +++ b/prompto-lab-app/src/main/java/io/github/timemachinelab/PromptolabApplication.java @@ -0,0 +1,11 @@ +package io.github.timemachinelab; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class PromptolabApplication { + public static void main(String[] args) { + SpringApplication.run(PromptolabApplication.class, args); + } +} \ No newline at end of file diff --git a/prompto-lab-app/src/main/resources/application.yml b/prompto-lab-app/src/main/resources/application.yml new file mode 100644 index 0000000..efa95ae --- /dev/null +++ b/prompto-lab-app/src/main/resources/application.yml @@ -0,0 +1,51 @@ +server: + port: 8080 + +spring: + application: + name: poet-agent + datasource: + url: ${SPRING_DATASOURCE_URL:jdbc:postgresql://117.72.211.46:5432/promptolab} + username: ${SPRING_DATASOURCE_USERNAME:root} + password: ${SPRING_DATASOURCE_PASSWORD:tmlis666} + driver-class-name: ${SPRING_DATASOURCE_DRIVER_CLASS_NAME:org.postgresql.Driver} + hikari: + # 连接最大生命周期(毫秒),设置为比数据库超时时间短 + max-lifetime: 900000 # 15分钟(从30分钟减少到15分钟) + # 连接空闲超时时间 + idle-timeout: 300000 # 5分钟(从10分钟减少到5分钟) + # 连接验证超时时间 + validation-timeout: 3000 # 3秒(从5秒减少到3秒) + # 连接测试查询 + connection-test-query: SELECT 1 + # 连接池最小空闲连接数 + minimum-idle: 2 # 从5减少到2 + # 连接池最大连接数 + maximum-pool-size: 10 # 从20减少到10 + # 获取连接超时时间 + connection-timeout: 20000 # 20秒(从30秒减少到20秒) + # 是否自动提交 + auto-commit: true + # 新增:连接泄漏检测时间(毫秒) + leak-detection-threshold: 60000 # 60秒 + # 新增:是否在获取连接时验证连接 + connection-init-sql: SELECT 1 + # 新增:连接池名称,便于监控 + pool-name: HikariCP-PoetAgent + jpa: + hibernate: + ddl-auto: update + show-sql: true + properties: + hibernate: + dialect: org.hibernate.dialect.PostgreSQLDialect + format_sql: true + open-in-view: false +ai: + # 持久化配置 + persistence: + data-dir: ${AI_PERSISTENCE_DATA_DIR:classpath:ai-config} + backup-dir: ${AI_PERSISTENCE_BACKUP_DIR:./data/ai-config/backups} + auto-backup: ${AI_PERSISTENCE_AUTO_BACKUP:true} + backup-retention-days: ${AI_PERSISTENCE_BACKUP_RETENTION_DAYS:30} +