feat: 初始化音乐项目后台管理系统- 新增后台管理相关页面和功能组件

- 实现管理员评论管理、数据统计等功能
- 添加后台布局和路由管理
-配置数据库和Redis连接
- 实现文件上传和访问路径配置
- 添加Sa-Token安全配置
This commit is contained in:
ikmkj
2025-04-26 19:32:45 +08:00
commit b275ffab5a
185 changed files with 32763 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
spring.application.name=music-houduan
server.port=8085
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/music_db?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai
spring.datasource.username=root
spring.datasource.password=123456
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true
spring.data.redis.host=127.0.0.1
spring.data.redis.port=6379
spring.data.redis.password=123456
sa-token.token-name=satoken
sa-token.timeout=2592000
sa-token.is-concurrent=true
sa-token.is-share=true
sa-token.token-style=uuid
# 文件上传配置
file.upload-path=C:/it/music-houduan/upload/
file.access-path=/upload/
file.allowed-types=jpg,jpeg,png,gif,mp3,wav,lrc,txt

View File

@@ -0,0 +1,141 @@
server:
port: 8085
servlet:
context-path: /
tomcat:
max-http-form-post-size: 100MB
spring:
application:
name: music-houduan
# 数据库配置
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/music_db?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=Asia/Shanghai
username: root
password: 123456
hikari:
minimum-idle: 5
maximum-pool-size: 20
idle-timeout: 30000
max-lifetime: 1800000
connection-timeout: 30000
# JPA配置
jpa:
database-platform: org.hibernate.dialect.MySQL8Dialect
hibernate:
ddl-auto: update
show-sql: false
properties:
hibernate:
format_sql: false
# Redis配置
redis:
host: 127.0.0.1
port: 6379
password: 123456
database: 0
timeout: 10000
lettuce:
pool:
max-active: 8
max-wait: -1
max-idle: 8
min-idle: 0
# 文件上传配置
servlet:
multipart:
enabled: true
max-file-size: 100MB
max-request-size: 100MB
# Jackson配置
jackson:
date-format: yyyy-MM-dd HH:mm:ss
time-zone: GMT+8
serialization:
write-dates-as-timestamps: false
# Sa-Token配置
sa-token:
# token名称 (同时也是cookie名称)
token-name: satoken
# token有效期单位s 默认30天, -1代表永不过期
timeout: 2592000
# token临时有效期 (指定时间内无操作就过期) 单位: 秒
active-timeout: -1
# 是否允许同一账号并发登录 (为true时允许一起登录, 为false时新登录挤掉旧登录)
is-concurrent: true
# 在多人登录同一账号时是否共用一个token (为true时所有登录共用一个token, 为false时每次登录新建一个token)
is-share: false
# token风格
token-style: uuid
# 是否输出操作日志
is-log: true
# 是否从cookie中读取token
is-read-cookie: true
# 是否从请求头中读取token
is-read-header: true
# 是否从请求体里读取token
is-read-body: false
# 是否在初始化配置时打印版本字符画
is-print: false
# 文件上传配置
file:
# 上传路径
upload-path: upload/
# 访问路径
access-path: /upload/
# 允许的文件类型
allowed-types: jpg,jpeg,png,gif,mp3,wav,lrc,txt
# 日志配置
logging:
level:
root: info
com.test.musichouduan: debug
cn.dev33.satoken: debug
org.hibernate: warn
org.hibernate.SQL: off
org.hibernate.type.descriptor.sql: off
org.springframework: warn
file:
name: logs/music-houduan.log
# Knife4j配置
knife4j:
enable: true
setting:
language: zh_cn
enable-swagger-models: true
enable-document-manage: true
swagger-model-name: 数据模型
enable-version: true
enable-footer: false
enable-footer-custom: true
footer-custom-content: 音乐应用API文档
documents:
- group: 默认
name: 项目介绍
locations: classpath:markdown/*
production: false
# Swagger配置
springdoc:
swagger-ui:
path: /swagger-ui/index.html
tags-sorter: alpha
operations-sorter: alpha
disable-swagger-default-url: true
display-request-duration: true
api-docs:
path: /v3/api-docs
group-configs:
- group: '默认'
paths-to-match: '/**'
default-flat-param-object: true