feat: 增加通知系统、RabbitMQ集成及Docker一键部署脚本
All checks were successful
test/timeline-server/pipeline/head This commit looks good

1. 新增通知中心功能,支持好友请求、评论、点赞等多种通知类型的持久化与推送
2. 集成 RabbitMQ 用于异步处理动态日志,解耦动态服务与日志记录逻辑
3. 提供完整的 Docker Compose 部署方案及一键启动/停止脚本(Shell/Bat)
4. 优化文件服务,增加图片上传时的自动压缩处理以节省存储空间
5. 增强动态服务,支持通过 shareId 公开访问动态项及关键词搜索功能
6. 完善代码健壮性,在关键业务 Service 层增加 @Transactional 事务控制
This commit is contained in:
2026-02-11 14:28:27 +08:00
parent 35f3959474
commit 482c32a59c
77 changed files with 2396 additions and 646 deletions

View File

@@ -0,0 +1,154 @@
{
"version": "29",
"credential": {
"accessKey": "minioadmin",
"secretKey": "WoCloud@9ol7uj"
},
"region": "us-east-1",
"browser": "on",
"worm": "off",
"storageclass": {
"standard": "",
"rrs": ""
},
"cache": {
"drives": [],
"expiry": 90,
"maxuse": 80,
"exclude": []
},
"kms": {
"vault": {
"endpoint": "",
"auth": {
"type": "",
"approle": {
"id": "",
"secret": ""
}
},
"tls": {
"ciphers": [],
"insecure": true,
"certs": {
"public": "",
"private": "",
"ca": ""
}
}
},
"kes": {
"endpoint": "",
"key-name": "",
"certs": {
"public": "",
"private": "",
"ca": ""
},
"tls": {
"ciphers": [],
"insecure": true
}
}
},
"notify": {
"amqp": {
"1": {
"enable": false,
"url": "",
"exchange": "",
"routingKey": "",
"exchangeType": "",
"deliveryMode": 0,
"mandatory": false,
"immediate": false,
"durable": false,
"internal": false,
"noWait": false,
"autoDeleted": false
}
},
"elasticsearch": {
"1": {
"enable": false,
"format": "",
"url": "",
"index": ""
}
},
"kafka": {
"1": {
"enable": false,
"brokers": null,
"topic": ""
}
},
"mqtt": {
"1": {
"enable": false,
"broker": "",
"topic": "",
"qos": 0,
"clientId": "",
"username": "",
"password": "",
"reconnectInterval": 0,
"keepAliveInterval": 0
}
},
"mysql": {
"1": {
"enable": false,
"format": "",
"dsnString": "",
"table": "",
"host": "",
"port": "",
"user": "",
"password": "",
"database": ""
}
},
"nats": {
"1": {
"enable": false,
"address": "",
"subject": "",
"username": "",
"password": "",
"token": "",
"secure": false,
"pingInterval": 0,
"streaming": {
"enable": false,
"clusterID": "",
"clientID": "",
"async": false,
"maxPubAcksInflight": 0
}
}
},
"postgresql": {
"1": {
"enable": false,
"format": "",
"connectionString": "",
"table": "",
"host": "",
"port": 0,
"user": "",
"password": "",
"database": ""
}
},
"redis": {
"1": {
"enable": false,
"format": "",
"address": "",
"password": "",
"key": ""
}
}
}
}

View File

@@ -0,0 +1,58 @@
[mysqld]
# Basic settings for containerized environment
port = 3306
bind-address = 0.0.0.0
server-id = 1
# Data directory
datadir = /var/lib/mysql
# Character set
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
# Log settings
log-error = /var/log/mysql/error.log
slow-query-log = 1
slow-query-log-file = /var/log/mysql/slow.log
long_query_time = 2
# Connection settings
max_connections = 200
max_connect_errors = 6000
open_files_limit = 65535
# InnoDB settings optimized for container
default-storage-engine = innodb
innodb_buffer_pool_size = 256M
innodb_log_file_size = 64M
innodb_log_buffer_size = 16M
innodb_flush_log_at_trx_commit = 2
innodb_lock_wait_timeout = 50
# Security
skip-name-resolve
# Binary log (for replication)
log-bin = mysql-bin
binlog-format = ROW
expire_logs_days = 7
# Performance settings for container
query_cache_size = 32M
query_cache_type = 1
tmp_table_size = 64M
max_heap_table_size = 64M
# Timeout settings
interactive_timeout = 60
wait_timeout = 60
net_read_timeout = 30
net_write_timeout = 60
# Network settings
max_allowed_packet = 64M
# Container specific settings
# Reduce memory usage for container environment
innodb_buffer_pool_instances = 1

45
deploy/conf/my.cnf Normal file
View File

@@ -0,0 +1,45 @@
[mysqld]
# Basic settings
port = 33306
bind-address = 0.0.0.0
server-id = 1
# Data directory
datadir = /var/lib/mysql
# Character set
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
# Log settings
log-error = /var/log/mysql/error.log
slow-query-log = 1
slow-query-log-file = /var/log/mysql/slow.log
long_query_time = 2
# Connection settings
max_connections = 200
max_connect_errors = 6000
open_files_limit = 65535
# InnoDB settings
default-storage-engine = innodb
innodb_buffer_pool_size = 1G
innodb_log_file_size = 256M
innodb_log_buffer_size = 64M
innodb_flush_log_at_trx_commit = 2
innodb_lock_wait_timeout = 50
# Security
skip-name-resolve
# Binary log (for replication)
log-bin = mysql-bin
binlog-format = ROW
expire_logs_days = 7
# Performance settings
query_cache_size = 64M
query_cache_type = 1
tmp_table_size = 256M
max_heap_table_size = 256M

View File

@@ -0,0 +1,233 @@
# spring
server.servlet.contextPath=/nacos
server.error.include-message=ALWAYS
server.error.include-binding-errors=ALWAYS
spring.autoconfigure.exclude=org.springframework.cloud.client.serviceregistry.AutoServiceRegistrationAutoConfiguration
spring.application.name=nacos-server
logging.config=classpath:org/springframework/boot/logging/logback/no-xml-config.xml
logging.exception-conversion-word=%wEx
logging.level.org.springframework.web=DEBUG
logging.level.org.springframework.transaction=DEBUG
logging.level.org.springframework.transaction.interceptor=DEBUG
logging.level.org.springframework.jdbc=DEBUG
logging.level.org.springframework.jdbc.core.JdbcTemplate=DEBUG
logging.level.com.alibaba.nacos.core.datasource=DEBUG
logging.level.com.alibaba.nacos.core.auth=DEBUG
logging.level.com.alibaba.nacos.core.env=DEBUG
logging.level.com.alibaba.nacos.core.cluster=DEBUG
logging.level.com.alibaba.nacos.core.distributed=DEBUG
logging.level.com.alibaba.nacos.core.namespace=DEBUG
logging.level.com.alibaba.nacos.core.listener=DEBUG
logging.level.com.alibaba.nacos.core.remote=DEBUG
logging.level.com.alibaba.nacos.core.routing=DEBUG
logging.level.com.alibaba.nacos.core.service=DEBUG
logging.level.com.alibaba.nacos.core.sys=DEBUG
logging.level.com.alibaba.nacos.core.trace=DEBUG
logging.level.com.alibaba.nacos.core.utils=DEBUG
logging.level.com.alibaba.nacos.core.auth.ldap=DEBUG
logging.level.com.alibaba.nacos.core.auth.ram=DEBUG
logging.level.com.alibaba.nacos.core.cluster.log=DEBUG
logging.level.com.alibaba.nacos.core.cluster.lookup=DEBUG
logging.level.com.alibaba.nacos.core.cluster.remote=DEBUG
logging.level.com.alibaba.nacos.core.cluster.server=DEBUG
logging.level.com.alibaba.nacos.core.cluster.server.member=DEBUG
logging.level.com.alibaba.nacos.core.cluster.server.member.CM=DEBUG
logging.level.com.alibaba.nacos.core.cluster.server.member.CM.RAFT=DEBUG
logging.level.com.alibaba.nacos.core.cluster.server.member.CM.DISTRO=DEBUG
logging.level.com.alibaba.nacos.core.cluster.server.member.CM.DISTRO.HASH=DEBUG
logging.level.com.alibaba.nacos.core.cluster.server.member.CM.DISTRO.LITE=DEBUG
logging.level.com.alibaba.nacos.core.cluster.server.member.CM.DISTRO.LITE.SYNC=DEBUG
logging.level.com.alibaba.nacos.core.cluster.server.member.CM.DISTRO.LITE.SYNC.SNAPSHOT=DEBUG
logging.level.com.alibaba.nacos.core.cluster.server.member.CM.DISTRO.LITE.SYNC.SNAPSHOT.SNAPSHOT=DEBUG
logging.level.com.alibaba.nacos.core.cluster.server.member.CM.DISTRO.LITE.SYNC.SNAPSHOT.SNAPSHOT.SNAPSHOT=DEBUG
logging.level.com.alibaba.nacos.core.cluster.server.member.CM.DISTRO.LITE.SYNC.SNAPSHOT.SNAPSHOT.SNAPSHOT.SNAPSHOT=DEBUG
# nacos
nacos.core.auth.system.type=nacos
nacos.core.auth.enabled=false
nacos.core.auth.caching.enabled=true
nacos.core.auth.enable.userAgentAuthWhite=false
nacos.core.auth.server.identity.key=nacos
nacos.core.auth.server.identity.value=nacos
nacos.core.auth.plugin.nacos.token.secret.key=SecretKey012345678901234567890123456789012345678901234567890123456789
nacos.core.auth.plugin.nacos.token.expire.seconds=18000
nacos.core.sampling.enabled=true
nacos.core.sampling.probability=0.01
nacos.core.metrics.enabled=true
nacos.core.metrics.dump.enabled=true
nacos.core.metrics.dump.period=600
nacos.core.metrics.storage=prometheus
nacos.core.metrics.log.file=/home/nacos/logs/metrics.log
nacos.core.metrics.log.period=60
nacos.core.cluster.lookup.type=address-server
nacos.core.cluster.address-server.url=https://nacos.io
nacos.core.cluster.address-server.endpoint=address-server.nacos.io
nacos.core.cluster.address-server.namespace=public
nacos.core.cluster.address-server.tenant=public
nacos.core.cluster.address-server.is.auth.enabled=false
nacos.core.cluster.address-server.username=nacos
nacos.core.cluster.address-server.password=nacos
nacos.core.cluster.address-server.access.key=
nacos.core.cluster.address-server.secret.key=
nacos.core.cluster.member.list=
nacos.core.env=standalone
nacos.core.insert.default.kv=on
nacos.core.loadconfig.enable=true
nacos.core.loadconfig.retrytime=2
nacos.core.loadconfig.retrysleepmillis=1000
nacos.core.notify.retrytimes=5
nacos.core.notify.retrydelaymillis=1000
nacos.core.notify.maxbatchsize=5000
nacos.core.notify.maxqueuesize=20000
nacos.core.notify.retryqueuecount=2
nacos.core.notify.timeout=5000
nacos.core.notify.log.enabled=true
nacos.core.notify.connection.timeout=2000
nacos.core.notify.socket.timeout=60000
nacos.core.notify.threads=20
nacos.core.notify.thread.keepalive=60
nacos.core.notify.request.failed.retrytimes=3
nacos.core.notify.distro.protocol=raft
nacos.core.notify.distrolist.sync.retrytimes=3
nacos.core.notify.distrolist.sync.timeout=5000
nacos.core.notify.distrolist.sync.threads=20
nacos.core.notify.distrolist.sync.thread.keepalive=60
nacos.core.notify.distrolist.sync.maxqueuesize=20000
nacos.core.notify.distrolist.sync.retryqueuecount=2
nacos.core.notify.distrolist.sync.log.enabled=true
nacos.core.notify.distrolist.sync.timeout=5000
nacos.core.notify.distrolist.sync.connection.timeout=2000
nacos.core.notify.distrolist.sync.socket.timeout=60000
nacos.core.notify.distrolist.sync.threads=20
nacos.core.notify.distrolist.sync.thread.keepalive=60
nacos.core.notify.distrolist.sync.maxqueuesize=20000
nacos.core.notify.distrolist.sync.retryqueuecount=2
nacos.core.notify.distrolist.sync.log.enabled=true
nacos.core.notify.distrolist.sync.timeout=5000
nacos.core.notify.distrolist.sync.connection.timeout=2000
nacos.core.notify.distrolist.sync.socket.timeout=60000
nacos.core.notify.distrolist.sync.threads=20
nacos.core.notify.distrolist.sync.thread.keepalive=60
nacos.core.notify.distrolist.sync.maxqueuesize=20000
nacos.core.notify.distrolist.sync.retryqueuecount=2
nacos.core.notify.distrolist.sync.log.enabled=true
# naming
nacos.naming.distro.taskDispatchThreadCount=20
nacos.naming.distro.taskDispatchPeriod=200
nacos.naming.distro.batchSyncKeyCount=1000
nacos.naming.distro.initDataOnly=false
nacos.naming.distro.syncRetryDelay=5000
nacos.naming.redo.delay=1000
nacos.naming.redo.expired=60000
nacos.naming.redo.retries=3
nacos.naming.cache.concurrent.size=64
nacos.naming.cache.expired.time=10000
nacos.naming.cache.updateTaskInterval=1000
nacos.naming.log.fileName=alipay-jraft.log
nacos.naming.log.level=warn
nacos.naming.data.warmup=true
nacos.naming.empty.service.autoClean=true
nacos.naming.empty.service.clean.initial.delay.ms=50000
nacos.naming.empty.service.clean.period.time.ms=30000
nacos.naming.push.empty.protect=true
nacos.naming.push.max.application=6000
nacos.naming.push.max.payload.bytes=1048576
nacos.naming.push.max.qps=20000
nacos.naming.push.dump.qps=10000
nacos.naming.push.health.check.fail.timeout=3000
nacos.naming.push.verify.enabled=false
nacos.naming.health.push.status.check.enabled=true
nacos.naming.health.push.status.check.time.delay=5000
nacos.naming.push.connection.max.hold.time=300000
nacos.naming.service.batch.register.thread.count=1
nacos.naming.service.batch.register.thread.work.queue.size=10000
nacos.naming.service.batch.register.enabled=false
nacos.naming.service.batch.register.interval=1000
nacos.naming.service.batch.register.batch.size=1000
nacos.naming.service.batch.register.delay=1000
nacos.naming.service.batch.register.timeout=30000
nacos.naming.service.batch.register.retry.times=3
nacos.naming.service.batch.register.retry.delay=1000
nacos.naming.service.batch.register.retry.max.delay=5000
nacos.naming.service.batch.register.retry.backoff=1.5
nacos.naming.service.batch.register.retry.max.attempts=5
nacos.naming.service.batch.register.retry.max.delay=30000
nacos.naming.service.batch.register.retry.backoff=2.0
nacos.naming.service.batch.register.retry.max.attempts=10
nacos.naming.service.batch.register.retry.max.delay=60000
nacos.naming.service.batch.register.retry.backoff=2.0
# config
nacos.config.log.level=warn
nacos.config.dumpTask.delay=30
nacos.config.dumpTask.period=300
nacos.config.syncTask.timeout=30
nacos.config.syncTask.retryTimes=3
nacos.config.syncTask.retryDelay=1000
nacos.config.notifyTask.timeout=30
nacos.config.notifyTask.retryTimes=3
nacos.config.notifyTask.retryDelay=1000
nacos.config.notifyTask.threadCount=2
nacos.config.notifyTask.maxQueueSize=10000
nacos.config.notifyTask.log.enabled=true
nacos.config.notifyTask.timeout=5000
nacos.config.notifyTask.connection.timeout=2000
nacos.config.notifyTask.socket.timeout=60000
nacos.config.notifyTask.threads=20
nacos.config.notifyTask.thread.keepalive=60
nacos.config.notifyTask.maxqueuesize=20000
nacos.config.notifyTask.retryqueuecount=2
nacos.config.notifyTask.log.enabled=true
# console
nacos.core.console.enableYaml=false
nacos.core.console.system.defender.enabled=false
nacos.core.console.system.defender.rate.limiting.threshold=100
nacos.core.console.system.defender.rate.limiting.duration=1
nacos.core.console.system.defender.rate.limiting.enabled=false
nacos.core.console.system.defender.rate.limiting.window=60
nacos.core.console.system.defender.rate.limiting.max=100
nacos.core.console.system.defender.rate.limiting.min=10
nacos.core.console.system.defender.rate.limiting.factor=1.0
nacos.core.console.system.defender.rate.limiting.strategy=fixed
nacos.core.console.system.defender.rate.limiting.algorithm=token-bucket
nacos.core.console.system.defender.rate.limiting.mode=local
nacos.core.console.system.defender.rate.limiting.scope=global
nacos.core.console.system.defender.rate.limiting.key=ip
nacos.core.console.system.defender.rate.limiting.enabled=false
# datasource
nacos.datasource.platform=mysql
nacos.datasource.db.num=1
nacos.datasource.db.url.0=jdbc:mysql://59.80.22.43:33306/nacos_config?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC
nacos.datasource.db.user=root
nacos.datasource.db.password=WoCloud@9ol7uj
nacos.datasource.db.pool.config.connectionTimeout=30000
nacos.datasource.db.pool.config.validationTimeout=10000
nacos.datasource.db.pool.config.maximumPoolSize=20
nacos.datasource.db.pool.config.minimumIdle=2
nacos.datasource.db.pool.config.maxWait=3000
nacos.datasource.db.pool.config.timeBetweenEvictionRunsMillis=60000
nacos.datasource.db.pool.config.minEvictableIdleTimeMillis=300000
nacos.datasource.db.pool.config.testWhileIdle=true
nacos.datasource.db.pool.config.testOnBorrow=true
nacos.datasource.db.pool.config.testOnReturn=false
nacos.datasource.db.pool.config.poolName=HikariCP
nacos.datasource.db.pool.config.connectionTestQuery=SELECT 1
nacos.datasource.db.pool.config.allowPoolSuspension=false
nacos.datasource.db.pool.config.autoCommit=true
nacos.datasource.db.pool.config.idleTimeout=600000
nacos.datasource.db.pool.config.jdbc4ConnectionTest=true
nacos.datasource.db.pool.config.useStatementFinalizer=true
nacos.datasource.db.pool.config.leakDetectionThreshold=60000
nacos.datasource.db.pool.config.dataSourceProperties.cachePrepStmts=true
nacos.datasource.db.pool.config.dataSourceProperties.prepStmtCacheSize=250
nacos.datasource.db.pool.config.dataSourceProperties.prepStmtCacheSqlLimit=2048
nacos.datasource.db.pool.config.dataSourceProperties.useServerPrepStmts=true
nacos.datasource.db.pool.config.dataSourceProperties.useLocalSessionState=true
nacos.datasource.db.pool.config.dataSourceProperties.rewriteBatchedStatements=true
nacos.datasource.db.pool.config.dataSourceProperties.cacheResultSetMetadata=true
nacos.datasource.db.pool.config.dataSourceProperties.cacheServerConfiguration=true
nacos.datasource.db.pool.config.dataSourceProperties.elideSetters=true
nacos.datasource.db.pool.config.dataSourceProperties.maintainTimeStats=false

View File

@@ -0,0 +1,52 @@
# Redis configuration for containerized environment
bind 0.0.0.0
protected-mode yes
port 6379
timeout 0
tcp-keepalive 300
daemonize no
pidfile /var/run/redis.pid
loglevel notice
logfile /var/log/redis/redis-server.log
databases 16
save 900 1
save 300 10
save 60 10000
stop-writes-on-bgsave-error yes
rdbcompression yes
rdbchecksum yes
dbfilename dump.rdb
dir /data
requirepass 123456
masterauth 123456
maxmemory 2gb
maxmemory-policy allkeys-lru
appendonly yes
appendfilename "appendonly.aof"
appendfsync everysec
no-appendfsync-on-rewrite no
auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb
lua-time-limit 5000
cluster-enabled no
cluster-config-file nodes.conf
cluster-node-timeout 15000
slowlog-log-slower-than 10000
slowlog-max-len 128
hash-max-ziplist-entries 512
hash-max-ziplist-value 64
list-max-ziplist-entries 512
list-max-ziplist-value 64
set-max-intset-entries 512
zset-max-ziplist-entries 128
zset-max-ziplist-value 64
activerehashing yes
client-output-buffer-limit normal 0 0 0
client-output-buffer-limit slave 256mb 64mb 60
client-output-buffer-limit pubsub 32mb 8mb 60
hz 10
aof-rewrite-incremental-fsync yes
# Container specific settings
# Allow more clients for containerized environment
maxclients 10000

48
deploy/conf/redis.conf Normal file
View File

@@ -0,0 +1,48 @@
# Redis configuration
bind 0.0.0.0
protected-mode yes
port 6379
timeout 0
tcp-keepalive 300
daemonize no
pidfile /var/run/redis.pid
loglevel notice
logfile /var/log/redis/redis-server.log
databases 16
save 900 1
save 300 10
save 60 10000
stop-writes-on-bgsave-error yes
rdbcompression yes
rdbchecksum yes
dbfilename dump.rdb
dir /data
requirepass 123456
masterauth 123456
maxmemory 2gb
maxmemory-policy allkeys-lru
appendonly yes
appendfilename "appendonly.aof"
appendfsync everysec
no-appendfsync-on-rewrite no
auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb
lua-time-limit 5000
cluster-enabled no
cluster-config-file nodes.conf
cluster-node-timeout 15000
slowlog-log-slower-than 10000
slowlog-max-len 128
hash-max-ziplist-entries 512
hash-max-ziplist-value 64
list-max-ziplist-entries 512
list-max-ziplist-value 64
set-max-intset-entries 512
zset-max-ziplist-entries 128
zset-max-ziplist-value 64
activerehashing yes
client-output-buffer-limit normal 0 0 0
client-output-buffer-limit slave 256mb 64mb 60
client-output-buffer-limit pubsub 32mb 8mb 60
hz 10
aof-rewrite-incremental-fsync yes