185 lines
4.3 KiB
YAML
185 lines
4.3 KiB
YAML
|
|
server:
|
||
|
|
port: 8081
|
||
|
|
servlet:
|
||
|
|
context-path: /schoolNewsServ
|
||
|
|
encoding:
|
||
|
|
charset: UTF-8
|
||
|
|
enabled: true
|
||
|
|
force: true
|
||
|
|
spring:
|
||
|
|
application:
|
||
|
|
name: school-news-admin
|
||
|
|
|
||
|
|
# 数据源配置 - Docker环境
|
||
|
|
datasource:
|
||
|
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||
|
|
url: jdbc:mysql://${MYSQL_HOST:mysql}:${MYSQL_PORT:3306}/${MYSQL_DATABASE:school_news}?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true
|
||
|
|
username: ${MYSQL_USER:root}
|
||
|
|
password: ${MYSQL_PASSWORD:123456}
|
||
|
|
hikari:
|
||
|
|
maximum-pool-size: 30
|
||
|
|
minimum-idle: 10
|
||
|
|
connection-timeout: 30000
|
||
|
|
idle-timeout: 600000
|
||
|
|
max-lifetime: 1800000
|
||
|
|
|
||
|
|
# Redis配置 - Docker环境
|
||
|
|
data:
|
||
|
|
redis:
|
||
|
|
host: ${REDIS_HOST:redis}
|
||
|
|
port: ${REDIS_PORT:6379}
|
||
|
|
password: ${REDIS_PASSWORD:123456}
|
||
|
|
database: 0
|
||
|
|
timeout: 10000
|
||
|
|
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:
|
||
|
|
enabled: false
|
||
|
|
provider: aliyun
|
||
|
|
access-key-id: LTAI5t68do3qVXx5Rufugt3X
|
||
|
|
access-key-secret: 2vD9ToIff49Vph4JQXsn0Cy8nXQfzA
|
||
|
|
sign-name: 星洋智慧
|
||
|
|
template-code: SMS_491985030
|
||
|
|
region-id: cn-hangzhou
|
||
|
|
endpoint: dysmsapi.aliyuncs.com
|
||
|
|
|
||
|
|
# 认证配置
|
||
|
|
school-news:
|
||
|
|
auth:
|
||
|
|
jwt-secret: schoolNewsSecretKeyForJWT2025SecureEnough
|
||
|
|
jwt-expiration: 86400
|
||
|
|
max-login-attempts: 5
|
||
|
|
lockout-duration: 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/**"
|
||
|
|
|
||
|
|
# 爬虫配置 - Docker环境
|
||
|
|
crawler:
|
||
|
|
# 容器内Python路径
|
||
|
|
pythonPath: /usr/bin/python3
|
||
|
|
# 容器内爬虫脚本根目录
|
||
|
|
basePath: /app/crawler
|
||
|
|
|
||
|
|
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: /app/uploads
|
||
|
|
|
||
|
|
# MyBatis Plus配置
|
||
|
|
mybatis-plus:
|
||
|
|
type-aliases-package: org.xyzh.common.dto
|
||
|
|
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
|
||
|
|
configuration:
|
||
|
|
map-underscore-to-camel-case: true
|
||
|
|
cache-enabled: true
|
||
|
|
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: false
|