diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index c6670944..6f8e7770 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -1,36 +1,31 @@ server: port: 8000 -# 数据库类型:用于 MyBatis-Plus 分页方言等(仅方言,不负责连接信息) -app: - db-type: mysql # 可选:mysql | postgres | dm - spring: datasource: type: com.alibaba.druid.pool.DruidDataSource - # === MySQL 数据源(默认启用) === - driver-class-name: com.mysql.cj.jdbc.Driver + driver-class-name: com.mysql.cj.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 url: jdbc:mysql://www.youlai.tech:3306/youlai_admin?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true&allowMultiQueries=true username: youlai password: 123456 - # === PostgreSQL 数据源示例(按需启用) === - # driver-class-name: org.postgresql.Driver - # url: jdbc:postgresql://127.0.0.1:5432/youlai_admin - # username: postgres - # password: 123456 + ai: + openai: + api-key: ${QWEN_API_KEY:sk-c2941d05bf2f411ca80424fcd1eb4e07} + base-url: https://dashscope.aliyuncs.com/compatible-mode + chat: + enabled: true + options: + model: qwen-plus + temperature: 0.7 + response-format: + type: json_object - # === 达梦 DM 数据源示例(按需启用,注意按实际驱动与 URL 调整) === - # driver-class-name: dm.jdbc.driver.DmDriver - # url: jdbc:dm://127.0.0.1:5236?schema=YOULAI_ADMIN - # username: SYSDBA - # password: 123456 data: redis: - database: 0 + database: 11 host: www.youlai.tech port: 6379 - # 如果Redis 服务未设置密码,需要将password删掉或注释,而不是设置为空字符串 password: 123456 timeout: 10s lettuce: @@ -68,31 +63,6 @@ spring: enable: true # 邮件发送者 from: youlaitech@163.com - # Spring AI 配置 - ai: - openai: - # API Key - api-key: ${DASHSCOPE_API_KEY:sk-c2941d05bf2f411ca80424fcd1eb4e07} - - # Base URL - base-url: https://dashscope.aliyuncs.com/compatible-mode - - # Chat 模型配置 - chat: - enabled: true - options: - # 模型名称(qwen-plus、qwen-turbo、qwen-max、qwen-long) - model: qwen-plus - - # Temperature(0.0-1.0,值越高回答越随机) - temperature: 0.7 - - # JSON 输出格式(确保模型返回合法 JSON) - response-format: - type: json_object - - - mybatis-plus: mapper-locations: classpath*:/mapper/**/*.xml global-config: @@ -114,22 +84,21 @@ mybatis-plus: # 安全配置 security: session: - type: jwt # 会话方式 jwt/redis-token - access-token-time-to-live: 7200 # 访问令牌 有效期(单位:秒),默认 2 小时,-1 表示永不过期 - refresh-token-time-to-live: 604800 # 刷新令牌有效期(单位:秒),默认 7 天,-1 表示永不过期 + type: jwt # 会话方式 [jwt|redis-token] + access-token-time-to-live: 7200 # 访问令牌 有效期(单位:秒),默认 2 小时,-1 表示永不过期 + refresh-token-time-to-live: 604800 # 刷新令牌有效期(单位:秒),默认 7 天,-1 表示永不过期 jwt: secret-key: SecretKey012345678901234567890123456789012345678901234567890123456789 # JWT密钥(HS256算法至少32字符) redis-token: allow-multi-login: true # 是否允许多设备登录 # 安全白名单路径,仅跳过 AuthorizationFilter 过滤器,还是会走 Spring Security 的其他过滤器(CSRF、CORS等) ignore-urls: - - /api/v1/auth/login/** # 登录接口(账号密码登录、手机验证码登录和微信登录) - - /api/v1/auth/captcha # 验证码获取接口 - - /api/v1/auth/refresh-token # 刷新令牌接口 - - /api/v1/auth/logout # 开放退出登录 - - /api/v1/auth/wx/miniapp/code-login # 微信小程序code登陆 - - /ws/** # WebSocket接口 - # 非安全端点路径,完全绕过 Spring Security 的安全控制 + - /api/v1/auth/login/** # 登录接口(账号密码登录、手机验证码登录和微信登录) + - /api/v1/auth/captcha # 验证码获取接口 + - /api/v1/auth/refresh-token # 刷新令牌接口 + - //api/v1/auth/wx/miniapp/code-login # 微信小程序code登陆 + - /ws/** # WebSocket接口 + # 非安全端点路径,完全绕过 Spring Security 的过滤器 unsecured-urls: - ${springdoc.swagger-ui.path} - /doc.html @@ -140,25 +109,25 @@ security: # 文件存储配置 oss: - # OSS 类型 (目前支持aliyun、minio、local) + # OSS 类型 (目前支持aliyun、minio) type: minio # MinIO 对象存储服务 minio: - # MinIO 服务地址 - endpoint: http://localhost:9000 + # 服务Endpoint + endpoint: http://111.229.83.153:9000 # 访问凭据 access-key: minioadmin # 凭据密钥 - secret-key: minioadmin + secret-key: Youlai@2025 # 存储桶名称 - bucket-name: youlai - # (可选) 自定义域名:配置后,文件 URL 会使用该域名格式 - custom-domain: + bucket-name: public + # (可选)自定义域名,如果配置了域名,生成的文件URL是域名格式,未配置则URL则是IP格式 (eg: https://www.youlai.tech/storage) + custom-domain: https://www.youlai.tech/storage # 阿里云OSS对象存储服务 aliyun: # 服务Endpoint endpoint: oss-cn-hangzhou.aliyuncs.com - # 访问凭据` + # 访问凭据 access-key-id: your-access-key-id # 凭据密钥 access-key-secret: your-access-key-secret @@ -185,50 +154,48 @@ sms: # 修改手机号短信验证码模板 change-mobile: SMS_22xxx773 -# springdoc配置: https://springdoc.org/properties.html +# springdoc 配置文档: https://springdoc.org/properties.html springdoc: swagger-ui: - path: /swagger-ui.html - operations-sorter: alpha - tags-sorter: alpha + path: /swagger-ui.html # Swagger UI 访问路径 + operationsSorter: alpha # 接口按方法名排序 + tags-sorter: alpha # 标签按字母排序 api-docs: - path: /v3/api-docs - group-configs: - - group: "系统管理" - paths-to-match: "/**" - packages-to-scan: + path: /v3/api-docs # OpenAPI JSON 地址 + group-configs: # 分组配置 + - group: '系统管理' # 分组名称 + paths-to-match: "/**" # 匹配的请求路径 + packages-to-scan: # 扫描的 Controller 包,限制只生成指定包的接口文档 - com.youlai.boot.auth.controller - com.youlai.boot.system.controller - com.youlai.boot.platform.file.controller - com.youlai.boot.platform.codegen.controller - default-flat-param-object: true + default-flat-param-object: true # 将对象参数扁平化显示在文档中 -# knife4j 接口文档配置 +# knife4j 配置 knife4j: - # 是否开启 Knife4j 增强功能 - enable: true # 设置为 true 表示开启增强功能 - # 生产环境配置 - production: false # 设置为 true 表示在生产环境中不显示文档,为 false 表示显示文档(通常在开发环境中使用) + enable: true # 是否启用 Knife4j 增强功能 + production: false # 是否启用生产环境保护(true=生产环境隐藏文档,false=开发环境可访问) setting: language: zh_cn + # xxl-job 定时任务配置 xxl: job: # 定时任务开关 enabled: false admin: - # 调度中心地址,多个逗号分隔 - addresses: http://127.0.0.1:8080/xxl-job-admin + # 多个地址使用,分割 + addresses: http://127.0.0.1:8686/xxl-job-admin accessToken: default_token - # 执行器配置 executor: - appname: xxl-job-executor-${spring.application.name} # 执行器AppName - address: # 执行器注册地址,默认为空,多网卡时可手动设置 - ip: # 执行器IP,默认为空,多网卡时可手动设置 - port: 9999 # 执行器通讯端口 - logpath: /data/applogs/xxl-job/jobhandler # 任务运行日志文件存储磁盘路径 - logretentiondays: 30 # 日志保存天数,值大于3时生效 + appname: xxl-job-executor-${spring.application.name} + address: + ip: + port: 9999 + logpath: /data/applogs/xxl-job/jobhandler + logretentiondays: 30 # 验证码配置 captcha: @@ -263,4 +230,5 @@ captcha: wx: miniapp: app-id: xxxxxx - app-secret: xxxxxx \ No newline at end of file + app-secret: xxxxxx + diff --git a/src/main/resources/mapper/ai/AiAssistantRecordMapper.xml b/src/main/resources/mapper/ai/AiAssistantRecordMapper.xml index eae36156..77a96cd8 100644 --- a/src/main/resources/mapper/ai/AiAssistantRecordMapper.xml +++ b/src/main/resources/mapper/ai/AiAssistantRecordMapper.xml @@ -4,7 +4,7 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + diff --git a/src/main/resources/mapper/codegen/DatabaseMapper.xml b/src/main/resources/mapper/codegen/DatabaseMapper.xml index 7771dfd2..0e402a8d 100644 --- a/src/main/resources/mapper/codegen/DatabaseMapper.xml +++ b/src/main/resources/mapper/codegen/DatabaseMapper.xml @@ -6,7 +6,7 @@ - SELECT t1.TABLE_NAME , t1.TABLE_COMMENT , @@ -34,7 +34,7 @@ CREATE_TIME DESC - SELECT t1.TABLE_NAME , c.COMMENTS AS TABLE_COMMENT , diff --git a/src/main/resources/mapper/system/DictItemMapper.xml b/src/main/resources/mapper/system/DictItemMapper.xml index 7c76c7ce..ab6cfec2 100644 --- a/src/main/resources/mapper/system/DictItemMapper.xml +++ b/src/main/resources/mapper/system/DictItemMapper.xml @@ -5,7 +5,7 @@ - SELECT id, dict_code, diff --git a/src/main/resources/mapper/system/DictMapper.xml b/src/main/resources/mapper/system/DictMapper.xml index 1624b764..670694b4 100644 --- a/src/main/resources/mapper/system/DictMapper.xml +++ b/src/main/resources/mapper/system/DictMapper.xml @@ -4,7 +4,7 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - SELECT t1.id, t1.name, diff --git a/src/main/resources/mapper/system/LogMapper.xml b/src/main/resources/mapper/system/LogMapper.xml index e542abaa..3099ba0d 100644 --- a/src/main/resources/mapper/system/LogMapper.xml +++ b/src/main/resources/mapper/system/LogMapper.xml @@ -6,7 +6,7 @@ - SELECT t1.id, t1.module, @@ -48,7 +48,7 @@ t1.create_time DESC - SELECT t1.id, t1.module, @@ -91,7 +91,7 @@ - SELECT COUNT(1) AS count, DATE_FORMAT(create_time,'%Y-%m-%d') AS date @@ -105,7 +105,7 @@ - SELECT COUNT(DISTINCT ip) AS count, DATE_FORMAT(create_time, '%Y-%m-%d') AS date @@ -119,7 +119,7 @@ - SELECT COUNT(CASE WHEN DATE(create_time) = CURDATE() THEN 1 END) AS todayCount, COUNT(*) AS totalCount, @@ -138,7 +138,7 @@ is_deleted = 0 - SELECT COUNT(CASE WHEN TRUNC(create_time) = TRUNC(SYSDATE) THEN 1 END) AS todayCount, COUNT(*) AS totalCount, @@ -161,7 +161,7 @@ - SELECT COUNT(DISTINCT CASE WHEN DATE(create_time) = CURDATE() THEN ip END) AS todayCount, COUNT(DISTINCT ip) AS totalCount, @@ -180,7 +180,7 @@ is_deleted = 0 - SELECT COUNT(DISTINCT CASE WHEN TRUNC(create_time) = TRUNC(SYSDATE) THEN ip END) AS todayCount, COUNT(DISTINCT ip) AS totalCount, ROUND( diff --git a/src/main/resources/mapper/system/NoticeMapper.xml b/src/main/resources/mapper/system/NoticeMapper.xml index 1dcc97ec..3e25389f 100644 --- a/src/main/resources/mapper/system/NoticeMapper.xml +++ b/src/main/resources/mapper/system/NoticeMapper.xml @@ -3,7 +3,7 @@ - SELECT t1.id, t1.title, @@ -42,7 +42,7 @@ - SELECT t1.id, t1.title, diff --git a/src/main/resources/mapper/system/RoleMenuMapper.xml b/src/main/resources/mapper/system/RoleMenuMapper.xml index 31b59157..75403b12 100644 --- a/src/main/resources/mapper/system/RoleMenuMapper.xml +++ b/src/main/resources/mapper/system/RoleMenuMapper.xml @@ -16,7 +16,7 @@ - + diff --git a/src/main/resources/mapper/system/UserMapper.xml b/src/main/resources/mapper/system/UserMapper.xml index 49efb882..2f15b75e 100644 --- a/src/main/resources/mapper/system/UserMapper.xml +++ b/src/main/resources/mapper/system/UserMapper.xml @@ -6,7 +6,7 @@ - SELECT u.id, u.username, @@ -82,7 +82,7 @@ - SELECT u.id, u.username, @@ -261,7 +261,7 @@ - SELECT u.username, u.nickname, @@ -302,7 +302,7 @@ - SELECT u.id, u.username, @@ -324,7 +324,7 @@ u.id = #{userId} AND u.is_deleted = 0 - SELECT u.id, u.username, diff --git a/src/main/resources/mapper/system/UserNoticeMapper.xml b/src/main/resources/mapper/system/UserNoticeMapper.xml index 5153ac49..c3364cb0 100644 --- a/src/main/resources/mapper/system/UserNoticeMapper.xml +++ b/src/main/resources/mapper/system/UserNoticeMapper.xml @@ -3,7 +3,7 @@ - SELECT t2.id, t2.title, diff --git a/src/main/resources/templates/codegen/mapper.xml.vm b/src/main/resources/templates/codegen/mapper.xml.vm index 30d0cc95..f690e0ee 100644 --- a/src/main/resources/templates/codegen/mapper.xml.vm +++ b/src/main/resources/templates/codegen/mapper.xml.vm @@ -3,7 +3,7 @@ - SELECT #if($fieldConfigs) #set ($fields = []) diff --git a/src/test/resources/templates/mapper.xml.vm b/src/test/resources/templates/mapper.xml.vm index 073b1a5b..c1e3ebd2 100644 --- a/src/test/resources/templates/mapper.xml.vm +++ b/src/test/resources/templates/mapper.xml.vm @@ -38,7 +38,7 @@ #end - SELECT FROM