Files
schoolNews/schoolNewsServ/admin/src/main/resources/application.yml
2025-11-17 18:34:37 +08:00

217 lines
5.6 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

server:
port: 8081
servlet:
context-path: /schoolNewsServ
encoding:
charset: UTF-8
enabled: true
force: true
spring:
application:
name: school-news-admin
# 数据源配置
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/school_news?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true
username: root
password: 123456
hikari:
maximum-pool-size: 30
minimum-idle: 10
connection-timeout: 30000
idle-timeout: 600000
max-lifetime: 1800000
# Redis配置
data:
redis:
# Redis服务器地址
host: localhost
# Redis服务器端口
port: 6379
# Redis密码如果没有设置密码可以留空或注释掉
password: 123456
# Redis数据库索引0-15默认为0
database: 0
# 连接超时时间(毫秒)
timeout: 10000
# Lettuce连接池配置
lettuce:
pool:
# 连接池最大连接数
max-active: 50
# 连接池最大阻塞等待时间(负值表示没有限制)
max-wait: 3000
# 连接池中的最大空闲连接
max-idle: 20
# 连接池中的最小空闲连接
min-idle: 5
# 关闭超时时间
shutdown-timeout: 100ms
# 邮件配置
mail:
host: smtp.qq.com
port: 587
username: 3223905473@qq.com
password: xmdmxvtjumxocicc
default-encoding: UTF-8
properties:
mail:
smtp:
auth: true
starttls:
enable: true
required: true
# 短信服务配置(支持多种服务商)
sms:
# 是否启用短信服务true: 真实发送, false: 模拟模式)
# 开发环境建议设置为 false避免浪费短信费用
enabled: false
# 短信服务商aliyun: 阿里云, tencent: 腾讯云)
provider: aliyun
# AccessKey ID从服务商控制台获取
access-key-id: LTAI5t68do3qVXx5Rufugt3X
# AccessKey Secret从服务商控制台获取
access-key-secret: 2vD9ToIff49Vph4JQXsn0Cy8nXQfzA
# 短信签名名称(需要在服务商平台申请)
sign-name: 星洋智慧
# 验证码模板CODE需要在服务商平台申请
template-code: SMS_491985030
# 区域ID阿里云默认cn-hangzhou腾讯云默认ap-guangzhou
region-id: cn-hangzhou
endpoint: dysmsapi.aliyuncs.com
# 认证配置
school-news:
auth:
# JWT配置
jwt-secret: schoolNewsSecretKeyForJWT2025SecureEnough
jwt-expiration: 86400 # 24小时
# 安全配置
max-login-attempts: 5
lockout-duration: 30 # 锁定30分钟
# 免登录白名单
white-list:
- "/auth/login"
- "/auth/logout"
- "/auth/register"
- "/auth/captcha"
- "/auth/send-sms-code"
- "/auth/send-email-code"
- "/auth/health"
- "/actuator/**"
- "/swagger-ui/**"
- "/v3/api-docs/**"
- "/favicon.ico"
- "/error"
- "/public/**"
- "/static/**"
- "/file/download/**"
- "/ai/chat/stream/**"
crawler:
# Python 可执行文件路径Windows 建议指向 python.exe如已在 PATH可直接用 "python"
pythonPath: F:/Environment/Conda/envs/schoolNewsCrawler/python.exe
# 爬虫脚本根目录NewsCrawlerTask 的工作目录)
basePath: F:/Project/schoolNews/schoolNewsCrawler
crontab:
items: #可供前端选择的定时任务列表
- name: 人民日报新闻爬取
methods: #爬取方式
- name: 关键字搜索爬取
clazz: newsCrewerTask
excuete_method: execute
path: crawler/RmrbSearch.py
params:
- name: query
description: 搜索关键字
type: String
value: ""
- name: total
description: 总新闻数量
type: Integer
value: 10
- name: 排行榜爬取
clazz: newsCrewerTask
excuete_method: execute
path: crawler/RmrbHotPoint.py
- name: 往日精彩头条爬取
clazz: newsCrewerTask
excuete_method: execute
path: crawler/RmrbTrending.py
params:
- name: startDate
description: 开始日期
type: String
value: ""
- name: endDate
description: 结束日期
type: String
value: ""
- name: yesterday
description: 是否是昨天
type: Boolean
value: true
# dify
dify:
knowledgeApiKey: dataset-nupqKP4LONpzdXmGthIrbjeJ
# 文件存储配置
file:
storage:
storages:
- type: local
enabled: true
base-path: ../uploads
# MyBatis Plus配置
mybatis-plus:
# 实体类扫描包
type-aliases-package: org.xyzh.common.dto
# mapper xml文件位置
mapper-locations: classpath*:mapper/*.xml
# 全局配置
global-config:
db-config:
# 逻辑删除字段
logic-delete-field: deleted
logic-delete-value: 1
logic-not-delete-value: 0
# 字段填充策略
insert-strategy: not_null
update-strategy: not_null
select-strategy: not_empty
# SQL配置
configuration:
# 开启驼峰命名转换
map-underscore-to-camel-case: true
# 开启二级缓存
cache-enabled: true
# 打印SQL
log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl
# 日志配置
logging:
config: classpath:log4j2-spring.xml
charset:
console: UTF-8
file: UTF-8
# 管理端点配置
management:
endpoints:
web:
exposure:
include: health,info,metrics,env
endpoint:
health:
show-details: when-authorized
debug: true