77
README.en.md
77
README.en.md
@@ -125,18 +125,71 @@ If you find HuLa helpful, welcome to sponsor HuLa. Your support is our motivatio
|
||||
## Sponsor List
|
||||
Thanks to the following sponsors for their support!
|
||||
|
||||
| Date | Sponsor | Amount | Platform |
|
||||
|------|---------|---------|----------|
|
||||
| 2025-04-25 | 上官俊斌 | ¥200 | 微信赞赏码 |
|
||||
| 2025-04-20 | 姜兴(Simon) | ¥188 | 微信赞赏码 |
|
||||
| 2025-02-17 | 禾硕 | ¥168 | 支付宝赞赏 |
|
||||
| 2025-02-8 | Boom.... | ¥100 | 微信赞赏码 |
|
||||
| 2025-05-09 | 犹豫,就会败北。| ¥88.00 | 微信红包 |
|
||||
| 2025-04-01 | 墨 | ¥88.88 | 微信转账 |
|
||||
| 2025-02-8 | 邓伟 | ¥88 | 微信赞赏码 |
|
||||
| 2025-02-7 | dennis | ¥80 | gitee码云赞赏 |
|
||||
| 2025-05-15 | 孤鸿影 | ¥56 | 微信红包 |
|
||||
| 2025-02-6 | 小二 | ¥62 | 微信转账 |
|
||||
### 🔐 User Authentication System
|
||||
| Feature | Description | Status |
|
||||
|---------|-------------|--------|
|
||||
| 🔑 | Username/Password Login |  |
|
||||
| 📱 | QR Code Scan Login |  |
|
||||
| 💻 | Multi-device Login Management |  |
|
||||
|
||||
### 💬 Message Communication
|
||||
| Feature | Description | Status |
|
||||
|---------|-------------|--------|
|
||||
| 👤 | One-on-one Private Chat |  |
|
||||
| 👥 | Group Chat |  |
|
||||
| ↩️ | Message Recall |  |
|
||||
| 📢 | @Mention & Reply Features |  |
|
||||
| 👁️ | Message Read Status |  |
|
||||
| 😊 | Emoji Features |  |
|
||||
| 🖱️ | Message Right-click Menu |  |
|
||||
| 🔗 | Link Preview Cards |  |
|
||||
| 👍 | Message Like Interaction |  |
|
||||
| 📔 | Chat History Management |  |
|
||||
|
||||
### 🤝 Social Management
|
||||
| Feature | Description | Status |
|
||||
|---------|-------------|--------|
|
||||
| ➕ | Add & Remove Friends |  |
|
||||
| 🔍 | Friend Search |  |
|
||||
| 🏢 | Group Creation & Management |  |
|
||||
| 🟢 | Friend Online Status |  |
|
||||
| 🎖️ | Friend Badge System |  |
|
||||
| 🚫 | Block & Do Not Disturb |  |
|
||||
| 📤 | Message Forwarding |  |
|
||||
| 📋 | Group Announcements |  |
|
||||
| 🏷️ | Nickname & Remark Management |  |
|
||||
| 📍 | Get and Send Location |  |
|
||||
|
||||
### 🎨 User Experience
|
||||
| Feature | Description | Status |
|
||||
|---------|-------------|--------|
|
||||
| 🖼️ | Modern UI Design |  |
|
||||
| 🌙 | Dark & Light Theme |  |
|
||||
| 🎭 | Skin Theme Switching |  |
|
||||
|
||||
### 🛠️ System Features
|
||||
| Feature | Description | Status |
|
||||
|---------|-------------|--------|
|
||||
| 🪟 | Multi-window Management |  |
|
||||
| 🔔 | System Tray Notifications |  |
|
||||
| 📷 | Image Viewer |  |
|
||||
| ✂️ | Screenshot Feature |  |
|
||||
| 📁 | File Upload (Qiniu Cloud) |  |
|
||||
| 🔄 | Auto-update System |  |
|
||||
|
||||
### 🌐 Cross-platform Support
|
||||
| Feature | Description | Status |
|
||||
|---------|-------------|--------|
|
||||
| 💻 | Windows/macOS/Linux |  |
|
||||
| 📱 | iOS/Android Adaptation |  |
|
||||
|
||||
### 🤖 AI Integration
|
||||
| Feature | Description | Status |
|
||||
|---------|-------------|--------|
|
||||
| 🧠 | AI Chat Assistant |  |
|
||||
| 🔌 | Multi-platform AI Support |  |
|
||||
|
||||
## 👏 Thanks to all Contributors!
|
||||
|
||||
> Note: This list is manually updated. If you have sponsored but are not shown in the list, please contact us through:
|
||||
1. Submit an Issue on GitHub
|
||||
|
||||
99
README.md
99
README.md
@@ -66,6 +66,88 @@ HuLa-Server 是一款基于 SpringCloud、SpringBoot3、Netty、MyBatis-Plus 和
|
||||
|
||||
• 集成Spring AI(deepseek、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确认** 
|
||||
12. **更新消息状态为已送达** 
|
||||

|
||||
|
||||
## 🌐 性能对比 (WS 服务)
|
||||
| 指标 | 广播模式 | 精准路由模式 | 提升倍数 | 性能指标 | 说明 |
|
||||
|:--- |:---:|:------------------:|---:|-------------------:|--------------------------:|
|
||||
| **网络消息数** | O(N) | O(k) | 10-100倍 | - | |
|
||||
| **CPU消耗** | 高 | 低 | 5-20倍 | 高并发下CPU<70% | |
|
||||
| **内存占用** | 全节点缓存 | 仅目标节点 | 3-10倍 | 单连接<50KB | |
|
||||
| **延迟时间** | 不稳定 | 稳定低延迟 | 2-5倍 | 平均<50ms | |
|
||||
|
||||
## 🚀 系统扩展性 - 线性扩展能力
|
||||
- **用户增长:** 增加用户不会增加单个消息的复杂度
|
||||
- **节点扩展:** 增加节点不会增加单消息的推送成本
|
||||
- **流量增长:** 系统吞吐量随节点数线性增长
|
||||
|
||||
## 客户端预览
|
||||
|
||||

|
||||
@@ -134,23 +216,30 @@ 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>
|
||||
|
||||
## 🙏 感谢赞助者
|
||||
|
||||
<div align="center">
|
||||
<h3>💎 贡献者荣誉榜</h3>
|
||||
<h3>贡献者荣誉榜</h3>
|
||||
<p><em>感谢以下朋友对 HuLa 项目的慷慨支持!</em></p>
|
||||
</div>
|
||||
|
||||
### 💎 钻石赞助者 (¥1000+)
|
||||
| 💝 日期 | 👤 赞助者 | 💰 金额 | 🏷️ 平台 |
|
||||
|---------|----------|--------|---------|
|
||||
| 2025-09-12 | **翟可** | `¥1688` |  |
|
||||
|
||||
### 🏆 金牌赞助者 (¥100+)
|
||||
| 💝 日期 | 👤 赞助者 | 💰 金额 | 🏷️ 平台 |
|
||||
|---------|----------|--------|---------|
|
||||
| 2025-09-03 | **烛火** | `¥500` |  |
|
||||
| 2025-09-05 | **Orion** | `¥200` |  |
|
||||
| 2025-08-26 | **唐勇** | `¥200` |  |
|
||||
| 2025-04-25 | **上官俊斌** | `¥200` |  |
|
||||
| 2025-05-27 | **临安居士** | `¥188` |  |
|
||||
| 2025-04-20 | **姜兴(Simon)** | `¥188` |  |
|
||||
|
||||
33
docs/install/docker/srs/srs_conf_7088.conf
Normal file
33
docs/install/docker/srs/srs_conf_7088.conf
Normal 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;
|
||||
}
|
||||
}
|
||||
BIN
docs/install/docker/turn/coturn-4.5.1.1.tar.gz
Normal file
BIN
docs/install/docker/turn/coturn-4.5.1.1.tar.gz
Normal file
Binary file not shown.
BIN
docs/install/docker/turn/libevent-2.1.12-stable.tar.gz
Normal file
BIN
docs/install/docker/turn/libevent-2.1.12-stable.tar.gz
Normal file
Binary file not shown.
730
docs/install/docker/turn/turnserver.conf
Normal file
730
docs/install/docker/turn/turnserver.conf
Normal 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
|
||||
83
docs/install/docker/搭建turn服务.md
Normal file
83
docs/install/docker/搭建turn服务.md
Normal 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/
|
||||
|
||||

|
||||
BIN
docs/install/image/img_13.png
Normal file
BIN
docs/install/image/img_13.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
44
docs/install/init_pg_db.sh
Normal file
44
docs/install/init_pg_db.sh
Normal 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!"
|
||||
@@ -3,15 +3,15 @@
|
||||
|
||||
Source Server : localhost
|
||||
Source Server Type : MySQL
|
||||
Source Server Version : 80405 (8.4.5)
|
||||
Source Host : localhost:3306
|
||||
Source Server Version : 80030 (8.0.30)
|
||||
Source Host : 127.0.0.1:13306
|
||||
Source Schema : luohuo_dev
|
||||
|
||||
Target Server Type : MySQL
|
||||
Target Server Version : 80405 (8.4.5)
|
||||
Target Server Version : 80030 (8.0.30)
|
||||
File Encoding : 65001
|
||||
|
||||
Date: 16/08/2025 00:27:04
|
||||
Date: 11/10/2025 18:27:50
|
||||
*/
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
@@ -30,7 +30,7 @@ CREATE TABLE `base_com_appendix` (
|
||||
`is_del` tinyint(1) NOT NULL DEFAULT 0,
|
||||
`tenant_id` bigint NOT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '业务附件' ROW_FORMAT = DYNAMIC;
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '业务附件' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of base_com_appendix
|
||||
@@ -62,7 +62,7 @@ CREATE TABLE `base_com_file` (
|
||||
`is_del` tinyint(1) NOT NULL DEFAULT 0,
|
||||
`tenant_id` bigint NOT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '增量文件上传日志' ROW_FORMAT = DYNAMIC;
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '增量文件上传日志' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of base_com_file
|
||||
@@ -86,16 +86,16 @@ CREATE TABLE `base_config` (
|
||||
`tenant_id` bigint NOT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
INDEX `key`(`config_key` ASC) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 19 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '参数配置表' ROW_FORMAT = DYNAMIC;
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 19 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '参数配置表' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of 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-as0.qiniup.com', 0, '2025-06-26 07:42:06.404', '2025-06-26 07:42:06.494', 3, NULL, 0);
|
||||
INSERT INTO `base_config` VALUES (4, 'qiniu_up_config', '{\"title\":\"accessKey\",\"componentType\":\"text\",\"value\":\"8si6G12t2MG9IOdkNDYmL0vGAYFTW-rHl4LgA5_\",\"configKey\":\"qnAccessKey\",\"type\":\"qiniu_up_config\"}', 'qnAccessKey', 'LXrRo6YhTnU0-_AlX79VS8uhy5yScLzQJAQaUGUJ', 0, '2025-06-26 07:42:06.404', '2025-06-26 07:42:06.494', 3, NULL, 0);
|
||||
INSERT INTO `base_config` VALUES (5, 'qiniu_up_config', '{\"title\":\"SecretKey\",\"componentType\":\"text\",\"value\":\"MLzT2U2daTXFDEG9PuAy4TnvfR1oXvK2Yipm_eS9\",\"configKey\":\"qnSecretKey\",\"type\":\"qiniu_up_config\"}', 'qnSecretKey', 'BYKKz6nIjHSJLarEQxLKgX6C300BlVS-llemF2Hg', 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\":\"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);
|
||||
@@ -103,7 +103,7 @@ INSERT INTO `base_config` VALUES (9, 'qiniu_up_config', '{\"title\":\"超过多
|
||||
INSERT INTO `base_config` VALUES (10, 'qiniu_up_config', '{\"title\":\"分片大小\",\"componentType\":\"text\",\"value\":\"50\",\"configKey\":\"fragmentSize\",\"type\":\"shop_config\"}', 'fragmentSize', '2', 0, '2025-06-26 07:42:06.404', '2025-06-26 07:42:06.494', 3, NULL, 0);
|
||||
INSERT INTO `base_config` VALUES (11, 'qiniu_up_config', '{\"title\":\"OSS引擎\",\"componentType\":\"text\",\"value\":\"qiniu\",\"configKey\":\"storageDefault\",\"type\":\"shop_config\"}', 'storageDefault', 'qiniu', 0, '2025-06-26 07:42:06.404', '2025-06-26 07:42:06.494', 3, NULL, 0);
|
||||
INSERT INTO `base_config` VALUES (12, 'system', '{\"title\":\"Hula管理员邮箱\",\"componentType\":\"text\",\"value\":\"\",\"configKey\":\"masterEmail\",\"type\":\"system\"}', 'masterEmail', 'nongyehong919@163.com', 0, '2025-06-26 07:42:06.404', '2025-07-16 19:58:20.816', 3, NULL, 0);
|
||||
INSERT INTO `base_config` VALUES (13, 'system', '{\"title\":\"AI基础信息\",\"componentType\":\"text\",\"value\":\"system/material/20250305/aX3YYCCpDf.png\",\"configKey\":\"baseInfo\",\"type\":\"site_config\"}', 'baseInfo', '{\"contentSecurity\":0,\"copyright\":\"© 2025 earth 湘ICP备2022002224号-1 xxxx技有限公司\",\"descrip\":\"HulaAi,基于AI大模型api实现的ChatGPT服务,支持ChatGPT(3.5、4.0)模型,同时也支持国内文心一言(支持Stable-Diffusion-XL作图)、通义千问、讯飞星火、智谱清言(ChatGLM)等主流模型,支出同步响应及流式响应,完美呈现打印机效果。\",\"keywords\":[\"通义千问\",\"ChatGPT\",\"文心一言\",\"智谱清言\"],\"proxyServer\":\"\",\"siteTitle\":\"HulaAi\",\"domain\":\"https://gpt.panday94.xyz\",\"proxyType\":2,\"siteLogo\":\"\"}', 0, '2025-06-26 07:42:06.404', '2025-07-16 19:58:22.025', 3, NULL, 0);
|
||||
INSERT INTO `base_config` VALUES (13, 'system', '{\"title\":\"AI基础信息\",\"componentType\":\"text\",\"value\":\"system/material/20250305/aX3YYCCpDf.png\",\"configKey\":\"baseInfo\",\"type\":\"site_config\"}', 'baseInfo', '{\"contentSecurity\":0,\"copyright\":\"© 2025 luohuo 粤ICP备2025455944号 深圳市络火科技有限公司\",\"descrip\":\"HulaAi,基于AI大模型api实现的ChatGPT服务,支持ChatGPT(3.5、4.0)模型,同时也支持国内文心一言(支持Stable-Diffusion-XL作图)、通义千问、讯飞星火、智谱清言(ChatGLM)等主流模型,支出同步响应及流式响应,完美呈现打印机效果。\",\"keywords\":[\"通义千问\",\"ChatGPT\",\"文心一言\",\"智谱清言\"],\"proxyServer\":\"\",\"siteTitle\":\"HulaAi\",\"domain\":\"https://gpt.panday94.xyz\",\"proxyType\":2,\"siteLogo\":\"\"}', 0, '2025-06-26 07:42:06.404', '2025-08-18 04:32:58.114', 3, NULL, 0);
|
||||
INSERT INTO `base_config` VALUES (14, 'system', '{\"title\":\"AI 扩展配置\",\"componentType\":\"text\",\"value\":\"system/material/20250305/aX3YYCCpDf.png\",\"configKey\":\"extraInfo\",\"type\":\"site_config\"}', 'extraInfo', '{\"ossType\":1,\"smsType\":0}', 0, '2025-06-26 07:42:06.404', '2025-07-16 19:58:23.711', 3, NULL, 0);
|
||||
INSERT INTO `base_config` VALUES (15, 'system', '{\"title\":\"AI AppInfo\",\"componentType\":\"text\",\"value\":\"system/material/20250305/aX3YYCCpDf.png\",\"configKey\":\"appInfo\",\"type\":\"site_config\"}', 'appInfo', '{\"h5Url\":\"https://gpt.panday94.xyz/h5\",\"isSms\":1,\"homeNotice\":\"确保合法合规使用,在运营过程中产生的一切问题后果自负,与作者无关。!\",\"isGptLimit\":0,\"isShare\":1,\"shareRewardNum\":\"20\",\"freeNum\":\"5\",\"isRedemption\":1}', 0, '2025-06-26 07:42:06.404', '2025-07-16 19:58:24.711', 3, NULL, 0);
|
||||
INSERT INTO `base_config` VALUES (16, 'system', '{\"title\":\"AI 微信配置\",\"componentType\":\"text\",\"value\":\"system/material/20250305/aX3YYCCpDf.png\",\"configKey\":\"wxInfo\",\"type\":\"site_config\"}', 'wxInfo', '{\"mpLogin\":0,\"mpPay\":0,\"maAppId\":\"xx\",\"maSecret\":\"xx\",\"mpAppId\":\"xx\",\"mpSecret\":\"xx\",\"mchNo\":\"xx\",\"v3Secret\":\"xx\"}', 0, '2025-06-26 07:42:06.404', '2025-07-16 19:58:26.063', 3, NULL, 0);
|
||||
@@ -137,12 +137,16 @@ CREATE TABLE `base_employee` (
|
||||
UNIQUE INDEX `uk_base_user`(`user_id` ASC) USING BTREE COMMENT '每个登录用户唯一映射一个',
|
||||
INDEX `idx_tenant_parent`(`parent_id` ASC) USING BTREE COMMENT '租户架构索引',
|
||||
INDEX `idx_tenant_type`(`user_type` ASC) USING BTREE COMMENT '租户架构索引'
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '员工' ROW_FORMAT = DYNAMIC;
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '员工' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of base_employee
|
||||
-- ----------------------------
|
||||
INSERT INTO `base_employee` VALUES (160566476187631622, 0, b'1', 1451532876054003712, 1, 1451532667655815168, NULL, 'hula', 0, '', '20', '10', b'1', 1452186486253289472, '2021-11-21 16:45:25', 1452186486253289472, '2021-11-21 16:45:25', 1, 0, 1);
|
||||
INSERT INTO `base_employee` VALUES (160566476187631622, 0, b'1', 1451532876054003712, 1, 1451532667655815168, NULL, '超管', 0, '', '20', '10', b'1', 1452186486253289472, '2021-11-21 16:45:25', 1452186486253289472, '2021-11-21 16:45:25', 1, 0, 1);
|
||||
INSERT INTO `base_employee` VALUES (1452186486492364800, 0, b'1', 1451532876054003712, 2, 1451532727697276928, 1451532821628715008, '内置超管-啊汤哥', 0, '', '20', '10', b'1', 2, '2021-10-24 16:13:33', 1452186486253289472, '2021-11-09 20:36:44', 2, 0, 1);
|
||||
INSERT INTO `base_employee` VALUES (1454329823978586112, 0, b'1', 1451532876054003712, 1454329823852756992, 1451532773234835456, NULL, '门店管理员-最后哥', 0, '', '20', '10', b'1', 1451549146992345088, '2021-10-30 14:10:25', 1451549146992345088, '2021-10-30 14:10:25', 1, 0, 1);
|
||||
INSERT INTO `base_employee` VALUES (1457904456589901824, 0, b'1', 1458051094994223104, 1457904455960756224, 1451532773234835456, NULL, '普通用户-小沙比', 0, '', '20', '10', b'1', 1451549146992345088, '2021-11-09 10:54:44', 2, '2024-10-08 15:31:36', 0, 0, 1);
|
||||
INSERT INTO `base_employee` VALUES (1457904456589901825, 0, b'1', 1458051094994223104, 649219302184284167, 1451532773234835456, NULL, 'Dawn', 0, '', '20', '10', b'1', 1451549146992345088, '2021-11-09 10:54:44', 2, '2024-10-08 15:31:36', 0, 0, 1);
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for base_employee_org_rel
|
||||
@@ -161,12 +165,12 @@ CREATE TABLE `base_employee_org_rel` (
|
||||
`tenant_id` bigint NOT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE INDEX `uk_employee_org`(`org_id` ASC, `employee_id` ASC) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '员工所在部门' ROW_FORMAT = DYNAMIC;
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '员工所在部门' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of base_employee_org_rel
|
||||
-- ----------------------------
|
||||
INSERT INTO `base_employee_org_rel` VALUES (550923181704211494, 180724033313046540, 160566476187631622, 2, '2024-10-08 15:31:36', 2, '2024-10-08 15:31:36', NULL, 0, 1);
|
||||
INSERT INTO `base_employee_org_rel` VALUES (550923181704211494, 180724033313046540, 1457904456589901824, 2, '2024-10-08 15:31:36', 2, '2024-10-08 15:31:36', NULL, 0, 1);
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for base_employee_role_rel
|
||||
@@ -185,12 +189,12 @@ CREATE TABLE `base_employee_role_rel` (
|
||||
`tenant_id` bigint NOT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE INDEX `uk_err_role_employee`(`role_id` ASC, `employee_id` ASC) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '员工的角色' ROW_FORMAT = DYNAMIC;
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '员工的角色' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of base_employee_role_rel
|
||||
-- ----------------------------
|
||||
INSERT INTO `base_employee_role_rel` VALUES (1, 1452496398934081536, 160566476187631622, 1, '2024-06-14 15:18:02', 1, '2024-06-14 15:18:04', 1, 0, 1);
|
||||
INSERT INTO `base_employee_role_rel` VALUES (1, 1452496398934081536, 1452186486492364800, 1, '2024-06-14 15:18:02', 1, '2024-06-14 15:18:04', 1, 0, 1);
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for base_operation_log
|
||||
@@ -218,7 +222,7 @@ CREATE TABLE `base_operation_log` (
|
||||
`is_del` tinyint(1) NOT NULL DEFAULT 0,
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '操作日志' ROW_FORMAT = DYNAMIC;
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '操作日志' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of base_operation_log
|
||||
@@ -241,7 +245,7 @@ CREATE TABLE `base_operation_log_ext` (
|
||||
`is_del` tinyint(1) NOT NULL DEFAULT 0,
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '操作日志扩展' ROW_FORMAT = DYNAMIC;
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '操作日志扩展' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of base_operation_log_ext
|
||||
@@ -271,7 +275,7 @@ CREATE TABLE `base_org` (
|
||||
`tenant_id` bigint NOT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE INDEX `uk_org_name`(`name` ASC) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '组织' ROW_FORMAT = DYNAMIC;
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '组织' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of base_org
|
||||
@@ -304,7 +308,7 @@ CREATE TABLE `base_org_role_rel` (
|
||||
`tenant_id` bigint NOT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE INDEX `uk_org_role`(`org_id` ASC, `role_id` ASC) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '组织的角色' ROW_FORMAT = DYNAMIC;
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '组织的角色' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of base_org_role_rel
|
||||
@@ -329,7 +333,7 @@ CREATE TABLE `base_position` (
|
||||
`tenant_id` bigint NOT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE INDEX `uk_name`(`name` ASC) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '岗位' ROW_FORMAT = DYNAMIC;
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '岗位' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of base_position
|
||||
@@ -355,7 +359,7 @@ CREATE TABLE `base_product` (
|
||||
`is_del` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除:0-未删除 1-已删除',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE INDEX `product_code`(`product_code` ASC) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '基础产品表' ROW_FORMAT = DYNAMIC;
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '基础产品表' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of base_product
|
||||
@@ -383,7 +387,7 @@ CREATE TABLE `base_role` (
|
||||
`tenant_id` bigint NOT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE INDEX `uk_code`(`code` ASC) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '角色' ROW_FORMAT = DYNAMIC;
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '角色' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of base_role
|
||||
@@ -411,7 +415,7 @@ CREATE TABLE `base_role_resource_rel` (
|
||||
`tenant_id` bigint NOT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE INDEX `uk_role_resource`(`resource_id` ASC, `role_id` ASC) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '角色的资源' ROW_FORMAT = DYNAMIC;
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '角色的资源' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of base_role_resource_rel
|
||||
@@ -512,14 +516,14 @@ CREATE TABLE `def_application` (
|
||||
`tenant_id` bigint NOT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE INDEX `uk_application_key`(`app_key` ASC) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '应用' ROW_FORMAT = DYNAMIC;
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '应用' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of def_application
|
||||
-- ----------------------------
|
||||
INSERT INTO `def_application` VALUES (1, 'basicPlatform', 'uhpe70w9rw0qjyp1hd6rae58ioa7anycc00p', '基础平台', '1', '10', '/msg/myMsg', '租户的工作台,最基础的功能。', '基础平台是整个平台最基础,最核心的功能,所有租户都拥有。可以理解为用户的工作台,跳转其他业务系统的控制台等。', '', b'1', b'1', 1, 2, '2021-12-12 12:12:12', 2, '2024-03-15 13:46:22', 0, 0);
|
||||
INSERT INTO `def_application` VALUES (2, 'devOperation', 'ymyqj01qvmz7bpkne5li81cvxma2bebrzb57', '开发运营系统', '1', '20', '/application/application', '开发者或运营者使用,系统级功能,不能分配给租户。', '开发运营系统是给 开发者和运营者公司的用户使用的,主要维护一些系统级的配置和数据,不能分配给普通租户使用。', '', b'0', b'1', 2, 2, '2021-12-12 12:12:13', 2, '2024-01-16 09:57:55', 0, 0);
|
||||
INSERT INTO `def_application` VALUES (3, 'businessSystem', 'c2mn7qb9i194mcypuletfxv8qe182e61awut', '业务系统', '1', '10', '/111:111', '根据不同业务开发出来的系统,租户需要购买方可使用。', '根据各自的业务,开发出来的系统。根据不同的租户需求,购买后获得此系统的功能。 ', '', b'0', b'1', 3, 2, '2021-12-12 12:12:14', 1452186486253289472, '2021-12-12 12:12:12', 0, 0);
|
||||
INSERT INTO `def_application` VALUES (3, 'businessSystem', 'c2mn7qb9i194mcypuletfxv8qe182e61awut', '业务系统', '1', '10', '/111:111', '根据不同业务开发出来的系统,租户需要购买方可使用。', '根据各自的业务,开发出来的系统。根据不同的租户需求,购买后获得此系统的功能。 (这个系统需要你们根据自己情况自行二次开发)', '', b'0', b'1', 3, 2, '2021-12-12 12:12:14', 1452186486253289472, '2021-12-12 12:12:12', 0, 0);
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for def_area
|
||||
@@ -548,7 +552,7 @@ CREATE TABLE `def_area` (
|
||||
`tenant_id` bigint NOT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE INDEX `uk_area_code`(`code` ASC) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '地区表' ROW_FORMAT = DYNAMIC;
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '地区表' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of def_area
|
||||
@@ -574,7 +578,7 @@ CREATE TABLE `def_client` (
|
||||
`tenant_id` bigint NOT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE INDEX `uk_client_client_id`(`client_id` ASC) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '客户端' ROW_FORMAT = DYNAMIC;
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '客户端' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of def_client
|
||||
@@ -601,7 +605,7 @@ CREATE TABLE `def_datasource_config` (
|
||||
`is_del` tinyint(1) NOT NULL DEFAULT 0,
|
||||
`tenant_id` bigint NOT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '数据源' ROW_FORMAT = DYNAMIC;
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '数据源' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of def_datasource_config
|
||||
@@ -634,7 +638,7 @@ CREATE TABLE `def_dict` (
|
||||
`tenant_id` bigint NOT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE INDEX `uk_dict_key`(`parent_id` ASC, `key_` ASC) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '字典' ROW_FORMAT = DYNAMIC;
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '字典' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of def_dict
|
||||
@@ -868,7 +872,7 @@ CREATE TABLE `def_gen_table` (
|
||||
`is_del` tinyint(1) NOT NULL DEFAULT 0,
|
||||
`tenant_id` bigint NOT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '代码生成' ROW_FORMAT = DYNAMIC;
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '代码生成' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of def_gen_table
|
||||
@@ -918,7 +922,7 @@ CREATE TABLE `def_gen_table_column` (
|
||||
`is_del` tinyint(1) NOT NULL DEFAULT 0,
|
||||
`tenant_id` bigint NOT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '代码生成字段' ROW_FORMAT = DYNAMIC;
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '代码生成字段' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of def_gen_table_column
|
||||
@@ -957,7 +961,7 @@ CREATE TABLE `def_gen_test_simple` (
|
||||
`is_del` tinyint(1) NOT NULL DEFAULT 0,
|
||||
`tenant_id` bigint NOT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '测试树结构' ROW_FORMAT = DYNAMIC;
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '测试树结构' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of def_gen_test_simple
|
||||
@@ -996,7 +1000,7 @@ CREATE TABLE `def_gen_test_tree` (
|
||||
`is_del` tinyint(1) NOT NULL DEFAULT 0,
|
||||
`tenant_id` bigint NOT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '测试树结构' ROW_FORMAT = DYNAMIC;
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '测试树结构' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of def_gen_test_tree
|
||||
@@ -1022,7 +1026,7 @@ CREATE TABLE `def_interface` (
|
||||
`tenant_id` bigint NOT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE INDEX `UK_INTERFACE_CODE`(`code` ASC) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '接口' ROW_FORMAT = DYNAMIC;
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '接口' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of def_interface
|
||||
@@ -1055,7 +1059,7 @@ CREATE TABLE `def_interface_property` (
|
||||
`tenant_id` bigint NOT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE INDEX `UK_I_P_INTERFACE_ID_KEY`(`interface_id` ASC, `key_` ASC) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '接口属性' ROW_FORMAT = DYNAMIC;
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '接口属性' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of def_interface_property
|
||||
@@ -1067,11 +1071,11 @@ INSERT INTO `def_interface_property` VALUES (245606910252810246, 244913337459015
|
||||
INSERT INTO `def_interface_property` VALUES (245606910252810248, 244913337459015682, '云通讯API密码', 'password', '请填写正确的秘钥', 0, '', '2021-12-12 12:12:12', 1452186486253289472, '2021-12-12 12:12:12', 1452186486253289472, 0, 0);
|
||||
INSERT INTO `def_interface_property` VALUES (245606910252810252, 244913337459015682, '云通讯API账号', 'account', '请填写正确的秘钥', 0, '', '2021-12-12 12:12:12', 1452186486253289472, '2021-12-12 12:12:12', 1452186486253289472, 0, 0);
|
||||
INSERT INTO `def_interface_property` VALUES (246604205953908742, 244913337459015682, '是否变量短信', 'variable', 'true', 0, '', '2021-12-12 12:12:12', 1452186486253289472, '2021-12-12 12:12:12', 1452186486253289472, 0, 0);
|
||||
INSERT INTO `def_interface_property` VALUES (246756273565990915, 244881451621810192, '发送邮箱地址', 'fromEmail', 'nongyeh21g919@163.com', 0, '', '2021-12-12 12:12:12', 1452186486253289472, '2023-08-16 22:38:59', 1452186486253289472, 0, 0);
|
||||
INSERT INTO `def_interface_property` VALUES (246756273565990915, 244881451621810192, '发送邮箱地址', 'fromEmail', 'nongyehong919@163.com', 0, '', '2021-12-12 12:12:12', 1452186486253289472, '2023-08-16 22:38:59', 1452186486253289472, 0, 0);
|
||||
INSERT INTO `def_interface_property` VALUES (246756273565990916, 244881451621810192, '发送邮箱名称', 'fromName', '络火科技', 0, '', '2021-12-12 12:12:12', 1452186486253289472, '2023-08-16 22:38:59', 1452186486253289472, 0, 0);
|
||||
INSERT INTO `def_interface_property` VALUES (246756273565990917, 244881451621810192, '邮件服务器地址', 'hostName', 'smtp.163.com', 0, '', '2021-12-12 12:12:12', 1452186486253289472, '2023-08-16 22:38:59', 1452186486253289472, 0, 0);
|
||||
INSERT INTO `def_interface_property` VALUES (246756273565990918, 244881451621810192, '密码', 'password', 'YZ7ju12X6WWS12e', 0, '', '2021-12-12 12:12:12', 1452186486253289472, '2023-08-16 22:47:15', 1452186486253289472, 0, 0);
|
||||
INSERT INTO `def_interface_property` VALUES (246756273565990919, 244881451621810192, '用户名', 'username', 'nongyeh1919@163.com', 0, '', '2021-12-12 12:12:12', 1452186486253289472, '2023-08-16 22:43:19', 1452186486253289472, 0, 0);
|
||||
INSERT INTO `def_interface_property` VALUES (246756273565990918, 244881451621810192, '密码', 'password', 'YZ7ju32X6WWSbx2e', 0, '', '2021-12-12 12:12:12', 1452186486253289472, '2023-08-16 22:47:15', 1452186486253289472, 0, 0);
|
||||
INSERT INTO `def_interface_property` VALUES (246756273565990919, 244881451621810192, '用户名', 'username', 'nongyehong919@163.com', 0, '', '2021-12-12 12:12:12', 1452186486253289472, '2023-08-16 22:43:19', 1452186486253289472, 0, 0);
|
||||
INSERT INTO `def_interface_property` VALUES (246756273565990920, 244881451621810192, '端口', 'smtpPort', '465', 0, '', '2021-12-12 12:12:12', 1452186486253289472, '2023-08-16 22:38:59', 1452186486253289472, 0, 0);
|
||||
INSERT INTO `def_interface_property` VALUES (246756273565990921, 244881451621810192, '是否ssl', 'ssl', 'true', 0, '', '2021-12-12 12:12:12', 1452186486253289472, '2021-12-12 12:12:12', 1452186486253289472, 0, 0);
|
||||
INSERT INTO `def_interface_property` VALUES (246756273565990922, 244881451621810192, '字符集', 'charset', 'UTF-8', 0, '', '2021-12-12 12:12:12', 1452186486253289472, '2021-12-12 12:12:12', 1452186486253289472, 0, 0);
|
||||
@@ -1117,19 +1121,20 @@ CREATE TABLE `def_login_log` (
|
||||
`update_by` bigint NULL DEFAULT NULL COMMENT '最后更新人',
|
||||
`is_del` tinyint(1) NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '登录日志' ROW_FORMAT = DYNAMIC;
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '登录日志' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of def_login_log
|
||||
-- ----------------------------
|
||||
INSERT INTO `def_login_log` VALUES (62630341681152, NULL, 10937855681024, 61847994706433, '192.168.1.37', 'Dawn', '2439646234', '01', '登录成功', '2025-08-15', 'tauri-plugin-http/2.5.1', 'Unknown', '', 'Unknown', '0|0|0|内网IP|内网IP', '2025-08-15 19:50:38', 61847994706433, '2025-08-15 19:50:38', NULL, 0);
|
||||
INSERT INTO `def_login_log` VALUES (62630522036224, NULL, 10937855681024, 61847994706433, '192.168.1.37', 'Dawn', '2439646234', '01', '登录成功', '2025-08-15', 'tauri-plugin-http/2.5.1', 'Unknown', '', 'Unknown', '0|0|0|内网IP|内网IP', '2025-08-15 19:51:20', 61847994706433, '2025-08-15 19:51:20', NULL, 0);
|
||||
INSERT INTO `def_login_log` VALUES (62631155376128, NULL, 10937855681024, 61847994706433, '192.168.1.37', 'Dawn', '2439646234', '01', '登录成功', '2025-08-15', 'tauri-plugin-http/2.5.1', 'Unknown', '', 'Unknown', '0|0|0|内网IP|内网IP', '2025-08-15 19:53:52', 61847994706433, '2025-08-15 19:53:52', NULL, 0);
|
||||
INSERT INTO `def_login_log` VALUES (62631407034368, NULL, 10937855681024, 61847994706433, '192.168.1.37', 'Dawn', '2439646234', '01', '登录成功', '2025-08-15', 'tauri-plugin-http/2.5.1', 'Unknown', '', 'Unknown', '0|0|0|内网IP|内网IP', '2025-08-15 19:54:52', 61847994706433, '2025-08-15 19:54:52', NULL, 0);
|
||||
INSERT INTO `def_login_log` VALUES (62631650304000, NULL, 10937855681024, 61847994706433, '192.168.1.37', 'Dawn', '2439646234', '01', '登录成功', '2025-08-15', 'tauri-plugin-http/2.5.1', 'Unknown', '', 'Unknown', '0|0|0|内网IP|内网IP', '2025-08-15 19:55:49', 61847994706433, '2025-08-15 19:55:49', NULL, 0);
|
||||
INSERT INTO `def_login_log` VALUES (62631876796416, NULL, 10937855681024, 61847994706433, '192.168.1.37', 'Dawn', '2439646234', '01', '登录成功', '2025-08-15', 'tauri-plugin-http/2.5.1', 'Unknown', '', 'Unknown', '0|0|0|内网IP|内网IP', '2025-08-15 19:56:43', 61847994706433, '2025-08-15 19:56:43', NULL, 0);
|
||||
INSERT INTO `def_login_log` VALUES (62632107483136, NULL, 10937855681024, 61847994706433, '192.168.1.37', 'Dawn', '2439646234', '01', '登录成功', '2025-08-15', 'tauri-plugin-http/2.5.1', 'Unknown', '', 'Unknown', '0|0|0|内网IP|内网IP', '2025-08-15 19:57:38', 61847994706433, '2025-08-15 19:57:38', NULL, 0);
|
||||
INSERT INTO `def_login_log` VALUES (62632514330624, NULL, 10937855681024, 61847994706433, '192.168.1.37', 'Dawn', '2439646234', '01', '登录成功', '2025-08-15', 'tauri-plugin-http/2.5.1', 'Unknown', '', 'Unknown', '0|0|0|内网IP|内网IP', '2025-08-15 19:59:16', 61847994706433, '2025-08-15 19:59:16', 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
|
||||
@@ -1161,22 +1166,22 @@ CREATE TABLE `def_msg_template` (
|
||||
`tenant_id` bigint NOT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE INDEX `UK_MSG_TEMPLATE_CODE`(`code` ASC) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '消息模板' ROW_FORMAT = DYNAMIC;
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '消息模板' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of 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, '395546031032642561', '03', 'PASSWORD_EDIT', '停服通知', b'1', NULL, NULL, NULL, '尊敬的用户,${nickname}:\n 近期服务器迁移,需要停服2天,特此通知。', NULL, '[{\"key\":\"nickname\",\"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
|
||||
@@ -1198,7 +1203,7 @@ CREATE TABLE `def_parameter` (
|
||||
`tenant_id` bigint NOT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE INDEX `uk_param_key`(`key_` ASC) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '参数配置' ROW_FORMAT = DYNAMIC;
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '参数配置' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of def_parameter
|
||||
@@ -1241,7 +1246,7 @@ CREATE TABLE `def_resource` (
|
||||
`is_del` tinyint(1) NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE INDEX `uk_resource_code`(`code` ASC) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '资源' ROW_FORMAT = DYNAMIC;
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '资源' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of def_resource
|
||||
@@ -1481,7 +1486,7 @@ CREATE TABLE `def_resource_api` (
|
||||
`is_del` tinyint(1) NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
INDEX `idx_res_api_resource_id`(`resource_id` ASC) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '资源接口' ROW_FORMAT = DYNAMIC;
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '资源接口' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of def_resource_api
|
||||
@@ -1720,7 +1725,7 @@ CREATE TABLE `def_tenant` (
|
||||
`update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
|
||||
`is_del` tinyint(1) NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '租户表' ROW_FORMAT = DYNAMIC;
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '租户表' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of def_tenant
|
||||
@@ -1742,7 +1747,7 @@ CREATE TABLE `def_tenant_application_rel` (
|
||||
`update_time` datetime NULL DEFAULT NULL COMMENT '最后更新时间',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE INDEX `uk_tar_tenant_application`(`tenant_id` ASC, `application_id` ASC) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '租户的应用' ROW_FORMAT = DYNAMIC;
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '租户的应用' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of def_tenant_application_rel
|
||||
@@ -1791,12 +1796,13 @@ CREATE TABLE `def_user` (
|
||||
UNIQUE INDEX `uk_user_email`(`email` ASC) USING BTREE,
|
||||
UNIQUE INDEX `uk_user_id_card`(`id_card` ASC) USING BTREE,
|
||||
UNIQUE INDEX `uk_user_mobile`(`system_type` ASC, `mobile` ASC) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '用户' ROW_FORMAT = DYNAMIC;
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '用户' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of def_user
|
||||
-- ----------------------------
|
||||
INSERT INTO `def_user` VALUES (61847994706433, 2, '2439646234', 'Dawn', '2439646234@qq.com', 'https://cdn.hulaspark.com/avatar/2439646234/6ec99d37b8ba1296c325d2d36b46a14d.webp', NULL, NULL, '', NULL, b'0', '', '', '1', b'1', '', '2025-08-13 08:01:53.466', '{\"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\": \"XX\", \"city_id\": \"local\", \"country\": \"XX\", \"region_id\": \"xx\", \"country_id\": \"xx\"}}', NULL, 0, NULL, 'a4d5c225e6709ba025272a31c7e90e0121d5e5ba16695afe0b61370bedb677d0', 'Dawn', '2025-08-15 19:57:38', 1, '2025-03-27 04:23:08', NULL, '2025-08-15 19:59:16', 0, 1);
|
||||
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-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
|
||||
@@ -1813,7 +1819,7 @@ CREATE TABLE `def_user_application` (
|
||||
`is_del` tinyint(1) NOT NULL DEFAULT 0,
|
||||
`tenant_id` bigint NOT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '用户的默认应用' ROW_FORMAT = DYNAMIC;
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '用户的默认应用' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of def_user_application
|
||||
@@ -1835,7 +1841,7 @@ CREATE TABLE `def_user_tenant_rel` (
|
||||
`update_time` datetime NULL DEFAULT NULL COMMENT '最后更新时间',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE INDEX `uk_utr_user_tenant`(`user_id` ASC, `tenant_id` ASC) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '员工' ROW_FORMAT = DYNAMIC;
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '员工' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of def_user_tenant_rel
|
||||
@@ -1875,11 +1881,13 @@ CREATE TABLE `extend_interface_log` (
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE INDEX `UK_EIL_INTERFACE_ID`(`interface_id` ASC) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '接口执行日志' ROW_FORMAT = DYNAMIC;
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '接口执行日志' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- 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
|
||||
@@ -1901,7 +1909,7 @@ CREATE TABLE `extend_interface_logging` (
|
||||
`is_del` tinyint(1) NOT NULL DEFAULT 0,
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '接口执行日志记录' ROW_FORMAT = DYNAMIC;
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '接口执行日志记录' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of extend_interface_logging
|
||||
@@ -1934,7 +1942,7 @@ CREATE TABLE `extend_msg` (
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
INDEX `tempate_id_topic_content`(`template_code` ASC, `title` ASC) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '消息' ROW_FORMAT = DYNAMIC;
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '消息' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of extend_msg
|
||||
@@ -1957,32 +1965,11 @@ CREATE TABLE `extend_msg_recipient` (
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
INDEX `task_id_tel_num`(`msg_id` ASC, `recipient` ASC) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '消息接收人' ROW_FORMAT = DYNAMIC;
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '消息接收人' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of extend_msg_recipient
|
||||
-- ----------------------------
|
||||
INSERT INTO `extend_msg_recipient` VALUES (56041463289345, 56041463289344, '1046762075@qq.com', NULL, NULL, '2025-07-30 15:28:46', NULL, '2025-07-30 15:28:46', 0, 0);
|
||||
INSERT INTO `extend_msg_recipient` VALUES (56065660230657, 56065660230656, '1046762075@qq.com', NULL, NULL, '2025-07-30 17:04:56', NULL, '2025-07-30 17:04:56', 0, 0);
|
||||
INSERT INTO `extend_msg_recipient` VALUES (59248075870721, 59248075870720, '1046762075@qq.com', NULL, NULL, '2025-08-08 11:50:43', NULL, '2025-08-08 11:50:43', 0, 0);
|
||||
INSERT INTO `extend_msg_recipient` VALUES (59255030029825, 59255030029824, '1046762075@qq.com', NULL, NULL, '2025-08-08 12:18:21', NULL, '2025-08-08 12:18:21', 0, 0);
|
||||
INSERT INTO `extend_msg_recipient` VALUES (59255554317825, 59255554317824, '1046762075@qq.com', NULL, NULL, '2025-08-08 12:20:26', NULL, '2025-08-08 12:20:26', 0, 0);
|
||||
INSERT INTO `extend_msg_recipient` VALUES (59255948582401, 59255948582400, '1046762075@qq.com', NULL, NULL, '2025-08-08 12:22:00', NULL, '2025-08-08 12:22:00', 0, 0);
|
||||
INSERT INTO `extend_msg_recipient` VALUES (59256342846977, 59256342846976, '1046762075@qq.com', NULL, NULL, '2025-08-08 12:23:34', NULL, '2025-08-08 12:23:34', 0, 0);
|
||||
INSERT INTO `extend_msg_recipient` VALUES (655274613365962753, 655274613365962752, '1046762075@qq.com', NULL, NULL, '2025-07-16 20:00:41', NULL, '2025-07-16 20:00:41', 0, 0);
|
||||
INSERT INTO `extend_msg_recipient` VALUES (655274613365962756, 655274613365962755, '1046762075@qq.com', NULL, NULL, '2025-07-16 20:01:32', NULL, '2025-07-16 20:01:32', 0, 0);
|
||||
INSERT INTO `extend_msg_recipient` VALUES (655275407934914561, 655275407934914560, '1046762075@qq.com', NULL, NULL, '2025-07-16 20:03:24', NULL, '2025-07-16 20:03:24', 0, 0);
|
||||
INSERT INTO `extend_msg_recipient` VALUES (655836257649364993, 655836257649364992, '1046762075@qq.com', NULL, NULL, '2025-07-18 15:24:23', NULL, '2025-07-18 15:24:23', 0, 0);
|
||||
INSERT INTO `extend_msg_recipient` VALUES (658180420734877697, 658180420734877696, '2439646234@qq.com', NULL, NULL, '2025-07-24 17:36:12', NULL, '2025-07-24 17:36:12', 0, 0);
|
||||
INSERT INTO `extend_msg_recipient` VALUES (658180420734877700, 658180420734877699, '2439646234@qq.com', NULL, NULL, '2025-07-24 17:39:21', NULL, '2025-07-24 17:39:21', 0, 0);
|
||||
INSERT INTO `extend_msg_recipient` VALUES (658180420734877703, 658180420734877702, '2439646234@qq.com', NULL, NULL, '2025-07-24 17:42:06', NULL, '2025-07-24 17:42:06', 0, 0);
|
||||
INSERT INTO `extend_msg_recipient` VALUES (658180420734877706, 658180420734877705, '2439646234@qq.com', NULL, NULL, '2025-07-24 17:46:38', NULL, '2025-07-24 17:46:38', 0, 0);
|
||||
INSERT INTO `extend_msg_recipient` VALUES (658180420734877709, 658180420734877708, '2439646234@qq.com', NULL, NULL, '2025-07-24 17:48:33', NULL, '2025-07-24 17:48:33', 0, 0);
|
||||
INSERT INTO `extend_msg_recipient` VALUES (658180420734877712, 658180420734877711, 'k2439646234d@qq.com', NULL, NULL, '2025-07-24 17:50:36', NULL, '2025-07-24 17:50:36', 0, 0);
|
||||
INSERT INTO `extend_msg_recipient` VALUES (658180420734877715, 658180420734877714, 'k2439646234@2925.com', NULL, NULL, '2025-07-24 17:51:19', NULL, '2025-07-24 17:51:19', 0, 0);
|
||||
INSERT INTO `extend_msg_recipient` VALUES (658180420734877718, 658180420734877717, 'k2439646234e@2925.com', NULL, NULL, '2025-07-24 17:52:06', NULL, '2025-07-24 17:52:06', 0, 0);
|
||||
INSERT INTO `extend_msg_recipient` VALUES (658441984243233793, 658441984243233792, '1046762025@qq.com', NULL, NULL, '2025-07-25 08:54:21', NULL, '2025-07-25 08:54:21', 0, 0);
|
||||
INSERT INTO `extend_msg_recipient` VALUES (658479831495055361, 658479831495055360, '1046762075@qq.com', NULL, NULL, '2025-07-25 17:17:14', NULL, '2025-07-25 17:17:14', 0, 0);
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for extend_notice
|
||||
@@ -2013,7 +2000,7 @@ CREATE TABLE `extend_notice` (
|
||||
`is_del` tinyint(1) NOT NULL DEFAULT 0,
|
||||
`tenant_id` bigint NOT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '通知表' ROW_FORMAT = DYNAMIC;
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '通知表' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of extend_notice
|
||||
@@ -2038,7 +2025,7 @@ CREATE TABLE `secure_invoke_record` (
|
||||
`is_del` tinyint(1) NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
INDEX `idx_next_retry_time`(`next_retry_time` ASC) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 651910116374933505 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '本地消息表' ROW_FORMAT = DYNAMIC;
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 651910116374933505 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '本地消息表' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of secure_invoke_record
|
||||
@@ -2061,7 +2048,7 @@ CREATE TABLE `undo_log` (
|
||||
`tenant_id` bigint NOT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE INDEX `ux_undo_log`(`xid` ASC, `branch_id` ASC) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = 'AT transaction mode undo table' ROW_FORMAT = DYNAMIC;
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = 'AT transaction mode undo table' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of undo_log
|
||||
@@ -2081,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 = 595 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 (590, '240e:3b3:30b1:e800:fcd9:9796:fe2c:ecaa', '1755258136388-66706', 2, '2025-08-15', '2025-08-15 19:42:16', '2025-08-15 19:42:16', 0);
|
||||
INSERT INTO `worker_node` VALUES (591, '240e:3b3:30b1:e800:fcd9:9796:fe2c:ecaa', '1755258148386-79108', 2, '2025-08-15', '2025-08-15 19:42:28', '2025-08-15 19:42:28', 0);
|
||||
INSERT INTO `worker_node` VALUES (592, '240e:3b3:30b1:e800:fcd9:9796:fe2c:ecaa', '1755258154166-73188', 2, '2025-08-15', '2025-08-15 19:42:34', '2025-08-15 19:42:34', 0);
|
||||
INSERT INTO `worker_node` VALUES (593, '240e:3b3:30b1:e800:fcd9:9796:fe2c:ecaa', '1755258159082-97668', 2, '2025-08-15', '2025-08-15 19:42:39', '2025-08-15 19:42:39', 0);
|
||||
INSERT INTO `worker_node` VALUES (594, '240e:3b3:30b1:e800:fcd9:9796:fe2c:ecaa', '1755258161620-25310', 2, '2025-08-15', '2025-08-15 19:42:42', '2025-08-15 19:42:42', 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;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
Target Server Version : 80030 (8.0.30)
|
||||
File Encoding : 65001
|
||||
|
||||
Date: 27/08/2025 19:29:52
|
||||
Date: 11/10/2025 18:27:42
|
||||
*/
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
@@ -136,11 +136,12 @@ CREATE TABLE `ai_gpt_chat` (
|
||||
`updated_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
|
||||
`is_del` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 83706726461169701 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '聊天摘要' ROW_FORMAT = Dynamic;
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 83706726461169702 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '聊天摘要' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- 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
|
||||
@@ -168,7 +169,7 @@ CREATE TABLE `ai_gpt_chat_message` (
|
||||
`updated_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
|
||||
`is_del` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 83706726461169734 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '对话消息' ROW_FORMAT = Dynamic;
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 83706726461169735 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '对话消息' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of ai_gpt_chat_message
|
||||
@@ -300,7 +301,7 @@ CREATE TABLE `ai_gpt_order` (
|
||||
`updated_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
|
||||
`is_del` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '订单' ROW_FORMAT = Dynamic;
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '订单' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of ai_gpt_order
|
||||
@@ -324,7 +325,7 @@ CREATE TABLE `ai_gpt_redemption` (
|
||||
`updated_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
|
||||
`is_del` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '兑换码' ROW_FORMAT = Dynamic;
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '兑换码' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of ai_gpt_redemption
|
||||
@@ -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\":\"8si6G12t2MG9IOdkNDYmL0vGAYFTW-rHl4LgA5_\",\"configKey\":\"qnAccessKey\",\"type\":\"qiniu_up_config\"}', 'qnAccessKey', 'LXrRo6YhTnU0-_AlX222279VS8uhy5yScLzQJAQaUGUJ', 0, '2025-06-26 07:42:06.404', '2025-08-27 11:14:13.672', 3, NULL, 0);
|
||||
INSERT INTO `base_config` VALUES (5, 'qiniu_up_config', '{\"title\":\"SecretKey\",\"componentType\":\"text\",\"value\":\"MLzT2U2daTXFDEG9PuAy4TnvfR1oXvK2Yipm_eS9\",\"configKey\":\"qnSecretKey\",\"type\":\"qiniu_up_config\"}', 'qnSecretKey', 'BYKKz6nIjHSJLarEQxLK222gX6C300BlVS-llemF2Hg', 0, '2025-06-26 07:42:06.404', '2025-08-27 11:14:11.819', 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);
|
||||
@@ -409,10 +410,9 @@ CREATE TABLE `im_announcements` (
|
||||
`update_by` bigint NULL DEFAULT NULL COMMENT '更新者',
|
||||
`update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
|
||||
`is_del` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除',
|
||||
`publish_time` datetime NULL DEFAULT NULL COMMENT '发布时间',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 1,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 66202684729345 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
|
||||
@@ -427,11 +427,10 @@ CREATE TABLE `im_announcements_read_records` (
|
||||
`announcements_id` bigint NOT NULL COMMENT '公告id',
|
||||
`uid` bigint NOT NULL COMMENT '阅读人id',
|
||||
`is_check` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否已读 0:未读 1:已读',
|
||||
`created_by` bigint NOT NULL DEFAULT 0 COMMENT '创建者',
|
||||
`create_by` bigint NOT NULL DEFAULT 0 COMMENT '创建者',
|
||||
`create_time` datetime NOT NULL COMMENT '创建时间',
|
||||
`is_del` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 1,
|
||||
`create_by` bigint NOT NULL DEFAULT 1,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_as_ci COMMENT = '公告是否已读表' ROW_FORMAT = Dynamic;
|
||||
|
||||
@@ -475,7 +474,7 @@ CREATE TABLE `im_contact` (
|
||||
`shield` tinyint NOT NULL DEFAULT 0 COMMENT '屏蔽会话',
|
||||
`read_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT '阅读到的时间',
|
||||
`top` tinyint NOT NULL DEFAULT 0 COMMENT '置顶消息',
|
||||
`hide` tinyint NOT NULL DEFAULT 0 COMMENT '置顶消息',
|
||||
`hide` tinyint NOT NULL DEFAULT 0 COMMENT '隐藏会话',
|
||||
`active_time` datetime(3) NULL DEFAULT NULL COMMENT '会话内消息最后更新的时间(只有普通会话需要维护,全员会话不需要维护)',
|
||||
`last_msg_id` bigint NULL DEFAULT NULL COMMENT '会话最新消息id',
|
||||
`create_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT '创建时间',
|
||||
@@ -490,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 = 65033612208054 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-08-25 18:33:09.986', 1, 0, '2025-08-27 19:01:44.000', 66966694008337, '2025-03-27 04:23:08.420', '2025-08-27 11:02:31.422', 1, 0, 61847994706433, 0);
|
||||
INSERT INTO `im_contact` VALUES (10937855681525, 1, 1, 0, 0, '2025-07-07 14:49:04.239', 1, 0, '2025-08-27 19:01:44.000', 66966694008337, '2025-03-27 04:23:08.420', '2025-08-27 11:02:31.422', 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
|
||||
@@ -579,7 +579,7 @@ CREATE TABLE `im_group_invite` (
|
||||
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;
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 62581624628737 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '群组邀请记录表' ROW_FORMAT = DYNAMIC;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of im_group_invite
|
||||
@@ -597,7 +597,7 @@ CREATE TABLE `im_group_member` (
|
||||
`role_id` int NOT NULL COMMENT '成员角色 1群主 2管理员 3普通成员',
|
||||
`remark` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '群备注',
|
||||
`de_friend` tinyint NOT NULL DEFAULT 0 COMMENT '屏蔽群 1 -> 屏蔽 0 -> 正常',
|
||||
`my_name` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '我的群昵称',
|
||||
`my_name` varchar(48) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '我的群昵称',
|
||||
`create_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT '创建时间',
|
||||
`update_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3) COMMENT '修改时间',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 1,
|
||||
@@ -607,13 +607,14 @@ CREATE TABLE `im_group_member` (
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
INDEX `idx_group_id_role`(`group_id` ASC, `role_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 = 65161763333633 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '群成员表' ROW_FORMAT = Dynamic;
|
||||
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 = 82522826436610 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '群成员表' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of im_group_member
|
||||
-- ----------------------------
|
||||
INSERT INTO `im_group_member` VALUES (10937855681026, 1, 10937855681024, 3, '', 0, '', '2025-03-27 04:23:08.435', '2025-03-27 04:23:08.435', 1, 0, 61847994706433, 0);
|
||||
INSERT INTO `im_group_member` VALUES (10937855681026, 1, 10937855681024, 1, '', 0, 'Dawn', '2025-03-27 04:23:08.435', '2025-09-12 06:47:19.108', 1, 0, 61170828519937, 0);
|
||||
INSERT INTO `im_group_member` VALUES (10937855681626, 1, 1, 3, '', 0, '', '2025-03-27 04:23:08.435', '2025-03-27 04:23:08.435', 1, 0, NULL, 0);
|
||||
|
||||
-- ----------------------------
|
||||
@@ -643,7 +644,7 @@ INSERT INTO `im_item_config` VALUES (1, 1, NULL, '用户可以使用改名卡,
|
||||
INSERT INTO `im_item_config` VALUES (2, 2, 'https://cdn.hulaspark.com/badge/like.png', '爆赞徽章,单条消息被点赞超过10次,即可获得', '2023-05-07 17:50:31.090', '2025-03-26 17:47:00.273', 1, 1, NULL, 0);
|
||||
INSERT INTO `im_item_config` VALUES (3, 2, 'https://cdn.hulaspark.com/badge/top10.png ', 'HuLa前10名注册的用户才能获得的专属徽章', '2023-05-07 17:50:31.100', '2025-03-26 17:47:04.452', 1, 1, NULL, 0);
|
||||
INSERT INTO `im_item_config` VALUES (4, 2, 'https://cdn.hulaspark.com/badge/top100.png', 'HuLa前100名注册的用户才能获得的专属徽章', '2023-05-07 17:50:31.109', '2025-03-26 17:47:07.734', 1, 1, NULL, 0);
|
||||
INSERT INTO `im_item_config` VALUES (5, 2, 'https://cdn.hulaspark.com/badge/planet.png', 'HuLa知识星球成员的专属徽章', '2023-05-07 17:50:31.109', '2025-03-26 17:47:10.714', 1, 1, NULL, 0);
|
||||
INSERT INTO `im_item_config` VALUES (5, 2, 'https://cdn.hulaspark.com/badge/planet.png', 'HuLa团队核心成员专属徽章', '2023-05-07 17:50:31.109', '2025-09-19 10:41:01.216', 1, 1, NULL, 0);
|
||||
INSERT INTO `im_item_config` VALUES (6, 2, 'https://cdn.hulaspark.com/badge/active.png', 'HuLa项目贡献者专属徽章', '2023-05-07 17:50:31.109', '2025-03-26 17:47:13.855', 1, 1, NULL, 0);
|
||||
|
||||
-- ----------------------------
|
||||
@@ -670,8 +671,8 @@ CREATE TABLE `im_message` (
|
||||
INDEX `idx_room_id`(`room_id` ASC) USING BTREE,
|
||||
INDEX `idx_from_uid`(`from_uid` ASC) USING BTREE,
|
||||
INDEX `idx_create_time`(`create_time` ASC) USING BTREE,
|
||||
INDEX `idx_room_create_time`(`room_id` ASC, `create_time` ASC) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 66966777894428 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '消息表' ROW_FORMAT = Dynamic;
|
||||
INDEX `idx_update_time`(`update_time` ASC) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 82910984107521 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '消息表' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of im_message
|
||||
@@ -701,12 +702,44 @@ 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 = 60474725050369 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
|
||||
-- ----------------------------
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for im_notice
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `im_notice`;
|
||||
CREATE TABLE `im_notice` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`event_type` tinyint NOT NULL COMMENT '通知类型:1-好友申请;2-群申请;3-群邀请;5-移除群成员;6-好友被申请;7-被邀请进群',
|
||||
`type` tinyint NOT NULL DEFAULT 1 COMMENT '通知类型 1群聊 2加好友',
|
||||
`sender_id` bigint NOT NULL COMMENT '发起人UID',
|
||||
`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 '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',
|
||||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`create_by` bigint NOT NULL COMMENT '创建人',
|
||||
`update_by` bigint NOT NULL COMMENT '创建人',
|
||||
`is_del` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
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 = 83150193654275 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '统一通知表' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of im_notice
|
||||
-- ----------------------------
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for im_role
|
||||
-- ----------------------------
|
||||
@@ -731,30 +764,6 @@ CREATE TABLE `im_role` (
|
||||
INSERT INTO `im_role` VALUES (1, '超级管理员', '2024-07-10 11:17:15.089', '2024-07-10 11:17:15.089', 1, 1, NULL, 0);
|
||||
INSERT INTO `im_role` VALUES (2, 'HuLa群聊管理员', '2024-07-10 11:17:15.091', '2024-11-26 12:00:22.452', 1, 1, NULL, 0);
|
||||
|
||||
DROP TABLE IF EXISTS `im_notice`;
|
||||
CREATE TABLE `im_notice` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`event_type` tinyint NOT NULL COMMENT '通知类型:1-好友申请;2-群申请;3-群邀请;5-移除群成员;6-好友被申请;7-被邀请进群',
|
||||
`type` tinyint NOT NULL DEFAULT 1 COMMENT '通知类型 1群聊 2加好友',
|
||||
`sender_id` bigint NOT NULL COMMENT '发起人UID',
|
||||
`receiver_id` bigint NOT NULL COMMENT '接收人UID',
|
||||
`apply_id` bigint NULL DEFAULT NULL COMMENT '申请ID',
|
||||
`operate_id` bigint NOT NULL COMMENT '房间ID',
|
||||
`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',
|
||||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`create_by` bigint NOT NULL COMMENT '创建人',
|
||||
`update_by` bigint NOT NULL COMMENT '创建人',
|
||||
`is_del` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
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 = 75169527849987 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '统一通知表' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for im_room
|
||||
-- ----------------------------
|
||||
@@ -775,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 = 65146059858433 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-08-27 19:02:04.507', 66966777894421, NULL, '2024-07-10 11:17:15.521', '2025-08-27 11:02:26.006', 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
|
||||
@@ -805,13 +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 = 62581054203394 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, '10937855681024,11225442329600', 0, 0, '2025-03-27 23:40:34.548', '2025-08-27 11:17:17.729', 1, 1, NULL, 0);
|
||||
INSERT INTO `im_room_friend` VALUES (11367692149763, 11367692149762, 1, 10937855681024, '11003672699392,11049889735168', 0, 0, '2025-03-28 08:51:09.406', '2025-08-27 11:17:40.365', 1, 1, NULL, 0);
|
||||
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
|
||||
@@ -823,6 +832,7 @@ CREATE TABLE `im_room_group` (
|
||||
`account` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '群号',
|
||||
`name` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '群名称',
|
||||
`avatar` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '群头像',
|
||||
`allow_scan_enter` tinyint NOT NULL DEFAULT 1 COMMENT '允许扫码直接进群',
|
||||
`ext_json` json NULL COMMENT '额外信息(根据不同类型房间有不同存储的东西)',
|
||||
`is_del` int NOT NULL DEFAULT 0 COMMENT '逻辑删除(0-正常,1-删除)',
|
||||
`create_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT '创建时间',
|
||||
@@ -834,12 +844,12 @@ CREATE TABLE `im_room_group` (
|
||||
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 = 65146059858435 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '群聊房间表' ROW_FORMAT = Dynamic;
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 74879168766467 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '群聊房间表' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of im_room_group
|
||||
-- ----------------------------
|
||||
INSERT INTO `im_room_group` VALUES (1, 1, 'hula-ds240401', 'HuLa官方频道', 'https://cdn.hulaspark.com/avatar/hula.png', 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
|
||||
@@ -876,7 +886,7 @@ CREATE TABLE `im_target` (
|
||||
`tenant_id` bigint NOT NULL DEFAULT 1,
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
INDEX `employee`(`u_id` ASC) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_as_ci COMMENT = '聊天的标签' ROW_FORMAT = Dynamic;
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_as_ci COMMENT = '聊天的标签' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of im_target
|
||||
@@ -917,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 = 65033610564609 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, 61847994706432, 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\": \"XX\", \"area\": \"\", \"city\": \"XX\", \"isp_id\": \"xx\", \"region\": \"XX\", \"city_id\": \"xx\", \"country\": \"美国\", \"region_id\": \"xx\", \"country_id\": \"US\"}, \"updateIpDetail\": {\"ip\": \"120.231.232.41\", \"isp\": \"移动\", \"area\": \"\", \"city\": \"XX\", \"isp_id\": \"100025\", \"region\": \"广东\", \"city_id\": \"xx\", \"country\": \"中国\", \"region_id\": \"440000\", \"country_id\": \"CN\"}}', 6, 0, '', '2025-03-27 04:23:08.393', '2025-08-13 16:01:51.930', 'k.23772439646234', 0, NULL, 0, '2025-05-09 18:24:37.089', 99978, 0, 1);
|
||||
INSERT INTO `im_user` VALUES (10937855681024, 61847994706433, 3, 'Dawn', 'https://cdn.hulaspark.com/avatar/2439646234/6ec99d37b8ba1296c325d2d36b46a14d.webp', '2439646234@qq.com', '2439646234', NULL, '', 9, '2025-07-30 15:31:57.651', '{\"createIp\": \"206.237.119.215\", \"updateIp\": \"120.229.24.173\", \"createIpDetail\": {\"ip\": \"206.237.119.215\", \"isp\": \"XX\", \"area\": \"\", \"city\": \"XX\", \"isp_id\": \"xx\", \"region\": \"XX\", \"city_id\": \"xx\", \"country\": \"美国\", \"region_id\": \"xx\", \"country_id\": \"US\"}, \"updateIpDetail\": {\"ip\": \"120.229.24.173\", \"isp\": \"移动\", \"area\": \"\", \"city\": \"XX\", \"isp_id\": \"100025\", \"region\": \"广东\", \"city_id\": \"xx\", \"country\": \"中国\", \"region_id\": \"440000\", \"country_id\": \"CN\"}}', 6, 0, '', '2025-03-27 04:23:08.393', '2025-08-21 10:55:17.103', 'k.2439646234', 0, NULL, 0, '2025-05-09 18:24:37.089', 99978, 0, 1);
|
||||
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, '', 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
|
||||
@@ -932,7 +942,7 @@ DROP TABLE IF EXISTS `im_user_apply`;
|
||||
CREATE TABLE `im_user_apply` (
|
||||
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'id',
|
||||
`uid` bigint NOT NULL COMMENT '申请人uid',
|
||||
`type` int NOT NULL COMMENT '申请类型 1加好友 2 加群',
|
||||
`type` int NOT NULL COMMENT '申请类型 1群聊 2加好友',
|
||||
`room_id` bigint NOT NULL COMMENT '房间id',
|
||||
`target_id` bigint NOT NULL COMMENT '接收对象 type: 1 -> uid; type: 2 -> roomGroupId',
|
||||
`msg` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '申请信息',
|
||||
@@ -952,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 = 65161746556417 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
|
||||
@@ -965,7 +975,7 @@ DROP TABLE IF EXISTS `im_user_backpack`;
|
||||
CREATE TABLE `im_user_backpack` (
|
||||
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'id',
|
||||
`uid` bigint NOT NULL COMMENT 'uid',
|
||||
`item_id` int NOT NULL COMMENT '物品id',
|
||||
`item_id` bigint NOT NULL COMMENT '物品id',
|
||||
`status` int NOT NULL COMMENT '使用状态 0.待使用 1已使用',
|
||||
`idempotent` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '幂等号',
|
||||
`create_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT '创建时间',
|
||||
@@ -979,11 +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 = 65033614758913 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 (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);
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for im_user_block
|
||||
@@ -1021,53 +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 = 59075366823937 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 (12637274416128, 10937855681024, 'https://cdn.hulaspark.com/chat/2439646234/710683d87faa15a807c58574a6ee8c81.png', 0, '2025-03-31 20:56:01.302', '2025-03-31 20:56:01.302', 1, 0, NULL);
|
||||
INSERT INTO `im_user_emoji` VALUES (12637333136384, 10937855681024, 'https://cdn.hulaspark.com/chat/2439646234/322eed8d06539028c2e9c27212ee232c.png', 0, '2025-03-31 20:56:15.350', '2025-03-31 20:56:15.350', 1, 0, NULL);
|
||||
INSERT INTO `im_user_emoji` VALUES (12637379273728, 10937855681024, 'https://cdn.hulaspark.com/chat/2439646234/6ac23bb3a9a384ada1e82f41d181e4bc.png', 0, '2025-03-31 20:56:26.793', '2025-03-31 20:56:26.793', 1, 0, NULL);
|
||||
INSERT INTO `im_user_emoji` VALUES (12637450576896, 10937855681024, 'https://cdn.hulaspark.com/chat/2439646234/ae4e6c0e10667c33f0066eaf7444c3a9.png', 1, '2025-03-31 20:56:43.103', '2025-07-01 19:55:38.895', 1, 0, NULL);
|
||||
INSERT INTO `im_user_emoji` VALUES (13077135270912, 10937855681024, 'https://upload-bbs.miyoushe.com/upload/2023/01/18/838dba51bd47c248d1f02b2e24a28b18_6640243918864203211.png', 1, '2025-04-02 02:03:52.348', '2025-04-02 02:03:59.199', 1, 0, NULL);
|
||||
INSERT INTO `im_user_emoji` VALUES (17994658920448, 10937855681024, 'https://cdn.hulaspark.com/chat/2439646234/ae779d7e2427a7efc292f518143146b9.png', 1, '2025-04-15 15:44:21.396', '2025-04-15 16:07:02.008', 1, 0, NULL);
|
||||
INSERT INTO `im_user_emoji` VALUES (18328189974528, 10937855681024, 'https://cdn.hulaspark.com/chat/2439646234/89f9617af96bc484d1302aa9965d45d3.jpg', 0, '2025-04-16 13:49:41.795', '2025-04-16 13:49:41.795', 1, 0, NULL);
|
||||
INSERT INTO `im_user_emoji` VALUES (18682617051648, 10937855681024, 'https://cdn.hulaspark.com/chat/2439646234/1fefca23dfc273f4b778867122b053db.jpg', 0, '2025-04-17 13:18:03.703', '2025-04-17 13:18:03.703', 1, 0, NULL);
|
||||
INSERT INTO `im_user_emoji` VALUES (18695812332032, 10937855681024, 'https://cdn.hulaspark.com/chat/67956761/0d7a38aff2095ffa86d4b6c650a05047.jpg', 0, '2025-04-17 14:10:29.694', '2025-04-17 14:10:29.694', 1, 0, NULL);
|
||||
INSERT INTO `im_user_emoji` VALUES (18851517480448, 10937855681024, 'https://cdn.hulaspark.com/chat/2439646234/414d8351a445105d5b5ec163f7d6c8d9.png', 0, '2025-04-18 00:29:12.454', '2025-04-18 00:29:12.454', 1, 0, NULL);
|
||||
INSERT INTO `im_user_emoji` VALUES (18851584589312, 10937855681024, 'https://cdn.hulaspark.com/chat/2439646234/b4d9d7ef33551c8440541e1f80f17eb1.png', 0, '2025-04-18 00:29:28.373', '2025-04-18 00:29:28.373', 1, 0, NULL);
|
||||
INSERT INTO `im_user_emoji` VALUES (19064231607808, 10937855681024, 'https://cdn.hulaspark.com/chat/2439646234/1d29c7156617203491e1180d8e3c0271.png', 0, '2025-04-18 14:34:27.304', '2025-04-18 14:34:27.304', 1, 0, NULL);
|
||||
INSERT INTO `im_user_emoji` VALUES (19185258250240, 10937855681024, 'https://cdn.hulaspark.com/chat/hi/98037c2c93c8271ba30682ddad9179e1.jpg', 1, '2025-04-18 22:35:22.450', '2025-05-05 21:03:56.172', 1, 0, NULL);
|
||||
INSERT INTO `im_user_emoji` VALUES (19193592332288, 10937855681024, 'https://cdn.hulaspark.com/chat/2439646234/a89559bc2abf4495de12fbd8f7bc4c11.jpg', 0, '2025-04-18 23:08:29.383', '2025-04-18 23:08:29.383', 1, 0, NULL);
|
||||
INSERT INTO `im_user_emoji` VALUES (19195794341888, 10937855681024, 'blob:http://127.0.0.1:6130/fe077b81-2630-4fea-be34-295ce093dd5b', 1, '2025-04-18 23:17:14.381', '2025-04-18 23:17:31.417', 1, 0, NULL);
|
||||
INSERT INTO `im_user_emoji` VALUES (19195882422272, 10937855681024, 'https://cdn.hulaspark.com/chat/2439646234/ed77cc7bbdf2bd358d81d8fd8e4b0370.jpg', 0, '2025-04-18 23:17:35.068', '2025-04-18 23:17:35.068', 1, 0, NULL);
|
||||
INSERT INTO `im_user_emoji` VALUES (20621085953536, 10937855681024, 'https://cdn.hulaspark.com/chat/2439646234/c5ef2eabb9845e67bb59d77df95587f0.jpg', 0, '2025-04-22 21:40:50.272', '2025-04-22 21:40:50.272', 1, 0, NULL);
|
||||
INSERT INTO `im_user_emoji` VALUES (20868013018624, 10937855681024, 'https://cdn.hulaspark.com/chat/hi/d1ff8ff45782de5aba7ea26d11e5d293.jpg', 0, '2025-04-23 14:02:02.617', '2025-04-23 14:02:02.617', 1, 0, NULL);
|
||||
INSERT INTO `im_user_emoji` VALUES (21586392438272, 10937855681024, 'https://cdn.hulaspark.com/chat/2439646234/dc792e85912194f614ce958078bcf0cf.jpg', 1, '2025-04-25 13:36:37.950', '2025-07-01 19:56:25.768', 1, 0, NULL);
|
||||
INSERT INTO `im_user_emoji` VALUES (21609389807104, 10937855681024, 'https://cdn.hulaspark.com/chat/2439646234/6d335fa2e7eb4ac9efacfc24181934c4.jpg', 0, '2025-04-25 15:08:00.378', '2025-04-25 15:08:00.378', 1, 0, NULL);
|
||||
INSERT INTO `im_user_emoji` VALUES (21646169658880, 10937855681024, 'https://cdn.hulaspark.com/chat/2439646234/c6a4fb7fad369e6a9629c8d09a69c7a4.jpg', 0, '2025-04-25 17:34:09.792', '2025-04-25 17:34:09.792', 1, 0, NULL);
|
||||
INSERT INTO `im_user_emoji` VALUES (22336166222336, 10937855681024, 'https://cdn.hulaspark.com/chat/2439646234/7e800eb444941bf2fdd1fda1014489f7.jpg', 0, '2025-04-27 15:15:57.668', '2025-04-27 15:15:57.668', 1, 0, NULL);
|
||||
INSERT INTO `im_user_emoji` VALUES (22338494061056, 10937855681024, 'https://cdn.hulaspark.com/chat/2439646234/37e4cf6e2c3f9a4f10f1bff6985bcfac.jpg', 0, '2025-04-27 15:25:12.500', '2025-04-27 15:25:12.500', 1, 0, NULL);
|
||||
INSERT INTO `im_user_emoji` VALUES (22338636667392, 10937855681024, 'https://cdn.hulaspark.com/chat/2439646234/a115050f07e3fab6fb5fdc7cc64b12c7.jpg', 0, '2025-04-27 15:25:46.528', '2025-04-27 15:25:46.528', 1, 0, NULL);
|
||||
INSERT INTO `im_user_emoji` VALUES (23117263070208, 10937855681024, 'https://cdn.hulaspark.com/chat/2439646234/068e2fbf5f99f83070528226d350868b.jpg', 0, '2025-04-29 18:59:45.353', '2025-04-29 18:59:45.353', 1, 0, NULL);
|
||||
INSERT INTO `im_user_emoji` VALUES (26629011205632, 10937855681024, 'https://cdn.hulaspark.com/chat/2439646234/8b93b2ae198ef2ce94c3154a7254e393.jpg', 1, '2025-05-09 11:34:11.893', '2025-07-01 19:22:26.391', 1, 0, NULL);
|
||||
INSERT INTO `im_user_emoji` VALUES (28509720343040, 10937855681024, 'blob:http://127.0.0.1:6130/8e9ec11a-7427-490d-ac5d-75d0e8607b3d', 1, '2025-05-14 16:07:27.880', '2025-05-14 16:08:29.807', 1, 0, NULL);
|
||||
INSERT INTO `im_user_emoji` VALUES (28510160744960, 10937855681024, 'https://cdn.hulaspark.com/chat/2439646234/a1c93b41ec729e3724f19cd04a614122.jpg', 0, '2025-05-14 16:09:12.778', '2025-05-14 16:09:12.778', 1, 0, NULL);
|
||||
INSERT INTO `im_user_emoji` VALUES (29219396579840, 10937855681024, 'https://cdn.hulaspark.com/chat/2439646234/4df3086ce47b86fd748171b86df2761a.jpg', 0, '2025-05-16 15:07:27.972', '2025-05-16 15:07:27.972', 1, 0, NULL);
|
||||
INSERT INTO `im_user_emoji` VALUES (31465626728960, 10937855681024, 'https://cdn.hulaspark.com/chat/evangelionss/9d3c2e49c264128f6dee70e51c8e76f9.GIF', 1, '2025-05-22 19:53:10.919', '2025-07-01 19:32:15.319', 1, 0, NULL);
|
||||
INSERT INTO `im_user_emoji` VALUES (32001298071040, 10937855681024, 'https://cdn.hulaspark.com/chat/2439646234/2a27e4f29b6ab87bcbe4273d4880730d.png', 1, '2025-05-24 07:21:44.792', '2025-05-24 07:21:59.184', 1, 0, NULL);
|
||||
INSERT INTO `im_user_emoji` VALUES (33239850880000, 10937855681024, 'https://cdn.hulaspark.com/chat/67956761/54492a8f8e93e349171b7d45ae23215a.jpeg', 0, '2025-05-27 17:23:18.592', '2025-05-27 17:23:18.592', 1, 0, NULL);
|
||||
INSERT INTO `im_user_emoji` VALUES (36197065886720, 10937855681024, 'https://cdn.hulaspark.com/chat/2439646234/0e84c8a1e75db04549a2ad2d8342c0d7.jpg', 0, '2025-06-04 21:14:13.194', '2025-06-04 21:14:13.194', 1, 0, NULL);
|
||||
INSERT INTO `im_user_emoji` VALUES (42407429213184, 10937855681024, 'https://cdn.hulaspark.com/chat/2439646234/85b53f3ecd4d5566ca576ef81abc91a4.png', 0, '2025-06-22 00:31:59.855', '2025-06-22 00:31:59.855', 1, 0, NULL);
|
||||
INSERT INTO `im_user_emoji` VALUES (45953419644416, 10937855681024, 'https://cdn.hulaspark.com/chat/1519147473/8b696cba58460ba3af91d89c92bda212.gif', 0, '2025-07-01 19:22:29.895', '2025-07-01 19:22:29.895', 1, 0, NULL);
|
||||
INSERT INTO `im_user_emoji` VALUES (45955890089472, 10937855681024, 'https://cdn.hulaspark.com/chat/1519147473/90e337fe5426f83737deea46890367d3.jpg', 0, '2025-07-01 19:32:18.709', '2025-07-01 19:32:18.709', 1, 0, NULL);
|
||||
INSERT INTO `im_user_emoji` VALUES (45961774697984, 10937855681024, 'https://cdn.hulaspark.com/chat/1519147473/ff7774c206f6739d70872dc7003b9aa3.png', 0, '2025-07-01 19:55:41.462', '2025-07-01 19:55:41.462', 1, 0, NULL);
|
||||
INSERT INTO `im_user_emoji` VALUES (45961984413184, 10937855681024, 'https://cdn.hulaspark.com/chat/1519147473/ac4d39e9816ee8245d48e1d1beac8fd0.png', 0, '2025-07-01 19:56:31.466', '2025-07-01 19:56:31.466', 1, 0, NULL);
|
||||
INSERT INTO `im_user_emoji` VALUES (47432423510528, 10937855681024, 'https://cdn.hulaspark.com/chat/hi/98037c2c93c8271ba30682ddad9179e1.jpg', 0, '2025-07-05 21:19:31.513', '2025-07-05 21:19:31.513', 1, 0, NULL);
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for im_user_friend
|
||||
@@ -1095,13 +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 = 62581054203396 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 (11367692149760, 1, 1, 10937855681024, 0, 0, 0, 0, 0, 0, 0, NULL, '2025-03-28 08:51:09.397', '2025-08-27 11:21:49.458', 1, 0, NULL);
|
||||
INSERT INTO `im_user_friend` VALUES (11515012883456, 1, 10937855681024, 1, 0, 0, 0, 0, 0, 0, 0, NULL, '2025-03-28 18:36:33.214', '2025-08-27 11:21:47.141', 1, 0, NULL);
|
||||
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
|
||||
@@ -1127,7 +1097,7 @@ CREATE TABLE `im_user_privacy` (
|
||||
`tenant_id` bigint NOT NULL DEFAULT 1 COMMENT '租户ID',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE INDEX `idx_uid`(`uid` ASC) USING BTREE COMMENT '用户ID唯一索引'
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户隐私设置表' ROW_FORMAT = Dynamic;
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户隐私设置表' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of im_user_privacy
|
||||
@@ -1178,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
|
||||
@@ -1250,7 +1218,7 @@ CREATE TABLE `im_wx_msg` (
|
||||
INDEX `idx_open_id`(`open_id` ASC) USING BTREE,
|
||||
INDEX `idx_create_time`(`create_time` ASC) USING BTREE,
|
||||
INDEX `idx_update_time`(`update_time` ASC) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '微信消息表' ROW_FORMAT = Dynamic;
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '微信消息表' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of im_wx_msg
|
||||
@@ -1275,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 = 66602343194113 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
|
||||
@@ -1294,10 +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 = 241 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 (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;
|
||||
|
||||
@@ -9,6 +9,6 @@ public class GroupConst {
|
||||
/**
|
||||
* 最大群管理员数量
|
||||
*/
|
||||
public static final int MAX_MANAGE_COUNT = 3;
|
||||
public static final int MAX_MANAGE_COUNT = 1000;
|
||||
|
||||
}
|
||||
|
||||
@@ -10,9 +10,9 @@ import com.luohuo.flex.im.domain.MsgSendMessageDTO;
|
||||
import com.luohuo.flex.im.domain.entity.Message;
|
||||
import com.luohuo.flex.im.domain.entity.Room;
|
||||
import com.luohuo.flex.im.domain.entity.RoomFriend;
|
||||
import com.luohuo.flex.im.domain.entity.msg.AudioCallMsgDTO;
|
||||
import com.luohuo.flex.im.domain.vo.response.msg.AudioCallMsgDTO;
|
||||
import com.luohuo.flex.im.domain.entity.msg.MessageExtra;
|
||||
import com.luohuo.flex.im.domain.entity.msg.VideoCallMsgDTO;
|
||||
import com.luohuo.flex.im.domain.vo.response.msg.VideoCallMsgDTO;
|
||||
import com.luohuo.flex.im.domain.enums.MessageTypeEnum;
|
||||
import com.luohuo.flex.im.domain.enums.RoomTypeEnum;
|
||||
import com.luohuo.flex.model.entity.WsBaseResp;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.luohuo.flex.im.core.chat.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.luohuo.flex.im.domain.vo.req.room.UserApplyResp;
|
||||
import com.luohuo.flex.im.domain.vo.request.admin.AdminAddReq;
|
||||
import com.luohuo.flex.im.domain.vo.request.admin.AdminRevokeReq;
|
||||
import com.luohuo.flex.im.domain.vo.request.contact.ContactAddReq;
|
||||
@@ -96,13 +95,6 @@ public interface RoomAppService {
|
||||
*/
|
||||
void asyncOnline(List<Long> uidList, Long roomId, boolean online);
|
||||
|
||||
/**
|
||||
* 申请加群列表
|
||||
* @param uid 登录用户id
|
||||
* @param req 请求
|
||||
*/
|
||||
CursorPageBaseResp<UserApplyResp> queryApplyPage(Long uid, MemberReq req);
|
||||
|
||||
/**
|
||||
* 管理员修改群信息
|
||||
* @return
|
||||
|
||||
@@ -36,9 +36,9 @@ public interface RoomService {
|
||||
RoomFriend getFriendRoom(Long uid1, Long uid2);
|
||||
|
||||
/**
|
||||
* 禁用一个单聊房间
|
||||
* 禁用一个单聊房间 [目前是谁删除的,谁就没有会话]
|
||||
*/
|
||||
void disableFriendRoom(List<Long> uidList);
|
||||
void disableFriendRoom(Long roomId, Long uid, Long friendUid);
|
||||
|
||||
/**
|
||||
* 创建一个群聊房间
|
||||
|
||||
@@ -6,15 +6,11 @@ import com.luohuo.flex.im.common.enums.YesOrNoEnum;
|
||||
import com.luohuo.flex.im.domain.entity.Announcements;
|
||||
import com.luohuo.flex.im.domain.entity.Message;
|
||||
import com.luohuo.flex.im.domain.entity.MessageMark;
|
||||
import com.luohuo.flex.im.domain.entity.msg.AudioCallMsgDTO;
|
||||
import com.luohuo.flex.im.domain.entity.msg.BodyDTO;
|
||||
import com.luohuo.flex.im.domain.entity.msg.VideoCallMsgDTO;
|
||||
import com.luohuo.flex.im.domain.entity.msg.MergeMsgDTO;
|
||||
import com.luohuo.flex.im.domain.entity.msg.NoticeMsgDTO;
|
||||
import com.luohuo.flex.im.domain.enums.ApplyReadStatusEnum;
|
||||
import com.luohuo.flex.im.domain.enums.ApplyStatusEnum;
|
||||
import com.luohuo.flex.im.domain.enums.RoomTypeEnum;
|
||||
import com.luohuo.flex.im.domain.vo.req.room.UserApplyResp;
|
||||
import com.luohuo.flex.im.domain.vo.response.msg.AudioCallMsgDTO;
|
||||
import com.luohuo.flex.im.domain.vo.response.msg.BodyDTO;
|
||||
import com.luohuo.flex.im.domain.vo.response.msg.VideoCallMsgDTO;
|
||||
import com.luohuo.flex.im.domain.vo.response.msg.MergeMsgDTO;
|
||||
import com.luohuo.flex.im.domain.vo.response.msg.NoticeMsgDTO;
|
||||
import com.luohuo.flex.model.entity.ws.WSNotice;
|
||||
import com.luohuo.flex.model.enums.MessageMarkTypeEnum;
|
||||
import com.luohuo.flex.im.domain.enums.MessageStatusEnum;
|
||||
@@ -29,7 +25,6 @@ import com.luohuo.flex.model.entity.WSRespTypeEnum;
|
||||
import com.luohuo.flex.model.entity.WsBaseResp;
|
||||
import com.luohuo.flex.model.ws.CallEndReq;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -191,16 +186,6 @@ public class MessageAdapter {
|
||||
return chatMessageReq;
|
||||
}
|
||||
|
||||
/**
|
||||
* 申请加群通知
|
||||
*/
|
||||
public static WsBaseResp<UserApplyResp> buildRoomGroupMessage(Long uid, Long roomId, Long groupAdminId, String msg) {
|
||||
WsBaseResp<UserApplyResp> wsBaseResp = new WsBaseResp<>();
|
||||
wsBaseResp.setType(WSRespTypeEnum.ROOM_GROUP_MSG.getType());
|
||||
wsBaseResp.setData(new UserApplyResp(uid, RoomTypeEnum.GROUP.getType(), roomId, groupAdminId, msg, ApplyStatusEnum.WAIT_APPROVAL.getCode(), ApplyReadStatusEnum.UNREAD.getCode(), false, LocalDateTime.now()));
|
||||
return wsBaseResp;
|
||||
}
|
||||
|
||||
/**
|
||||
* 邀请用户进群通知
|
||||
* @param resp 通知数据
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -336,7 +334,7 @@ public class ChatServiceImpl implements ChatService {
|
||||
|
||||
@Override
|
||||
public List<Message> getMsgByIds(List<Long> msgIds) {
|
||||
return msgCache.getBatch(msgIds).values().stream().collect(Collectors.toList());
|
||||
return msgCache.getBatch(msgIds).values().stream().sorted(Comparator.comparingLong(Message::getId)).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -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) {
|
||||
|
||||
@@ -26,7 +26,6 @@ import com.luohuo.flex.im.core.user.service.cache.UserSummaryCache;
|
||||
import com.luohuo.flex.im.domain.dto.SummeryInfoDTO;
|
||||
import com.luohuo.flex.im.domain.entity.*;
|
||||
import com.luohuo.flex.im.domain.enums.*;
|
||||
import com.luohuo.flex.im.domain.vo.req.room.UserApplyResp;
|
||||
import com.luohuo.flex.im.domain.vo.request.ChatMessageReq;
|
||||
import com.luohuo.flex.im.domain.vo.request.admin.AdminAddReq;
|
||||
import com.luohuo.flex.im.domain.vo.request.admin.AdminRevokeReq;
|
||||
@@ -337,15 +336,29 @@ public class RoomAppServiceImpl implements RoomAppService, InitializingBean {
|
||||
|
||||
private void setAdminNotice(NoticeTypeEnum noticeTypeEnum, Long uid, List<Long> uidList, List<Long> manageUidList, String content) {
|
||||
long uuid = uidGenerator.getUid();
|
||||
uidList.stream().filter(id -> !manageUidList.contains(id)).forEach(id -> noticeService.createNotice(
|
||||
RoomTypeEnum.GROUP,
|
||||
noticeTypeEnum,
|
||||
uid,
|
||||
id,
|
||||
uuid,
|
||||
id,
|
||||
content
|
||||
));
|
||||
uidList.stream().filter(id -> !manageUidList.contains(id)).forEach(id -> {
|
||||
// 通知被操作的人
|
||||
noticeService.createNotice(
|
||||
RoomTypeEnum.GROUP,
|
||||
noticeTypeEnum,
|
||||
uid,
|
||||
id,
|
||||
uuid,
|
||||
id,
|
||||
content
|
||||
);
|
||||
|
||||
// 通知群主
|
||||
// noticeService.createNotice(
|
||||
// RoomTypeEnum.GROUP,
|
||||
// noticeTypeEnum,
|
||||
// uid,
|
||||
// uid,
|
||||
// uuid,
|
||||
// id,
|
||||
// content
|
||||
// );
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -394,37 +407,6 @@ public class RoomAppServiceImpl implements RoomAppService, InitializingBean {
|
||||
SpringUtils.publishEvent(new GroupMemberAddEvent(this, roomId, Math.toIntExact(cachePlusOps.sCard(gKey)), Math.toIntExact(cachePlusOps.sCard(onlineGroupMembersKey)), Arrays.asList(uid), uid));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询加群申请记录
|
||||
*
|
||||
* @param uid 登录用户id
|
||||
* @param req 分页请求
|
||||
*/
|
||||
@Override
|
||||
public CursorPageBaseResp<UserApplyResp> queryApplyPage(Long uid, MemberReq req) {
|
||||
// 1. 校验权限
|
||||
GroupMember member = groupMemberDao.getMember(req.getRoomId(), uid);
|
||||
if (member == null || member.getRoleId() == GroupRoleEnum.MEMBER.getType()) {
|
||||
throw new BizException("无权限查看申请列表");
|
||||
}
|
||||
|
||||
// 2. 游标查询申请进群记录
|
||||
CursorPageBaseResp<UserApply> userApplyPage = userApplyDao.getApplyPage(uid, RoomTypeEnum.GROUP.getType(), req);
|
||||
|
||||
return CursorPageBaseResp.init(userApplyPage, userApplyPage.getList().stream().map(apply -> {
|
||||
UserApplyResp applyResp = new UserApplyResp();
|
||||
applyResp.setType(apply.getType());
|
||||
applyResp.setUid(uid);
|
||||
applyResp.setMsg(apply.getMsg());
|
||||
applyResp.setRoomId(apply.getRoomId());
|
||||
applyResp.setTargetId(apply.getTargetId());
|
||||
applyResp.setStatus(apply.getStatus());
|
||||
applyResp.setReadStatus(apply.getReadStatus());
|
||||
applyResp.setCreateTime(apply.getCreateTime());
|
||||
return applyResp;
|
||||
}).collect(Collectors.toList()), userApplyPage.getTotal());
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理用户在线状态
|
||||
*
|
||||
@@ -493,6 +475,7 @@ public class RoomAppServiceImpl implements RoomAppService, InitializingBean {
|
||||
// 2.修改群信息
|
||||
roomGroup.setAvatar(request.getAvatar());
|
||||
roomGroup.setName(request.getName());
|
||||
roomGroup.setAllowScanEnter(request.getAllowScanEnter());
|
||||
Boolean success = roomService.updateRoomInfo(roomGroup);
|
||||
|
||||
// 3.通知群里所有人群信息修改了
|
||||
@@ -767,11 +750,12 @@ public class RoomAppServiceImpl implements RoomAppService, InitializingBean {
|
||||
case SOUND -> message.getExtra().getSoundMsgDTO();
|
||||
case VIDEO -> message.getExtra().getVideoMsgDTO();
|
||||
case EMOJI -> message.getExtra().getEmojisMsgDTO();
|
||||
case BOT, SYSTEM -> null;
|
||||
case AI, REPLY, AIT, MIXED, BOT, SYSTEM -> null;
|
||||
case MERGE -> message.getExtra().getMergeMsgDTO();
|
||||
case NOTICE -> message.getExtra().getNoticeMsgDTO();
|
||||
case VIDEO_CALL -> message.getExtra().getVideoCallMsgDTO();
|
||||
case AUDIO_CALL -> message.getExtra().getAudioCallMsgDTO();
|
||||
case LOCATION -> message.getExtra().getMapMsgDTO();
|
||||
};
|
||||
}
|
||||
|
||||
@@ -800,8 +784,9 @@ public class RoomAppServiceImpl implements RoomAppService, InitializingBean {
|
||||
.onlineNum(onlineNum)
|
||||
.memberNum(memberNum)
|
||||
.account(roomGroup.getAccount())
|
||||
.remark(member.getRemark())
|
||||
.myName(member.getMyName())
|
||||
.remark(member == null? "": member.getRemark())
|
||||
.myName(member == null? "": member.getMyName())
|
||||
.allowScanEnter(roomGroup.getAllowScanEnter())
|
||||
.roleId(getGroupRole(uid, roomGroup.getId()))
|
||||
.build();
|
||||
}
|
||||
@@ -932,6 +917,7 @@ public class RoomAppServiceImpl implements RoomAppService, InitializingBean {
|
||||
removedUid,
|
||||
uuid,
|
||||
removedUid,
|
||||
roomGroup.getName(),
|
||||
roomGroup.getName()
|
||||
);
|
||||
|
||||
@@ -944,6 +930,7 @@ public class RoomAppServiceImpl implements RoomAppService, InitializingBean {
|
||||
managerId,
|
||||
uuid,
|
||||
removedUid,
|
||||
roomGroup.getName(),
|
||||
roomGroup.getName()
|
||||
));
|
||||
}
|
||||
@@ -992,6 +979,7 @@ public class RoomAppServiceImpl implements RoomAppService, InitializingBean {
|
||||
invite.getTargetId(),
|
||||
invite.getId(),
|
||||
invite.getTargetId(),
|
||||
roomGroup.getName(),
|
||||
roomGroup.getName()
|
||||
);
|
||||
|
||||
@@ -1003,6 +991,7 @@ public class RoomAppServiceImpl implements RoomAppService, InitializingBean {
|
||||
managerId,
|
||||
invite.getId(),
|
||||
invite.getTargetId(),
|
||||
roomGroup.getName(),
|
||||
roomGroup.getName()
|
||||
));
|
||||
});
|
||||
|
||||
@@ -8,23 +8,18 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
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.domain.entity.Announcements;
|
||||
import com.luohuo.flex.im.domain.entity.AnnouncementsReadRecord;
|
||||
import com.luohuo.flex.im.core.chat.dao.ContactDao;
|
||||
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;
|
||||
@@ -41,6 +36,7 @@ import java.util.Objects;
|
||||
public class RoomServiceImpl implements RoomService {
|
||||
|
||||
private RoomFriendDao roomFriendDao;
|
||||
private ContactDao contactDao;
|
||||
private RoomDao roomDao;
|
||||
private UidGenerator uidGenerator;
|
||||
private GroupMemberDao groupMemberDao;
|
||||
@@ -75,10 +71,9 @@ public class RoomServiceImpl implements RoomService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableFriendRoom(List<Long> uidList) {
|
||||
AssertUtil.isNotEmpty(uidList, "房间创建失败,好友数量不对");
|
||||
AssertUtil.equal(uidList.size(), 2, "房间创建失败,好友数量不对");
|
||||
String key = ChatAdapter.generateRoomKey(uidList);
|
||||
public void disableFriendRoom(Long roomId, Long uid, Long friendUid) {
|
||||
contactDao.removeByRoomId(roomId, Arrays.asList(uid));
|
||||
String key = ChatAdapter.generateRoomKey(Arrays.asList(uid, friendUid));
|
||||
roomFriendDao.disableRoom(key);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.luohuo.flex.im.core.chat.service.strategy.msg;
|
||||
import com.luohuo.basic.context.ContextUtil;
|
||||
import com.luohuo.flex.im.core.chat.dao.MessageDao;
|
||||
import com.luohuo.flex.im.domain.entity.Message;
|
||||
import com.luohuo.flex.im.domain.entity.msg.AudioCallMsgDTO;
|
||||
import com.luohuo.flex.im.domain.vo.response.msg.AudioCallMsgDTO;
|
||||
import com.luohuo.flex.im.domain.entity.msg.MessageExtra;
|
||||
import com.luohuo.flex.im.domain.enums.MessageTypeEnum;
|
||||
import com.luohuo.flex.model.enums.CallStatusEnum;
|
||||
|
||||
@@ -14,7 +14,7 @@ import com.luohuo.flex.im.domain.entity.msg.MessageExtra;
|
||||
import com.luohuo.flex.im.domain.enums.MessageTypeEnum;
|
||||
import com.luohuo.flex.im.domain.enums.RoleTypeEnum;
|
||||
import com.luohuo.flex.im.domain.entity.msg.TextMsgReq;
|
||||
import com.luohuo.flex.im.domain.vo.response.msg.TextMsgResp;
|
||||
import com.luohuo.flex.im.domain.vo.response.msg.TextMsgDTO;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -91,7 +91,7 @@ public class BotMsgHandler extends AbstractMsgHandler<TextMsgReq> {
|
||||
|
||||
@Override
|
||||
public Object showMsg(Message msg) {
|
||||
TextMsgResp resp = new TextMsgResp();
|
||||
TextMsgDTO resp = new TextMsgDTO();
|
||||
resp.setContent(msg.getContent());
|
||||
resp.setUrlContentMap(Optional.ofNullable(msg.getExtra()).map(MessageExtra::getUrlContentMap).orElse(null));
|
||||
resp.setAtUidList(Optional.ofNullable(msg.getExtra()).map(MessageExtra::getAtUidList).orElse(null));
|
||||
|
||||
@@ -4,7 +4,7 @@ import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Component;
|
||||
import com.luohuo.flex.im.core.chat.dao.MessageDao;
|
||||
import com.luohuo.flex.im.domain.entity.Message;
|
||||
import com.luohuo.flex.im.domain.entity.msg.EmojisMsgDTO;
|
||||
import com.luohuo.flex.im.domain.vo.response.msg.EmojisMsgDTO;
|
||||
import com.luohuo.flex.im.domain.entity.msg.MessageExtra;
|
||||
import com.luohuo.flex.im.domain.enums.MessageTypeEnum;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.luohuo.flex.im.core.chat.service.strategy.msg;
|
||||
|
||||
import com.luohuo.flex.im.core.chat.dao.MessageDao;
|
||||
import com.luohuo.flex.im.domain.entity.Message;
|
||||
import com.luohuo.flex.im.domain.entity.msg.FileMsgDTO;
|
||||
import com.luohuo.flex.im.domain.vo.response.msg.FileMsgDTO;
|
||||
import com.luohuo.flex.im.domain.entity.msg.MessageExtra;
|
||||
import com.luohuo.flex.im.domain.enums.MessageTypeEnum;
|
||||
import jakarta.annotation.Resource;
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.luohuo.flex.im.core.chat.service.strategy.msg;
|
||||
|
||||
import com.luohuo.flex.im.core.chat.dao.MessageDao;
|
||||
import com.luohuo.flex.im.domain.entity.Message;
|
||||
import com.luohuo.flex.im.domain.entity.msg.ImgMsgDTO;
|
||||
import com.luohuo.flex.im.domain.vo.response.msg.ImgMsgDTO;
|
||||
import com.luohuo.flex.im.domain.entity.msg.MessageExtra;
|
||||
import com.luohuo.flex.im.domain.enums.MessageTypeEnum;
|
||||
import jakarta.annotation.Resource;
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.luohuo.flex.im.core.chat.service.strategy.msg;
|
||||
|
||||
import com.luohuo.flex.im.core.chat.dao.MessageDao;
|
||||
import com.luohuo.flex.im.domain.entity.Message;
|
||||
import com.luohuo.flex.im.domain.entity.msg.MessageExtra;
|
||||
import com.luohuo.flex.im.domain.enums.MessageTypeEnum;
|
||||
import com.luohuo.flex.im.domain.vo.response.msg.MapMsgDTO;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* 地图消息
|
||||
* @author 乾乾
|
||||
*/
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class MapMsgHandler extends AbstractMsgHandler<MapMsgDTO> {
|
||||
|
||||
private MessageDao messageDao;
|
||||
|
||||
@Override
|
||||
MessageTypeEnum getMsgTypeEnum() {
|
||||
return MessageTypeEnum.LOCATION;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveMsg(Message msg, MapMsgDTO body) {
|
||||
MessageExtra extra = Optional.ofNullable(msg.getExtra()).orElse(new MessageExtra());
|
||||
Message update = new Message();
|
||||
update.setId(msg.getId());
|
||||
update.setContent(body.getAddress());
|
||||
update.setExtra(extra);
|
||||
|
||||
// 填充地图信息
|
||||
MapMsgDTO mapMsgDTO = new MapMsgDTO();
|
||||
mapMsgDTO.setTimestamp(body.getTimestamp());
|
||||
mapMsgDTO.setAddress(body.getAddress());
|
||||
mapMsgDTO.setLongitude(body.getLongitude());
|
||||
mapMsgDTO.setLatitude(body.getLatitude());
|
||||
mapMsgDTO.setPrecision(body.getPrecision());
|
||||
extra.setMapMsgDTO(mapMsgDTO);
|
||||
messageDao.updateById(update);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object showMsg(Message msg) {
|
||||
return msg.getExtra().getMapMsgDTO();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object showReplyMsg(Message msg) {
|
||||
return "[位置信息]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String showContactMsg(Message msg) {
|
||||
return "[位置信息]";
|
||||
}
|
||||
}
|
||||
@@ -4,13 +4,14 @@ import com.luohuo.flex.im.core.chat.dao.MessageDao;
|
||||
import com.luohuo.flex.im.core.chat.service.cache.MsgCache;
|
||||
import com.luohuo.flex.im.core.user.service.cache.UserCache;
|
||||
import com.luohuo.flex.im.domain.entity.Message;
|
||||
import com.luohuo.flex.im.domain.entity.msg.MergeMsgDTO;
|
||||
import com.luohuo.flex.im.domain.vo.response.msg.MergeMsgDTO;
|
||||
import com.luohuo.flex.im.domain.entity.msg.MessageExtra;
|
||||
import com.luohuo.flex.im.domain.enums.MessageTypeEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -24,34 +25,38 @@ import static com.luohuo.flex.im.domain.enums.MessageTypeEnum.*;
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class MergeMsgHandler extends AbstractMsgHandler<MergeMsgDTO> {
|
||||
private MsgCache msgCache;
|
||||
private MsgCache msgCache;
|
||||
private UserCache userCache;
|
||||
private MessageDao messageDao;
|
||||
|
||||
@Override
|
||||
MessageTypeEnum getMsgTypeEnum() {
|
||||
return MERGE;
|
||||
}
|
||||
MessageTypeEnum getMsgTypeEnum() {
|
||||
return MERGE;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void saveMsg(Message message, MergeMsgDTO body) {
|
||||
List<Message> messages = new ArrayList<>(msgCache.getBatch(body.getBody().stream()
|
||||
.limit(3)
|
||||
.map(item -> Long.parseLong(item.getMessageId()))
|
||||
.collect(Collectors.toList())).values());
|
||||
List<Message> messages = new ArrayList<>(msgCache.getBatch(
|
||||
body.getBody().stream()
|
||||
.limit(3)
|
||||
.map(item -> Long.parseLong(item.getMessageId()))
|
||||
.collect(Collectors.toList())).values().stream()
|
||||
.sorted(Comparator.comparing(Message::getId))
|
||||
.collect(Collectors.toList())
|
||||
);
|
||||
|
||||
List<String> content = messages.stream().map(msg ->
|
||||
userCache.get(msg.getFromUid()).getName() + ": " + switch (MessageTypeEnum.of(msg.getType())) {
|
||||
case MERGE -> "[聊天记录]";
|
||||
case SOUND -> "[语音]";
|
||||
case VIDEO -> "[视频]";
|
||||
case FILE -> "[文件]";
|
||||
case IMG -> "[图片]";
|
||||
case RECALL -> "[消息已撤回]";
|
||||
case EMOJI -> "[表情]";
|
||||
case NOTICE -> "[公告消息]";
|
||||
default -> msg.getContent();
|
||||
}).collect(Collectors.toList());
|
||||
userCache.get(msg.getFromUid()).getName() + ": " + switch (MessageTypeEnum.of(msg.getType())) {
|
||||
case MERGE -> "[聊天记录]";
|
||||
case SOUND -> "[语音]";
|
||||
case VIDEO -> "[视频]";
|
||||
case FILE -> "[文件]";
|
||||
case IMG -> "[图片]";
|
||||
case RECALL -> "[消息已撤回]";
|
||||
case EMOJI -> "[表情]";
|
||||
case NOTICE -> "[公告消息]";
|
||||
default -> msg.getContent();
|
||||
}).collect(Collectors.toList());
|
||||
body.setContent(content);
|
||||
|
||||
MessageExtra extra = Optional.ofNullable(message.getExtra()).orElse(new MessageExtra());
|
||||
@@ -64,19 +69,19 @@ public class MergeMsgHandler extends AbstractMsgHandler<MergeMsgDTO> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object showMsg(Message msg) {
|
||||
public Object showMsg(Message msg) {
|
||||
MergeMsgDTO resp = msg.getExtra().getMergeMsgDTO();
|
||||
resp.setReply(replyMsg(msg));
|
||||
return resp;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object showReplyMsg(Message msg) {
|
||||
@Override
|
||||
public Object showReplyMsg(Message msg) {
|
||||
return "合并消息";
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String showContactMsg(Message msg) {
|
||||
@Override
|
||||
public String showContactMsg(Message msg) {
|
||||
return "[合并消息]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import com.luohuo.flex.im.common.utils.sensitiveword.SensitiveWordBs;
|
||||
import com.luohuo.flex.im.core.chat.dao.MessageDao;
|
||||
import com.luohuo.flex.im.domain.entity.Message;
|
||||
import com.luohuo.flex.im.domain.entity.msg.MessageExtra;
|
||||
import com.luohuo.flex.im.domain.entity.msg.NoticeMsgDTO;
|
||||
import com.luohuo.flex.im.domain.vo.response.msg.NoticeMsgDTO;
|
||||
import com.luohuo.flex.im.domain.enums.MessageTypeEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -12,7 +12,7 @@ import com.luohuo.flex.im.core.chat.dao.MessageDao;
|
||||
import com.luohuo.flex.model.entity.dto.ChatMsgRecallDTO;
|
||||
import com.luohuo.flex.im.domain.entity.Message;
|
||||
import com.luohuo.flex.im.domain.entity.msg.MessageExtra;
|
||||
import com.luohuo.flex.im.domain.entity.msg.MsgRecall;
|
||||
import com.luohuo.flex.im.domain.vo.response.msg.MsgRecallDTO;
|
||||
import com.luohuo.flex.im.domain.enums.MessageTypeEnum;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
@@ -43,7 +43,7 @@ public class RecallMsgHandler extends AbstractMsgHandler<Object> {
|
||||
|
||||
@Override
|
||||
public Object showMsg(Message msg) {
|
||||
MsgRecall recall = msg.getExtra().getRecall();
|
||||
MsgRecallDTO recall = msg.getExtra().getRecall();
|
||||
SummeryInfoDTO userInfo = userSummaryCache.get(recall.getRecallUid());
|
||||
if (!Objects.equals(recall.getRecallUid(), msg.getFromUid())) {
|
||||
return "管理员\"" + userInfo.getName() + "\"撤回了一条成员消息";
|
||||
@@ -58,7 +58,7 @@ public class RecallMsgHandler extends AbstractMsgHandler<Object> {
|
||||
|
||||
public void recall(Long recallUid, List<Long> uidList, Message message) {//todo 消息覆盖问题用版本号解决
|
||||
MessageExtra extra = message.getExtra();
|
||||
extra.setRecall(new MsgRecall(recallUid, TimeUtils.getTime(LocalDateTime.now())));
|
||||
extra.setRecall(new MsgRecallDTO(recallUid, TimeUtils.getTime(LocalDateTime.now())));
|
||||
Message update = new Message();
|
||||
update.setId(message.getId());
|
||||
update.setType(MessageTypeEnum.RECALL.getType());
|
||||
|
||||
@@ -5,7 +5,7 @@ import org.springframework.stereotype.Component;
|
||||
import com.luohuo.flex.im.core.chat.dao.MessageDao;
|
||||
import com.luohuo.flex.im.domain.entity.Message;
|
||||
import com.luohuo.flex.im.domain.entity.msg.MessageExtra;
|
||||
import com.luohuo.flex.im.domain.entity.msg.SoundMsgDTO;
|
||||
import com.luohuo.flex.im.domain.vo.response.msg.SoundMsgDTO;
|
||||
import com.luohuo.flex.im.domain.enums.MessageTypeEnum;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
@@ -12,7 +12,7 @@ import com.luohuo.flex.im.domain.entity.Message;
|
||||
import com.luohuo.flex.im.domain.entity.msg.MessageExtra;
|
||||
import com.luohuo.flex.im.domain.enums.MessageTypeEnum;
|
||||
import com.luohuo.flex.im.domain.entity.msg.TextMsgReq;
|
||||
import com.luohuo.flex.im.domain.vo.response.msg.TextMsgResp;
|
||||
import com.luohuo.flex.im.domain.vo.response.msg.TextMsgDTO;
|
||||
import com.luohuo.flex.im.domain.entity.User;
|
||||
import com.luohuo.flex.im.domain.enums.RoleTypeEnum;
|
||||
import com.luohuo.flex.im.core.user.service.RoleService;
|
||||
@@ -95,7 +95,7 @@ public class TextMsgHandler extends AbstractMsgHandler<TextMsgReq> {
|
||||
|
||||
@Override
|
||||
public Object showMsg(Message msg) {
|
||||
TextMsgResp resp = new TextMsgResp();
|
||||
TextMsgDTO resp = new TextMsgDTO();
|
||||
resp.setContent(msg.getContent());
|
||||
resp.setUrlContentMap(Optional.ofNullable(msg.getExtra()).map(MessageExtra::getUrlContentMap).orElse(null));
|
||||
resp.setAtUidList(Optional.ofNullable(msg.getExtra()).map(MessageExtra::getAtUidList).orElse(null));
|
||||
|
||||
@@ -4,7 +4,7 @@ import com.luohuo.basic.context.ContextUtil;
|
||||
import com.luohuo.flex.im.core.chat.dao.MessageDao;
|
||||
import com.luohuo.flex.im.core.user.service.cache.UserSummaryCache;
|
||||
import com.luohuo.flex.im.domain.entity.Message;
|
||||
import com.luohuo.flex.im.domain.entity.msg.VideoCallMsgDTO;
|
||||
import com.luohuo.flex.im.domain.vo.response.msg.VideoCallMsgDTO;
|
||||
import com.luohuo.flex.im.domain.entity.msg.MessageExtra;
|
||||
import com.luohuo.flex.im.domain.enums.MessageTypeEnum;
|
||||
import com.luohuo.flex.model.enums.CallStatusEnum;
|
||||
@@ -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 ->
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.luohuo.flex.im.core.chat.service.strategy.msg;
|
||||
import com.luohuo.flex.im.core.chat.dao.MessageDao;
|
||||
import com.luohuo.flex.im.domain.entity.Message;
|
||||
import com.luohuo.flex.im.domain.entity.msg.MessageExtra;
|
||||
import com.luohuo.flex.im.domain.entity.msg.VideoMsgDTO;
|
||||
import com.luohuo.flex.im.domain.vo.response.msg.VideoMsgDTO;
|
||||
import com.luohuo.flex.im.domain.enums.MessageTypeEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -1,16 +1,11 @@
|
||||
package com.luohuo.flex.im.core.user.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.luohuo.flex.im.common.utils.CursorUtils;
|
||||
import com.luohuo.flex.im.domain.entity.UserApply;
|
||||
import com.luohuo.flex.im.domain.enums.ApplyDeletedEnum;
|
||||
import com.luohuo.flex.im.domain.enums.ApplyStatusEnum;
|
||||
import com.luohuo.flex.im.core.user.mapper.UserApplyMapper;
|
||||
import com.luohuo.flex.im.domain.enums.RoomTypeEnum;
|
||||
import com.luohuo.flex.im.domain.vo.req.CursorPageBaseReq;
|
||||
import com.luohuo.flex.im.domain.vo.res.CursorPageBaseResp;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
@@ -18,8 +13,6 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.luohuo.flex.im.domain.enums.ApplyReadStatusEnum.READ;
|
||||
import static com.luohuo.flex.im.domain.enums.ApplyReadStatusEnum.UNREAD;
|
||||
import static com.luohuo.flex.im.domain.enums.ApplyStatusEnum.AGREE;
|
||||
|
||||
/**
|
||||
@@ -32,13 +25,6 @@ import static com.luohuo.flex.im.domain.enums.ApplyStatusEnum.AGREE;
|
||||
@Service
|
||||
public class UserApplyDao extends ServiceImpl<UserApplyMapper, UserApply> {
|
||||
|
||||
/**
|
||||
* 获取用户进群审批列表
|
||||
*/
|
||||
public CursorPageBaseResp<UserApply> getApplyPage(Long uid, Integer type, CursorPageBaseReq request) {
|
||||
return CursorUtils.getCursorPageByMysql(this, request, wrapper -> wrapper.eq(UserApply::getTargetId, uid).eq(UserApply::getType, type).eq(UserApply::getApplyFor, true), UserApply::getCreateTime);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param uid uid
|
||||
|
||||
@@ -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::getId, UserFriend::getRoomId)
|
||||
.list();
|
||||
}
|
||||
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,13 +31,6 @@ public interface ApplyService {
|
||||
*/
|
||||
Boolean applyGroup(Long uid, RoomApplyReq request);
|
||||
|
||||
/**
|
||||
* 处理加群申请
|
||||
* @param uid 当前登录人id
|
||||
* @param req 审批请求
|
||||
*/
|
||||
void handleApply(Long uid, GroupApplyHandleReq req);
|
||||
|
||||
/**
|
||||
* 审批申请
|
||||
*
|
||||
|
||||
@@ -44,7 +44,7 @@ public interface FriendService {
|
||||
* @param type 申请类型
|
||||
* @return
|
||||
*/
|
||||
void createUserApply(Long uid, Long roomId, Long targetId, String msg, Integer type);
|
||||
Long createUserApply(Long uid, Long roomId, Long targetId, String msg, Integer type);
|
||||
|
||||
/**
|
||||
* 与系统用户创建好友关系
|
||||
@@ -63,6 +63,10 @@ public interface FriendService {
|
||||
*/
|
||||
void deleteFriend(Long uid, Long friendUid);
|
||||
|
||||
/**
|
||||
* 联系人列表
|
||||
* @param uid 当前登录人
|
||||
*/
|
||||
CursorPageBaseResp<FriendResp> friendList(Long uid, CursorPageBaseReq request);
|
||||
|
||||
/**
|
||||
|
||||
@@ -24,6 +24,8 @@ public interface NoticeService {
|
||||
*/
|
||||
void createNotice(RoomTypeEnum applyType, NoticeTypeEnum type, Long senderId, Long receiverId, Long applyId, Long operate, String content);
|
||||
|
||||
void createNotice(RoomTypeEnum applyType, NoticeTypeEnum type, Long senderId, Long receiverId, Long applyId, Long operate, String name, String content);
|
||||
|
||||
/**
|
||||
* 更新通知状态
|
||||
* @param notice
|
||||
|
||||
@@ -5,7 +5,6 @@ import com.luohuo.flex.im.domain.entity.UserFriend;
|
||||
import com.luohuo.flex.im.domain.enums.RoomTypeEnum;
|
||||
import com.luohuo.flex.model.enums.ChatActiveStatusEnum;
|
||||
import com.luohuo.flex.im.domain.vo.req.friend.FriendApplyReq;
|
||||
import com.luohuo.flex.im.domain.vo.resp.friend.FriendApplyResp;
|
||||
import com.luohuo.flex.im.domain.vo.resp.friend.FriendResp;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -44,6 +43,7 @@ public class FriendAdapter {
|
||||
return friendPage.stream().map(userFriend -> {
|
||||
FriendResp resp = new FriendResp();
|
||||
resp.setUid(userFriend.getFriendUid());
|
||||
resp.setRemark(userFriend.getRemark());
|
||||
UserFriend friend = friendHashMap.get(userFriend.getFriendUid());
|
||||
resp.setHideMyPosts(friend.getHideMyPosts());
|
||||
resp.setHideTheirPosts(friend.getHideTheirPosts());
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package com.luohuo.flex.im.core.user.service.adapter;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.luohuo.flex.im.domain.enums.RoomTypeEnum;
|
||||
import com.luohuo.flex.im.domain.vo.req.room.UserApplyResp;
|
||||
import com.luohuo.flex.model.entity.ws.*;
|
||||
import me.chanjar.weixin.mp.bean.result.WxMpQrCodeTicket;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -14,7 +12,6 @@ import com.luohuo.flex.im.domain.entity.User;
|
||||
import com.luohuo.flex.model.entity.WSRespTypeEnum;
|
||||
import com.luohuo.flex.model.entity.WsBaseResp;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Collections;
|
||||
|
||||
/**
|
||||
@@ -114,11 +111,4 @@ public class WsAdapter {
|
||||
wsBaseResp.setData(StrUtil.format("你已{}屏蔽来自{}的消息", state? "":"解除",name));
|
||||
return wsBaseResp;
|
||||
}
|
||||
|
||||
public static WsBaseResp<UserApplyResp> buildApplyResultWS(Long uid, Long roomId, Long targetId, String msg, Integer status, Integer readStatus) {
|
||||
WsBaseResp<UserApplyResp> wsBaseResp = new WsBaseResp<>();
|
||||
wsBaseResp.setType(WSRespTypeEnum.GROUP_APPLY_NOTICE.getType());
|
||||
wsBaseResp.setData(new UserApplyResp(uid, RoomTypeEnum.GROUP.getType(), roomId, targetId, msg, status, readStatus, true, LocalDateTime.now()));
|
||||
return wsBaseResp;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
package com.luohuo.flex.im.core.user.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.luohuo.basic.cache.repository.CachePlusOps;
|
||||
import com.luohuo.basic.exception.BizException;
|
||||
import com.luohuo.basic.model.cache.CacheKey;
|
||||
@@ -31,7 +29,6 @@ import com.luohuo.flex.im.core.user.service.ApplyService;
|
||||
import com.luohuo.flex.im.core.user.service.FriendService;
|
||||
import com.luohuo.flex.im.core.user.service.NoticeService;
|
||||
import com.luohuo.flex.im.core.user.service.adapter.FriendAdapter;
|
||||
import com.luohuo.flex.im.core.user.service.adapter.WsAdapter;
|
||||
import com.luohuo.flex.im.core.user.service.cache.UserSummaryCache;
|
||||
import com.luohuo.flex.im.domain.dto.RequestApprovalDto;
|
||||
import com.luohuo.flex.im.domain.dto.SummeryInfoDTO;
|
||||
@@ -43,19 +40,14 @@ import com.luohuo.flex.im.domain.entity.RoomGroup;
|
||||
import com.luohuo.flex.im.domain.entity.UserApply;
|
||||
import com.luohuo.flex.im.domain.entity.UserFriend;
|
||||
import com.luohuo.flex.im.domain.enums.ApplyDeletedEnum;
|
||||
import com.luohuo.flex.im.domain.enums.ApplyReadStatusEnum;
|
||||
import com.luohuo.flex.im.domain.enums.ApplyStatusEnum;
|
||||
import com.luohuo.flex.im.domain.enums.GroupRoleEnum;
|
||||
import com.luohuo.flex.im.domain.enums.NoticeStatusEnum;
|
||||
import com.luohuo.flex.im.domain.enums.NoticeTypeEnum;
|
||||
import com.luohuo.flex.im.domain.enums.RoomTypeEnum;
|
||||
import com.luohuo.flex.im.domain.vo.req.PageBaseReq;
|
||||
import com.luohuo.flex.im.domain.vo.req.friend.FriendApplyReq;
|
||||
import com.luohuo.flex.im.domain.vo.request.RoomApplyReq;
|
||||
import com.luohuo.flex.im.domain.vo.request.member.ApplyReq;
|
||||
import com.luohuo.flex.im.domain.vo.request.member.GroupApplyHandleReq;
|
||||
import com.luohuo.flex.im.domain.vo.res.PageBaseResp;
|
||||
import com.luohuo.flex.im.domain.vo.resp.friend.FriendApplyResp;
|
||||
import com.luohuo.flex.model.redis.annotation.RedissonLock;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -63,11 +55,9 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.support.TransactionTemplate;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.luohuo.flex.im.domain.enums.ApplyStatusEnum.AGREE;
|
||||
import static com.luohuo.flex.im.domain.enums.ApplyStatusEnum.WAIT_APPROVAL;
|
||||
@@ -87,7 +77,6 @@ public class ApplyServiceImpl implements ApplyService {
|
||||
private RoomService roomService;
|
||||
private ChatService chatService;
|
||||
private RoomCache roomCache;
|
||||
private PushService pushService;
|
||||
private UserSummaryCache userSummaryCache;
|
||||
private GroupMemberCache groupMemberCache;
|
||||
private RoomGroupCache roomGroupCache;
|
||||
@@ -126,23 +115,23 @@ public class ApplyServiceImpl implements ApplyService {
|
||||
userApplyDao.save(newApply);
|
||||
|
||||
noticeService.createNotice(
|
||||
RoomTypeEnum.FRIEND,
|
||||
NoticeTypeEnum.ADD_ME,
|
||||
uid,
|
||||
request.getTargetUid(),
|
||||
newApply.getId(),
|
||||
request.getTargetUid(),
|
||||
request.getMsg()
|
||||
RoomTypeEnum.FRIEND,
|
||||
NoticeTypeEnum.ADD_ME,
|
||||
uid,
|
||||
request.getTargetUid(),
|
||||
newApply.getId(),
|
||||
request.getTargetUid(),
|
||||
request.getMsg()
|
||||
);
|
||||
|
||||
noticeService.createNotice(
|
||||
RoomTypeEnum.FRIEND,
|
||||
NoticeTypeEnum.FRIEND_APPLY,
|
||||
uid,
|
||||
uid,
|
||||
newApply.getId(),
|
||||
request.getTargetUid(),
|
||||
request.getMsg()
|
||||
RoomTypeEnum.FRIEND,
|
||||
NoticeTypeEnum.FRIEND_APPLY,
|
||||
uid,
|
||||
uid,
|
||||
newApply.getId(),
|
||||
request.getTargetUid(),
|
||||
request.getMsg()
|
||||
);
|
||||
|
||||
// 申请事件
|
||||
@@ -164,6 +153,10 @@ public class ApplyServiceImpl implements ApplyService {
|
||||
return false;
|
||||
}
|
||||
|
||||
if(req.getType().equals(2) && !roomGroup.getAllowScanEnter()){
|
||||
return false;
|
||||
}
|
||||
|
||||
List<Long> memberUidList = groupMemberCache.getMemberUidList(roomGroup.getRoomId());
|
||||
if(memberUidList.contains(uid)){
|
||||
throw new BizException("你已经加入群聊");
|
||||
@@ -174,11 +167,30 @@ public class ApplyServiceImpl implements ApplyService {
|
||||
SummeryInfoDTO userInfo = userSummaryCache.get(uid);
|
||||
String msg = StrUtil.format("用户{}申请加入群聊{}", userInfo.getName(), roomGroup.getName());
|
||||
|
||||
for (Long groupAdminId : groupAdminIds) {
|
||||
friendService.createUserApply(uid, roomGroup.getRoomId(), groupAdminId, msg, RoomTypeEnum.GROUP.getType());
|
||||
// 申请进入群聊
|
||||
Long applyId = friendService.createUserApply(uid, roomGroup.getRoomId(), uid, msg, RoomTypeEnum.GROUP.getType());
|
||||
noticeService.createNotice(
|
||||
RoomTypeEnum.GROUP,
|
||||
NoticeTypeEnum.GROUP_APPLY,
|
||||
uid,
|
||||
uid,
|
||||
applyId,
|
||||
uid,
|
||||
roomGroup.getName(),
|
||||
req.getMsg()
|
||||
);
|
||||
|
||||
// 给群里的管理员发送申请
|
||||
pushService.sendPushMsg(MessageAdapter.buildRoomGroupMessage(uid, roomGroup.getRoomId(), groupAdminId, msg), groupAdminId, uid);
|
||||
for (Long groupAdminId : groupAdminIds) {
|
||||
noticeService.createNotice(
|
||||
RoomTypeEnum.GROUP,
|
||||
NoticeTypeEnum.GROUP_APPLY,
|
||||
uid,
|
||||
groupAdminId,
|
||||
applyId,
|
||||
uid,
|
||||
roomGroup.getName(),
|
||||
req.getMsg()
|
||||
);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -188,7 +200,7 @@ public class ApplyServiceImpl implements ApplyService {
|
||||
public void handlerApply(Long uid, ApplyReq request) {
|
||||
// 1. 校验邀请记录
|
||||
UserApply invite = userApplyDao.getById(request.getApplyId());
|
||||
if (invite == null || !invite.getTargetId().equals(uid)) {
|
||||
if (invite == null) {
|
||||
throw new BizException("无效的邀请");
|
||||
}
|
||||
|
||||
@@ -264,6 +276,15 @@ public class ApplyServiceImpl implements ApplyService {
|
||||
// 处理加群, 如果是申请进群,那么用uid、否则是拉进群
|
||||
Long infoUid = invite.getApplyFor() ? invite.getUid() : invite.getTargetId();
|
||||
RoomGroup roomGroup = roomGroupCache.getByRoomId(invite.getRoomId());
|
||||
|
||||
// 如果是申请进群,那么判断当前人员是否具备权限
|
||||
if(invite.getApplyFor()){
|
||||
GroupMember thisMember = groupMemberDao.getMemberByGroupId(roomGroup.getId(), uid);
|
||||
if (thisMember == null || !(thisMember.getRoleId().equals(GroupRoleEnum.LEADER.getType()) && !thisMember.getRoleId().equals(GroupRoleEnum.MANAGER.getType()))) {
|
||||
throw new BizException("无审批权限");
|
||||
}
|
||||
}
|
||||
|
||||
Room room = roomCache.get(invite.getRoomId());
|
||||
GroupMember member = groupMemberDao.getMemberByGroupId(roomGroup.getId(), infoUid);
|
||||
if(ObjectUtil.isNotNull(member)){
|
||||
@@ -308,67 +329,6 @@ public class ApplyServiceImpl implements ApplyService {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理加群申请
|
||||
* @param uid 当前登录人id
|
||||
* @param req 审批请求
|
||||
*/
|
||||
@Override
|
||||
@RedissonLock(key = "#request.applyId")
|
||||
public void handleApply(Long uid, GroupApplyHandleReq req) {
|
||||
// 1. 校验申请记录
|
||||
UserApply apply = userApplyDao.getById(req.getApplyId());
|
||||
if (apply == null || !apply.getType().equals(RoomTypeEnum.GROUP.getType())) {
|
||||
throw new BizException("无效的申请记录");
|
||||
}
|
||||
|
||||
// 2. 校验管理员权限
|
||||
RoomGroup group = roomGroupCache.get(apply.getRoomId());
|
||||
GroupMember member = groupMemberDao.getMemberByGroupId(group.getId(), uid);
|
||||
if (member == null || (member.getRoleId().equals(GroupRoleEnum.LEADER.getType()) && !member.getRoleId().equals(GroupRoleEnum.MANAGER.getType()))) {
|
||||
throw new BizException("无审批权限");
|
||||
}
|
||||
|
||||
Room room = roomCache.get(group.getRoomId());
|
||||
apply.setStatus(req.getStatus());
|
||||
apply.setReadStatus(ApplyReadStatusEnum.READ.getCode());
|
||||
|
||||
// 3. 更新申请状态
|
||||
transactionTemplate.execute(e -> {
|
||||
userApplyDao.updateById(apply);
|
||||
|
||||
// 5.0 创建申请人与房间的会话
|
||||
chatService.createContact(uid, apply.getRoomId());
|
||||
|
||||
// 5.1 同意则加群
|
||||
if (req.getStatus().equals(2)) {
|
||||
// 5.2 加入群聊
|
||||
groupMemberDao.save(MemberAdapter.buildMemberAdd(group.getId(), apply.getTargetId()));
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
// 5.3 写入缓存
|
||||
if (req.getStatus().equals(2)) {
|
||||
groupMemberCache.evictMemberList(group.getRoomId());
|
||||
groupMemberCache.evictExceptMemberList(group.getRoomId());
|
||||
|
||||
CacheKey uKey = PresenceCacheKeyBuilder.userGroupsKey(apply.getUid());
|
||||
CacheKey gKey = PresenceCacheKeyBuilder.groupMembersKey(room.getId());
|
||||
CacheKey onlineGroupMembersKey = PresenceCacheKeyBuilder.onlineGroupMembersKey(room.getId());
|
||||
cachePlusOps.sAdd(uKey, room.getId());
|
||||
cachePlusOps.sAdd(gKey, apply.getUid());
|
||||
roomAppService.asyncOnline(Arrays.asList(apply.getUid()), room.getId(), true);
|
||||
|
||||
// 5.5 发布成员增加事件
|
||||
SpringUtils.publishEvent(new GroupInviteMemberEvent(this, room.getId(), Arrays.asList(apply.getUid()), apply.getUid(), false));
|
||||
SpringUtils.publishEvent(new GroupMemberAddEvent(this, room.getId(), Math.toIntExact(cachePlusOps.sCard(gKey)), Math.toIntExact(cachePlusOps.sCard(onlineGroupMembersKey)), Collections.singletonList(apply.getUid()), apply.getUid()));
|
||||
}
|
||||
|
||||
// 6. 通知申请人 [这条消息需要覆盖前端]
|
||||
pushService.sendPushMsg(WsAdapter.buildApplyResultWS(apply.getUid(), group.getRoomId(), uid, apply.getMsg(), apply.getStatus(), apply.getReadStatus()), apply.getUid(), uid);
|
||||
}
|
||||
|
||||
@Override
|
||||
@RedissonLock(prefixKey = "friend:deleteApprove", key = "#uid")
|
||||
public void deleteApprove(Long uid, ApplyReq request) {
|
||||
|
||||
@@ -14,6 +14,8 @@ import com.luohuo.flex.im.core.user.service.cache.UserSummaryCache;
|
||||
import com.luohuo.flex.im.domain.dto.SummeryInfoDTO;
|
||||
import com.luohuo.flex.im.domain.enums.ApplyReadStatusEnum;
|
||||
import com.luohuo.flex.im.domain.enums.ApplyStatusEnum;
|
||||
import com.luohuo.flex.model.entity.WSRespTypeEnum;
|
||||
import com.luohuo.flex.model.entity.WsBaseResp;
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -46,6 +48,7 @@ import com.luohuo.flex.im.core.user.service.FriendService;
|
||||
import com.luohuo.flex.im.core.user.service.adapter.FriendAdapter;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
@@ -66,6 +69,7 @@ public class FriendServiceImpl implements FriendService, InitializingBean {
|
||||
private UserDao userDao;
|
||||
private UserSummaryCache userSummaryCache;
|
||||
private BaseRedis baseRedis;
|
||||
private final PushService pushService;
|
||||
private CachePlusOps cachePlusOps;
|
||||
private PresenceApi presenceApi;
|
||||
|
||||
@@ -126,7 +130,7 @@ public class FriendServiceImpl implements FriendService, InitializingBean {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createUserApply(Long uid, Long roomId, Long targetId, String msg, Integer type) {
|
||||
public Long createUserApply(Long uid, Long roomId, Long targetId, String msg, Integer type) {
|
||||
UserApply userApply = new UserApply();
|
||||
userApply.setMsg(msg);
|
||||
userApply.setUid(uid);
|
||||
@@ -137,6 +141,7 @@ public class FriendServiceImpl implements FriendService, InitializingBean {
|
||||
userApply.setReadStatus(ApplyReadStatusEnum.UNREAD.getCode());
|
||||
userApply.setApplyFor(true);
|
||||
userApplyDao.save(userApply);
|
||||
return userApply.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -203,8 +208,14 @@ public class FriendServiceImpl implements FriendService, InitializingBean {
|
||||
List<Long> friendRecordIds = userFriends.stream().map(UserFriend::getId).collect(Collectors.toList());
|
||||
userFriendDao.removeByIds(friendRecordIds);
|
||||
// 禁用房间
|
||||
roomService.disableFriendRoom(Arrays.asList(uid, friendUid));
|
||||
roomService.disableFriendRoom(userFriends.get(0).getRoomId(), uid, friendUid);
|
||||
removeFriendCache(uid, friendUid);
|
||||
|
||||
// 删除好友的事件
|
||||
WsBaseResp<String> wsMsg = new WsBaseResp<>();
|
||||
wsMsg.setData(uid.toString());
|
||||
wsMsg.setType(WSRespTypeEnum.DELETE_FRIEND.getType());
|
||||
pushService.sendPushMsg(wsMsg, Collections.singletonList(friendUid), uid);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.luohuo.flex.im.core.user.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
@@ -24,6 +25,8 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.luohuo.flex.im.domain.enums.ApplyReadStatusEnum.UNREAD;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class NoticeServiceImpl implements NoticeService {
|
||||
@@ -46,6 +49,11 @@ public class NoticeServiceImpl implements NoticeService {
|
||||
|
||||
@Override
|
||||
public void createNotice(RoomTypeEnum applyType, NoticeTypeEnum type, Long senderId, Long receiverId, Long applyId, Long operate, String content) {
|
||||
createNotice(applyType, type, senderId, receiverId, applyId, operate, "", content);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createNotice(RoomTypeEnum applyType, NoticeTypeEnum type, Long senderId, Long receiverId, Long applyId, Long operate, String name, String content) {
|
||||
Notice notice = new Notice();
|
||||
notice.setType(applyType.getType());
|
||||
notice.setEventType(type.getType());
|
||||
@@ -53,7 +61,9 @@ public class NoticeServiceImpl implements NoticeService {
|
||||
notice.setReceiverId(receiverId);
|
||||
notice.setApplyId(applyId);
|
||||
notice.setOperateId(operate);
|
||||
notice.setName(name);
|
||||
notice.setContent(content);
|
||||
notice.setIsRead(UNREAD.getCode());
|
||||
notice.setStatus(NoticeStatusEnum.UNTREATED.getStatus());
|
||||
noticeDao.save(notice);
|
||||
|
||||
@@ -83,7 +93,9 @@ public class NoticeServiceImpl implements NoticeService {
|
||||
List<Long> notices = noticeIPage.getRecords()
|
||||
.stream().map(Notice::getId)
|
||||
.collect(Collectors.toList());
|
||||
noticeDao.readNotices(uid, notices);
|
||||
if(CollUtil.isNotEmpty(notices)){
|
||||
noticeDao.readNotices(uid, notices);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -101,6 +113,7 @@ public class NoticeServiceImpl implements NoticeService {
|
||||
vo.setSenderId(notice.getSenderId());
|
||||
vo.setReceiverId(notice.getReceiverId());
|
||||
vo.setOperateId(notice.getOperateId());
|
||||
vo.setName(notice.getName());
|
||||
vo.setContent(notice.getContent());
|
||||
vo.setEventType(notice.getEventType());
|
||||
vo.setType(notice.getType());
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,6 @@ import com.luohuo.flex.im.core.user.service.adapter.UserAdapter;
|
||||
import com.luohuo.flex.im.core.user.service.cache.UserSummaryCache;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
@@ -135,9 +134,9 @@ public class UserServiceImpl implements UserService {
|
||||
AssertUtil.isFalse(sensitiveWordBs.hasSensitiveWord(newName), "名字中包含敏感词,请重新输入"); // 判断名字中有没有敏感词
|
||||
|
||||
User user = userDao.getById(uid);
|
||||
AssertUtil.isTrue(req.getAvatar().equals(user.getAvatar()) ||
|
||||
(user.getAvatarUpdateTime() != null && user.getAvatarUpdateTime().plusDays(30).isBefore(LocalDateTime.now())),
|
||||
"30天内只能修改一次头像");
|
||||
// AssertUtil.isTrue(req.getAvatar().equals(user.getAvatar()) ||
|
||||
// (user.getAvatarUpdateTime() != null && user.getAvatarUpdateTime().plusDays(30).isBefore(LocalDateTime.now())),
|
||||
// "30天内只能修改一次头像");
|
||||
// 更新
|
||||
User update = new User();
|
||||
update.setId(uid);
|
||||
@@ -152,6 +151,7 @@ public class UserServiceImpl implements UserService {
|
||||
|
||||
userDao.updateById(update);
|
||||
// 删除缓存
|
||||
userCache.delete(uid);
|
||||
userSummaryCache.delete(uid);
|
||||
userSummaryCache.evictFriend(userSummaryCache.get(uid).getAccount());
|
||||
}
|
||||
@@ -161,10 +161,10 @@ public class UserServiceImpl implements UserService {
|
||||
public void modifyAvatar(Long uid, ModifyAvatarReq req) {
|
||||
// 判断30天内是否改过头像
|
||||
User user = userDao.getById(uid);
|
||||
AssertUtil.isTrue(Objects.isNull(user.getAvatarUpdateTime()) ||
|
||||
user.getAvatarUpdateTime().plusDays(30).atZone(ZoneId.systemDefault()).toInstant().toEpochMilli() <=
|
||||
LocalDateTime.now().atZone(ZoneId.systemDefault()).toInstant().toEpochMilli(),
|
||||
"30天内只能修改一次头像");
|
||||
// AssertUtil.isTrue(Objects.isNull(user.getAvatarUpdateTime()) ||
|
||||
// user.getAvatarUpdateTime().plusDays(30).atZone(ZoneId.systemDefault()).toInstant().toEpochMilli() <=
|
||||
// LocalDateTime.now().atZone(ZoneId.systemDefault()).toInstant().toEpochMilli(),
|
||||
// "30天内只能修改一次头像");
|
||||
|
||||
|
||||
// 更新
|
||||
@@ -172,6 +172,7 @@ public class UserServiceImpl implements UserService {
|
||||
updateUser.setId(user.getId());
|
||||
userDao.updateById(updateUser);
|
||||
// 删除缓存
|
||||
userCache.delete(uid);
|
||||
userSummaryCache.delete(uid);
|
||||
userSummaryCache.evictFriend(user.getAccount());
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
g.avatar as avatar,
|
||||
g.id as groupId,
|
||||
g.account,
|
||||
g.allow_scan_enter,
|
||||
r.update_time
|
||||
from im_room_group g
|
||||
inner join im_room r on g.room_id = r.id
|
||||
|
||||
@@ -7,7 +7,6 @@ import com.luohuo.flex.im.domain.entity.UserApply;
|
||||
import com.luohuo.flex.im.domain.vo.req.friend.FriendApplyReq;
|
||||
import com.luohuo.flex.im.domain.vo.request.RoomApplyReq;
|
||||
import com.luohuo.flex.im.domain.vo.request.member.ApplyReq;
|
||||
import com.luohuo.flex.im.domain.vo.request.member.GroupApplyHandleReq;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
@@ -50,13 +49,6 @@ public class ApplyController {
|
||||
return R.success(applyService.applyGroup(ContextUtil.getUid(), request));
|
||||
}
|
||||
|
||||
@PostMapping("/adminHandleApply")
|
||||
@Operation(summary = "处理加群申请 [仅仅管理员、群主可调用]")
|
||||
public R<Void> handleApply(@Valid @RequestBody GroupApplyHandleReq request) {
|
||||
applyService.handleApply(ContextUtil.getUid(), request);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除好友申请")
|
||||
public R<Boolean> deleteApprove(@Valid @RequestBody ApplyReq request) {
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.luohuo.flex.im.controller.chat;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.luohuo.flex.im.domain.vo.req.IdReqVO;
|
||||
import com.luohuo.flex.im.domain.vo.req.room.UserApplyResp;
|
||||
import com.luohuo.flex.im.domain.vo.res.IdRespVO;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@@ -14,7 +13,6 @@ import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.luohuo.basic.base.R;
|
||||
import com.luohuo.basic.context.ContextUtil;
|
||||
import com.luohuo.flex.im.domain.vo.res.CursorPageBaseResp;
|
||||
import com.luohuo.flex.im.domain.entity.Announcements;
|
||||
import com.luohuo.flex.im.domain.entity.RoomGroup;
|
||||
import com.luohuo.flex.im.domain.vo.request.ChatMessageMemberReq;
|
||||
@@ -120,12 +118,6 @@ public class RoomController {
|
||||
return R.success(roomService.updateMyRoomInfo(uid, request));
|
||||
}
|
||||
|
||||
@GetMapping("/apply/group/list")
|
||||
@Operation(summary = "申请加群列表 [仅仅管理员、群主可见]")
|
||||
public R<CursorPageBaseResp<UserApplyResp>> applyGroup(@Valid MemberReq request){
|
||||
return R.success(roomService.queryApplyPage(ContextUtil.getUid(), request));
|
||||
}
|
||||
|
||||
@PostMapping("/group/member")
|
||||
@Operation(summary ="邀请好友进群")
|
||||
public R<Void> addMember(@Valid @RequestBody MemberAddReq request) {
|
||||
|
||||
@@ -48,7 +48,7 @@ public class FriendController {
|
||||
return R.success(friendService.searchFriend(friendReq));
|
||||
}
|
||||
|
||||
@DeleteMapping()
|
||||
@DeleteMapping
|
||||
@Operation(summary = "删除好友")
|
||||
public R<Boolean> delete(@Valid @RequestBody FriendDeleteReq request) {
|
||||
Long uid = ContextUtil.getUid();
|
||||
|
||||
@@ -48,6 +48,9 @@ public class Notice extends Entity<Long> {
|
||||
@TableField("operate_id")
|
||||
private Long operateId;
|
||||
|
||||
@Schema(description = "群聊的名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "通知内容 申请时填写的, 进群、移除时是群聊的名称")
|
||||
private String content;
|
||||
|
||||
|
||||
@@ -48,4 +48,11 @@ public class RoomGroup extends Entity<Long> {
|
||||
*/
|
||||
@TableField("ext_json")
|
||||
private String extJson;
|
||||
|
||||
/**
|
||||
* 允许扫码直接进群
|
||||
*/
|
||||
@TableField("allow_scan_enter")
|
||||
private Boolean allowScanEnter;
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.luohuo.flex.im.domain.entity.msg;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.luohuo.flex.im.domain.UrlInfo;
|
||||
import com.luohuo.flex.im.domain.vo.response.msg.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
@@ -28,7 +29,7 @@ public class MessageExtra implements Serializable {
|
||||
//url跳转链接
|
||||
private Map<String, UrlInfo> urlContentMap;
|
||||
//消息撤回详情
|
||||
private MsgRecall recall;
|
||||
private MsgRecallDTO recall;
|
||||
//艾特的uid
|
||||
private List<Long> atUidList;
|
||||
//文件消息
|
||||
@@ -47,6 +48,8 @@ public class MessageExtra implements Serializable {
|
||||
private VideoCallMsgDTO videoCallMsgDTO;
|
||||
//音频扩展消息
|
||||
private AudioCallMsgDTO audioCallMsgDTO;
|
||||
//地图扩展消息
|
||||
private MapMsgDTO mapMsgDTO;
|
||||
|
||||
/**
|
||||
* 表情图片信息
|
||||
|
||||
@@ -28,6 +28,11 @@ public enum MessageTypeEnum {
|
||||
BOT(11, "机器人"),
|
||||
VIDEO_CALL(12, "视频电话消息"),
|
||||
AUDIO_CALL(13, "音频电话消息"),
|
||||
MIXED(14, "混合消息"),
|
||||
AIT(15, "艾特"),
|
||||
REPLY(16, "回复"),
|
||||
AI(17, "AI"),
|
||||
LOCATION(18, "地图"),
|
||||
;
|
||||
|
||||
private final Integer type;
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
package com.luohuo.flex.im.domain.vo.req.room;
|
||||
|
||||
import com.luohuo.flex.im.domain.enums.ApplyStatusEnum;
|
||||
import com.luohuo.flex.im.domain.enums.RoomTypeEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class UserApplyResp implements Serializable {
|
||||
@Schema(description ="申请人uid")
|
||||
private Long uid;
|
||||
/**
|
||||
* @see RoomTypeEnum
|
||||
*/
|
||||
@Schema(description ="申请类型 1 群 2加好友")
|
||||
private Integer type;
|
||||
@Schema(description ="type = 2 才需要房间id")
|
||||
private Long roomId;
|
||||
@Schema(description ="接收人uid, 管理员id")
|
||||
private Long targetId;
|
||||
@Schema(description ="申请消息")
|
||||
private String msg;
|
||||
/**
|
||||
* @see ApplyStatusEnum
|
||||
*/
|
||||
@Schema(description ="申请状态")
|
||||
private Integer status;
|
||||
@Schema(description ="阅读状态 1未读 2已读")
|
||||
private Integer readStatus;
|
||||
@Schema(description ="主动申请加群 true 是主动申请进群")
|
||||
private Boolean applyFor;
|
||||
@Schema(description ="申请时间")
|
||||
private LocalDateTime createTime;
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.luohuo.flex.im.domain.vo.request;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -11,11 +10,13 @@ import lombok.Data;
|
||||
*/
|
||||
@Data
|
||||
public class RoomApplyReq {
|
||||
@NotBlank
|
||||
@Schema(description = "申请信息")
|
||||
private String msg;
|
||||
private String msg = "申请加入群聊";
|
||||
|
||||
@NotNull(message = "请输入群聊账号")
|
||||
@Schema(description = "群聊账号")
|
||||
private String account;
|
||||
|
||||
@Schema(description = "1: 搜索进群 2: 扫码进群")
|
||||
private Integer type = 1;
|
||||
}
|
||||
|
||||
@@ -24,4 +24,7 @@ public class RoomInfoReq {
|
||||
@NotEmpty(message = "群头像不能为空")
|
||||
@Schema(description ="群头像")
|
||||
private String avatar;
|
||||
|
||||
@Schema(description ="是否允许扫码直接进群")
|
||||
private Boolean allowScanEnter;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ public class GroupApplyHandleReq {
|
||||
@NotNull(message = "申请ID不能为空")
|
||||
private Long applyId;
|
||||
|
||||
@NotNull(message = "审批状态不能为空 0拒绝 2同意 3忽略")
|
||||
@NotNull(message = "审批状态不能为空 0未处理 1-已同意 2拒绝 3忽略")
|
||||
@Min(value = 0, message = "状态值不能小于0")
|
||||
@Max(value = 3, message = "状态值不能大于3")
|
||||
private Integer status;
|
||||
|
||||
@@ -27,6 +27,9 @@ public class NoticeVO {
|
||||
@Schema(description = "被操作的人")
|
||||
private Long operateId;
|
||||
|
||||
@Schema(description = "群昵称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "通知内容 申请时填写的")
|
||||
private String content;
|
||||
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
package com.luohuo.flex.im.domain.vo.resp.friend;
|
||||
|
||||
import com.luohuo.flex.im.domain.enums.ApplyStatusEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
|
||||
/**
|
||||
* 好友校验
|
||||
* @author nyh
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class FriendApplyResp {
|
||||
@Schema(description ="申请id")
|
||||
private Long applyId;
|
||||
|
||||
@Schema(description ="申请人uid")
|
||||
private Long uid;
|
||||
|
||||
@Schema(description = "被申请人uid、申请的roomId")
|
||||
private Long targetId;
|
||||
|
||||
@Schema(description ="申请类型 1加好友 2群聊")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description ="申请信息")
|
||||
private String msg;
|
||||
|
||||
/**
|
||||
* 申请状态
|
||||
* @see ApplyStatusEnum
|
||||
*/
|
||||
@Schema(description ="申请状态")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description ="申请时间")
|
||||
private LocalDateTime createTime;
|
||||
}
|
||||
@@ -21,6 +21,9 @@ public class FriendResp implements Serializable {
|
||||
@Schema(description ="好友uid")
|
||||
private Long uid;
|
||||
|
||||
@Schema(description ="好友备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description ="在线状态 1在线 2离线")
|
||||
private Integer activeStatus;
|
||||
|
||||
|
||||
@@ -34,4 +34,6 @@ public class MemberResp {
|
||||
private String remark;
|
||||
@Schema(description = "在这个群的昵称")
|
||||
private String myName;
|
||||
@Schema(description = "是否允许扫码直接进群")
|
||||
private Boolean allowScanEnter;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.luohuo.flex.im.domain.entity.msg;
|
||||
package com.luohuo.flex.im.domain.vo.response.msg;
|
||||
|
||||
import com.luohuo.flex.model.enums.CallStatusEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.luohuo.flex.im.domain.entity.msg;
|
||||
package com.luohuo.flex.im.domain.vo.response.msg;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.luohuo.flex.im.domain.entity.msg;
|
||||
package com.luohuo.flex.im.domain.vo.response.msg;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.luohuo.flex.im.domain.entity.msg;
|
||||
package com.luohuo.flex.im.domain.vo.response.msg;
|
||||
|
||||
import com.luohuo.flex.im.domain.entity.msg.ReplyMsg;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -35,6 +36,4 @@ public class EmojisMsgDTO implements Serializable {
|
||||
|
||||
@Schema(description ="父消息,如果没有父消息,返回的是null")
|
||||
private ReplyMsg reply;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.luohuo.flex.im.domain.entity.msg;
|
||||
package com.luohuo.flex.im.domain.vo.response.msg;
|
||||
|
||||
import com.luohuo.flex.im.domain.entity.msg.ReplyMsg;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.luohuo.flex.im.domain.entity.msg;
|
||||
package com.luohuo.flex.im.domain.vo.response.msg;
|
||||
|
||||
import com.luohuo.flex.im.domain.entity.msg.ReplyMsg;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
@@ -42,6 +43,4 @@ public class ImgMsgDTO extends BaseFileDTO implements Serializable {
|
||||
|
||||
@Schema(description ="父消息,如果没有父消息,返回的是null")
|
||||
private ReplyMsg reply;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.luohuo.flex.im.domain.vo.response.msg;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 地图消息返回体
|
||||
* @author 乾乾
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class MapMsgDTO {
|
||||
@Schema(description = "纬度")
|
||||
private String latitude;
|
||||
|
||||
@Schema(description = "经度")
|
||||
private String longitude;
|
||||
|
||||
@Schema(description = "详细地址")
|
||||
private String address;
|
||||
|
||||
@Schema(description = "定位精度")
|
||||
private String precision;
|
||||
|
||||
@Schema(description = "时间戳")
|
||||
private String timestamp;
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.luohuo.flex.im.domain.entity.msg;
|
||||
package com.luohuo.flex.im.domain.vo.response.msg;
|
||||
|
||||
import com.luohuo.flex.im.domain.entity.msg.ReplyMsg;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.luohuo.flex.im.domain.entity.msg;
|
||||
package com.luohuo.flex.im.domain.vo.response.msg;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
@@ -13,14 +13,14 @@ import java.io.Serializable;
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
public class MsgRecall implements Serializable {
|
||||
public class MsgRecallDTO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
//撤回消息的uid
|
||||
private Long recallUid;
|
||||
//撤回的时间点
|
||||
private Long recallTime;
|
||||
|
||||
public MsgRecall(Long recallUid, Long date) {
|
||||
public MsgRecallDTO(Long recallUid, Long date) {
|
||||
this.recallUid = recallUid;
|
||||
this.recallTime = date;
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.luohuo.flex.im.domain.entity.msg;
|
||||
package com.luohuo.flex.im.domain.vo.response.msg;
|
||||
|
||||
import com.luohuo.flex.im.domain.entity.msg.ReplyMsg;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.luohuo.flex.im.domain.entity.msg;
|
||||
package com.luohuo.flex.im.domain.vo.response.msg;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -19,7 +19,7 @@ import java.util.Map;
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class TextMsgResp {
|
||||
public class TextMsgDTO {
|
||||
@Schema(description ="消息内容")
|
||||
private String content;
|
||||
@Schema(description ="消息链接映射")
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.luohuo.flex.im.domain.entity.msg;
|
||||
package com.luohuo.flex.im.domain.vo.response.msg;
|
||||
|
||||
import com.luohuo.flex.model.enums.CallStatusEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.luohuo.flex.im.domain.entity.msg;
|
||||
package com.luohuo.flex.im.domain.vo.response.msg;
|
||||
|
||||
import com.luohuo.flex.im.domain.entity.msg.ReplyMsg;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
@@ -7,6 +7,13 @@ public enum QrLoginState {
|
||||
* - 描述:二维码生成后等待用户扫描
|
||||
*/
|
||||
PENDING("待扫描", "PENDING", 30_000),
|
||||
|
||||
/**
|
||||
* 已过期
|
||||
* - 有效期:30秒
|
||||
* - 描述:超时未扫描
|
||||
*/
|
||||
EXPIRED("已过期", "EXPIRED", 30_000),
|
||||
|
||||
/**
|
||||
* 已扫描待确认
|
||||
|
||||
@@ -434,6 +434,7 @@ public abstract class AbstractTokenGranter implements TokenGranter {
|
||||
obj.set(JWT_KEY_DEPT_ID, tokenSession.get(JWT_KEY_DEPT_ID));
|
||||
}
|
||||
|
||||
resultVO.setUid(uid);
|
||||
resultVO.setRefreshToken(SaTempUtil.createToken(obj.toString(), 2 * saTokenConfig.getTimeout()));
|
||||
|
||||
log.info("用户:{} 登录成功", userInfo.getUsername());
|
||||
|
||||
@@ -25,8 +25,8 @@ import com.luohuo.flex.oauth.vo.param.LoginParamVO;
|
||||
import com.luohuo.flex.oauth.vo.param.QueryStatusReq;
|
||||
import com.luohuo.flex.oauth.vo.param.ScanReq;
|
||||
import com.luohuo.flex.oauth.vo.result.LoginResultVO;
|
||||
import com.luohuo.flex.oauth.vo.result.LoginUserInfo;
|
||||
import com.luohuo.flex.oauth.vo.result.QrCodeResp;
|
||||
import com.luohuo.flex.oauth.vo.result.QrCodeResult;
|
||||
import com.luohuo.flex.oauth.vo.result.QrCodeStatus;
|
||||
import com.luohuo.flex.oauth.vo.result.ScanResp;
|
||||
import jakarta.annotation.Resource;
|
||||
@@ -94,7 +94,11 @@ public class QrCodeGranter extends AbstractTokenGranter {
|
||||
|
||||
// 2. 更新为已扫描状态
|
||||
String ip = ContextUtil.getIP();
|
||||
if (!DeviceFingerprintValidator.validateDeviceFingerprint(makeRawDeviceHash(ip), qrCodeStatus.getDeviceHash())) {
|
||||
// if (!DeviceFingerprintValidator.validateDeviceFingerprint(makeRawDeviceHash(ip), qrCodeStatus.getDeviceHash())) {
|
||||
// throw new BizException("可疑设备");
|
||||
// }
|
||||
|
||||
if (QrLoginState.SCANNED.getValue().equals(qrCodeStatus.getStatus())) {
|
||||
throw new BizException("二维码已扫描");
|
||||
}
|
||||
|
||||
@@ -103,7 +107,7 @@ public class QrCodeGranter extends AbstractTokenGranter {
|
||||
cacheKey.setExpire(Duration.ofMillis(scanned.getMillis()));
|
||||
qrCodeStatus.setStatus(scanned.getValue());
|
||||
cachePlusOps.set(cacheKey, qrCodeStatus);
|
||||
return new ScanResp(ip, scanned.getExpireTime());
|
||||
return new ScanResp(ip, scanned.getExpireTime(), "PC");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -125,37 +129,37 @@ public class QrCodeGranter extends AbstractTokenGranter {
|
||||
// 存储用户ID并更新状态
|
||||
QrLoginState confirmed = QrLoginState.CONFIRMED;
|
||||
statusKey.setExpire(Duration.ofMillis(confirmed.getMillis()));
|
||||
cachePlusOps.set(statusKey, new LoginUserInfo(confirmed.getValue(), qrLoginState.getDeviceHash(), ContextUtil.getUserId(), ContextUtil.getUid()));
|
||||
cachePlusOps.set(statusKey, new QrCodeStatus(confirmed.getValue(), qrLoginState.getDeviceHash(), ContextUtil.getUserId(), ContextUtil.getUid()));
|
||||
return confirmed.getExpireTime();
|
||||
}
|
||||
|
||||
@RedissonLock(prefixKey ="luohuo:checkStatus:", key = "#req.deviceHash")
|
||||
public R checkStatus(QueryStatusReq req) {
|
||||
CacheKey statusKey = QrCacheKeyBuilder.builder(req.getQrId());
|
||||
CacheResult<LoginUserInfo> result = cachePlusOps.get(statusKey);
|
||||
LoginUserInfo userInfo = result.getValue();
|
||||
CacheResult<QrCodeStatus> result = cachePlusOps.get(statusKey);
|
||||
QrCodeStatus qrCodeStatus = result.getValue();
|
||||
|
||||
// 1. 校验数据
|
||||
if (userInfo == null) {
|
||||
throw new BizException("二维码状态异常");
|
||||
if (qrCodeStatus == null) {
|
||||
return R.success(new QrCodeResult(QrLoginState.EXPIRED.getValue()));
|
||||
}
|
||||
if (!req.getDeviceHash().equals(userInfo.getDeviceHash())) {
|
||||
if (!req.getDeviceHash().equals(qrCodeStatus.getDeviceHash())) {
|
||||
throw new BizException("设备状态异常");
|
||||
}
|
||||
|
||||
String status = userInfo.getStatus();
|
||||
String status = qrCodeStatus.getStatus();
|
||||
if (QrLoginState.CONFIRMED.getValue().equals(status)) {
|
||||
// 2. 查询用户信息
|
||||
Long userId = userInfo.getUserId();
|
||||
Long uid = userInfo.getUid();
|
||||
Long userId = qrCodeStatus.getUserId();
|
||||
Long uid = qrCodeStatus.getUid();
|
||||
DefUser defUser = defUserService.getByIdCache(userId);
|
||||
|
||||
// 3. 生成token
|
||||
return R.success(buildResult(uid, defUser, findOrg(defUser), req.getDeviceType(), req.getClientId()));
|
||||
return R.success(new QrCodeResult(QrLoginState.CONFIRMED.getValue(), buildResult(uid, defUser, findOrg(defUser), req.getDeviceType(), req.getClientId())));
|
||||
} else if (QrLoginState.SCANNED.getValue().equals(status)) {
|
||||
return R.fail().setData("请在手机上完成确认");
|
||||
return R.success(new QrCodeResult(QrLoginState.SCANNED.getValue()));
|
||||
} else {
|
||||
return R.fail().setData("请扫描二维码");
|
||||
return R.success(new QrCodeResult(QrLoginState.PENDING.getValue()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,5 +10,5 @@ import java.io.Serializable;
|
||||
@Schema(description = "二维码确认")
|
||||
public class ConfirmReq implements Serializable {
|
||||
@NotEmpty(message = "二维码参数不能为空")
|
||||
private String qrId;
|
||||
private String qrId;
|
||||
}
|
||||
@@ -27,6 +27,9 @@ import java.time.LocalDateTime;
|
||||
@Schema(description = "登录结果")
|
||||
public class LoginResultVO {
|
||||
|
||||
@Schema(description = "用户id")
|
||||
private Long uid;
|
||||
|
||||
@Schema(description = "随机数")
|
||||
private String uuid;
|
||||
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
package com.luohuo.flex.oauth.vo.result;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@Schema(description = "用户扫码成功后的信息")
|
||||
public class LoginUserInfo implements Serializable {
|
||||
@Schema(description = "二维码唯一标识")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "系统id")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "用户id")
|
||||
private Long uid;
|
||||
|
||||
@Schema(description = "用户指纹")
|
||||
private String deviceHash;
|
||||
|
||||
public LoginUserInfo(String status, String deviceHash, Long userId, Long uid) {
|
||||
this.status = status;
|
||||
this.userId = userId;
|
||||
this.uid = uid;
|
||||
this.deviceHash = deviceHash;
|
||||
}
|
||||
|
||||
public LoginUserInfo() {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.luohuo.flex.oauth.vo.result;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@Schema(description = "二维码状态")
|
||||
public class QrCodeResult implements Serializable {
|
||||
@Schema(description = "二维码状态")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "数据")
|
||||
private Object data;
|
||||
|
||||
public QrCodeResult(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public QrCodeResult(String status, Object data) {
|
||||
this.status = status;
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public QrCodeResult() {
|
||||
}
|
||||
}
|
||||
@@ -14,11 +14,24 @@ public class QrCodeStatus implements Serializable {
|
||||
@Schema(description = "设备指纹")
|
||||
private String deviceHash;
|
||||
|
||||
@Schema(description = "系统id")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "用户id")
|
||||
private Long uid;
|
||||
|
||||
public QrCodeStatus(String status, String deviceHash) {
|
||||
this.status = status;
|
||||
this.deviceHash = deviceHash;
|
||||
}
|
||||
|
||||
public QrCodeStatus(String status, String deviceHash, Long userId, Long uid) {
|
||||
this.status = status;
|
||||
this.userId = userId;
|
||||
this.uid = uid;
|
||||
this.deviceHash = deviceHash;
|
||||
}
|
||||
|
||||
public QrCodeStatus() {
|
||||
}
|
||||
}
|
||||
@@ -14,8 +14,15 @@ public class ScanResp implements Serializable {
|
||||
@Schema(description = "登录端ip")
|
||||
private String ip;
|
||||
|
||||
public ScanResp(String ip, Long expireTime) {
|
||||
@Schema(description = "登录设备")
|
||||
private String deviceType;
|
||||
|
||||
@Schema(description = "登录地址")
|
||||
private String locPlace;
|
||||
|
||||
public ScanResp(String ip, Long expireTime, String deviceType) {
|
||||
this.ip = ip;
|
||||
this.expireTime = expireTime;
|
||||
}
|
||||
this.expireTime = expireTime;
|
||||
this.deviceType = deviceType;
|
||||
}
|
||||
}
|
||||
@@ -29,13 +29,12 @@ public enum WSRespTypeEnum {
|
||||
INVALID_USER("invalidUser", "拉黑用户", WSBlack.class),
|
||||
MSG_MARK_ITEM("msgMarkItem", "消息标记", WSMsgMark.class),
|
||||
MSG_RECALL("msgRecall", "消息撤回", WSMsgRecall.class),
|
||||
DELETE_FRIEND("deleteFriend", "删除好友", null),
|
||||
|
||||
NOTICE("notice", "通知总线", null),
|
||||
REQUEST_APPROVAL_FRIEND("requestApprovalFriend", "同意好友请求", WSFriendApproval.class),
|
||||
NEW_APPLY("newApply", "好友申请、群聊邀请", WSNotice.class),
|
||||
ROOM_DISSOLUTION("roomDissolution", "群解散", null),
|
||||
ROOM_GROUP_MSG("roomGroupMsg", "用户申请加群通知消息", null),
|
||||
GROUP_APPLY_NOTICE("GroupApplyNotice", "管理员用户申请加群通知消息", null),
|
||||
|
||||
ROOM_GROUP_NOTICE_READ_MSG("roomGroupNoticeReadMsg", "群公告已读", null),
|
||||
FEED_SEND_MSG("feedSendMsg", "朋友圈发布", null),
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package com.luohuo.flex.ws.vo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 群组视频房间创建通知VO
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public class GroupRoomCreatedVO {
|
||||
private Long roomId; // 房间ID
|
||||
private Long creatorUid; // 创建者用户ID
|
||||
private boolean isVideo; // 是否为视频房间
|
||||
|
||||
public GroupRoomCreatedVO() {
|
||||
}
|
||||
|
||||
public GroupRoomCreatedVO(Long roomId) {
|
||||
this.roomId = roomId;
|
||||
}
|
||||
}
|
||||
@@ -86,7 +86,7 @@ public class AssertUtil {
|
||||
|
||||
public static void isTrue(boolean expression, GroupErrorEnum errorEnum) {
|
||||
if (!expression) {
|
||||
throwException(errorEnum, "");
|
||||
throwException(errorEnum, errorEnum == null? "": errorEnum.getMsg());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
BIN
preview/messageFlow.png
Normal file
BIN
preview/messageFlow.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 233 KiB |
BIN
preview/qq.jpg
Normal file
BIN
preview/qq.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 447 KiB |
BIN
preview/ws-push.png
Normal file
BIN
preview/ws-push.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 121 KiB |
BIN
preview/wx.png
BIN
preview/wx.png
Binary file not shown.
|
Before Width: | Height: | Size: 464 KiB After Width: | Height: | Size: 140 KiB |
Reference in New Issue
Block a user