fix: 调整关断电话的逻辑、群主管理员可以撤回任何消息

This commit is contained in:
乾乾
2025-10-11 19:03:55 +08:00
parent 1bb96e1454
commit aec9e78e0c
29 changed files with 1141 additions and 148 deletions

View File

@@ -66,6 +66,88 @@ HuLa-Server 是一款基于 SpringCloud、SpringBoot3、Netty、MyBatis-Plus 和
• 集成Spring AIdeepseek、OpenAI、通义千问等luohuo-ai-biz调用ai服务提供调用第三方ai、工作流TinyFlow能力扩展业务场景。
## 🏗️系统架构
### 🚪 luohuo-gateway - 网关服务
🔐 API网关 | 🛡️ 安全防护 | 🔄 服务路由
- **路由转发:** 智能路由到后端微服务
- **统一鉴权:** JWT令牌验证与权限检查
- **服务发现:** 集成nacos实现动态服务发现
- **流量控制:** 限流、熔断、降级保护
- **安全过滤:** XSS防护、SQL注入防护
- **日志记录:** 请求日志、审计日志
### 🏗️ luohuo-base - 基础服务
🏢 租户管理 | 👥 组织架构 | 🔧 资源中心
- **多租户架构:** 支持多租户数据隔离
- **组织管理:** 部门、岗位、职级管理
- **角色权限:** RBAC权限模型细粒度控制
- **应用模块:** 统一应用管理平台
### 🔐 luohuo-oauth - 认证服务
- **多方式登录:** 账号密码、手机验证码、邮箱、扫码登录
- **动态二维码:** 实时生成扫码登录二维码
- **令牌颁发:** Token、RefreshToken生成
- **会话管理:** 分布式会话存储与验证
- **权限控制:** 基于角色的细粒度权限管理
### 💬 luohuo-im - IM业务服务
👥 即时通讯 | 🏘️ 群组管理 | 💾 消息存储
- **消息管理:** 单聊/群聊消息存储与转发
- **群组管理:** 创建群组、成员管理、权限控制
- **好友关系:** 好友添加、删除、黑名单管理
- **会话管理:** 会话列表、置顶、消息状态
### 📡 luohuo-presence - 在线状态服务
🟢 状态追踪 | 📊 实时统计 | 🔔 状态推送
- **用户状态:** 实时追踪在线/离线状态
- **群组统计:** 群成员在线情况统计
### 📶 luohuo-ws - websocket服务
🔗 长连接管理 | 🚀 实时推送 | 📞 音视频通话
- **连接管理:** 建立与维护会话的指纹级映射,宕机自动重连机制
- **WebFlux异步架构** 基础netty提升并发性能
- **消息路由:** 智能消息路由到目标客户端, 配合指纹机映射解决消息风暴
- **P2P通话SRS直连** WebRTC一对一音视频通话
### ⚙️ luohuo-system - 后台服务
🖥️ 系统管理 | 📈 数据统计 | 🔍 监控审计
- **系统配置:** IM系统参数配置管理
- **用户管理:** 用户信息维护、封禁解封
- **数据统计:** 用户活跃度、消息量统计
- **系统监控:** 服务健康状态监控
- **内容审计:** 消息内容安全审计过滤
## 📊 消息执行流程步骤详解
1. **客户端发送消息到网关**
2. **网关路由到对应的IM服务**
3. **IM服务进行消息持久化**
4. **调用IM内部PushService进行消息分发**
5. **PushService查询路由表, 获取目标用户所在的WS节点**
6. **获取节点-设备-用户映射关系**
7. **直接分发到各WS节点的专属主题**
8. **目标WS节点消费分发过来的主题消息**
9. **查找本地会话映射表**
10. **推送消息到具体客户端**
11. **客户端返回ACK确认** ![进行中](https://img.shields.io/badge/🐣-进行中-ee9f20?style=flat&labelColor=fef7e6&color=ee9f20)
12. **更新消息状态为已送达** ![进行中](https://img.shields.io/badge/🐣-进行中-ee9f20?style=flat&labelColor=fef7e6&color=ee9f20)
![messageFlow.png](preview/messageFlow.png)
## 🌐 性能对比 WS 服务)
| 指标 | 广播模式 | 精准路由模式 | 提升倍数 | 性能指标 | 说明 |
|:--- |:---:|:------------------:|---:|-------------------:|--------------------------:|
| **网络消息数** | O(N) | O(k) | 10-100倍 | - | |
| **CPU消耗** | 高 | 低 | 5-20倍 | 高并发下CPU<70% | |
| **内存占用** | 全节点缓存 | 仅目标节点 | 3-10倍 | 单连接<50KB | |
| **延迟时间** | 不稳定 | 稳定低延迟 | 2-5倍 | 平均<50ms | |
## 🚀 系统扩展性 - 线性扩展能力
- **用户增长:** 增加用户不会增加单个消息的复杂度
- **节点扩展:** 增加节点不会增加单消息的推送成本
- **流量增长:** 系统吞吐量随节点数线性增长
## 客户端预览
![img.png](preview/img.png)
@@ -134,11 +216,10 @@ HuLa-Server 是一款基于 SpringCloud、SpringBoot3、Netty、MyBatis-Plus 和
<h3>🤝 HuLa 社区讨论群</h3>
<p><em>与开发者和用户一起交流讨论,获取最新资讯和技术支持</em></p>
<div>
<img src="preview/wx.png" width="220" height="260" alt="微信群二维码">
<div style="display: flex; justify-content: center; gap: 20px;">
<img src="preview/wx.png" width="260" height="340" alt="微信群二维码">
<img src="preview/qq.jpg" width="260" height="340" alt="QQ群二维码">
</div>
<p><strong>📱 扫码加入微信讨论群</strong></p>
</div>
## 🙏 感谢赞助者

View File

@@ -0,0 +1,33 @@
listen 1935;
max_connections 1000;
daemon off;
srs_log_tank console;
http_api {
enabled on;
listen 1985;
}
http_server {
enabled on;
listen 7088;
dir ./objs/nginx/html;
}
rtc_server {
enabled on;
listen 8000;
candidate 公网ip;
}
vhost __defaultVhost__ {
rtc {
enabled on;
rtmp_to_rtc on;
rtc_to_rtmp on;
}
http_remux {
enabled on;
mount [vhost]/[app]/[stream].flv;
}
}

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,730 @@
#与前ifconfig查到的网卡名称一致
relay-device=eth0
#内网IP
listening-ip=172.16.0.4
#公网IP
external-ip=公网ip
#用户名密码创建IceServer时用
user=chr:123456
#一般与turnadmin创建用户时指定的realm一致
realm=hulaspark.com
#端口号
listening-port=3478
#不开启会报CONFIG ERROR: Empty cli-password, and so telnet cli interface is disabled! Please set a non empty cli-password!错误
cli-password=qwerty
# 禁用 IPv6
no-udp6
no-tcp6
cert=/etc/turn_server_cert.pem
pkey=/etc/turn_server_pkey.pem
dh-file=/etc/coturn/dhparam.pem
# Coturn TURN SERVER configuration file
#
# Boolean values note: where boolean value is supposed to be used,
# you can use '0', 'off', 'no', 'false', 'f' as 'false,
# and you can use '1', 'on', 'yes', 'true', 't' as 'true'
# If the value is missed, then it means 'true'.
#
# Listener interface device (optional, Linux only).
# NOT RECOMMENDED.
#
#listening-device=eth0
# TURN listener port for UDP and TCP (Default: 3478).
# Note: actually, TLS & DTLS sessions can connect to the
# "plain" TCP & UDP port(s), too - if allowed by configuration.
#
#listening-port=3478
# TURN listener port for TLS (Default: 5349).
# Note: actually, "plain" TCP & UDP sessions can connect to the TLS & DTLS
# port(s), too - if allowed by configuration. The TURN server
# "automatically" recognizes the type of traffic. Actually, two listening
# endpoints (the "plain" one and the "tls" one) are equivalent in terms of
# functionality; but we keep both endpoints to satisfy the RFC 5766 specs.
# For secure TCP connections, we currently support SSL version 3 and
# TLS version 1.0, 1.1 and 1.2.
# For secure UDP connections, we support DTLS version 1.
#
#tls-listening-port=5349
# Alternative listening port for UDP and TCP listeners;
# default (or zero) value means "listening port plus one".
# This is needed for RFC 5780 support
# (STUN extension specs, NAT behavior discovery). The TURN Server
# supports RFC 5780 only if it is started with more than one
# listening IP address of the same family (IPv4 or IPv6).
# RFC 5780 is supported only by UDP protocol, other protocols
# are listening to that endpoint only for "symmetry".
#
#alt-listening-port=0
# Alternative listening port for TLS and DTLS protocols.
# Default (or zero) value means "TLS listening port plus one".
#
#alt-tls-listening-port=0
# Listener IP address of relay server. Multiple listeners can be specified.
# If no IP(s) specified in the config file or in the command line options,
# then all IPv4 and IPv6 system IPs will be used for listening.
#
#listening-ip=172.17.19.101
#listening-ip=10.207.21.238
#listening-ip=2607:f0d0:1002:51::4
# Auxiliary STUN/TURN server listening endpoint.
# Aux servers have almost full TURN and STUN functionality.
# The (minor) limitations are:
#
# 1) Auxiliary servers do not have alternative ports and
# they do not support STUN RFC 5780 functionality (CHANGE REQUEST).
#
# 2) Auxiliary servers also are never returning ALTERNATIVE-SERVER reply.
#
# Valid formats are 1.2.3.4:5555 for IPv4 and [1:2::3:4]:5555 for IPv6.
#
# There may be multiple aux-server options, each will be used for listening
# to client requests.
#
#aux-server=172.17.19.110:33478
#aux-server=[2607:f0d0:1002:51::4]:33478
# (recommended for older Linuxes only)
# Automatically balance UDP traffic over auxiliary servers (if configured).
# The load balancing is using the ALTERNATE-SERVER mechanism.
# The TURN client must support 300 ALTERNATE-SERVER response for this
# functionality.
#
#udp-self-balance
# Relay interface device for relay sockets (optional, Linux only).
# NOT RECOMMENDED.
#
#relay-device=eth1
# Relay address (the local IP address that will be used to relay the
# packets to the peer).
# Multiple relay addresses may be used.
# The same IP(s) can be used as both listening IP(s) and relay IP(s).
#
# If no relay IP(s) specified, then the turnserver will apply the default
# policy: it will decide itself which relay addresses to be used, and it
# will always be using the client socket IP address as the relay IP address
# of the TURN session (if the requested relay address family is the same
# as the family of the client socket).
#
#relay-ip=172.17.19.105
#relay-ip=2607:f0d0:1002:51::5
# For Amazon EC2 users:
#
# TURN Server public/private address mapping, if the server is behind NAT.
# In that situation, if a -X is used in form "-X <ip>" then that ip will be reported
# as relay IP address of all allocations. This scenario works only in a simple case
# when one single relay address is be used, and no RFC5780 functionality is required.
# That single relay address must be mapped by NAT to the 'external' IP.
# The "external-ip" value, if not empty, is returned in XOR-RELAYED-ADDRESS field.
# For that 'external' IP, NAT must forward ports directly (relayed port 12345
# must be always mapped to the same 'external' port 12345).
#
# In more complex case when more than one IP address is involved,
# that option must be used several times, each entry must
# have form "-X <public-ip/private-ip>", to map all involved addresses.
# RFC5780 NAT discovery STUN functionality will work correctly,
# if the addresses are mapped properly, even when the TURN server itself
# is behind A NAT.
#
# By default, this value is empty, and no address mapping is used.
#
#external-ip=60.70.80.91
#
#OR:
#
#external-ip=60.70.80.91/172.17.19.101
#external-ip=60.70.80.92/172.17.19.102
# Number of the relay threads to handle the established connections
# (in addition to authentication thread and the listener thread).
# If explicitly set to 0 then application runs relay process in a
# single thread, in the same thread with the listener process
# (the authentication thread will still be a separate thread).
#
# If this parameter is not set, then the default OS-dependent
# thread pattern algorithm will be employed. Usually the default
# algorithm is the most optimal, so you have to change this option
# only if you want to make some fine tweaks.
#
# In the older systems (Linux kernel before 3.9),
# the number of UDP threads is always one thread per network listening
# endpoint - including the auxiliary endpoints - unless 0 (zero) or
# 1 (one) value is set.
#
#relay-threads=0
# Lower and upper bounds of the UDP relay endpoints:
# (default values are 49152 and 65535)
#
#min-port=49152
#max-port=65535
# Uncomment to run TURN server in 'normal' 'moderate' verbose mode.
# By default the verbose mode is off.
#verbose
# Uncomment to run TURN server in 'extra' verbose mode.
# This mode is very annoying and produces lots of output.
# Not recommended under any normal circumstances.
#
#Verbose
# Uncomment to use fingerprints in the TURN messages.
# By default the fingerprints are off.
#
#fingerprint
# Uncomment to use long-term credential mechanism.
# By default no credentials mechanism is used (any user allowed).
#
#lt-cred-mech
# This option is opposite to lt-cred-mech.
# (TURN Server with no-auth option allows anonymous access).
# If neither option is defined, and no users are defined,
# then no-auth is default. If at least one user is defined,
# in this file or in command line or in usersdb file, then
# lt-cred-mech is default.
#
#no-auth
# TURN REST API flag.
# (Time Limited Long Term Credential)
# Flag that sets a special authorization option that is based upon authentication secret.
#
# This feature's purpose is to support "TURN Server REST API", see
# "TURN REST API" link in the project's page
# https://github.com/coturn/coturn/
#
# This option is used with timestamp:
#
# usercombo -> "timestamp:userid"
# turn user -> usercombo
# turn password -> base64(hmac(secret key, usercombo))
#
# This allows TURN credentials to be accounted for a specific user id.
# If you don't have a suitable id, the timestamp alone can be used.
# This option is just turning on secret-based authentication.
# The actual value of the secret is defined either by option static-auth-secret,
# or can be found in the turn_secret table in the database (see below).
#
# Read more about it:
# - https://tools.ietf.org/html/draft-uberti-behave-turn-rest-00
# - https://www.ietf.org/proceedings/87/slides/slides-87-behave-10.pdf
#
# Be aware that use-auth-secret overrides some part of lt-cred-mech.
# Notice that this feature depends internally on lt-cred-mech, so if you set
# use-auth-secret then it enables internally automatically lt-cred-mech option
# like if you enable both.
#
# You can use only one of the to auth mechanisms in the same time because,
# both mechanism use the username and password validation in different way.
#
# This way be aware that you can't use both auth mechnaism in the same time!
# Use in config either the lt-cred-mech or the use-auth-secret
# to avoid any confusion.
#
#use-auth-secret
# 'Static' authentication secret value (a string) for TURN REST API only.
# If not set, then the turn server
# will try to use the 'dynamic' value in turn_secret table
# in user database (if present). The database-stored value can be changed on-the-fly
# by a separate program, so this is why that other mode is 'dynamic'.
#
#static-auth-secret=north
# Server name used for
# the oAuth authentication purposes.
# The default value is the realm name.
#
#server-name=blackdow.carleon.gov
# Flag that allows oAuth authentication.
#
#oauth
# 'Static' user accounts for long term credentials mechanism, only.
# This option cannot be used with TURN REST API.
# 'Static' user accounts are NOT dynamically checked by the turnserver process,
# so that they can NOT be changed while the turnserver is running.
#
#user=username1:key1
#user=username2:key2
# OR:
#user=username1:password1
#user=username2:password2
#
# Keys must be generated by turnadmin utility. The key value depends
# on user name, realm, and password:
#
# Example:
# $ turnadmin -k -u ninefingers -r north.gov -p youhavetoberealistic
# Output: 0xbc807ee29df3c9ffa736523fb2c4e8ee
# ('0x' in the beginning of the key is what differentiates the key from
# password. If it has 0x then it is a key, otherwise it is a password).
#
# The corresponding user account entry in the config file will be:
#
#user=ninefingers:0xbc807ee29df3c9ffa736523fb2c4e8ee
# Or, equivalently, with open clear password (less secure):
#user=ninefingers:youhavetoberealistic
#
# SQLite database file name.
#
# Default file name is /var/db/turndb or /usr/local/var/db/turndb or
# /var/lib/turn/turndb.
#
#userdb=/var/db/turndb
# PostgreSQL database connection string in the case that we are using PostgreSQL
# as the user database.
# This database can be used for long-term credential mechanism
# and it can store the secret value for secret-based timed authentication in TURN RESP API.
# See http://www.postgresql.org/docs/8.4/static/libpq-connect.html for 8.x PostgreSQL
# versions connection string format, see
# http://www.postgresql.org/docs/9.2/static/libpq-connect.html#LIBPQ-CONNSTRING
# for 9.x and newer connection string formats.
#
#psql-userdb="host=<host> dbname=<database-name> user=<database-user> password=<database-user-password> connect_timeout=30"
# MySQL database connection string in the case that we are using MySQL
# as the user database.
# This database can be used for long-term credential mechanism
# and it can store the secret value for secret-based timed authentication in TURN RESP API.
#
# Optional connection string parameters for the secure communications (SSL):
# ca, capath, cert, key, cipher
# (see http://dev.mysql.com/doc/refman/5.1/en/ssl-options.html for the
# command options description).
#
# Use string format as below (space separated parameters, all optional):
#
#mysql-userdb="host=<host> dbname=<database-name> user=<database-user> password=<database-user-password> port=<port> connect_timeout=<seconds> read_timeout=<seconds>"
# If you want to use in the MySQL connection string the password in encrypted format,
# then set in this option the MySQL password encryption secret key file.
#
# Warning: If this option is set, then mysql password must be set in "mysql-userdb" in encrypted format!
# If you want to use cleartext password then do not set this option!
#
# This is the file path which contain secret key of aes encryption while using password encryption.
#
#secret-key-file=/path/
# MongoDB database connection string in the case that we are using MongoDB
# as the user database.
# This database can be used for long-term credential mechanism
# and it can store the secret value for secret-based timed authentication in TURN RESP API.
# Use string format is described at http://hergert.me/docs/mongo-c-driver/mongoc_uri.html
#
#mongo-userdb="mongodb://[username:password@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[database][?options]]"
# Redis database connection string in the case that we are using Redis
# as the user database.
# This database can be used for long-term credential mechanism
# and it can store the secret value for secret-based timed authentication in TURN RESP API.
# Use string format as below (space separated parameters, all optional):
#
#redis-userdb="ip=<ip-address> dbname=<database-number> password=<database-user-password> port=<port> connect_timeout=<seconds>"
# Redis status and statistics database connection string, if used (default - empty, no Redis stats DB used).
# This database keeps allocations status information, and it can be also used for publishing
# and delivering traffic and allocation event notifications.
# The connection string has the same parameters as redis-userdb connection string.
# Use string format as below (space separated parameters, all optional):
#
#redis-statsdb="ip=<ip-address> dbname=<database-number> password=<database-user-password> port=<port> connect_timeout=<seconds>"
# The default realm to be used for the users when no explicit
# origin/realm relationship was found in the database, or if the TURN
# server is not using any database (just the commands-line settings
# and the userdb file). Must be used with long-term credentials
# mechanism or with TURN REST API.
#
# Note: If default realm is not specified at all, then realm falls back to the host domain name.
# If domain name is empty string, or '(None)', then it is initialized to am empty string.
#
#realm=mycompany.org
# The flag that sets the origin consistency
# check: across the session, all requests must have the same
# main ORIGIN attribute value (if the ORIGIN was
# initially used by the session).
#
#check-origin-consistency
# Per-user allocation quota.
# default value is 0 (no quota, unlimited number of sessions per user).
# This option can also be set through the database, for a particular realm.
#
#user-quota=0
# Total allocation quota.
# default value is 0 (no quota).
# This option can also be set through the database, for a particular realm.
#
#total-quota=0
# Max bytes-per-second bandwidth a TURN session is allowed to handle
# (input and output network streams are treated separately). Anything above
# that limit will be dropped or temporary suppressed (within
# the available buffer limits).
# This option can also be set through the database, for a particular realm.
#
#max-bps=0
#
# Maximum server capacity.
# Total bytes-per-second bandwidth the TURN server is allowed to allocate
# for the sessions, combined (input and output network streams are treated separately).
#
# bps-capacity=0
# Uncomment if no UDP client listener is desired.
# By default UDP client listener is always started.
#
#no-udp
# Uncomment if no TCP client listener is desired.
# By default TCP client listener is always started.
#
#no-tcp
# Uncomment if no TLS client listener is desired.
# By default TLS client listener is always started.
#
#no-tls
# Uncomment if no DTLS client listener is desired.
# By default DTLS client listener is always started.
#
#no-dtls
# Uncomment if no UDP relay endpoints are allowed.
# By default UDP relay endpoints are enabled (like in RFC 5766).
#
#no-udp-relay
# Uncomment if no TCP relay endpoints are allowed.
# By default TCP relay endpoints are enabled (like in RFC 6062).
#
#no-tcp-relay
# Uncomment if extra security is desired,
# with nonce value having limited lifetime.
# By default, the nonce value is unique for a session,
# and has unlimited lifetime.
# Set this option to limit the nonce lifetime.
# It defaults to 600 secs (10 min) if no value is provided. After that delay,
# the client will get 438 error and will have to re-authenticate itself.
#
#stale-nonce=600
# Uncomment if you want to set the maximum allocation
# time before it has to be refreshed.
# Default is 3600s.
#
#max-allocate-lifetime=3600
# Uncomment to set the lifetime for the channel.
# Default value is 600 secs (10 minutes).
# This value MUST not be changed for production purposes.
#
#channel-lifetime=600
# Uncomment to set the permission lifetime.
# Default to 300 secs (5 minutes).
# In production this value MUST not be changed,
# however it can be useful for test purposes.
#
#permission-lifetime=300
# Certificate file.
# Use an absolute path or path relative to the
# configuration file.
#
#cert=/usr/local/etc/turn_server_cert.pem
# Private key file.
# Use an absolute path or path relative to the
# configuration file.
# Use PEM file format.
#
#pkey=/usr/local/etc/turn_server_pkey.pem
# Private key file password, if it is in encoded format.
# This option has no default value.
#
#pkey-pwd=...
# Allowed OpenSSL cipher list for TLS/DTLS connections.
# Default value is "DEFAULT".
#
#cipher-list="DEFAULT"
# CA file in OpenSSL format.
# Forces TURN server to verify the client SSL certificates.
# By default it is not set: there is no default value and the client
# certificate is not checked.
#
# Example:
#CA-file=/etc/ssh/id_rsa.cert
# Curve name for EC ciphers, if supported by OpenSSL
# library (TLS and DTLS). The default value is prime256v1,
# if pre-OpenSSL 1.0.2 is used. With OpenSSL 1.0.2+,
# an optimal curve will be automatically calculated, if not defined
# by this option.
#
#ec-curve-name=prime256v1
# Use 566 bits predefined DH TLS key. Default size of the key is 1066.
#
#dh566
# Use 2066 bits predefined DH TLS key. Default size of the key is 1066.
#
#dh2066
# Use custom DH TLS key, stored in PEM format in the file.
# Flags --dh566 and --dh2066 are ignored when the DH key is taken from a file.
#
#dh-file=<DH-PEM-file-name>
# Flag to prevent stdout log messages.
# By default, all log messages are going to both stdout and to
# the configured log file. With this option everything will be
# going to the configured log only (unless the log file itself is stdout).
#
#no-stdout-log
# Option to set the log file name.
# By default, the turnserver tries to open a log file in
# /var/log, /var/tmp, /tmp and current directories directories
# (which open operation succeeds first that file will be used).
# With this option you can set the definite log file name.
# The special names are "stdout" and "-" - they will force everything
# to the stdout. Also, the "syslog" name will force everything to
# the system log (syslog).
# In the runtime, the logfile can be reset with the SIGHUP signal
# to the turnserver process.
#
#log-file=/var/tmp/turn.log
# Option to redirect all log output into system log (syslog).
#
#syslog
# This flag means that no log file rollover will be used, and the log file
# name will be constructed as-is, without PID and date appendage.
# This option can be used, for example, together with the logrotate tool.
#
#simple-log
# Option to set the "redirection" mode. The value of this option
# will be the address of the alternate server for UDP & TCP service in form of
# <ip>[:<port>]. The server will send this value in the attribute
# ALTERNATE-SERVER, with error 300, on ALLOCATE request, to the client.
# Client will receive only values with the same address family
# as the client network endpoint address family.
# See RFC 5389 and RFC 5766 for ALTERNATE-SERVER functionality description.
# The client must use the obtained value for subsequent TURN communications.
# If more than one --alternate-server options are provided, then the functionality
# can be more accurately described as "load-balancing" than a mere "redirection".
# If the port number is omitted, then the default port
# number 3478 for the UDP/TCP protocols will be used.
# Colon (:) characters in IPv6 addresses may conflict with the syntax of
# the option. To alleviate this conflict, literal IPv6 addresses are enclosed
# in square brackets in such resource identifiers, for example:
# [2001:db8:85a3:8d3:1319:8a2e:370:7348]:3478 .
# Multiple alternate servers can be set. They will be used in the
# round-robin manner. All servers in the pool are considered of equal weight and
# the load will be distributed equally. For example, if we have 4 alternate servers,
# then each server will receive 25% of ALLOCATE requests. A alternate TURN server
# address can be used more than one time with the alternate-server option, so this
# can emulate "weighting" of the servers.
#
# Examples:
#alternate-server=1.2.3.4:5678
#alternate-server=11.22.33.44:56789
#alternate-server=5.6.7.8
#alternate-server=[2001:db8:85a3:8d3:1319:8a2e:370:7348]:3478
# Option to set alternative server for TLS & DTLS services in form of
# <ip>:<port>. If the port number is omitted, then the default port
# number 5349 for the TLS/DTLS protocols will be used. See the previous
# option for the functionality description.
#
# Examples:
#tls-alternate-server=1.2.3.4:5678
#tls-alternate-server=11.22.33.44:56789
#tls-alternate-server=[2001:db8:85a3:8d3:1319:8a2e:370:7348]:3478
# Option to suppress TURN functionality, only STUN requests will be processed.
# Run as STUN server only, all TURN requests will be ignored.
# By default, this option is NOT set.
#
#stun-only
# Option to suppress STUN functionality, only TURN requests will be processed.
# Run as TURN server only, all STUN requests will be ignored.
# By default, this option is NOT set.
#
#no-stun
# This is the timestamp/username separator symbol (character) in TURN REST API.
# The default value is ':'.
# rest-api-separator=:
# Flag that can be used to allow peers on the loopback addresses (127.x.x.x and ::1).
# This is an extra security measure.
#
# (To avoid any security issue that allowing loopback access may raise,
# the no-loopback-peers option is replaced by allow-loopback-peers.)
#
# Allow it only for testing in a development environment!
# In production it adds a possible security vulnerability, so for security reasons
# it is not allowed using it together with empty cli-password.
#
#allow-loopback-peers
# Flag that can be used to disallow peers on well-known broadcast addresses (224.0.0.0 and above, and FFXX:*).
# This is an extra security measure.
#
#no-multicast-peers
# Option to set the max time, in seconds, allowed for full allocation establishment.
# Default is 60 seconds.
#
#max-allocate-timeout=60
# Option to allow or ban specific ip addresses or ranges of ip addresses.
# If an ip address is specified as both allowed and denied, then the ip address is
# considered to be allowed. This is useful when you wish to ban a range of ip
# addresses, except for a few specific ips within that range.
#
# This can be used when you do not want users of the turn server to be able to access
# machines reachable by the turn server, but would otherwise be unreachable from the
# internet (e.g. when the turn server is sitting behind a NAT)
#
# Examples:
# denied-peer-ip=83.166.64.0-83.166.95.255
# allowed-peer-ip=83.166.68.45
# File name to store the pid of the process.
# Default is /var/run/turnserver.pid (if superuser account is used) or
# /var/tmp/turnserver.pid .
#
#pidfile="/var/run/turnserver.pid"
# Require authentication of the STUN Binding request.
# By default, the clients are allowed anonymous access to the STUN Binding functionality.
#
#secure-stun
# Mobility with ICE (MICE) specs support.
#
#mobility
# Allocate Address Family according
# If enabled then TURN server allocates address family according the TURN
# Client <=> Server communication address family.
# (By default coTURN works according RFC 6156.)
# !!Warning: Enabling this option breaks RFC6156 section-4.2 (violates use default IPv4)!!
#
#keep-address-family
# User name to run the process. After the initialization, the turnserver process
# will make an attempt to change the current user ID to that user.
#
#proc-user=<user-name>
# Group name to run the process. After the initialization, the turnserver process
# will make an attempt to change the current group ID to that group.
#
#proc-group=<group-name>
# Turn OFF the CLI support.
# By default it is always ON.
# See also options cli-ip and cli-port.
#
#no-cli
#Local system IP address to be used for CLI server endpoint. Default value
# is 127.0.0.1.
#
#cli-ip=127.0.0.1
# CLI server port. Default is 5766.
#
#cli-port=5766
# CLI access password. Default is empty (no password).
# For the security reasons, it is recommended to use the encrypted
# for of the password (see the -P command in the turnadmin utility).
#
# Secure form for password 'qwerty':
#
#cli-password=$5$79a316b350311570$81df9cfb9af7f5e5a76eada31e7097b663a0670f99a3c07ded3f1c8e59c5658a
#
# Or unsecure form for the same password:
#
#cli-password=qwerty
# Enable Web-admin support on https. By default it is Disabled.
# If it is enabled it also enables a http a simple static banner page
# with a small reminder that the admin page is available only on https.
#
#web-admin
# Local system IP address to be used for Web-admin server endpoint. Default value is 127.0.0.1.
#
#web-admin-ip=127.0.0.1
# Web-admin server port. Default is 8080.
#
#web-admin-port=8080
# Web-admin server listen on STUN/TURN worker threads
# By default it is disabled for security resons! (Not recommended in any production environment!)
#
#web-admin-listen-on-workers
# Server relay. NON-STANDARD AND DANGEROUS OPTION.
# Only for those applications when we want to run
# server applications on the relay endpoints.
# This option eliminates the IP permissions check on
# the packets incoming to the relay endpoints.
#
#server-relay
# Maximum number of output sessions in ps CLI command.
# This value can be changed on-the-fly in CLI. The default value is 256.
#
#cli-max-output-sessions
# Set network engine type for the process (for internal purposes).
#
#ne=[1|2|3]
# Do not allow an TLS/DTLS version of protocol
#
#no-tlsv1
#no-tlsv1_1
#no-tlsv1_2

View File

@@ -0,0 +1,83 @@
## 📝 root用户登录
### 1. 检查环境
```bash
# 检查 gcc
which gcc
# 安装 gcc
1.1.1 使用yum安装
yum -y install openssl-devel
1.1.2 生成签名 [一直回车就行]
openssl req -x509 -newkey rsa:2048 -keyout /etc/turn_server_pkey.pem -out /etc/turn_server_cert.pem -days 99999 -nodes
1.1.3 开放端口
3478/udp、3478/tcp
```
### 2. 安装libevent
```bash
# 解压
tar -zxvf libevent-2.1.12-stable.tar.gz
# 安装 libevent
cd libevent-2.1.12-stable/
./configure
make
make install
```
### 3. 安装coturn
```bash
# 解压
tar -zxvf coturn-4.5.1.1.tar.gz
# 安装 coturn
cd coturn-4.5.1.1
./configure
make
make install
```
### 3. 生成用户
```bash
# 生成
turnadmin -a -u chr -p 11111 -r hulaspark.com
```
### 4. 创建 [turnserver.conf](turn/turnserver.conf) 配置文件
```bash
# 创建文件
vi /usr/local/etc/turnserver.conf
```
### 5. 启动服务
```bash
# 执行命令
turnserver -a -o -f -r hulaspark.com
```
### 6. 测试服务
https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/
![img_13.png](../image/img_13.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@@ -0,0 +1,44 @@
#!/usr/bin/env bash
set -x
set -eo pipefail
# Check if a custom parameter has been set, otherwise use default values
DB_PORT="${DB_PORT:=5432}"
SUPERUSER="${SUPERUSER:=postgres}"
SUPERUSER_PWD="${SUPERUSER_PWD:=postgres}"
# Allow to skip Docker if a dockerized Postgres database is already running
if [[ -z "${SKIP_DOCKER}" ]]
then
# if a postgres container is running, print instructions to kill it and exit
RUNNING_POSTGRES_CONTAINER=$(docker ps --filter 'name=postgres' --format '{{.ID}}')
if [[ -n $RUNNING_POSTGRES_CONTAINER ]]; then
echo >&2 "there is a postgres container already running, kill it with"
echo >&2 " docker kill ${RUNNING_POSTGRES_CONTAINER}"
exit 1
fi
CONTAINER_NAME="postgres"
# Launch postgres using Docker
docker run \
--env POSTGRES_USER=${SUPERUSER} \
--env POSTGRES_PASSWORD=${SUPERUSER_PWD} \
--health-cmd="pg_isready -U ${SUPERUSER} || exit 1" \
--health-interval=1s \
--health-timeout=5s \
--health-retries=5 \
--publish "${DB_PORT}":5432 \
--detach \
--name "${CONTAINER_NAME}" \
postgres -N 1000
# ^ Increased maximum number of connections for testing purposes
until [ \
"$(docker inspect -f "{{.State.Health.Status}}" ${CONTAINER_NAME})" == \
"healthy" \
]; do
>&2 echo "Postgres is still unavailable - sleeping"
sleep 1
done
fi
>&2 echo "Postgres is up and running on port ${DB_PORT} - running migrations now!"

View File

@@ -11,7 +11,7 @@
Target Server Version : 80030 (8.0.30)
File Encoding : 65001
Date: 26/09/2025 18:10:05
Date: 11/10/2025 18:27:50
*/
SET NAMES utf8mb4;
@@ -94,8 +94,8 @@ CREATE TABLE `base_config` (
INSERT INTO `base_config` VALUES (1, 'system', '{\"title\":\"系统名称\",\"componentType\":\"text\",\"value\":\"Hula-IM\",\"configKey\":\"systemName\",\"type\":\"system\"}', 'systemName', 'HuLa', 0, '2025-06-26 07:42:06.404', '2025-06-26 07:42:06.494', 3, NULL, 0);
INSERT INTO `base_config` VALUES (2, 'system', '{\"title\":\"系统Logo\",\"componentType\":\"text\",\"value\":\"/static/img/Iogo.png\",\"configKey\":\"logo\",\"type\":\"system\"}', 'logo', '/static/img/Iogo.png', 0, '2025-06-26 07:42:06.404', '2025-06-26 07:42:06.494', 3, NULL, 0);
INSERT INTO `base_config` VALUES (3, 'qiniu_up_config', '{\"title\":\"空间域名 Domain\",\"componentType\":\"text\",\"value\":\"https://upload-z2.qiniup.com\",\"configKey\":\"qnUploadUrl\",\"type\":\"qiniu_up_config\"}', 'qnUploadUrl', 'https://up-z2.qiniup.com', 0, '2025-06-26 07:42:06.404', '2025-08-18 04:29:56.616', 3, NULL, 0);
INSERT INTO `base_config` VALUES (4, 'qiniu_up_config', '{\"title\":\"accessKey\",\"componentType\":\"text\",\"value\":\"8si6G11kNDLgA5_\",\"configKey\":\"qnAccessKey\",\"type\":\"qiniu_up_config\"}', 'qnAccessKey', 'LXrRo6Yh1JAQaUGUJ', 0, '2025-06-26 07:42:06.404', '2025-09-26 09:45:10.485', 3, NULL, 0);
INSERT INTO `base_config` VALUES (5, 'qiniu_up_config', '{\"title\":\"SecretKey\",\"componentType\":\"text\",\"value\":\"MLzT2U2daTX1Ay4m_eS9\",\"configKey\":\"qnSecretKey\",\"type\":\"qiniu_up_config\"}', 'qnSecretKey', 'BYKKz6nIjHSJLa1lemF2Hg', 0, '2025-06-26 07:42:06.404', '2025-09-26 09:45:13.415', 3, NULL, 0);
INSERT INTO `base_config` VALUES (4, 'qiniu_up_config', '{\"title\":\"accessKey\",\"componentType\":\"text\",\"value\":\"231YmL0vGAYFTW-rHl4LgA5_\",\"configKey\":\"qnAccessKey\",\"type\":\"qiniu_up_config\"}', 'qnAccessKey', 'LXrRo6YhT22hy5yScLzQJAQaUGUJ', 0, '2025-06-26 07:42:06.404', '2025-10-11 03:43:10.679', 3, NULL, 0);
INSERT INTO `base_config` VALUES (5, 'qiniu_up_config', '{\"title\":\"SecretKey\",\"componentType\":\"text\",\"value\":\"2daTXFDEG9PuAy4TnvfR1o2\",\"configKey\":\"qnSecretKey\",\"type\":\"qiniu_up_config\"}', 'qnSecretKey', 'BYKKz6n222111VS-llemF2Hg', 0, '2025-06-26 07:42:06.404', '2025-10-11 03:43:05.090', 3, NULL, 0);
INSERT INTO `base_config` VALUES (6, 'qiniu_up_config', '{\"title\":\"存储空间名称\",\"componentType\":\"text\",\"value\":\"hula\",\"configKey\":\"qnStorageName\",\"type\":\"qiniu_up_config\"}', 'qnStorageName', 'hula-spark', 0, '2025-06-26 07:42:06.404', '2025-06-26 07:42:06.494', 3, NULL, 0);
INSERT INTO `base_config` VALUES (7, 'qiniu_up_config', '{\"title\":\"七牛云CDN访问图片用的\",\"componentType\":\"text\",\"value\":\"https://file.hula.com/\",\"configKey\":\"qnStorageCDN\",\"type\":\"qiniu_up_config\"}', 'qnStorageCDN', 'https://cdn.hulaspark.com', 0, '2025-06-26 07:42:06.404', '2025-06-26 07:42:06.494', 3, NULL, 0);
INSERT INTO `base_config` VALUES (8, 'system', '{\"title\":\"大群ID\",\"componentType\":\"text\",\"value\":\"1\",\"configKey\":\"roomGroupId\",\"type\":\"system\"}', 'roomGroupId', '1', 0, '2025-06-26 07:42:06.404', '2025-06-26 07:42:06.494', 3, NULL, 0);
@@ -1126,9 +1126,15 @@ CREATE TABLE `def_login_log` (
-- ----------------------------
-- Records of def_login_log
-- ----------------------------
INSERT INTO `def_login_log` VALUES (77820315306496, NULL, 10937855681024, 61170828519937, '192.168.1.37', 'Dawn', '2439646234', '01', '登录成功', '2025-09-26', 'ReactorNetty/1.2.2', 'Unknown', '', 'Unknown', '0|0|0|内网IP|内网IP', '2025-09-26 17:50:10', 61170828519937, '2025-09-26 17:50:10', NULL, 0);
INSERT INTO `def_login_log` VALUES (77820541798912, NULL, 10937855681024, 61170828519937, '192.168.1.37', 'Dawn', '2439646234', '01', '登录成功', '2025-09-26', 'ReactorNetty/1.2.2', 'Unknown', '', 'Unknown', '0|0|0|内网IP|内网IP', '2025-09-26 17:51:04', 61170828519937, '2025-09-26 17:51:04', NULL, 0);
INSERT INTO `def_login_log` VALUES (77822001416704, NULL, 10937855681024, 61170828519937, '192.168.1.37', 'Dawn', '2439646234', '01', '登录成功', '2025-09-26', 'ReactorNetty/1.2.2', 'Unknown', '', 'Unknown', '0|0|0|内网IP|内网IP', '2025-09-26 17:56:51', 61170828519937, '2025-09-26 17:56:51', NULL, 0);
INSERT INTO `def_login_log` VALUES (83160717456896, NULL, NULL, NULL, '192.168.1.37', '', '1046762075', '04', '用户不存在!', '2025-10-11', 'ReactorNetty/1.2.2', 'Unknown', '', 'Unknown', '0|0|0|内网IP|内网IP', '2025-10-11 11:31:00', NULL, '2025-10-11 11:31:00', NULL, 0);
INSERT INTO `def_login_log` VALUES (83160742622720, NULL, NULL, NULL, '192.168.1.37', '', 'Dawn', '04', '用户不存在!', '2025-10-11', 'ReactorNetty/1.2.2', 'Unknown', '', 'Unknown', '0|0|0|内网IP|内网IP', '2025-10-11 11:31:06', NULL, '2025-10-11 11:31:06', NULL, 0);
INSERT INTO `def_login_log` VALUES (83160776177152, NULL, 10937855681024, 61170828519937, '192.168.1.37', 'Dawn', '2439646234', '01', '登录成功', '2025-10-11', 'ReactorNetty/1.2.2', 'Unknown', '', 'Unknown', '0|0|0|内网IP|内网IP', '2025-10-11 11:31:15', 61170828519937, '2025-10-11 11:31:15', NULL, 0);
INSERT INTO `def_login_log` VALUES (83161032029696, NULL, 10937855681024, 61170828519937, '192.168.1.37', 'Dawn', '2439646234', '01', '登录成功', '2025-10-11', 'ReactorNetty/1.2.2', 'Unknown', '', 'Unknown', '0|0|0|内网IP|内网IP', '2025-10-11 11:32:15', 61170828519937, '2025-10-11 11:32:15', NULL, 0);
INSERT INTO `def_login_log` VALUES (83162239989248, NULL, 10937855681024, 61170828519937, '192.168.1.37', 'Dawn', '2439646234', '01', '登录成功', '2025-10-11', 'ReactorNetty/1.2.2', 'Unknown', '', 'Unknown', '0|0|0|内网IP|内网IP', '2025-10-11 11:37:04', 61170828519937, '2025-10-11 11:37:04', NULL, 0);
INSERT INTO `def_login_log` VALUES (83263746340352, NULL, NULL, NULL, '192.168.1.37', '', '1046762075', '04', '用户不存在!', '2025-10-11', 'ReactorNetty/1.2.2', 'Unknown', '', 'Unknown', '0|0|0|内网IP|内网IP', '2025-10-11 18:20:24', NULL, '2025-10-11 18:20:24', NULL, 0);
INSERT INTO `def_login_log` VALUES (83265226929664, NULL, NULL, NULL, '192.168.1.37', '', '1046762075', '04', '用户不存在!', '2025-10-11', 'ReactorNetty/1.2.2', 'Unknown', '', 'Unknown', '0|0|0|内网IP|内网IP', '2025-10-11 18:26:17', NULL, '2025-10-11 18:26:17', NULL, 0);
INSERT INTO `def_login_log` VALUES (83265235318272, NULL, NULL, NULL, '192.168.1.37', '', '1046762075', '04', '用户不存在!', '2025-10-11', 'ReactorNetty/1.2.2', 'Unknown', '', 'Unknown', '0|0|0|内网IP|内网IP', '2025-10-11 18:26:20', NULL, '2025-10-11 18:26:20', NULL, 0);
INSERT INTO `def_login_log` VALUES (83265403090432, NULL, 10937855681024, 61170828519937, '192.168.1.37', 'Dawn', '2439646234', '01', '登录成功', '2025-10-11', 'ReactorNetty/1.2.2', 'Unknown', '', 'Unknown', '0|0|0|内网IP|内网IP', '2025-10-11 18:27:00', 61170828519937, '2025-10-11 18:27:00', NULL, 0);
-- ----------------------------
-- Table structure for def_msg_template
@@ -1167,15 +1173,15 @@ CREATE TABLE `def_msg_template` (
-- ----------------------------
INSERT INTO `def_msg_template` VALUES (245657569392066565, '244881451621810192', '02', 'TENCENT_EMAIL', '腾讯邮件', b'1', NULL, '', '你的一份邮件', '邮件内容3 ${xx}, ddd, \n\n<br/>\n<p style=\"color: red;\">red</p>', '', '[{\"key\":\"xx\",\"value\":\"\"}]', '3', '02', b'1', '02', '44', 1452186486253289472, '2021-12-12 12:12:12', 1452186486253289472, '2023-08-16 23:24:23', 0, 1);
INSERT INTO `def_msg_template` VALUES (245891967232245772, '244913337459015682', '01', 'CHUAGNLAN_REG_SMS', '注册短信', b'1', '111', '盘江煤电', '注册', '采购项目【${xmmc}】发起了${lbmc}质疑,等待您的答复', '', '[{\"key\":\"xmmc\",\"value\":\"\"},{\"key\":\"lbmc\",\"value\":\"\"}]', 'chuanglan短信', NULL, b'1', NULL, '', 1452186486253289472, '2021-12-12 12:12:12', 1452186486253289472, '2023-08-16 23:24:36', 0, 1);
INSERT INTO `def_msg_template` VALUES (250055645967941632, '244439130119864323', '01', 'REGISTER_SMS', '注册成功短信', b'1', 'SMS_99185070', '络火网', '', '尊敬的用户,欢迎注册络火网,您的注册验证码:${code},有效期5分钟。请勿将短信验证码告知他人', '', '[{\"key\":\"code\",\"value\":\"\"}]', '', NULL, b'1', NULL, '', 1452186486253289472, '2021-12-12 12:12:12', 1452186486253289472, '2023-08-16 23:24:41', 0, 1);
INSERT INTO `def_msg_template` VALUES (250055645967941632, '244439130119864323', '01', 'REGISTER_SMS', '注册成功短信', b'1', 'SMS_99185070', '络火网', '注册成功', '尊敬的用户,欢迎注册络火网,您的注册验证码:${code},有效期5分钟。请勿将短信验证码告知他人', '', '[{\"key\":\"code\",\"value\":\"\"}]', '', NULL, b'1', NULL, '', 1452186486253289472, '2021-12-12 12:12:12', 1452186486253289472, '2023-08-16 23:24:41', 0, 1);
INSERT INTO `def_msg_template` VALUES (250660012290998275, '250025856074776718', '01', 'BAIDU_SMS_REG', '百度注册短信', b'1', 'sms-tmpl-awKvRY85349', 'sms-signQxkiwz88470', NULL, '您的验证码为:${code}, ${minute}分钟内有效', '', '[{\"key\":\"code\",\"value\":\"\"},{\"key\":\"minute\",\"value\":\"\"}]', '', NULL, b'1', NULL, '', 1452186486253289472, '2021-12-12 12:12:12', 1452186486253289472, '2023-08-16 23:24:44', 0, 1);
INSERT INTO `def_msg_template` VALUES (250660012290998282, '250025856074776719', '01', 'TX_SMS', '腾讯注册短信', b'1', '1234', '腾讯云', NULL, '你的验证阿妈为: ${code}', NULL, '[{\"key\":\"code\",\"value\":\"\"}]', '', NULL, b'1', NULL, '', 1452186486253289472, '2021-12-12 12:12:12', 1452186486253289472, '2023-08-16 23:24:47', 0, 1);
INSERT INTO `def_msg_template` VALUES (251763346439667713, '251763346439667712', '03', 'TEST', '测试', b'1', NULL, '', '发送一个xx', '发送 ${xmmc}, 哈哈哈 ${name}.', NULL, '[{\"key\":\"xmmc\",\"value\":\"\"},{\"key\":\"name\",\"value\":\"\"}]', '', '02', b'1', '01', '', 1452186486253289472, '2021-12-12 12:12:12', 1452186486253289472, '2023-08-16 22:47:53', 0, 1);
INSERT INTO `def_msg_template` VALUES (252969897242394624, '244439130119864323', '01', 'MOBILE_LOGIN', '手机登录短信', b'1', 'SMS_99185070', '络火网', '', '本次验证码为:${code}', '', '[{\"key\":\"code\",\"value\":\"\"}]', '', NULL, b'1', NULL, '', 1452186486253289472, '2021-12-12 12:12:12', 1452186486253289472, '2023-08-16 23:50:23', 0, 1);
INSERT INTO `def_msg_template` VALUES (252969897242394625, '244881451621810192', '02', 'REGISTER_EMAIL', '注册邮件验证码', b'1', NULL, '', '欢迎注册${systemName}', '<!doctype html><html lang=\"en\"><head><meta charset=\"UTF-8\" /><title>${systemName}</title></head><body><div style=\"background-color: #ececec; padding: 15px\"><table cellpadding=\"0\" align=\"center\" style=\"width: 600px; margin: 0px auto; text-align: left; position: relative; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; font-size: 14px; font-family: 微软雅黑, 黑体; line-height: 1.5; box-shadow: rgb(153, 153, 153) 0px 0px 5px; border-collapse: collapse; background-position: initial initial; background-repeat: initial initial; background: #fff\"><tbody><tr><th valign=\"middle\" style=\"height: 25px; line-height: 25px; padding: 15px 35px; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; text-align: center\"><img src=\"https://cdn.hulaspark.com/avatar/logo.png\" width=\"180\" height=\"80\" alt=\"HuLa Logo\" /></th></tr><tr><td><div style=\"padding: 6px 35px 10px; background-color: #fff\"><h2 style=\"margin: 5px 0px\"><font color=\"#333333\" style=\"line-height: 20px\"><font style=\"line-height: 22px\" size=\"4\">亲爱的<b>${systemName}</b>用户,您好:</font></font></h2><p>首先感谢您使用${systemName},请在验证页面输入以下验证码:<br /><p style=\"font-size: 18px; text-align: center; font-weight: bold\">${emailCode}</p>本验证码${expireMinutes}分钟内有效,为了保障您的账户安全,请不要告诉别人<br />如果您有什么疑问可以联系管理员Email: ${adminEmail} </p><p align=\"right\">${systemName}</p><p align=\"right\">${currentTime}</p><div style=\"width: 700px; margin: 0 auto\"><div style=\"padding: 10px 10px 0; border-top: 1px solid #ccc; color: #747474; margin-bottom: 20px; line-height: 1.3em; font-size: 12px\"><p>本邮件系统自动发送,请勿回复<br />请保管好您的邮箱,避免账号被他人盗用</p></div></div></div></td></tr></tbody></table></div></body></html>', '// 逻辑\n\n\n// 返回\n[systemName: systemName, systemName: systemName, systemName: systemName, emailCode: emailCode, expireMinutes: expireMinutes, adminEmail: adminEmail, currentTime: currentTime]', '[{\"key\": \"systemName\", \"value\": \"\"}, {\"key\": \"systemName\", \"value\": \"\"}, {\"key\": \"emailCode\", \"value\": \"\"}, {\"key\": \"expireSeconds\", \"value\": \"\"}, {\"key\": \"adminEmail\", \"value\": \"\"}, {\"key\": \"currentTime\", \"value\": \"\"}]', '最新适配版本', NULL, b'1', NULL, '', 1452186486253289472, '2021-12-12 12:12:12', 1452186486253289472, '2023-08-14 22:42:09', 0, 1);
INSERT INTO `def_msg_template` VALUES (277119952886956032, '244439130119864323', '01', 'MOBILE_EDIT', '个人中心修改手机', b'1', 'SMS_99185070', '络火网', NULL, '您正在修改登录手机,您的验证码为:${code},请勿告知他人。', NULL, '[{\"key\":\"code\",\"value\":\"\"}]', NULL, NULL, b'1', NULL, NULL, 1452186486253289472, '2022-10-01 23:49:46', 1452186486253289472, '2023-08-16 23:50:12', 0, 1);
INSERT INTO `def_msg_template` VALUES (277119952886956032, '244439130119864323', '01', 'MOBILE_EDIT', '个人中心修改手机', b'1', 'SMS_99185070', '络火网', '修改${systemName}手机号', '您正在修改登录手机,您的验证码为:${code},请勿告知他人。', NULL, '[{\"key\":\"code\",\"value\":\"\"}]', NULL, NULL, b'1', NULL, NULL, 1452186486253289472, '2022-10-01 23:49:46', 1452186486253289472, '2023-08-16 23:50:12', 0, 1);
INSERT INTO `def_msg_template` VALUES (277119952886956033, '244881451621810192', '02', 'EMAIL_EDIT', '修改登录邮箱', b'1', NULL, NULL, '修改登录邮箱', '您正在修改登录邮箱,您的验证码为:${code},请勿告知他人。', NULL, '[{\"key\":\"code\",\"value\":\"\"}]', NULL, NULL, b'1', NULL, NULL, 1452186486253289472, '2022-10-01 23:50:13', 1452186486253289472, '2023-08-16 22:26:38', 0, 1);
INSERT INTO `def_msg_template` VALUES (395546031032642562, '244881451621810192', '02', 'PASSWORD_EDIT', '忘记密码', b'1', NULL, NULL, NULL, '<!doctype html><html lang=\"en\"><head><meta charset=\"UTF-8\" /><title>${systemName}</title></head><body><div style=\"background-color: #ececec; padding: 15px\"><table cellpadding=\"0\" align=\"center\" style=\"width: 600px; margin: 0px auto; text-align: left; position: relative; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; font-size: 14px; font-family: 微软雅黑, 黑体; line-height: 1.5; box-shadow: rgb(153, 153, 153) 0px 0px 5px; border-collapse: collapse; background-position: initial initial; background-repeat: initial initial; background: #fff\"><tbody><tr><th valign=\"middle\" style=\"height: 25px; line-height: 25px; padding: 15px 35px; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; text-align: center\"><img src=\"https://cdn.hulaspark.com/avatar/logo.png\" width=\"180\" height=\"80\" alt=\"HuLa Logo\" /></th></tr><tr><td><div style=\"padding: 6px 35px 10px; background-color: #fff\"><h2 style=\"margin: 5px 0px\"><font color=\"#333333\" style=\"line-height: 20px\"><font style=\"line-height: 22px\" size=\"4\">亲爱的<b>${systemName}</b>用户,您好:</font></font></h2><p>首先感谢您使用${systemName},请在验证页面输入以下验证码:<br /><p style=\"font-size: 18px; text-align: center; font-weight: bold\">${emailCode}</p>本验证码${expireMinutes}分钟内有效,为了保障您的账户安全,请不要告诉别人<br />如果您有什么疑问可以联系管理员Email: ${adminEmail} </p><p align=\"right\">${systemName}</p><p align=\"right\">${currentTime}</p><div style=\"width: 700px; margin: 0 auto\"><div style=\"padding: 10px 10px 0; border-top: 1px solid #ccc; color: #747474; margin-bottom: 20px; line-height: 1.3em; font-size: 12px\"><p>本邮件系统自动发送,请勿回复<br />请保管好您的邮箱,避免账号被他人盗用</p></div></div></div></td></tr></tbody></table></div></body></html>', NULL, '[{\"key\": \"systemName\", \"value\": \"\"}, {\"key\": \"systemName\", \"value\": \"\"}, {\"key\": \"emailCode\", \"value\": \"\"}, {\"key\": \"expireSeconds\", \"value\": \"\"}, {\"key\": \"adminEmail\", \"value\": \"\"}, {\"key\": \"currentTime\", \"value\": \"\"}]', NULL, NULL, b'1', NULL, NULL, 1452186486253289472, '2023-08-16 22:56:53', 1452186486253289472, '2023-08-16 22:57:21', 0, 1);
INSERT INTO `def_msg_template` VALUES (395546031032642562, '244881451621810192', '02', 'PASSWORD_EDIT', '忘记密码', b'1', NULL, NULL, '忘记${systemName}密码', '<!doctype html><html lang=\"en\"><head><meta charset=\"UTF-8\" /><title>${systemName}</title></head><body><div style=\"background-color: #ececec; padding: 15px\"><table cellpadding=\"0\" align=\"center\" style=\"width: 600px; margin: 0px auto; text-align: left; position: relative; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; font-size: 14px; font-family: 微软雅黑, 黑体; line-height: 1.5; box-shadow: rgb(153, 153, 153) 0px 0px 5px; border-collapse: collapse; background-position: initial initial; background-repeat: initial initial; background: #fff\"><tbody><tr><th valign=\"middle\" style=\"height: 25px; line-height: 25px; padding: 15px 35px; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; text-align: center\"><img src=\"https://cdn.hulaspark.com/avatar/logo.png\" width=\"180\" height=\"80\" alt=\"HuLa Logo\" /></th></tr><tr><td><div style=\"padding: 6px 35px 10px; background-color: #fff\"><h2 style=\"margin: 5px 0px\"><font color=\"#333333\" style=\"line-height: 20px\"><font style=\"line-height: 22px\" size=\"4\">亲爱的<b>${systemName}</b>用户,您好:</font></font></h2><p>首先感谢您使用${systemName},请在验证页面输入以下验证码:<br /><p style=\"font-size: 18px; text-align: center; font-weight: bold\">${emailCode}</p>本验证码${expireMinutes}分钟内有效,为了保障您的账户安全,请不要告诉别人<br />如果您有什么疑问可以联系管理员Email: ${adminEmail} </p><p align=\"right\">${systemName}</p><p align=\"right\">${currentTime}</p><div style=\"width: 700px; margin: 0 auto\"><div style=\"padding: 10px 10px 0; border-top: 1px solid #ccc; color: #747474; margin-bottom: 20px; line-height: 1.3em; font-size: 12px\"><p>本邮件系统自动发送,请勿回复<br />请保管好您的邮箱,避免账号被他人盗用</p></div></div></div></td></tr></tbody></table></div></body></html>', NULL, '[{\"key\": \"systemName\", \"value\": \"\"}, {\"key\": \"systemName\", \"value\": \"\"}, {\"key\": \"emailCode\", \"value\": \"\"}, {\"key\": \"expireSeconds\", \"value\": \"\"}, {\"key\": \"adminEmail\", \"value\": \"\"}, {\"key\": \"currentTime\", \"value\": \"\"}]', NULL, NULL, b'1', NULL, NULL, 1452186486253289472, '2023-08-16 22:56:53', 1452186486253289472, '2023-08-16 22:57:21', 0, 1);
-- ----------------------------
-- Table structure for def_parameter
@@ -1796,7 +1802,7 @@ CREATE TABLE `def_user` (
-- Records of def_user
-- ----------------------------
INSERT INTO `def_user` VALUES (61170828519936, 2, 'bot', 'HuLa小管家', '', '022', NULL, NULL, '', NULL, b'0', '', '', '1', b'1', '', '2025-08-11 11:11:03.139', '{\"createIp\": \"206.237.119.215\", \"updateIp\": \"120.231.232.41\", \"createIpDetail\": null, \"updateIpDetail\": null}', '2025-08-19 10:05:05', 1, NULL, 'a4d5c225e6709ba025272a31c7e90e0121d5e5ba16695afe0b61370bedb677d0', 'Dawn', '2025-07-07 15:27:02', 1, '2025-03-27 04:23:08', NULL, '2025-07-16 12:26:15', 0, 1);
INSERT INTO `def_user` VALUES (61170828519937, 2, '2439646234', 'Dawn', '2439646234@qq.com', 'https://cdn.hulaspark.com/avatar/2439646234/6ec99d37b8ba1296c325d2d36b46a14d.webp', NULL, NULL, '', NULL, b'0', '', '', '1', b'1', '', '2025-08-11 11:11:03.189', '{\"createIp\": \"206.237.119.215\", \"updateIp\": \"192.168.1.37\", \"createIpDetail\": null, \"updateIpDetail\": {\"ip\": \"192.168.1.37\", \"isp\": \"内网IP\", \"area\": \"\", \"city\": \"内网IP\", \"isp_id\": \"local\", \"region\": \"\", \"city_id\": \"local\", \"country\": \"\", \"region_id\": \"\", \"country_id\": \"\"}}', NULL, 0, NULL, 'a4d5c225e6709ba025272a31c7e90e0121d5e5ba16695afe0b61370bedb677d0', 'Dawn', '2025-09-26 17:56:51', 1, '2025-03-27 04:23:08', NULL, '2025-09-26 17:56:51', 0, 1);
INSERT INTO `def_user` VALUES (61170828519937, 2, '2439646234', 'Dawn', '2439646234@qq.com', 'https://cdn.hulaspark.com/avatar/2439646234/6ec99d37b8ba1296c325d2d36b46a14d.webp', NULL, NULL, '', NULL, b'0', '', '', '1', b'1', '', '2025-08-11 11:11:03.189', '{\"createIp\": \"206.237.119.215\", \"updateIp\": \"192.168.1.37\", \"createIpDetail\": null, \"updateIpDetail\": {\"ip\": \"192.168.1.37\", \"isp\": \"内网IP\", \"area\": \"\", \"city\": \"内网IP\", \"isp_id\": \"local\", \"region\": \"\", \"city_id\": \"local\", \"country\": \"\", \"region_id\": \"\", \"country_id\": \"\"}}', NULL, 0, NULL, 'a4d5c225e6709ba025272a31c7e90e0121d5e5ba16695afe0b61370bedb677d0', 'Dawn', '2025-10-11 18:27:00', 1, '2025-03-27 04:23:08', NULL, '2025-10-11 18:27:00', 0, 1);
-- ----------------------------
-- Table structure for def_user_application
@@ -1880,6 +1886,8 @@ CREATE TABLE `extend_interface_log` (
-- ----------------------------
-- Records of extend_interface_log
-- ----------------------------
INSERT INTO `extend_interface_log` VALUES (66567882983426, 244439130119864323, '阿里短信', 0, 1, '2025-08-26 16:37:01', '2025-08-26 16:37:00', NULL, '2025-08-26 16:37:00', NULL, 0, 0);
INSERT INTO `extend_interface_log` VALUES (655249535051914248, 244881451621810192, '腾讯邮件', 222, 37, '2025-10-10 09:11:17', '2025-07-16 18:41:01', NULL, '2025-07-16 18:41:01', NULL, 0, 0);
-- ----------------------------
-- Table structure for extend_interface_logging
@@ -2060,15 +2068,15 @@ CREATE TABLE `worker_node` (
`created` timestamp NULL DEFAULT NULL COMMENT '创建时间',
`is_del` tinyint(1) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = 'DB;WorkerID Assigner for UID Generator' ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 765 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = 'DB;WorkerID Assigner for UID Generator' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of worker_node
-- ----------------------------
INSERT INTO `worker_node` VALUES (1, '240e:3b3:30b4:1f60:d382:ae04:eb18:d48', '1758880098590-54351', 2, '2025-09-26', '2025-09-26 17:48:19', '2025-09-26 17:48:19', 0);
INSERT INTO `worker_node` VALUES (2, '240e:3b3:30b4:1f60:d382:ae04:eb18:d48', '1758880114275-29594', 2, '2025-09-26', '2025-09-26 17:48:34', '2025-09-26 17:48:34', 0);
INSERT INTO `worker_node` VALUES (3, '240e:3b3:30b4:1f60:d382:ae04:eb18:d48', '1758880134622-39281', 2, '2025-09-26', '2025-09-26 17:48:55', '2025-09-26 17:48:55', 0);
INSERT INTO `worker_node` VALUES (4, '240e:3b3:30b4:1f60:d382:ae04:eb18:d48', '1758880146931-64715', 2, '2025-09-26', '2025-09-26 17:49:07', '2025-09-26 17:49:07', 0);
INSERT INTO `worker_node` VALUES (5, '240e:3b3:30b4:1f60:d382:ae04:eb18:d48', '1758880164411-51026', 2, '2025-09-26', '2025-09-26 17:49:24', '2025-09-26 17:49:24', 0);
INSERT INTO `worker_node` VALUES (760, '240e:3b3:30b4:1f60:d382:ae04:eb18:d48', '1760153290834-59563', 2, '2025-10-11', '2025-10-11 11:28:11', '2025-10-11 11:28:11', 0);
INSERT INTO `worker_node` VALUES (761, '240e:3b3:30b4:1f60:d382:ae04:eb18:d48', '1760153295768-6425', 2, '2025-10-11', '2025-10-11 11:28:16', '2025-10-11 11:28:16', 0);
INSERT INTO `worker_node` VALUES (762, '240e:3b3:30b4:1f60:d382:ae04:eb18:d48', '1760153296437-43886', 2, '2025-10-11', '2025-10-11 11:28:16', '2025-10-11 11:28:16', 0);
INSERT INTO `worker_node` VALUES (763, '240e:3b3:30b4:1f60:d382:ae04:eb18:d48', '1760153304108-67251', 2, '2025-10-11', '2025-10-11 11:28:24', '2025-10-11 11:28:24', 0);
INSERT INTO `worker_node` VALUES (764, '240e:3b3:30b4:1f60:d382:ae04:eb18:d48', '1760153319987-85683', 2, '2025-10-11', '2025-10-11 11:28:40', '2025-10-11 11:28:40', 0);
SET FOREIGN_KEY_CHECKS = 1;

View File

@@ -11,7 +11,7 @@
Target Server Version : 80030 (8.0.30)
File Encoding : 65001
Date: 26/09/2025 18:09:58
Date: 11/10/2025 18:27:42
*/
SET NAMES utf8mb4;
@@ -141,6 +141,7 @@ CREATE TABLE `ai_gpt_chat` (
-- ----------------------------
-- Records of ai_gpt_chat
-- ----------------------------
INSERT INTO `ai_gpt_chat` VALUES (6, '1920746450749358080', 0, 10937855681024, '你好', '', 10937855681024, '2025-05-13 10:47:15', NULL, NULL, 1);
-- ----------------------------
-- Table structure for ai_gpt_chat_message
@@ -272,8 +273,8 @@ CREATE TABLE `ai_gpt_openkey` (
-- ----------------------------
INSERT INTO `ai_gpt_openkey` VALUES (1, 'ChatGPT', '', '', '', 100000, 0, 0, 1, '1046762075@qq.com', 0, '2025-03-07 18:17:46', NULL, NULL, 0);
INSERT INTO `ai_gpt_openkey` VALUES (2, 'WENXIN', '', '', '', 100000, 0, 0, 1, '', 0, '2025-03-05 20:33:20', NULL, NULL, 0);
INSERT INTO `ai_gpt_openkey` VALUES (3, 'QIANWEN', 'sk-cc182631c3244fcd18fc8856c321b4e07', 'sk-cc182631c3244fcd8fc8856c1321b4e07', 'sk-cc182631c3244fcd8fc88516c321b4e07', 100000, 0, 0, 1, '', 0, '2025-09-26 10:09:40', NULL, NULL, 0);
INSERT INTO `ai_gpt_openkey` VALUES (4, 'SPARK', '0f1760da92baf60148056907115fc1ca0', '0f1760da92baf60480561907115fc1ca0', '0f1760da92baf60480561907115fc1ca0', 100000, 0, 0, 1, '', 0, '2025-09-26 10:09:42', NULL, NULL, 0);
INSERT INTO `ai_gpt_openkey` VALUES (3, 'QIANWEN', 'sk-cc182631c3244fcd8fc8856c321b4e07', 'sk-cc182631c3244fcd8fc8856c321b4e07', 'sk-cc182631c3244fcd8fc8856c321b4e07', 100000, 0, 0, 1, '', 0, '2025-05-11 20:30:23', NULL, NULL, 0);
INSERT INTO `ai_gpt_openkey` VALUES (4, 'SPARK', '0f1760da92baf6048056907115fc1ca0', '0f1760da92baf6048056907115fc1ca0', '0f1760da92baf6048056907115fc1ca0', 100000, 0, 0, 1, '', 0, '2025-05-11 21:01:31', NULL, NULL, 0);
INSERT INTO `ai_gpt_openkey` VALUES (5, 'ChatGLM', '', '', '', 100000, 0, 0, 1, '', 0, '2025-03-05 20:33:20', NULL, NULL, 0);
INSERT INTO `ai_gpt_openkey` VALUES (6, 'Moonshot', 'sk-iJRKZOS3oA8x9k1kB8xWSvTmecbpAue1qDsGTh8pc1p6I3x0', 'sk-iJRKZOS3oA8x9k1kB8xWSvTmecbpAue1qDsGTh8pc1p6I3x0', 'sk-iJRKZOS3oA8x9k1kB8xWSvTmecbpAue1qDsGTh8pc1p6I3x0', 100000, 0, 0, 1, '', 0, '2025-05-11 20:09:13', NULL, NULL, 0);
INSERT INTO `ai_gpt_openkey` VALUES (7, 'Internlm', '', '', '', 100000, 0, 0, 1, '', 0, '2025-03-05 20:33:20', NULL, NULL, 0);
@@ -380,8 +381,8 @@ CREATE TABLE `base_config` (
INSERT INTO `base_config` VALUES (1, 'system', '{\"title\":\"系统名称\",\"componentType\":\"text\",\"value\":\"Hula-IM\",\"configKey\":\"systemName\",\"type\":\"system\"}', 'systemName', 'HuLa', 0, '2025-06-26 07:42:06.404', '2025-06-26 07:42:06.494', 3, NULL, 0);
INSERT INTO `base_config` VALUES (2, 'system', '{\"title\":\"系统Logo\",\"componentType\":\"text\",\"value\":\"/static/img/Iogo.png\",\"configKey\":\"logo\",\"type\":\"system\"}', 'logo', '/static/img/Iogo.png', 0, '2025-06-26 07:42:06.404', '2025-06-26 07:42:06.494', 3, NULL, 0);
INSERT INTO `base_config` VALUES (3, 'qiniu_up_config', '{\"title\":\"空间域名 Domain\",\"componentType\":\"text\",\"value\":\"https://upload-z2.qiniup.com\",\"configKey\":\"qnUploadUrl\",\"type\":\"qiniu_up_config\"}', 'qnUploadUrl', 'https://up-z2.qiniup.com', 0, '2025-06-26 07:42:06.404', '2025-08-18 04:29:56.616', 3, NULL, 0);
INSERT INTO `base_config` VALUES (4, 'qiniu_up_config', '{\"title\":\"accessKey\",\"componentType\":\"text\",\"value\":\"8si6G11kNDLgA5_\",\"configKey\":\"qnAccessKey\",\"type\":\"qiniu_up_config\"}', 'qnAccessKey', 'LXrRo6Yh1JAQaUGUJ', 0, '2025-06-26 07:42:06.404', '2025-09-26 09:45:10.485', 3, NULL, 0);
INSERT INTO `base_config` VALUES (5, 'qiniu_up_config', '{\"title\":\"SecretKey\",\"componentType\":\"text\",\"value\":\"MLzT2U2daTX1Ay4m_eS9\",\"configKey\":\"qnSecretKey\",\"type\":\"qiniu_up_config\"}', 'qnSecretKey', 'BYKKz6nIjHSJLa1lemF2Hg', 0, '2025-06-26 07:42:06.404', '2025-09-26 09:45:13.415', 3, NULL, 0);
INSERT INTO `base_config` VALUES (4, 'qiniu_up_config', '{\"title\":\"accessKey\",\"componentType\":\"text\",\"value\":\"231YmL0vGAYFTW-rHl4LgA5_\",\"configKey\":\"qnAccessKey\",\"type\":\"qiniu_up_config\"}', 'qnAccessKey', 'LXrRo6YhT22hy5yScLzQJAQaUGUJ', 0, '2025-06-26 07:42:06.404', '2025-10-11 03:43:10.679', 3, NULL, 0);
INSERT INTO `base_config` VALUES (5, 'qiniu_up_config', '{\"title\":\"SecretKey\",\"componentType\":\"text\",\"value\":\"2daTXFDEG9PuAy4TnvfR1o2\",\"configKey\":\"qnSecretKey\",\"type\":\"qiniu_up_config\"}', 'qnSecretKey', 'BYKKz6n222111VS-llemF2Hg', 0, '2025-06-26 07:42:06.404', '2025-10-11 03:43:05.090', 3, NULL, 0);
INSERT INTO `base_config` VALUES (6, 'qiniu_up_config', '{\"title\":\"存储空间名称\",\"componentType\":\"text\",\"value\":\"hula\",\"configKey\":\"qnStorageName\",\"type\":\"qiniu_up_config\"}', 'qnStorageName', 'hula-spark', 0, '2025-06-26 07:42:06.404', '2025-06-26 07:42:06.494', 3, NULL, 0);
INSERT INTO `base_config` VALUES (7, 'qiniu_up_config', '{\"title\":\"七牛云CDN访问图片用的\",\"componentType\":\"text\",\"value\":\"https://file.hula.com/\",\"configKey\":\"qnStorageCDN\",\"type\":\"qiniu_up_config\"}', 'qnStorageCDN', 'https://cdn.hulaspark.com', 0, '2025-06-26 07:42:06.404', '2025-06-26 07:42:06.494', 3, NULL, 0);
INSERT INTO `base_config` VALUES (8, 'system', '{\"title\":\"大群ID\",\"componentType\":\"text\",\"value\":\"1\",\"configKey\":\"roomGroupId\",\"type\":\"system\"}', 'roomGroupId', '1', 0, '2025-06-26 07:42:06.404', '2025-06-26 07:42:06.494', 3, NULL, 0);
@@ -411,12 +412,11 @@ CREATE TABLE `im_announcements` (
`is_del` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除',
`tenant_id` bigint NOT NULL DEFAULT 1,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 75996980144129 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_as_ci COMMENT = '聊天公告表' ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 82552736018433 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_as_ci COMMENT = '聊天公告表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of im_announcements
-- ----------------------------
INSERT INTO `im_announcements` VALUES (21371346277888, 21239271839232, 11225442329600, '你好啊', 0, 0, '2025-04-24 23:22:06', NULL, NULL, 0, 1);
-- ----------------------------
-- Table structure for im_announcements_read_records
@@ -489,13 +489,14 @@ CREATE TABLE `im_contact` (
INDEX `idx_create_time`(`create_time` ASC) USING BTREE,
INDEX `idx_update_time`(`update_time` ASC) USING BTREE,
INDEX `idx_contact_room_uid_hide`(`room_id` ASC, `uid` ASC, `hide` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 69082079079163 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '会话列表' ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 69082079229806 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '会话列表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of im_contact
-- ----------------------------
INSERT INTO `im_contact` VALUES (10937855681025, 10937855681024, 1, 0, 0, '2025-09-26 17:56:52.462', 1, 0, '2025-09-26 16:38:31.943', 77802288279040, '2025-03-27 04:23:08.420', '2025-09-26 17:56:52.462', 1, 0, 61170828519937, 0);
INSERT INTO `im_contact` VALUES (10937855681525, 1, 1, 0, 0, '2025-07-07 14:49:04.239', 1, 0, '2025-09-26 16:38:31.943', 77802288279040, '2025-03-27 04:23:08.420', '2025-09-26 08:38:32.260', 1, 0, NULL, 0);
INSERT INTO `im_contact` VALUES (10937855681025, 10937855681024, 1, 0, 0, '2025-10-11 18:27:03.193', 1, 0, '2025-10-10 18:46:37.156', 82907955820032, '2025-03-27 04:23:08.420', '2025-10-11 18:27:03.194', 1, 0, 61170828519937, 0);
INSERT INTO `im_contact` VALUES (10937855681525, 1, 1, 0, 0, '2025-07-07 14:49:04.239', 1, 0, '2025-10-10 18:46:37.156', 82907955820032, '2025-03-27 04:23:08.420', '2025-10-10 10:46:38.197', 1, 0, NULL, 0);
INSERT INTO `im_contact` VALUES (10937855681526, 10937855681024, 11229133317122, 0, 0, '2025-10-11 11:58:14.001', 1, 0, '2025-10-10 18:46:37.156', 82907955820032, '2025-03-27 04:23:08.420', '2025-10-11 11:58:14.001', 1, 0, 61170828519937, 0);
-- ----------------------------
-- Table structure for im_feed
@@ -559,6 +560,32 @@ CREATE TABLE `im_feed_target` (
-- Records of im_feed_target
-- ----------------------------
-- ----------------------------
-- Table structure for im_group_invite
-- ----------------------------
DROP TABLE IF EXISTS `im_group_invite`;
CREATE TABLE `im_group_invite` (
`id` bigint NOT NULL AUTO_INCREMENT,
`group_id` bigint NOT NULL COMMENT '群组ID',
`inviter_uid` bigint NOT NULL COMMENT '邀请人ID',
`invitee_uid` bigint NOT NULL COMMENT '被邀请人ID',
`tenant_id` bigint NOT NULL DEFAULT 1,
`state` tinyint NOT NULL DEFAULT 0 COMMENT '0=待审批,1=已同意,2=已拒绝',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`update_time` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`create_by` bigint NOT NULL DEFAULT 1 COMMENT '创建者',
`update_by` bigint NULL DEFAULT NULL COMMENT '更新者',
`is_del` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除',
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_invitee_state`(`invitee_uid` ASC, `state` ASC) USING BTREE,
INDEX `idx_group`(`group_id` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 62581624628737 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '群组邀请记录表' ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Records of im_group_invite
-- ----------------------------
INSERT INTO `im_group_invite` VALUES (62581624628736, 26248738827266, 10937855681024, 11013365735936, 1, 0, '2025-08-15 16:37:03', '2025-08-15 16:37:03', 10937855681024, 61847994706433, 0);
-- ----------------------------
-- Table structure for im_group_member
-- ----------------------------
@@ -582,7 +609,7 @@ CREATE TABLE `im_group_member` (
INDEX `idx_create_time`(`create_time` ASC) USING BTREE,
INDEX `idx_update_time`(`update_time` ASC) USING BTREE,
INDEX `idx_group_member_uid_isdel_groupid`(`uid` ASC, `is_del` ASC, `group_id` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 77814703420417 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '群成员表' ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 82522826436610 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '群成员表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of im_group_member
@@ -645,7 +672,7 @@ CREATE TABLE `im_message` (
INDEX `idx_from_uid`(`from_uid` ASC) USING BTREE,
INDEX `idx_create_time`(`create_time` ASC) USING BTREE,
INDEX `idx_update_time`(`update_time` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 77814799889409 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '消息表' ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 82910984107521 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '消息表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of im_message
@@ -653,7 +680,6 @@ CREATE TABLE `im_message` (
INSERT INTO `im_message` VALUES (10939168498176, 1, 10937855681024, NULL, NULL, 0, NULL, 7, '{\"recall\": null, \"fileMsg\": null, \"atUidList\": null, \"imgMsgDTO\": null, \"soundMsgDTO\": null, \"videoMsgDTO\": null, \"emojisMsgDTO\": {\"url\": \"https://bbs-static.miyoushe.com/static/2024/10/24/1b9f7abf6e8338291f02e882a1ffec64_7988382128756120451.png\"}, \"urlContentMap\": null}', '2025-03-27 04:28:21.410', NULL, '2025-03-27 04:28:21.431', NULL, 1, 0);
INSERT INTO `im_message` VALUES (10939189469696, 1, 10937855681024, '更新咯', NULL, 0, NULL, 1, '{\"recall\": null, \"fileMsg\": null, \"atUidList\": null, \"imgMsgDTO\": null, \"soundMsgDTO\": null, \"videoMsgDTO\": null, \"emojisMsgDTO\": null, \"urlContentMap\": {}}', '2025-03-27 04:28:26.276', NULL, '2025-03-27 04:28:26.295', NULL, 1, 0);
INSERT INTO `im_message` VALUES (10939243995648, 1, 10937855681024, '大家快来占沙发', NULL, 0, NULL, 1, '{\"recall\": null, \"fileMsg\": null, \"atUidList\": null, \"imgMsgDTO\": null, \"soundMsgDTO\": null, \"videoMsgDTO\": null, \"emojisMsgDTO\": null, \"urlContentMap\": {}}', '2025-03-27 04:28:39.792', NULL, '2025-03-27 04:28:39.800', NULL, 1, 0);
INSERT INTO `im_message` VALUES (10940166742528, 1, 10937855681024, NULL, NULL, 0, NULL, 7, '{\"recall\": null, \"fileMsg\": null, \"atUidList\": null, \"imgMsgDTO\": null, \"soundMsgDTO\": null, \"videoMsgDTO\": null, \"emojisMsgDTO\": {\"url\": \"https://bbs-static.miyoushe.com/static/2023/11/16/e03be25a7b2bc86f2b1909dddb6ca915_6686505940047795068.png\"}, \"urlContentMap\": null}', '2025-03-27 04:32:19.702', NULL, '2025-03-27 04:32:19.709', NULL, 1, 0);
-- ----------------------------
-- Table structure for im_message_mark
@@ -676,7 +702,7 @@ CREATE TABLE `im_message_mark` (
INDEX `idx_uid`(`uid` ASC) USING BTREE,
INDEX `idx_create_time`(`create_time` ASC) USING BTREE,
INDEX `idx_update_time`(`update_time` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 76222189103617 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '消息标记表' ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 82582746263553 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '消息标记表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of im_message_mark
@@ -694,8 +720,8 @@ CREATE TABLE `im_notice` (
`receiver_id` bigint NOT NULL COMMENT '接收人UID',
`apply_id` bigint NULL DEFAULT NULL COMMENT '申请ID',
`operate_id` bigint NOT NULL COMMENT '房间ID',
`name` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '群昵称',
`content` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '通知消息 [申请时填写]',
`name` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '0' COMMENT '群昵称',
`content` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '0' COMMENT '通知消息 [申请时填写]',
`status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '处理状态:0-未处理;1-已同意;2-已拒绝',
`is_read` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否已读',
`tenant_id` bigint NOT NULL COMMENT '租户id',
@@ -708,7 +734,7 @@ CREATE TABLE `im_notice` (
INDEX `idx_receiver_type`(`receiver_id` ASC, `event_type` ASC) USING BTREE,
INDEX `idx_sender`(`sender_id` ASC) USING BTREE,
INDEX `idx_related`(`apply_id` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 77799729753608 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '统一通知表' ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 83150193654275 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '统一通知表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of im_notice
@@ -758,12 +784,13 @@ CREATE TABLE `im_room` (
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_create_time`(`create_time` ASC) USING BTREE,
INDEX `idx_update_time`(`update_time` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 77797351583235 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '房间表' ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 82522826436611 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '房间表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of im_room
-- ----------------------------
INSERT INTO `im_room` VALUES (1, 1, 1, '2025-09-26 16:38:31.943', 77802288279040, NULL, '2024-07-10 11:17:15.521', '2025-09-26 08:38:32.130', 1, 1, NULL, 0);
INSERT INTO `im_room` VALUES (1, 1, 1, '2025-10-10 18:46:37.156', 82907955820032, NULL, '2024-07-10 11:17:15.521', '2025-10-10 10:46:37.155', 1, 1, NULL, 0);
INSERT INTO `im_room` VALUES (11229133317122, 2, 0, '2025-10-10 18:46:37.156', 82907955820032, NULL, '2024-07-10 11:17:15.521', '2025-10-11 03:35:25.988', 1, 1, NULL, 0);
-- ----------------------------
-- Table structure for im_room_friend
@@ -788,11 +815,12 @@ CREATE TABLE `im_room_friend` (
INDEX `idx_room_id`(`room_id` ASC) USING BTREE,
INDEX `idx_create_time`(`create_time` ASC) USING BTREE,
INDEX `idx_update_time`(`update_time` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 77797351583236 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '单聊房间表' ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 82522826436612 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '单聊房间表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of im_room_friend
-- ----------------------------
INSERT INTO `im_room_friend` VALUES (11229133317123, 11229133317122, 10937855681024, 1, '1,10937855681024', 0, 0, '2025-03-27 23:40:34.548', '2025-10-11 03:34:48.606', 1, 1, NULL, 0);
-- ----------------------------
-- Table structure for im_room_group
@@ -821,7 +849,7 @@ CREATE TABLE `im_room_group` (
-- ----------------------------
-- Records of im_room_group
-- ----------------------------
INSERT INTO `im_room_group` VALUES (1, 1, 'hula-ds240401', 'HuLa官方频道', 'https://cdn.hulaspark.com/avatar/hula.png', 1, NULL, 0, '2024-07-10 11:17:15.523', '2025-03-31 20:59:45.523', 1, 1, NULL);
INSERT INTO `im_room_group` VALUES (1, 1, 'hula-ds240401', 'HuLa官方频道', 'https://cdn.hulaspark.com/avatar/hula.png', 1, NULL, 0, '2024-07-10 11:17:15.523', '2025-10-06 03:57:29.384', 1, 1, 61170828519937);
-- ----------------------------
-- Table structure for im_sensitive_word
@@ -899,13 +927,13 @@ CREATE TABLE `im_user` (
INDEX `idx_update_time`(`update_time` ASC) USING BTREE,
INDEX `idx_active_status_last_opt_time`(`last_opt_time` ASC) USING BTREE,
INDEX `account_UNIQUE`(`account` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 77797351583233 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户表' ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 82522826436609 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of im_user
-- ----------------------------
INSERT INTO `im_user` VALUES (1, 61170828519936, 2, 'HuLa小管家', '022', '', 'bot', NULL, '', 17, '2025-07-07 15:27:01.711', '{\"createIp\": \"206.237.119.215\", \"updateIp\": \"120.231.232.41\", \"createIpDetail\": {\"ip\": \"206.237.119.215\", \"isp\": \"\", \"area\": \"\", \"city\": \"\", \"isp_id\": \"\", \"region\": \"\", \"city_id\": \"\", \"country\": \"美国\", \"region_id\": \"\", \"country_id\": \"US\"}, \"updateIpDetail\": {\"ip\": \"120.231.232.41\", \"isp\": \"移动\", \"area\": \"\", \"city\": \"\", \"isp_id\": \"100025\", \"region\": \"广东\", \"city_id\": \"\", \"country\": \"中国\", \"region_id\": \"440000\", \"country_id\": \"CN\"}}', 6, 0, '', '2025-03-27 04:23:08.393', '2025-09-17 02:34:06.481', 'k.23772439646234', 0, NULL, 0, '2025-05-09 18:24:37.089', 99978, 0, 1);
INSERT INTO `im_user` VALUES (10937855681024, 61170828519937, 3, 'Dawn', 'https://cdn.hulaspark.com/avatar/2439646234/97320189485dca88dcc7a70054445a56.webp', '2439646234@qq.com', '2439646234', NULL, '', 7, '2025-07-30 15:31:57.651', '{\"createIp\": \"206.237.119.215\", \"updateIp\": \"192.168.1.37\", \"createIpDetail\": null, \"updateIpDetail\": {\"ip\": \"192.168.1.37\", \"isp\": \"内网IP\", \"area\": \"\", \"city\": \"内网IP\", \"isp_id\": \"local\", \"region\": \"\", \"city_id\": \"local\", \"country\": \"\", \"region_id\": \"\", \"country_id\": \"\"}}', 5, 0, '', '2025-03-27 04:23:08.393', '2025-09-26 17:50:10.357', 'k.2439646234', 0, NULL, 0, '2025-09-20 21:35:31.415', 99978, 0, 1);
INSERT INTO `im_user` VALUES (10937855681024, 61170828519937, 3, 'Dawn', 'https://cdn.hulaspark.com/avatar/2439646234/97320189485dca88dcc7a70054445a56.webp', '2439646234@qq.com', '2439646234', NULL, '', 4, '2025-07-30 15:31:57.651', '{\"createIp\": \"206.237.119.215\", \"updateIp\": \"192.168.1.37\", \"createIpDetail\": null, \"updateIpDetail\": {\"ip\": \"192.168.1.37\", \"isp\": \"内网IP\", \"area\": \"\", \"city\": \"内网IP\", \"isp_id\": \"local\", \"region\": \"\", \"city_id\": \"local\", \"country\": \"\", \"region_id\": \"\", \"country_id\": \"\"}}', 6, 0, '', '2025-03-27 04:23:08.393', '2025-10-11 10:27:11.457', 'k.2439646234', 0, NULL, 0, '2025-09-20 21:35:31.415', 99978, 0, 1);
-- ----------------------------
-- Table structure for im_user_apply
@@ -934,7 +962,7 @@ CREATE TABLE `im_user_apply` (
INDEX `idx_target_id`(`target_id` ASC) USING BTREE,
INDEX `idx_create_time`(`create_time` ASC) USING BTREE,
INDEX `idx_update_time`(`update_time` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 77799729753602 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户申请表' ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 82880386659841 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户申请表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of im_user_apply
@@ -961,15 +989,12 @@ CREATE TABLE `im_user_backpack` (
INDEX `idx_uid`(`uid` ASC) USING BTREE,
INDEX `idx_create_time`(`create_time` ASC) USING BTREE,
INDEX `idx_update_time`(`update_time` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 77797351583243 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户背包表' ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 82522826436619 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户背包表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of im_user_backpack
-- ----------------------------
INSERT INTO `im_user_backpack` VALUES (10937855681027, 10937855681024, 1, 0, '1_1_10937855681024', '2025-03-27 04:23:08.580', '2025-03-27 04:23:08.580', 1, 0, NULL, 0);
INSERT INTO `im_user_backpack` VALUES (10937855681028, 10937855681024, 3, 0, '3_1_10937855681024', '2025-03-27 04:23:08.564', '2025-03-27 04:23:08.564', 1, 0, NULL, 0);
INSERT INTO `im_user_backpack` VALUES (10937855681029, 10937855681024, 6, 0, '6_1_10937855681024', '2025-03-27 04:27:34.443', '2025-03-27 04:27:34.443', 1, 0, NULL, 0);
INSERT INTO `im_user_backpack` VALUES (10937855681030, 20901198351872, 6, 0, '6_1_20901198351872', '2025-03-27 04:27:34.443', '2025-03-27 04:27:34.443', 1, 0, NULL, 0);
-- ----------------------------
-- Table structure for im_user_block
@@ -1007,15 +1032,12 @@ CREATE TABLE `im_user_emoji` (
`update_by` bigint NULL DEFAULT NULL COMMENT '更新者',
PRIMARY KEY (`id`) USING BTREE,
INDEX `IDX_USER_EMOJIS_UID`(`uid` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 77456098815489 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户表情包' ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 80580641386497 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户表情包' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of im_user_emoji
-- ----------------------------
INSERT INTO `im_user_emoji` VALUES (10951726244352, 10937855681024, 'https://cdn.hulaspark.com/chat/2439646234/c64611c3bbbcd197552b7f84ac4b709b.jpg', 0, '2025-03-27 05:18:15.512', '2025-03-27 05:18:15.512', 1, 0, NULL);
INSERT INTO `im_user_emoji` VALUES (11099252499456, 10937855681024, 'https://cdn.hulaspark.com/chat/2439646234/34c18e6c846bf18525a2eb180179ff5a.jpg', 0, '2025-03-27 15:04:28.904', '2025-03-27 15:04:28.904', 1, 0, NULL);
INSERT INTO `im_user_emoji` VALUES (11099458020352, 10937855681024, 'https://cdn.hulaspark.com/chat/2439646234/bb124e9812456b4f6c9c2b3dcfeb859b.jpg', 0, '2025-03-27 15:05:17.671', '2025-03-27 15:05:17.671', 1, 0, NULL);
INSERT INTO `im_user_emoji` VALUES (11465121637376, 11002917724672, 'https://cdn.hulaspark.com/chat/a13501369717/8b4ed30d4b58e59aab62004774915d3b.jpg', 1, '2025-03-28 15:18:18.011', '2025-03-28 15:18:22.875', 1, 0, NULL);
-- ----------------------------
-- Table structure for im_user_friend
@@ -1043,11 +1065,13 @@ CREATE TABLE `im_user_friend` (
INDEX `idx_uid_friend_uid`(`uid` ASC, `friend_uid` ASC) USING BTREE,
INDEX `idx_create_time`(`create_time` ASC) USING BTREE,
INDEX `idx_update_time`(`update_time` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 77797351583238 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户联系人表' ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 82881355544066 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户联系人表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of im_user_friend
-- ----------------------------
INSERT INTO `im_user_friend` VALUES (11367692149761, 11229133317122, 1, 10937855681024, 0, 0, 0, 0, 0, 0, 0, NULL, '2025-03-28 08:51:09.399', '2025-10-11 03:34:59.682', 1, 0, NULL);
INSERT INTO `im_user_friend` VALUES (11515012883456, 11229133317122, 10937855681024, 1, 0, 0, 0, 0, 0, 0, 0, NULL, '2025-03-28 18:36:33.214', '2025-10-11 03:35:00.200', 1, 0, NULL);
-- ----------------------------
-- Table structure for im_user_privacy
@@ -1124,39 +1148,37 @@ CREATE TABLE `im_user_state` (
-- ----------------------------
-- Records of im_user_state
-- ----------------------------
INSERT INTO `im_user_state` VALUES (1, '在线', '/status/online.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (2, '离开', '/status/leave.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (3, '忙碌', '/status/busy.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (4, '请勿打扰', '/status/IonBan.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (5, '隐身', '/status/cloaking.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (6, '离线', '/status/offline.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (7, '今日天气', '/status/weather_3x.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (8, '一言难尽', '/status/hardtosay@3x.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (9, '我太难了', '/status/toohard@3x.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (10, '难得糊涂', '/status/nandehutu.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (11, '元气满满', '/status/fullofyuanqi@3x.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (12, '嗨到飞起', '/status/happytofly@3x.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (13, '水逆退散', '/status/luck@2x.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (14, '好运锦鲤', '/status/jinli@2x.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (15, '恋爱中', '/status/relationship_3x.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (16, '我crush了', '/status/crush.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (17, '被掏空', '/status/tkong.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (18, '听歌', '/status/music@2x.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (19, '我没事', '/status/imfine_3x.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (20, '学习', '/status/study_3x.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (21, '睡觉中', '/status/sleeping_3x.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (22, '搬砖', '/status/banzhuan.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (23, '想静静', '/status/bequiet@3x.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (24, '运动中', '/status/yundongzhong@2x.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (25, '我想开了', '/status/woxiangkaile.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (26, '信号弱', '/status/signal_3x.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (27, '追剧', '/status/tv_3x.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (28, '美滋滋', '/status/meizizi@3x.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (29, '摸鱼中', '/status/fish@2x.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (30, '无聊中', '/status/boring@3x.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (31, '悠哉哉', '/status/youzaizai@3x.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (32, '去旅行', '/status/gototravel.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (33, '游戏中', '/status/game_3x.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (1, '离开', '/status/leave.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (2, '忙碌', '/status/busy.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (3, '请勿打扰', '/status/IonBan.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (4, '隐身', '/status/cloaking.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (5, '今日天气', '/status/weather_3x.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (6, '一言难尽', '/status/hardtosay@3x.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (7, '我太难了', '/status/toohard@3x.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (8, '难得糊涂', '/status/nandehutu.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (9, '元气满满', '/status/fullofyuanqi@3x.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (10, '嗨到飞起', '/status/happytofly@3x.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (11, '水逆退散', '/status/luck@2x.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (12, '好运锦鲤', '/status/jinli@2x.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (13, '恋爱中', '/status/relationship_3x.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (14, '我crush了', '/status/crush.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (15, '被掏空', '/status/tkong.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (16, '听歌中', '/status/music@2x.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (17, '我没事', '/status/imfine_3x.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (18, '学习', '/status/study_3x.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (19, '睡觉中', '/status/sleeping_3x.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (20, '搬砖', '/status/banzhuan.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (21, '想静静', '/status/bequiet@3x.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (22, '运动', '/status/yundongzhong@2x.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (23, '我想开了', '/status/woxiangkaile.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (24, '信号弱', '/status/signal_3x.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (25, '追剧中', '/status/tv_3x.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (26, '美滋滋', '/status/meizizi@3x.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (27, '摸鱼', '/status/fish@2x.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (28, '无聊中', '/status/boring@3x.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (29, '悠哉哉', '/status/youzaizai@3x.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (30, '去旅行', '/status/gototravel.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
INSERT INTO `im_user_state` VALUES (31, '游戏中', '/status/game_3x.png', 1, '2025-02-17 11:39:49', NULL, NULL, 0, 1);
-- ----------------------------
-- Table structure for im_user_target_rel
@@ -1221,7 +1243,7 @@ CREATE TABLE `secure_invoke_record` (
`is_del` tinyint NOT NULL DEFAULT 0 COMMENT '是否删除',
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_next_retry_time`(`next_retry_time` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 77802288279042 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '本地消息表' ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 82910984107522 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '本地消息表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of secure_invoke_record
@@ -1240,11 +1262,12 @@ CREATE TABLE `worker_node` (
`modified` timestamp NULL DEFAULT NULL COMMENT '修改时间',
`created` timestamp NULL DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = 'DB;WorkerID Assigner for UID Generator' ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 192 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = 'DB;WorkerID Assigner for UID Generator' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of worker_node
-- ----------------------------
INSERT INTO `worker_node` VALUES (1, '240e:3b3:30b4:1f60:d382:ae04:eb18:d48', '1758880131215-13029', 2, '2025-09-26', '2025-09-26 17:48:51', '2025-09-26 17:48:51');
INSERT INTO `worker_node` VALUES (190, '240e:3b3:30b4:1f60:d382:ae04:eb18:d48', '1760153294125-92616', 2, '2025-10-11', '2025-10-11 11:28:14', '2025-10-11 11:28:14');
INSERT INTO `worker_node` VALUES (191, '240e:3b3:30b4:1f60:d382:ae04:eb18:d48', '1760153797714-77047', 2, '2025-10-11', '2025-10-11 11:36:38', '2025-10-11 11:36:38');
SET FOREIGN_KEY_CHECKS = 1;

View File

@@ -9,6 +9,6 @@ public class GroupConst {
/**
* 最大群管理员数量
*/
public static final int MAX_MANAGE_COUNT = 3;
public static final int MAX_MANAGE_COUNT = 1000;
}

View File

@@ -36,7 +36,7 @@ public interface RoomService {
RoomFriend getFriendRoom(Long uid1, Long uid2);
/**
* 禁用一个单聊房间
* 禁用一个单聊房间 [目前是谁删除的,谁就没有会话]
*/
void disableFriendRoom(Long roomId, Long uid, Long friendUid);

View File

@@ -39,7 +39,6 @@ import com.luohuo.flex.im.core.chat.service.strategy.mark.MsgMarkFactory;
import com.luohuo.flex.im.core.chat.service.strategy.msg.AbstractMsgHandler;
import com.luohuo.flex.im.core.chat.service.strategy.msg.MsgHandlerFactory;
import com.luohuo.flex.im.core.chat.service.strategy.msg.RecallMsgHandler;
import com.luohuo.flex.im.core.user.service.RoleService;
import java.time.Duration;
import java.time.LocalDateTime;
@@ -59,7 +58,6 @@ public class ChatServiceImpl implements ChatService {
private MessageDao messageDao;
private MessageMarkDao messageMarkDao;
private RoomFriendDao roomFriendDao;
private RoleService roleService;
private RecallMsgHandler recallMsgHandler;
private ContactService contactService;
private ContactDao contactDao;
@@ -269,7 +267,7 @@ public class ChatServiceImpl implements ChatService {
public void recallMsg(Long uid, ChatMessageBaseReq request) {
Message message = messageDao.getById(request.getMsgId());
//校验能不能执行撤回
checkRecall(uid, message);
Integer roleId = checkRecall(uid, message);
recallMsgHandler.recall(uid, getRoomHowPeople(uid, message.getRoomId()), message);
}
@@ -344,17 +342,22 @@ public class ChatServiceImpl implements ChatService {
contactService.createContact(uid, roomId);
}
private void checkRecall(Long uid, Message message) {
/**
* @return 返回撤回人的权限
*/
private Integer checkRecall(Long uid, Message message) {
AssertUtil.isNotEmpty(message, "消息有误");
AssertUtil.notEqual(message.getType(), MessageTypeEnum.RECALL.getType(), "消息无法撤回");
boolean isChatManager = roleService.hasRole(uid, RoleTypeEnum.CHAT_MANAGER);
if (isChatManager) {
return;
GroupMember member = groupMemberCache.getMemberDetail(message.getRoomId(), uid);
if (member.getRoleId().equals(GroupRoleEnum.LEADER.getType()) || member.getRoleId().equals(GroupRoleEnum.MANAGER.getType())) {
return member.getRoleId();
}
boolean self = Objects.equals(uid, message.getFromUid());
AssertUtil.isTrue(self, "抱歉,您没有权限");
long between = Duration.between(message.getCreateTime(), LocalDateTime.now()).toMinutes();
AssertUtil.isTrue(between < 2, "超过2分钟的消息不能撤回");
return member.getRoleId();
}
public List<ChatMessageResp> getMsgRespBatch(List<Message> messages, Long receiveUid) {

View File

@@ -349,15 +349,15 @@ public class RoomAppServiceImpl implements RoomAppService, InitializingBean {
);
// 通知群主
noticeService.createNotice(
RoomTypeEnum.GROUP,
noticeTypeEnum,
uid,
uid,
uuid,
id,
content
);
// noticeService.createNotice(
// RoomTypeEnum.GROUP,
// noticeTypeEnum,
// uid,
// uid,
// uuid,
// id,
// content
// );
});
}

View File

@@ -9,23 +9,17 @@ import com.luohuo.basic.validator.utils.AssertUtil;
import com.luohuo.flex.im.core.chat.dao.AnnouncementsDao;
import com.luohuo.flex.im.core.chat.dao.AnnouncementsReadRecordDao;
import com.luohuo.flex.im.core.chat.dao.ContactDao;
import com.luohuo.flex.im.domain.entity.Announcements;
import com.luohuo.flex.im.domain.entity.AnnouncementsReadRecord;
import com.luohuo.flex.im.domain.entity.*;
import com.luohuo.flex.im.domain.vo.request.GroupAddReq;
import com.luohuo.flex.im.domain.vo.response.AnnouncementsResp;
import com.luohuo.flex.im.core.chat.dao.GroupMemberDao;
import com.luohuo.flex.im.core.chat.dao.RoomDao;
import com.luohuo.flex.im.core.chat.dao.RoomFriendDao;
import com.luohuo.flex.im.core.chat.dao.RoomGroupDao;
import com.luohuo.flex.im.domain.entity.GroupMember;
import com.luohuo.flex.im.domain.entity.Room;
import com.luohuo.flex.im.domain.entity.RoomFriend;
import com.luohuo.flex.im.domain.entity.RoomGroup;
import com.luohuo.flex.im.domain.enums.GroupRoleEnum;
import com.luohuo.flex.im.domain.enums.RoomTypeEnum;
import com.luohuo.flex.im.core.chat.service.RoomService;
import com.luohuo.flex.im.core.chat.service.adapter.ChatAdapter;
import com.luohuo.flex.im.domain.entity.User;
import com.luohuo.flex.im.core.user.service.cache.UserCache;
import com.luohuo.flex.im.domain.vo.response.MemberResp;
import lombok.AllArgsConstructor;

View File

@@ -54,14 +54,13 @@ public class VideoCallMsgHandler extends AbstractMsgHandler<VideoCallMsgDTO> {
// 结束消息状态处理
Long uid = ContextUtil.getUid();
boolean isSender = uid.equals(msg.getFromUid());
boolean isCreator = uid.equals(dto.getCreator());
CallStatusEnum status = CallStatusEnum.of(dto.getState());
if (status == null) return "通话状态未知";
// 双视角统一规则
return switch (status) {
case REJECTED ->
(isSender == isCreator) ? "" + status.getDesc() : "对方已" + status.getDesc();
!isSender ? "" + status.getDesc() : "对方已" + status.getDesc();
case TIMEOUT ->
isSender ? "对方未接听" : "未接听";
case CANCEL ->

View File

@@ -49,7 +49,7 @@ public class UserFriendDao extends ServiceImpl<UserFriendMapper, UserFriend> {
.or()
.eq(UserFriend::getFriendUid, uid)
.eq(UserFriend::getUid, friendUid)
.select(UserFriend::getId).select(UserFriend::getRoomId)
.select(UserFriend::getId, UserFriend::getRoomId)
.list();
}

View File

@@ -5,7 +5,8 @@ import com.luohuo.flex.im.domain.entity.UserRole;
import com.luohuo.flex.im.core.user.mapper.UserRoleMapper;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
/**
* <p>
@@ -17,9 +18,8 @@ import java.util.List;
@Service
public class UserRoleDao extends ServiceImpl<UserRoleMapper, UserRole> {
public List<UserRole> listByUid(Long uid) {
public Set<Long> listByUid(Long uid) {
return lambdaQuery()
.eq(UserRole::getUid, uid)
.list();
.eq(UserRole::getUid, uid).select(UserRole::getUid).list().stream().map(UserRole::getUid).collect(Collectors.toSet());
}
}

View File

@@ -6,13 +6,11 @@ import com.luohuo.flex.im.common.service.cache.AbstractRedisStringCache;
import com.luohuo.flex.im.core.user.dao.BlackDao;
import com.luohuo.flex.im.core.user.dao.UserBackpackDao;
import com.luohuo.flex.im.core.user.dao.UserDao;
import com.luohuo.flex.im.core.user.dao.UserRoleDao;
import com.luohuo.flex.im.domain.dto.SummeryInfoDTO;
import com.luohuo.flex.im.domain.entity.Black;
import com.luohuo.flex.im.domain.entity.ItemConfig;
import com.luohuo.flex.im.domain.entity.User;
import com.luohuo.flex.im.domain.entity.UserBackpack;
import com.luohuo.flex.im.domain.entity.UserRole;
import com.luohuo.flex.im.domain.enums.ItemTypeEnum;
import com.luohuo.flex.im.domain.vo.response.ChatMemberListResp;
import com.luohuo.flex.model.entity.base.IpDetail;
@@ -39,7 +37,6 @@ public class UserSummaryCache extends AbstractRedisStringCache<Long, SummeryInfo
private final UserCache userCache;
private final UserBackpackDao userBackpackDao;
private final ItemCache itemCache;
private final UserRoleDao userRoleDao;
private final BlackDao blackDao;
/**
@@ -115,19 +112,6 @@ public class UserSummaryCache extends AbstractRedisStringCache<Long, SummeryInfo
return null;
}
@Cacheable(cacheNames = "luohuo:user", key = "'roles:'+#uid")
public Set<Long> getRoleSet(Long uid) {
List<UserRole> userRoles = userRoleDao.listByUid(uid);
return userRoles.stream()
.map(UserRole::getRoleId)
.collect(Collectors.toSet());
}
@CacheEvict(cacheNames = "luohuo:user", key = "'roles'")
public Map<Integer, Set<String>> evictrolesSet() {
return null;
}
@Cacheable(cacheNames = "luohuo:user", key = "'blackList'")
public Map<Integer, Set<String>> getBlackMap() {
LocalDateTime now = LocalDateTime.now();

View File

@@ -1,10 +1,14 @@
package com.luohuo.flex.im.core.user.service.impl;
import com.luohuo.flex.im.core.user.dao.UserRoleDao;
import com.luohuo.flex.im.core.user.service.cache.UserSummaryCache;
import com.luohuo.flex.im.domain.entity.UserRole;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import com.luohuo.flex.im.domain.enums.RoleTypeEnum;
import com.luohuo.flex.im.core.user.service.RoleService;
import java.util.List;
import java.util.Set;
/**
@@ -14,11 +18,11 @@ import java.util.Set;
public class RoleServiceImpl implements RoleService {
@Resource
private UserSummaryCache userSummaryCache;
private UserRoleDao userRoleDao;
@Override
public boolean hasRole(Long uid, RoleTypeEnum roleTypeEnum) {
Set<Long> roleSet = userSummaryCache.getRoleSet(uid);
Set<Long> roleSet = userRoleDao.listByUid(uid);
return isAdmin(roleSet) || roleSet.contains(roleTypeEnum.getId());
}

View File

@@ -2,6 +2,7 @@ package com.luohuo.flex.ws.cache;
import com.luohuo.basic.model.cache.CacheKey;
import com.luohuo.basic.model.cache.CacheKeyBuilder;
import com.luohuo.flex.common.cache.CacheKeyModular;
import java.time.Duration;
@@ -17,6 +18,11 @@ public class UserRoomsCacheKeyBuilder implements CacheKeyBuilder {
return new UserRoomsCacheKeyBuilder().key(key);
}
@Override
public String getPrefix() {
return CacheKeyModular.PREFIX;
}
@Override
public String getTable() {
return "user_rooms";

View File

@@ -2,6 +2,7 @@ package com.luohuo.flex.ws.cache;
import com.luohuo.basic.model.cache.CacheKey;
import com.luohuo.basic.model.cache.CacheKeyBuilder;
import com.luohuo.flex.common.cache.CacheKeyModular;
import java.time.Duration;
@@ -17,6 +18,11 @@ public class VideoRoomsCacheKeyBuilder implements CacheKeyBuilder {
return new VideoRoomsCacheKeyBuilder().key(key);
}
@Override
public String getPrefix() {
return CacheKeyModular.PREFIX;
}
@Override
public String getTable() {
return "rooms";

View File

@@ -35,7 +35,7 @@ public class RoomMetadataService {
public Boolean isRoomClosed(Long roomId) {
CacheResult<Boolean> result = cachePlusOps.get(CloseRoomCacheKeyBuilder.builder(roomId));
return result.isNull()? true: result.getValue();
return result.isNull()? true: result.getRawValue();
}
/**

View File

@@ -134,7 +134,7 @@ public class RoomTimeoutService {
* 清理房间资源
* @param roomId 房间ID
*/
@RedissonLock(key = "#roomId")
@RedissonLock(prefixKey = "cleanRoom:", key = "#roomId")
public void cleanRoom(Long roomId, Long uid, String reason) {
// 1. 检查房间是否已关闭
if (roomMetadataService.isRoomClosed(roomId)) return;

View File

@@ -211,7 +211,7 @@ public class VideoChatService {
/**
* 清理房间数据 [仅仅关闭房间时内部调用]
*/
@RedissonLock(key = "#roomId")
@RedissonLock(prefixKey = "cleanRoomData:", key = "#roomId")
public void cleanRoomData(Long roomId) {
// 1. 获取房间所有成员
List<Long> members = getRoomMembers(roomId);

View File

@@ -48,7 +48,7 @@ public class VideoProcessor implements MessageProcessor {
// 处理不同情况的会话消息
switch (WSReqTypeEnum.of(baseReq.getType())) {
// 信令在这里单独处理
case WEBRTC_SIGNAL -> {
case WEBRTC_SIGNAL -> {
VideoSignalReq signalReq = JSONUtil.toBean(baseReq.getData(), VideoSignalReq.class);
videoService.forwardSignal(uid, signalReq.getRoomId(), signalReq.getSignal(), signalReq.getSignalType());
}
@@ -66,9 +66,4 @@ public class VideoProcessor implements MessageProcessor {
private String signal; // WebRTC信令内容
private String signalType; // offer=发起通话 answer=接收通话 candidate=
}
@Data
private static class LeaveRoomReq {
private Long roomId;
}
}

BIN
preview/messageFlow.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 KiB

BIN
preview/qq.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 447 KiB

BIN
preview/ws-push.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 KiB