From a8b8d2a74801e0e1f54057f675135780b6258b58 Mon Sep 17 00:00:00 2001 From: xsx <825657193@qq.com> Date: Sat, 28 Dec 2024 17:37:27 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=81=E8=81=8A=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/im-admin.sql | 28 +- im-admin-ui/src/api/im/group/index.ts | 63 ++++ im-admin-ui/src/api/im/group/types.ts | 193 ++++++++++ im-admin-ui/src/api/im/groupMember/index.ts | 18 + im-admin-ui/src/api/im/groupMember/types.ts | 173 +++++++++ im-admin-ui/src/api/im/groupMessage/index.ts | 63 ++++ im-admin-ui/src/api/im/groupMessage/types.ts | 191 ++++++++++ .../src/api/im/privateMessage/index.ts | 29 ++ .../src/api/im/privateMessage/types.ts | 129 +++++++ im-admin-ui/src/api/im/sensitiveWord/index.ts | 63 ++++ im-admin-ui/src/api/im/sensitiveWord/types.ts | 71 ++++ im-admin-ui/src/api/im/smPushTask/index.ts | 63 ++++ im-admin-ui/src/api/im/smPushTask/types.ts | 161 +++++++++ im-admin-ui/src/api/im/systemMessage/index.ts | 63 ++++ im-admin-ui/src/api/im/systemMessage/types.ts | 161 +++++++++ im-admin-ui/src/api/im/user/index.ts | 63 ++++ im-admin-ui/src/api/im/user/types.ts | 204 +++++++++++ .../src/components/im/ImGroupSelect/index.vue | 52 +++ .../components/im/ImMessageContent/index.vue | 39 ++ .../components/im/ImSysMsgSelect/index.vue | 51 +++ .../src/components/im/ImUserSelect/index.vue | 51 +++ im-admin-ui/src/views/im/group/index.vue | 292 +++++++++++++++ im-admin-ui/src/views/im/group/member.vue | 99 +++++ .../src/views/im/groupMember/index.vue | 339 ++++++++++++++++++ .../src/views/im/message/group/index.vue | 333 +++++++++++++++++ .../src/views/im/message/private/index.vue | 231 ++++++++++++ .../src/views/im/message/system/index.vue | 304 ++++++++++++++++ .../src/views/im/message/task/index.vue | 318 ++++++++++++++++ .../src/views/im/sensitiveWord/index.vue | 235 ++++++++++++ im-admin-ui/src/views/im/user/index.vue | 284 +++++++++++++++ .../src/main/resources/application.yml | 1 + .../src/main/resources/logback-plus.xml | 47 +-- .../ImPrivateMessageController.java | 59 +-- .../org/dromara/im/domain/bo/ImGroupBo.java | 4 - .../im/domain/bo/ImPrivateMessageBo.java | 19 +- .../im/domain/vo/ImPrivateMessageVo.java | 27 +- .../im/service/IImPrivateMessageService.java | 24 -- .../impl/ImPrivateMessageServiceImpl.java | 61 +--- 38 files changed, 4411 insertions(+), 195 deletions(-) create mode 100644 im-admin-ui/src/api/im/group/index.ts create mode 100644 im-admin-ui/src/api/im/group/types.ts create mode 100644 im-admin-ui/src/api/im/groupMember/index.ts create mode 100644 im-admin-ui/src/api/im/groupMember/types.ts create mode 100644 im-admin-ui/src/api/im/groupMessage/index.ts create mode 100644 im-admin-ui/src/api/im/groupMessage/types.ts create mode 100644 im-admin-ui/src/api/im/privateMessage/index.ts create mode 100644 im-admin-ui/src/api/im/privateMessage/types.ts create mode 100644 im-admin-ui/src/api/im/sensitiveWord/index.ts create mode 100644 im-admin-ui/src/api/im/sensitiveWord/types.ts create mode 100644 im-admin-ui/src/api/im/smPushTask/index.ts create mode 100644 im-admin-ui/src/api/im/smPushTask/types.ts create mode 100644 im-admin-ui/src/api/im/systemMessage/index.ts create mode 100644 im-admin-ui/src/api/im/systemMessage/types.ts create mode 100644 im-admin-ui/src/api/im/user/index.ts create mode 100644 im-admin-ui/src/api/im/user/types.ts create mode 100644 im-admin-ui/src/components/im/ImGroupSelect/index.vue create mode 100644 im-admin-ui/src/components/im/ImMessageContent/index.vue create mode 100644 im-admin-ui/src/components/im/ImSysMsgSelect/index.vue create mode 100644 im-admin-ui/src/components/im/ImUserSelect/index.vue create mode 100644 im-admin-ui/src/views/im/group/index.vue create mode 100644 im-admin-ui/src/views/im/group/member.vue create mode 100644 im-admin-ui/src/views/im/groupMember/index.vue create mode 100644 im-admin-ui/src/views/im/message/group/index.vue create mode 100644 im-admin-ui/src/views/im/message/private/index.vue create mode 100644 im-admin-ui/src/views/im/message/system/index.vue create mode 100644 im-admin-ui/src/views/im/message/task/index.vue create mode 100644 im-admin-ui/src/views/im/sensitiveWord/index.vue create mode 100644 im-admin-ui/src/views/im/user/index.vue diff --git a/db/im-admin.sql b/db/im-admin.sql index c219489..a47e857 100644 --- a/db/im-admin.sql +++ b/db/im-admin.sql @@ -349,12 +349,16 @@ insert into sys_menu values('4002', '用户封禁', '4', '2', '#', '', '', 1, 0 insert into sys_menu values('4003', '用户导出', '4', '3', '#', '', '', 1, 0, 'F', '0', '0', 'im:user:export', '#', 103, 1, sysdate(), null, null, ''); -- IM-群聊管理 -insert into sys_menu values('5', '群聊管理', '0', '2', 'im/group', 'im/group/index', '', 1, 0, 'C', '0', '0', 'im:group:list', 'user', 103, 1, sysdate(), null, null, 'IM群聊管理'); +insert into sys_menu values('5', '群聊管理', '0', '2', 'im/group', 'im/group/index', '', 1, 0, 'C', '0', '0', 'im:group:list', 'peoples', 103, 1, sysdate(), null, null, 'IM群聊管理'); insert into sys_menu values('5001', '群聊查询', '5', '1', '#', '', '', 1, 0, 'F', '0', '0', 'im:group:query', '#', 103, 1, sysdate(), null, null, ''); insert into sys_menu values('5002', '群聊封禁', '5', '2', '#', '', '', 1, 0, 'F', '0', '0', 'im:group:ban', '#', 103, 1, sysdate(), null, null, ''); insert into sys_menu values('5003', '群聊导出', '5', '3', '#', '', '', 1, 0, 'F', '0', '0', 'im:group:export', '#', 103, 1, sysdate(), null, null, ''); insert into sys_menu values('5004', '群聊成员', '5', '4', '#', '', '', 1, 0, 'F', '0', '0', 'im:group:member', '#', 103, 1, sysdate(), null, null, ''); +-- IM-私聊管理 +insert into sys_menu values('6', '消息管理', '0', '3', 'message', null, '', 1, 0, 'M', '0', '0', '', 'message', 103, 1, sysdate(), null, null, 'IM消息管理'); +insert into sys_menu values('60', '私聊消息', '6', '1', 'private', 'im/message/private/index', '', 1, 0, 'C', '0', '0', 'im:privateMessage:list', 'education, 103, 1, sysdate(), null, null, 'IM私聊消息'); +insert into sys_menu values('6001', '私聊消息查询', '60', '1', '#', '', '', 1, 0, 'F', '0', '0', 'im:privateMessage:query', '#', 103, 1, sysdate(), null, null, ''); -- ---------------------------- -- 6、用户和角色关联表 用户N-1角色 @@ -463,6 +467,8 @@ insert into sys_dict_type values(11, '000000', '授权类型', 'sys_grant_type', insert into sys_dict_type values(12, '000000', '设备类型', 'sys_device_type', 103, 1, sysdate(), null, null, '客户端设备类型'); insert into sys_dict_type values(13, '000000', '布尔值', 'sys_bool', 103, 1, sysdate(), null, null, '布尔值, true 或 false'); insert into sys_dict_type values(14, '000000', '用户状态', 'im_user_status', 103, 1, sysdate(), null, null, 'IM用户状态'); +insert into sys_dict_type values(15, '000000', '消息状态', 'im_message_status', 103, 1, sysdate(), null, null, 'IM消息状态'); +insert into sys_dict_type values(16, '000000', '消息类型', 'im_message_type', 103, 1, sysdate(), null, null, 'IM消息类型'); -- ---------------------------- @@ -522,10 +528,22 @@ insert into sys_dict_data values(35, '000000', 0, 'PC', 'pc', 'sys_d insert into sys_dict_data values(36, '000000', 0, '安卓', 'android', 'sys_device_type', '', 'default', 'N', 103, 1, sysdate(), null, null, '安卓'); insert into sys_dict_data values(37, '000000', 0, 'iOS', 'ios', 'sys_device_type', '', 'default', 'N', 103, 1, sysdate(), null, null, 'iOS'); insert into sys_dict_data values(38, '000000', 0, '小程序', 'xcx', 'sys_device_type', '', 'default', 'N', 103, 1, sysdate(), null, null, '小程序'); -insert into sys_dict_data values(39, '000000', 0, '否', 'false', 'sys_bool', '', 'danger', 'N', 103, 1, sysdate(), null, null, 'PC'); -insert into sys_dict_data values(40, '000000', 0, '是', 'true', 'sys_bool', '', 'primary', 'N', 103, 1, sysdate(), null, null, '安卓'); -insert into sys_dict_data values(41, '000000', 0, '正常', '0', 'im_user_status', '', 'primary', 'N', 103, 1, sysdate(), null, null, 'iOS'); -insert into sys_dict_data values(42, '000000', 0, '已注销', '1', 'im_user_status', '', 'danger', 'N', 103, 1, sysdate(), null, null, '小程序'); +insert into sys_dict_data values(39, '000000', 0, '否', 'false', 'sys_bool', '', 'danger', 'N', 103, 1, sysdate(), null, null, ''); +insert into sys_dict_data values(40, '000000', 0, '是', 'true', 'sys_bool', '', 'primary', 'N', 103, 1, sysdate(), null, null, ''); +insert into sys_dict_data values(41, '000000', 0, '正常', '0', 'im_user_status', '', 'primary', 'N', 103, 1, sysdate(), null, null, ''); +insert into sys_dict_data values(42, '000000', 0, '已注销', '1', 'im_user_status', '', 'danger', 'N', 103, 1, sysdate(), null, null, ''); +insert into sys_dict_data values(43, '000000', 1, '未发送', '0', 'im_message_status', '', 'danger', 'N', 103, 1, sysdate(), null, null, ''); +insert into sys_dict_data values(44, '000000', 2, '送达', '1', 'im_message_status', '', 'primary', 'N', 103, 1, sysdate(), null, null, ''); +insert into sys_dict_data values(45, '000000', 3, '撤回', '2', 'im_message_status', '', 'warning', 'N', 103, 1, sysdate(), null, null, ''); +insert into sys_dict_data values(46, '000000', 4, '已读', '3', 'im_message_status', '', 'success', 'N', 103, 1, sysdate(), null, null, ''); +insert into sys_dict_data values(47, '000000', 1, '文字', '0', 'im_message_type', '', 'primary', 'N', 103, 1, sysdate(), null, null, ''); +insert into sys_dict_data values(48, '000000', 2, '图片', '1', 'im_message_type', '', 'primary', 'N', 103, 1, sysdate(), null, null, ''); +insert into sys_dict_data values(49, '000000', 3, '文件', '2', 'im_message_type', '', 'primary', 'N', 103, 1, sysdate(), null, null, ''); +insert into sys_dict_data values(50, '000000', 4, '语音', '3', 'im_message_type', '', 'primary', 'N', 103, 1, sysdate(), null, null, ''); +insert into sys_dict_data values(51, '000000', 5, '视频', '4', 'im_message_type', '', 'primary', 'N', 103, 1, sysdate(), null, null, ''); +insert into sys_dict_data values(52, '000000', 6, '文字提示', '21', 'im_message_type', '', 'primary', 'N', 103, 1, sysdate(), null, null, ''); +insert into sys_dict_data values(53, '000000', 7, '语音通话', '40', 'im_message_type', '', 'primary', 'N', 103, 1, sysdate(), null, null, ''); +insert into sys_dict_data values(54, '000000', 8, '视频通话', '41', 'im_message_type', '', 'primary', 'N', 103, 1, sysdate(), null, null, ''); -- ---------------------------- diff --git a/im-admin-ui/src/api/im/group/index.ts b/im-admin-ui/src/api/im/group/index.ts new file mode 100644 index 0000000..0b9a972 --- /dev/null +++ b/im-admin-ui/src/api/im/group/index.ts @@ -0,0 +1,63 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { GroupVO, GroupBanDTO, GroupUnbanDTO, GroupQuery } from '@/api/im/group/types'; + +/** + * 查询群列表 + * @param query + * @returns {*} + */ + +export const listGroup = (query?: GroupQuery): AxiosPromise => { + return request({ + url: '/im/group/list', + method: 'get', + params: query + }); +}; + +/** + * 查询群详细 + * @param id + */ +export const getGroup = (id: string | number): AxiosPromise => { + return request({ + url: '/im/group/' + id, + method: 'get' + }); +}; + +/** + * 封禁用户 + * @param data + */ +export const ban = (data: GroupBanDTO) => { + return request({ + url: '/im/group/ban', + method: 'put', + data: data + }); +}; + + +/** + * 解封用户 + * @param data + */ +export const unban = (data: GroupUnbanDTO) => { + return request({ + url: '/im/group/unban', + method: 'put', + data: data + }); +}; + + + +export const findGroupByName = (name?: String): AxiosPromise => { + return request({ + url: '/im/group/findByName?name='+name, + method: 'get' + }); +}; + diff --git a/im-admin-ui/src/api/im/group/types.ts b/im-admin-ui/src/api/im/group/types.ts new file mode 100644 index 0000000..86999dd --- /dev/null +++ b/im-admin-ui/src/api/im/group/types.ts @@ -0,0 +1,193 @@ +export interface GroupVO { + /** + * id + */ + id: string | number; + + /** + * 群名字 + */ + name: string; + + /** + * 群主id + */ + ownerId: string | number; + + /** + * 群头像 + */ + headImage: string; + + /** + * 群头像Url + */ + headImageUrl: string; + /** + * 群头像缩略图 + */ + headImageThumb: string; + + /** + * 群公告 + */ + notice: string; + /** + * 是否已解散 + */ + dissolve: number; + + /** + * 创建时间 + */ + createdTime: string; + + /** + * 是否被封禁 0:否 1:是 + */ + isBanned: number; + + /** + * 被封禁原因 + */ + reason: string; + + /** + * 成员数量 + */ + memberCount: number; + +} + +export interface GroupForm extends BaseEntity { + /** + * id + */ + id?: string | number; + + /** + * 群名字 + */ + name?: string; + + /** + * 群主id + */ + ownerId?: string | number; + + /** + * 群主 + */ + ownerUserName: string, + /** + * 群头像 + */ + headImage?: string; + + /** + * 群头像缩略图 + */ + headImageThumb?: string; + + /** + * 群公告 + */ + notice?: string; + + /** + * 是否已解散 + */ + dissolve?: number; + + /** + * 创建时间 + */ + createdTime?: string; + + /** + * 是否被封禁 0:否 1:是 + */ + isBanned?: number; + + /** + * 被封禁原因 + */ + reason?: string; + +} + +export interface GroupQuery extends PageQuery { + + /** + * 群名字 + */ + name?: string; + + /** + * 群主id + */ + ownerId?: number; + + /** + * 群头像 + */ + headImage?: string; + + /** + * 群头像缩略图 + */ + headImageThumb?: string; + + /** + * 群公告 + */ + notice?: string; + + /** + * 是否已解散 + */ + dissolve?: number; + + /** + * 创建时间 + */ + createdTime?: string; + + /** + * 是否被封禁 0:否 1:是 + */ + isBanned?: number; + + /** + * 被封禁原因 + */ + reason?: string; + + /** + * 日期范围参数 + */ + params?: any; +} + +export interface GroupBanDTO { + + /** + * id + */ + id?: string | number; + + /** + * 被封禁原因 + */ + reason?: string; +} + + +export interface GroupUnbanDTO { + + /** + * id + */ + id?: string | number; +} + diff --git a/im-admin-ui/src/api/im/groupMember/index.ts b/im-admin-ui/src/api/im/groupMember/index.ts new file mode 100644 index 0000000..5442fc9 --- /dev/null +++ b/im-admin-ui/src/api/im/groupMember/index.ts @@ -0,0 +1,18 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { GroupMemberVO, GroupMemberQuery } from '@/api/im/groupMember/types'; + +/** + * 查询群成员列表 + * @param query + * @returns {*} + */ + +export const listGroupMember = (query?: GroupMemberQuery): AxiosPromise => { + return request({ + url: '/im/group/member/list', + method: 'get', + params: query + }); +}; + diff --git a/im-admin-ui/src/api/im/groupMember/types.ts b/im-admin-ui/src/api/im/groupMember/types.ts new file mode 100644 index 0000000..c2e07bf --- /dev/null +++ b/im-admin-ui/src/api/im/groupMember/types.ts @@ -0,0 +1,173 @@ +export interface GroupMemberVO { + /** + * id + */ + id: string | number; + + /** + * 群id + */ + groupId: string | number; + + /** + * 用户id + */ + userId: string | number; + + /** + * 组内显示名称 + */ + remarkNickName: string; + + /** + * 用户头像 + */ + headImage: string; + + /** + * 用户头像Url + */ + headImageUrl: string; + /** + * 群名备注 + */ + remarkGroupName: string; + + /** + * 是否已退出 + */ + quit: number; + + /** + * 创建时间 + */ + createdTime: string; + + /** + * 退出时间 + */ + quitTime: string; + + /** + * 用户昵称 + */ + userNickName: string; + +} + +export interface GroupMemberForm extends BaseEntity { + /** + * id + */ + id?: string | number; + + /** + * 群id + */ + groupId?: string | number; + + /** + * 用户id + */ + userId?: string | number; + + /** + * 组内显示名称 + */ + remarkNickName?: string; + + /** + * 用户头像 + */ + headImage?: string; + + /** + * 群名备注 + */ + remarkGroupName?: string; + + /** + * 是否已退出 + */ + quit?: number; + + /** + * 创建时间 + */ + createdTime?: string; + + /** + * 退出时间 + */ + quitTime?: string; + + /** + * 用户昵称 + */ + userNickName?: string; + +} + +export interface GroupMemberQuery extends PageQuery { + + /** + * 群id + */ + groupId?: string | number; + + /** + * 用户id + */ + userId?: number; + + /** + * 用户名 + */ + userName: String, + + /** + * 组内显示名称 + */ + remarkNickName?: string; + + /** + * 用户头像 + */ + headImage?: string; + + /** + * 群名备注 + */ + remarkGroupName?: string; + + /** + * 是否已退出 + */ + quit?: number; + + /** + * 创建时间 + */ + createdTime?: string; + + /** + * 退出时间 + */ + quitTime?: string; + + /** + * 用户昵称 + */ + userNickName?: string; + /** + * 群内显示名 + */ + showNickName?: string; + /** + * 日期范围参数 + */ + params?: any; +} + + + diff --git a/im-admin-ui/src/api/im/groupMessage/index.ts b/im-admin-ui/src/api/im/groupMessage/index.ts new file mode 100644 index 0000000..64aca83 --- /dev/null +++ b/im-admin-ui/src/api/im/groupMessage/index.ts @@ -0,0 +1,63 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { GroupMessageVO, GroupMessageForm, GroupMessageQuery } from '@/api/im/groupMessage/types'; + +/** + * 查询群消息列表 + * @param query + * @returns {*} + */ + +export const listGroupMessage = (query?: GroupMessageQuery): AxiosPromise => { + return request({ + url: '/im/groupMessage/list', + method: 'get', + params: query + }); +}; + +/** + * 查询群消息详细 + * @param id + */ +export const getGroupMessage = (id: string | number): AxiosPromise => { + return request({ + url: '/im/groupMessage/' + id, + method: 'get' + }); +}; + +/** + * 新增群消息 + * @param data + */ +export const addGroupMessage = (data: GroupMessageForm) => { + return request({ + url: '/im/groupMessage', + method: 'post', + data: data + }); +}; + +/** + * 修改群消息 + * @param data + */ +export const updateGroupMessage = (data: GroupMessageForm) => { + return request({ + url: '/im/groupMessage', + method: 'put', + data: data + }); +}; + +/** + * 删除群消息 + * @param id + */ +export const delGroupMessage = (id: string | number | Array) => { + return request({ + url: '/im/groupMessage/' + id, + method: 'delete' + }); +}; diff --git a/im-admin-ui/src/api/im/groupMessage/types.ts b/im-admin-ui/src/api/im/groupMessage/types.ts new file mode 100644 index 0000000..e195bbd --- /dev/null +++ b/im-admin-ui/src/api/im/groupMessage/types.ts @@ -0,0 +1,191 @@ +export interface GroupMessageVO { + /** + * id + */ + id: string | number; + + /** + * 群id + */ + groupId: string | number; + + /** + * 发送用户id + */ + sendId: string | number; + + /** + * 发送用户昵称 + */ + sendNickName: string; + + /** + * 被@用户id列表,逗号分隔 + */ + atUserIds: string | number; + + /** + * 发送内容 + */ + content: string; + + /** + * + */ + status: number; + + /** + * 消息类型 0:文字 1:图片 2:文件 + */ + type: number; + + /** + * 发送时间 + */ + sendTime: string; + + /** + * 回执消息是否完成 + */ + receiptOk: number; + + /** + * 是否回执消息 + */ + receipt: number; + + /** + * 接收用户id,逗号分隔,为空表示发给所有成员 + */ + recvIds: string | number; + +} + +export interface GroupMessageForm extends BaseEntity { + /** + * id + */ + id?: string | number; + + /** + * 群id + */ + groupId?: string | number; + + /** + * 发送用户id + */ + sendId?: string | number; + + /** + * 发送用户昵称 + */ + sendNickName?: string; + + /** + * 被@用户id列表,逗号分隔 + */ + atUserIds?: string | number; + + /** + * 发送内容 + */ + content?: string; + + /** + * + */ + status?: number; + + /** + * 消息类型 0:文字 1:图片 2:文件 + */ + type?: number; + + /** + * 发送时间 + */ + sendTime?: string; + + /** + * 回执消息是否完成 + */ + receiptOk?: number; + + /** + * 是否回执消息 + */ + receipt?: number; + + /** + * 接收用户id,逗号分隔,为空表示发给所有成员 + */ + recvIds?: string | number; + +} + +export interface GroupMessageQuery extends PageQuery { + + /** + * 群id + */ + groupId?: string | number; + + /** + * 发送用户id + */ + sendId?: string | number; + + /** + * 发送用户昵称 + */ + sendNickName?: string; + + /** + * 被@用户id列表,逗号分隔 + */ + atUserIds?: string | number; + + /** + * 发送内容 + */ + content?: string; + + /** + * + */ + status?: number; + + /** + * 消息类型 0:文字 1:图片 2:文件 + */ + type?: number; + + /** + * 发送时间 + */ + sendTime?: string; + + /** + * 回执消息是否完成 + */ + receiptOk?: number; + + /** + * 是否回执消息 + */ + receipt?: number; + + /** + * 接收用户id,逗号分隔,为空表示发给所有成员 + */ + recvIds?: string | number; + + /** + * 日期范围参数 + */ + params?: any; +} + + + diff --git a/im-admin-ui/src/api/im/privateMessage/index.ts b/im-admin-ui/src/api/im/privateMessage/index.ts new file mode 100644 index 0000000..45f2f44 --- /dev/null +++ b/im-admin-ui/src/api/im/privateMessage/index.ts @@ -0,0 +1,29 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { PrivateMessageVO, PrivateMessageQuery } from '@/api/im/privateMessage/types'; + +/** + * 查询私聊消息列表 + * @param query + * @returns {*} + */ + +export const listPrivateMessage = (query?: PrivateMessageQuery): AxiosPromise => { + return request({ + url: '/im/privateMessage/list', + method: 'get', + params: query + }); +}; + +/** + * 查询私聊消息详细 + * @param id + */ +export const getPrivateMessage = (id: string | number): AxiosPromise => { + return request({ + url: '/im/privateMessage/' + id, + method: 'get' + }); +}; + diff --git a/im-admin-ui/src/api/im/privateMessage/types.ts b/im-admin-ui/src/api/im/privateMessage/types.ts new file mode 100644 index 0000000..b55fbb4 --- /dev/null +++ b/im-admin-ui/src/api/im/privateMessage/types.ts @@ -0,0 +1,129 @@ +export interface PrivateMessageVO { + /** + * id + */ + id: string | number; + + /** + * 发送用户id + */ + sendId: string | number; + + /** + * 接收用户id + */ + recvId: string | number; + + /** + * 发送内容 + */ + content: string; + + /** + * 消息类型 0:文字 1:图片 2:文件 + */ + type: number; + + /** + * 状态 0:未读 1:已读 + */ + status: number; + + /** + * 发送时间 + */ + sendTime: string; + +} + +export interface PrivateMessageForm extends BaseEntity { + /** + * id + */ + id?: string | number; + + /** + * 发送用户id + */ + sendId?: string | number; + + + /** + * 发送用户id + */ + sendUserName: string; + + + /** + * 接收用户id + */ + recvId?: string | number; + + + /** + * 接收用户 + */ + recvUserName: string; + + /** + * 发送内容 + */ + content?: string; + + /** + * 消息类型 0:文字 1:图片 2:文件 + */ + type?: number; + + /** + * 状态 0:未读 1:已读 + */ + status?: number; + + /** + * 发送时间 + */ + sendTime?: string; + +} + +export interface PrivateMessageQuery extends PageQuery { + + /** + * 发送用户id + */ + sendId?: number; + + /** + * 接收用户id + */ + recvId?: number; + + /** + * 发送内容 + */ + content?: string; + + /** + * 消息类型 0:文字 1:图片 2:文件 + */ + type?: number; + + /** + * 状态 0:未读 1:已读 + */ + status?: number; + + /** + * 发送时间 + */ + sendTime?: string; + + /** + * 日期范围参数 + */ + params?: any; +} + + + diff --git a/im-admin-ui/src/api/im/sensitiveWord/index.ts b/im-admin-ui/src/api/im/sensitiveWord/index.ts new file mode 100644 index 0000000..6462658 --- /dev/null +++ b/im-admin-ui/src/api/im/sensitiveWord/index.ts @@ -0,0 +1,63 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { SensitiveWordVO, SensitiveWordForm, SensitiveWordQuery } from '@/api/im/sensitiveWord/types'; + +/** + * 查询敏感词列表 + * @param query + * @returns {*} + */ + +export const listSensitiveWord = (query?: SensitiveWordQuery): AxiosPromise => { + return request({ + url: '/im/sensitiveWord/list', + method: 'get', + params: query + }); +}; + +/** + * 查询敏感词详细 + * @param id + */ +export const getSensitiveWord = (id: string | number): AxiosPromise => { + return request({ + url: '/im/sensitiveWord/' + id, + method: 'get' + }); +}; + +/** + * 新增敏感词 + * @param data + */ +export const addSensitiveWord = (data: SensitiveWordForm) => { + return request({ + url: '/im/sensitiveWord', + method: 'post', + data: data + }); +}; + +/** + * 修改敏感词 + * @param data + */ +export const updateSensitiveWord = (data: SensitiveWordForm) => { + return request({ + url: '/im/sensitiveWord', + method: 'put', + data: data + }); +}; + +/** + * 删除敏感词 + * @param id + */ +export const delSensitiveWord = (id: string | number | Array) => { + return request({ + url: '/im/sensitiveWord/' + id, + method: 'delete' + }); +}; diff --git a/im-admin-ui/src/api/im/sensitiveWord/types.ts b/im-admin-ui/src/api/im/sensitiveWord/types.ts new file mode 100644 index 0000000..a3ccb4d --- /dev/null +++ b/im-admin-ui/src/api/im/sensitiveWord/types.ts @@ -0,0 +1,71 @@ +export interface SensitiveWordVO { + /** + * id + */ + id: string | number; + + /** + * 敏感词内容 + */ + content: string; + + /** + * 是否启用 0:未启用 1:启用 + */ + enabled: number; + + /** + * 创建者 + */ + creator: number; + +} + +export interface SensitiveWordForm extends BaseEntity { + /** + * id + */ + id?: string | number; + + /** + * 敏感词内容 + */ + content?: string; + + /** + * 是否启用 0:未启用 1:启用 + */ + enabled?: number; + + /** + * 创建者 + */ + creator?: number; + +} + +export interface SensitiveWordQuery extends PageQuery { + + /** + * 敏感词内容 + */ + content?: string; + + /** + * 是否启用 0:未启用 1:启用 + */ + enabled?: number; + + /** + * 创建者 + */ + creator?: number; + + /** + * 日期范围参数 + */ + params?: any; +} + + + diff --git a/im-admin-ui/src/api/im/smPushTask/index.ts b/im-admin-ui/src/api/im/smPushTask/index.ts new file mode 100644 index 0000000..0a8f9b1 --- /dev/null +++ b/im-admin-ui/src/api/im/smPushTask/index.ts @@ -0,0 +1,63 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { SmPushTaskVO, SmPushTaskForm, SmPushTaskQuery } from '@/api/im/smPushTask/types'; + +/** + * 查询系统消息推送任务列表 + * @param query + * @returns {*} + */ + +export const listSmPushTask = (query?: SmPushTaskQuery): AxiosPromise => { + return request({ + url: '/im/smPushTask/list', + method: 'get', + params: query + }); +}; + +/** + * 查询系统消息推送任务详细 + * @param id + */ +export const getSmPushTask = (id: string | number): AxiosPromise => { + return request({ + url: '/im/smPushTask/' + id, + method: 'get' + }); +}; + +/** + * 新增系统消息推送任务 + * @param data + */ +export const addSmPushTask = (data: SmPushTaskForm) => { + return request({ + url: '/im/smPushTask', + method: 'post', + data: data + }); +}; + +/** + * 修改系统消息推送任务 + * @param data + */ +export const updateSmPushTask = (data: SmPushTaskForm) => { + return request({ + url: '/im/smPushTask', + method: 'put', + data: data + }); +}; + +/** + * 删除系统消息推送任务 + * @param id + */ +export const delSmPushTask = (id: string | number | Array) => { + return request({ + url: '/im/smPushTask/' + id, + method: 'delete' + }); +}; diff --git a/im-admin-ui/src/api/im/smPushTask/types.ts b/im-admin-ui/src/api/im/smPushTask/types.ts new file mode 100644 index 0000000..be57cee --- /dev/null +++ b/im-admin-ui/src/api/im/smPushTask/types.ts @@ -0,0 +1,161 @@ +export interface SmPushTaskVO { + /** + * id + */ + id: string | number; + + /** + * 系统消息id + */ + messageId: string | number; + + /** + * 发送序列号 + */ + seqNo: number; + + /** + * 推送时间 + */ + sendTime: string; + + /** + * 状态 1:待发送 2:发送中 3:已发送 4:已取消 + */ + status: number; + + /** + * 是否发送给全体用户 + */ + sendToAll: number; + + /** + * 接收用户id,逗号分隔,send_to_all为false时有效 + */ + recvIds: string | number; + + /** + * 删除标识 0:正常 1:已删除 + */ + deleted: number; + + /** + * 创建者 + */ + creator: number; + + /** + * 更新者 + */ + updater: number; + +} + +export interface SmPushTaskForm extends BaseEntity { + /** + * id + */ + id?: string | number; + + /** + * 系统消息id + */ + messageId?: string | number; + + /** + * 发送序列号 + */ + seqNo?: number; + + /** + * 推送时间 + */ + sendTime?: string; + + /** + * 状态 1:待发送 2:发送中 3:已发送 4:已取消 + */ + status?: number; + + /** + * 是否发送给全体用户 + */ + sendToAll?: number; + + /** + * 接收用户id,逗号分隔,send_to_all为false时有效 + */ + recvIds?: string | number; + + /** + * 删除标识 0:正常 1:已删除 + */ + deleted?: number; + + /** + * 创建者 + */ + creator?: number; + + /** + * 更新者 + */ + updater?: number; + +} + +export interface SmPushTaskQuery extends PageQuery { + + /** + * 系统消息id + */ + messageId?: string | number; + + /** + * 发送序列号 + */ + seqNo?: number; + + /** + * 推送时间 + */ + sendTime?: string; + + /** + * 状态 1:待发送 2:发送中 3:已发送 4:已取消 + */ + status?: number; + + /** + * 是否发送给全体用户 + */ + sendToAll?: number; + + /** + * 接收用户id,逗号分隔,send_to_all为false时有效 + */ + recvIds?: string | number; + + /** + * 删除标识 0:正常 1:已删除 + */ + deleted?: number; + + /** + * 创建者 + */ + creator?: number; + + /** + * 更新者 + */ + updater?: number; + + /** + * 日期范围参数 + */ + params?: any; +} + + + diff --git a/im-admin-ui/src/api/im/systemMessage/index.ts b/im-admin-ui/src/api/im/systemMessage/index.ts new file mode 100644 index 0000000..1043ed3 --- /dev/null +++ b/im-admin-ui/src/api/im/systemMessage/index.ts @@ -0,0 +1,63 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { SystemMessageVO, SystemMessageForm, SystemMessageQuery } from '@/api/im/systemMessage/types'; + +/** + * 查询系统消息列表 + * @param query + * @returns {*} + */ + +export const listSystemMessage = (query?: SystemMessageQuery): AxiosPromise => { + return request({ + url: '/im/systemMessage/list', + method: 'get', + params: query + }); +}; + +/** + * 查询系统消息详细 + * @param id + */ +export const getSystemMessage = (id: string | number): AxiosPromise => { + return request({ + url: '/im/systemMessage/' + id, + method: 'get' + }); +}; + +/** + * 新增系统消息 + * @param data + */ +export const addSystemMessage = (data: SystemMessageForm) => { + return request({ + url: '/im/systemMessage', + method: 'post', + data: data + }); +}; + +/** + * 修改系统消息 + * @param data + */ +export const updateSystemMessage = (data: SystemMessageForm) => { + return request({ + url: '/im/systemMessage', + method: 'put', + data: data + }); +}; + +/** + * 删除系统消息 + * @param id + */ +export const delSystemMessage = (id: string | number | Array) => { + return request({ + url: '/im/systemMessage/' + id, + method: 'delete' + }); +}; diff --git a/im-admin-ui/src/api/im/systemMessage/types.ts b/im-admin-ui/src/api/im/systemMessage/types.ts new file mode 100644 index 0000000..efc7055 --- /dev/null +++ b/im-admin-ui/src/api/im/systemMessage/types.ts @@ -0,0 +1,161 @@ +export interface SystemMessageVO { + /** + * id + */ + id: string | number; + + /** + * 标题 + */ + title: string; + + /** + * 封面 + */ + coverUrl: string; + + /** + * 简介 + */ + intro: string; + + /** + * 内容类型 0:富文本 1:外部链接 + */ + contentType: number; + + /** + * 富文本内容,base64编码 + */ + richText: string; + + /** + * 外部链接 + */ + externLink: string; + + /** + * 删除标识 0:正常 1:已删除 + */ + deleted: number; + + /** + * 创建者 + */ + creator: number; + + /** + * 更新者 + */ + updater: number; + +} + +export interface SystemMessageForm extends BaseEntity { + /** + * id + */ + id?: string | number; + + /** + * 标题 + */ + title?: string; + + /** + * 封面 + */ + coverUrl?: string; + + /** + * 简介 + */ + intro?: string; + + /** + * 内容类型 0:富文本 1:外部链接 + */ + contentType?: number; + + /** + * 富文本内容,base64编码 + */ + richText?: string; + + /** + * 外部链接 + */ + externLink?: string; + + /** + * 删除标识 0:正常 1:已删除 + */ + deleted?: number; + + /** + * 创建者 + */ + creator?: number; + + /** + * 更新者 + */ + updater?: number; + +} + +export interface SystemMessageQuery extends PageQuery { + + /** + * 标题 + */ + title?: string; + + /** + * 封面 + */ + coverUrl?: string; + + /** + * 简介 + */ + intro?: string; + + /** + * 内容类型 0:富文本 1:外部链接 + */ + contentType?: number; + + /** + * 富文本内容,base64编码 + */ + richText?: string; + + /** + * 外部链接 + */ + externLink?: string; + + /** + * 删除标识 0:正常 1:已删除 + */ + deleted?: number; + + /** + * 创建者 + */ + creator?: number; + + /** + * 更新者 + */ + updater?: number; + + /** + * 日期范围参数 + */ + params?: any; +} + + + diff --git a/im-admin-ui/src/api/im/user/index.ts b/im-admin-ui/src/api/im/user/index.ts new file mode 100644 index 0000000..a692af6 --- /dev/null +++ b/im-admin-ui/src/api/im/user/index.ts @@ -0,0 +1,63 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { UserVO, UserBanDTO, UserUnbanDTO, UserQuery } from '@/api/im/user/types'; + +/** + * 查询用户列表 + * @param query + * @returns {*} + */ + +export const listUser = (query?: UserQuery): AxiosPromise => { + return request({ + url: '/im/user/list', + method: 'get', + params: query + }); +}; + +/** + * 查询用户详细 + * @param id + */ +export const getUser = (id: string | number): AxiosPromise => { + return request({ + url: '/im/user/' + id, + method: 'get' + }); +}; + + +/** + * 封禁用户 + * @param data + */ +export const ban = (data: UserBanDTO) => { + return request({ + url: '/im/user/ban', + method: 'put', + data: data + }); +}; + + +/** + * 解封用户 + * @param data + */ +export const unban = (data: UserUnbanDTO) => { + return request({ + url: '/im/user/unban', + method: 'put', + data: data + }); +}; + + +export const findUserByName = (name?: String): AxiosPromise => { + return request({ + url: '/im/user/findByName?name='+name, + method: 'get' + }); +}; + diff --git a/im-admin-ui/src/api/im/user/types.ts b/im-admin-ui/src/api/im/user/types.ts new file mode 100644 index 0000000..f2f535e --- /dev/null +++ b/im-admin-ui/src/api/im/user/types.ts @@ -0,0 +1,204 @@ +export interface UserVO { + /** + * id + */ + id: string | number; + + /** + * 用户名 + */ + userName: string; + + /** + * 用户昵称 + */ + nickName: string; + + /** + * 用户头像 + */ + headImage: string; + + /** + * 用户头像Url + */ + headImageUrl: string; + /** + * 用户头像缩略图 + */ + headImageThumb: string; + + /** + * 密码(明文) + */ + password: string; + + /** + * 性别 0:男 1::女 + */ + sex: number; + + /** + * 个性签名 + */ + signature: string; + + /** + * 最后登录时间 + */ + lastLoginTime: string; + + /** + * 创建时间 + */ + createdTime: string; + + /** + * + */ + type: number; + + /** + * 是否被封禁 0:否 1:是 + */ + isBanned: number; + + /** + * 被封禁原因 + */ + reason: string; + + /** + * 客户端id,用于uni-push推送 + */ + cid: string | number; + + /** + * 状态 0:正常 1:已注销 + */ + status: number; + +} + +export interface UserForm extends BaseEntity { + /** + * id + */ + id?: string | number; + + /** + * 用户名 + */ + userName?: string; + + /** + * 用户昵称 + */ + nickName?: string; + + /** + * 用户头像 + */ + headImage?: string; + + /** + * 用户头像缩略图 + */ + headImageThumb?: string; + + /** + * 密码(明文) + */ + password?: string; + + /** + * 性别 0:男 1::女 + */ + sex?: number; + + /** + * 个性签名 + */ + signature?: string; + + /** + * 最后登录时间 + */ + lastLoginTime?: string; + + /** + * 创建时间 + */ + createdTime?: string; + + /** + * + */ + type?: number; + + /** + * 是否被封禁 0:否 1:是 + */ + isBanned?: number; + + /** + * 被封禁原因 + */ + reason?: string; + + /** + * 客户端id,用于uni-push推送 + */ + cid?: string | number; + + /** + * 状态 0:正常 1:已注销 + */ + status?: number; + +} + +export interface UserQuery extends PageQuery { + + /** + * 用户名 + */ + userName?: string; + + /** + * 用户昵称 + */ + nickName?: string; + /** + * 创建时间 + */ + createdTime?: string; + /** + * 日期范围参数 + */ + params?: any; +} + +export interface UserBanDTO { + + /** + * id + */ + id?: string | number; + + /** + * 被封禁原因 + */ + reason?: string; +} + + +export interface UserUnbanDTO { + + /** + * id + */ + id?: string | number; +} + + diff --git a/im-admin-ui/src/components/im/ImGroupSelect/index.vue b/im-admin-ui/src/components/im/ImGroupSelect/index.vue new file mode 100644 index 0000000..86cc562 --- /dev/null +++ b/im-admin-ui/src/components/im/ImGroupSelect/index.vue @@ -0,0 +1,52 @@ + + + diff --git a/im-admin-ui/src/components/im/ImMessageContent/index.vue b/im-admin-ui/src/components/im/ImMessageContent/index.vue new file mode 100644 index 0000000..b50ffbd --- /dev/null +++ b/im-admin-ui/src/components/im/ImMessageContent/index.vue @@ -0,0 +1,39 @@ + + + + + \ No newline at end of file diff --git a/im-admin-ui/src/components/im/ImSysMsgSelect/index.vue b/im-admin-ui/src/components/im/ImSysMsgSelect/index.vue new file mode 100644 index 0000000..73cd212 --- /dev/null +++ b/im-admin-ui/src/components/im/ImSysMsgSelect/index.vue @@ -0,0 +1,51 @@ + + + diff --git a/im-admin-ui/src/components/im/ImUserSelect/index.vue b/im-admin-ui/src/components/im/ImUserSelect/index.vue new file mode 100644 index 0000000..52c9ce9 --- /dev/null +++ b/im-admin-ui/src/components/im/ImUserSelect/index.vue @@ -0,0 +1,51 @@ + + + diff --git a/im-admin-ui/src/views/im/group/index.vue b/im-admin-ui/src/views/im/group/index.vue new file mode 100644 index 0000000..9372249 --- /dev/null +++ b/im-admin-ui/src/views/im/group/index.vue @@ -0,0 +1,292 @@ + + + diff --git a/im-admin-ui/src/views/im/group/member.vue b/im-admin-ui/src/views/im/group/member.vue new file mode 100644 index 0000000..947163c --- /dev/null +++ b/im-admin-ui/src/views/im/group/member.vue @@ -0,0 +1,99 @@ + + + \ No newline at end of file diff --git a/im-admin-ui/src/views/im/groupMember/index.vue b/im-admin-ui/src/views/im/groupMember/index.vue new file mode 100644 index 0000000..c8ed598 --- /dev/null +++ b/im-admin-ui/src/views/im/groupMember/index.vue @@ -0,0 +1,339 @@ + + + diff --git a/im-admin-ui/src/views/im/message/group/index.vue b/im-admin-ui/src/views/im/message/group/index.vue new file mode 100644 index 0000000..c48c590 --- /dev/null +++ b/im-admin-ui/src/views/im/message/group/index.vue @@ -0,0 +1,333 @@ + + + diff --git a/im-admin-ui/src/views/im/message/private/index.vue b/im-admin-ui/src/views/im/message/private/index.vue new file mode 100644 index 0000000..78dfd2b --- /dev/null +++ b/im-admin-ui/src/views/im/message/private/index.vue @@ -0,0 +1,231 @@ + + + diff --git a/im-admin-ui/src/views/im/message/system/index.vue b/im-admin-ui/src/views/im/message/system/index.vue new file mode 100644 index 0000000..c060d52 --- /dev/null +++ b/im-admin-ui/src/views/im/message/system/index.vue @@ -0,0 +1,304 @@ + + + diff --git a/im-admin-ui/src/views/im/message/task/index.vue b/im-admin-ui/src/views/im/message/task/index.vue new file mode 100644 index 0000000..1bf9ccb --- /dev/null +++ b/im-admin-ui/src/views/im/message/task/index.vue @@ -0,0 +1,318 @@ + + + diff --git a/im-admin-ui/src/views/im/sensitiveWord/index.vue b/im-admin-ui/src/views/im/sensitiveWord/index.vue new file mode 100644 index 0000000..fda016d --- /dev/null +++ b/im-admin-ui/src/views/im/sensitiveWord/index.vue @@ -0,0 +1,235 @@ + + + diff --git a/im-admin-ui/src/views/im/user/index.vue b/im-admin-ui/src/views/im/user/index.vue new file mode 100644 index 0000000..8136ce1 --- /dev/null +++ b/im-admin-ui/src/views/im/user/index.vue @@ -0,0 +1,284 @@ + + + diff --git a/im-admin/ruoyi-admin/src/main/resources/application.yml b/im-admin/ruoyi-admin/src/main/resources/application.yml index bf4a886..085cb38 100644 --- a/im-admin/ruoyi-admin/src/main/resources/application.yml +++ b/im-admin/ruoyi-admin/src/main/resources/application.yml @@ -152,6 +152,7 @@ mybatis-encryptor: publicKey: privateKey: +# 【bug】ruoyi的这个文档配置似乎没有生效,跟代码也对不上 springdoc: api-docs: # 是否开启接口文档 diff --git a/im-admin/ruoyi-admin/src/main/resources/logback-plus.xml b/im-admin/ruoyi-admin/src/main/resources/logback-plus.xml index 40fa33b..ee2d7a2 100644 --- a/im-admin/ruoyi-admin/src/main/resources/logback-plus.xml +++ b/im-admin/ruoyi-admin/src/main/resources/logback-plus.xml @@ -8,7 +8,7 @@ - ${console.log.pattern} + ${log.pattern} utf-8 @@ -79,7 +79,7 @@ - + 0 512 @@ -97,33 +97,20 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + diff --git a/im-admin/ruoyi-im/src/main/java/org/dromara/im/controller/ImPrivateMessageController.java b/im-admin/ruoyi-im/src/main/java/org/dromara/im/controller/ImPrivateMessageController.java index cc66c77..f718ec9 100644 --- a/im-admin/ruoyi-im/src/main/java/org/dromara/im/controller/ImPrivateMessageController.java +++ b/im-admin/ruoyi-im/src/main/java/org/dromara/im/controller/ImPrivateMessageController.java @@ -1,17 +1,9 @@ package org.dromara.im.controller; import cn.dev33.satoken.annotation.SaCheckPermission; -import jakarta.servlet.http.HttpServletResponse; -import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.NotNull; import lombok.RequiredArgsConstructor; import org.dromara.common.core.domain.R; -import org.dromara.common.core.validate.AddGroup; -import org.dromara.common.core.validate.EditGroup; -import org.dromara.common.excel.utils.ExcelUtil; -import org.dromara.common.idempotent.annotation.RepeatSubmit; -import org.dromara.common.log.annotation.Log; -import org.dromara.common.log.enums.BusinessType; import org.dromara.common.mybatis.core.page.PageQuery; import org.dromara.common.mybatis.core.page.TableDataInfo; import org.dromara.common.web.core.BaseController; @@ -19,9 +11,10 @@ import org.dromara.im.domain.bo.ImPrivateMessageBo; import org.dromara.im.domain.vo.ImPrivateMessageVo; import org.dromara.im.service.IImPrivateMessageService; import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import java.util.List; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; /** * 私聊消息 @@ -46,16 +39,6 @@ public class ImPrivateMessageController extends BaseController { return imPrivateMessageService.queryPageList(bo, pageQuery); } - /** - * 导出私聊消息列表 - */ - @SaCheckPermission("im:privateMessage:export") - @Log(title = "私聊消息", businessType = BusinessType.EXPORT) - @PostMapping("/export") - public void export(ImPrivateMessageBo bo, HttpServletResponse response) { - List list = imPrivateMessageService.queryList(bo); - ExcelUtil.exportExcel(list, "私聊消息", ImPrivateMessageVo.class, response); - } /** * 获取私聊消息详细信息 @@ -69,38 +52,4 @@ public class ImPrivateMessageController extends BaseController { return R.ok(imPrivateMessageService.queryById(id)); } - /** - * 新增私聊消息 - */ - @SaCheckPermission("im:privateMessage:add") - @Log(title = "私聊消息", businessType = BusinessType.INSERT) - @RepeatSubmit() - @PostMapping() - public R add(@Validated(AddGroup.class) @RequestBody ImPrivateMessageBo bo) { - return toAjax(imPrivateMessageService.insertByBo(bo)); - } - - /** - * 修改私聊消息 - */ - @SaCheckPermission("im:privateMessage:edit") - @Log(title = "私聊消息", businessType = BusinessType.UPDATE) - @RepeatSubmit() - @PutMapping() - public R edit(@Validated(EditGroup.class) @RequestBody ImPrivateMessageBo bo) { - return toAjax(imPrivateMessageService.updateByBo(bo)); - } - - /** - * 删除私聊消息 - * - * @param ids 主键串 - */ - @SaCheckPermission("im:privateMessage:remove") - @Log(title = "私聊消息", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public R remove(@NotEmpty(message = "主键不能为空") - @PathVariable Long[] ids) { - return toAjax(imPrivateMessageService.deleteWithValidByIds(List.of(ids), true)); - } } diff --git a/im-admin/ruoyi-im/src/main/java/org/dromara/im/domain/bo/ImGroupBo.java b/im-admin/ruoyi-im/src/main/java/org/dromara/im/domain/bo/ImGroupBo.java index 75aab67..0441cce 100644 --- a/im-admin/ruoyi-im/src/main/java/org/dromara/im/domain/bo/ImGroupBo.java +++ b/im-admin/ruoyi-im/src/main/java/org/dromara/im/domain/bo/ImGroupBo.java @@ -1,7 +1,5 @@ package org.dromara.im.domain.bo; -import com.baomidou.mybatisplus.annotation.TableField; -import com.fasterxml.jackson.annotation.JsonInclude; import io.github.linpeilie.annotations.AutoMapper; import lombok.Data; import org.dromara.im.domain.ImGroup; @@ -73,8 +71,6 @@ public class ImGroupBo { /** * 请求参数 */ - @JsonInclude(JsonInclude.Include.NON_EMPTY) - @TableField(exist = false) private Map params = new HashMap<>(); diff --git a/im-admin/ruoyi-im/src/main/java/org/dromara/im/domain/bo/ImPrivateMessageBo.java b/im-admin/ruoyi-im/src/main/java/org/dromara/im/domain/bo/ImPrivateMessageBo.java index 2dab11b..0b057e8 100644 --- a/im-admin/ruoyi-im/src/main/java/org/dromara/im/domain/bo/ImPrivateMessageBo.java +++ b/im-admin/ruoyi-im/src/main/java/org/dromara/im/domain/bo/ImPrivateMessageBo.java @@ -1,16 +1,14 @@ package org.dromara.im.domain.bo; import io.github.linpeilie.annotations.AutoMapper; -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.NotNull; import lombok.Data; import lombok.EqualsAndHashCode; -import org.dromara.common.core.validate.AddGroup; -import org.dromara.common.core.validate.EditGroup; import org.dromara.common.mybatis.core.domain.BaseEntity; import org.dromara.im.domain.ImPrivateMessage; import java.util.Date; +import java.util.HashMap; +import java.util.Map; /** * 私聊消息业务对象 im_private_message @@ -26,44 +24,41 @@ public class ImPrivateMessageBo extends BaseEntity { /** * id */ - @NotNull(message = "id不能为空", groups = { EditGroup.class }) private Long id; /** * 发送用户id */ - @NotNull(message = "发送用户id不能为空", groups = { AddGroup.class, EditGroup.class }) private Long sendId; /** * 接收用户id */ - @NotNull(message = "接收用户id不能为空", groups = { AddGroup.class, EditGroup.class }) private Long recvId; /** * 发送内容 */ - @NotBlank(message = "发送内容不能为空", groups = { AddGroup.class, EditGroup.class }) private String content; /** * 消息类型 0:文字 1:图片 2:文件 */ - @NotNull(message = "消息类型 0:文字 1:图片 2:文件不能为空", groups = { AddGroup.class, EditGroup.class }) private Long type; /** - * 状态 0:未读 1:已读 + * 状态 0:未读 1:已读 */ - @NotNull(message = "状态 0:未读 1:已读 不能为空", groups = { AddGroup.class, EditGroup.class }) private Long status; /** * 发送时间 */ - @NotNull(message = "发送时间不能为空", groups = { AddGroup.class, EditGroup.class }) private Date sendTime; + /** + * 请求参数 + */ + private Map params = new HashMap<>(); } diff --git a/im-admin/ruoyi-im/src/main/java/org/dromara/im/domain/vo/ImPrivateMessageVo.java b/im-admin/ruoyi-im/src/main/java/org/dromara/im/domain/vo/ImPrivateMessageVo.java index b69bfc8..e60ad84 100644 --- a/im-admin/ruoyi-im/src/main/java/org/dromara/im/domain/vo/ImPrivateMessageVo.java +++ b/im-admin/ruoyi-im/src/main/java/org/dromara/im/domain/vo/ImPrivateMessageVo.java @@ -2,12 +2,16 @@ package org.dromara.im.domain.vo; import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; import com.alibaba.excel.annotation.ExcelProperty; +import com.fhs.core.trans.anno.Trans; +import com.fhs.core.trans.constant.TransType; +import com.fhs.core.trans.vo.TransPojo; import io.github.linpeilie.annotations.AutoMapper; import lombok.Data; +import org.dromara.im.constant.ImConstant; import org.dromara.im.domain.ImPrivateMessage; +import org.dromara.im.domain.ImUser; import java.io.Serial; -import java.io.Serializable; import java.util.Date; @@ -21,7 +25,7 @@ import java.util.Date; @Data @ExcelIgnoreUnannotated @AutoMapper(target = ImPrivateMessage.class) -public class ImPrivateMessageVo implements Serializable { +public class ImPrivateMessageVo implements TransPojo { @Serial private static final long serialVersionUID = 1L; @@ -35,15 +39,21 @@ public class ImPrivateMessageVo implements Serializable { /** * 发送用户id */ - @ExcelProperty(value = "发送用户id") + @Trans(type = TransType.SIMPLE,dataSource = ImConstant.DS_IM_PLATFORM,target = ImUser.class, fields = "userName", ref = "sendUserName") private Long sendId; + @ExcelProperty(value = "发送用户") + private String sendUserName; + /** * 接收用户id */ - @ExcelProperty(value = "接收用户id") + @Trans(type = TransType.SIMPLE,dataSource = ImConstant.DS_IM_PLATFORM,target = ImUser.class, fields = "userName", ref = "recvUserName") private Long recvId; + @ExcelProperty(value = "接收用户") + private String recvUserName; + /** * 发送内容 */ @@ -51,15 +61,15 @@ public class ImPrivateMessageVo implements Serializable { private String content; /** - * 消息类型 0:文字 1:图片 2:文件 + * 消息类型 */ - @ExcelProperty(value = "消息类型 0:文字 1:图片 2:文件") + @ExcelProperty(value = "消息类型") private Long type; /** - * 状态 0:未读 1:已读 + * 状态 */ - @ExcelProperty(value = "状态 0:未读 1:已读 ") + @ExcelProperty(value = "状态") private Long status; /** @@ -68,5 +78,4 @@ public class ImPrivateMessageVo implements Serializable { @ExcelProperty(value = "发送时间") private Date sendTime; - } diff --git a/im-admin/ruoyi-im/src/main/java/org/dromara/im/service/IImPrivateMessageService.java b/im-admin/ruoyi-im/src/main/java/org/dromara/im/service/IImPrivateMessageService.java index 1016ce4..d894df3 100644 --- a/im-admin/ruoyi-im/src/main/java/org/dromara/im/service/IImPrivateMessageService.java +++ b/im-admin/ruoyi-im/src/main/java/org/dromara/im/service/IImPrivateMessageService.java @@ -5,7 +5,6 @@ import org.dromara.common.mybatis.core.page.TableDataInfo; import org.dromara.im.domain.bo.ImPrivateMessageBo; import org.dromara.im.domain.vo.ImPrivateMessageVo; -import java.util.Collection; import java.util.List; /** @@ -41,28 +40,5 @@ public interface IImPrivateMessageService { */ List queryList(ImPrivateMessageBo bo); - /** - * 新增私聊消息 - * - * @param bo 私聊消息 - * @return 是否新增成功 - */ - Boolean insertByBo(ImPrivateMessageBo bo); - - /** - * 修改私聊消息 - * - * @param bo 私聊消息 - * @return 是否修改成功 - */ - Boolean updateByBo(ImPrivateMessageBo bo); - /** - * 校验并批量删除私聊消息信息 - * - * @param ids 待删除的主键集合 - * @param isValid 是否进行有效性校验 - * @return 是否删除成功 - */ - Boolean deleteWithValidByIds(Collection ids, Boolean isValid); } diff --git a/im-admin/ruoyi-im/src/main/java/org/dromara/im/service/impl/ImPrivateMessageServiceImpl.java b/im-admin/ruoyi-im/src/main/java/org/dromara/im/service/impl/ImPrivateMessageServiceImpl.java index 304f38c..31a83ce 100644 --- a/im-admin/ruoyi-im/src/main/java/org/dromara/im/service/impl/ImPrivateMessageServiceImpl.java +++ b/im-admin/ruoyi-im/src/main/java/org/dromara/im/service/impl/ImPrivateMessageServiceImpl.java @@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import lombok.RequiredArgsConstructor; -import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.StringUtils; import org.dromara.common.mybatis.core.page.PageQuery; import org.dromara.common.mybatis.core.page.TableDataInfo; @@ -17,7 +16,6 @@ import org.dromara.im.mapper.ImPrivateMessageMapper; import org.dromara.im.service.IImPrivateMessageService; import org.springframework.stereotype.Service; -import java.util.Collection; import java.util.List; import java.util.Map; @@ -41,7 +39,7 @@ public class ImPrivateMessageServiceImpl implements IImPrivateMessageService { * @return 私聊消息 */ @Override - public ImPrivateMessageVo queryById(Long id){ + public ImPrivateMessageVo queryById(Long id) { return baseMapper.selectVoById(id); } @@ -76,62 +74,13 @@ public class ImPrivateMessageServiceImpl implements IImPrivateMessageService { LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); lqw.eq(bo.getSendId() != null, ImPrivateMessage::getSendId, bo.getSendId()); lqw.eq(bo.getRecvId() != null, ImPrivateMessage::getRecvId, bo.getRecvId()); - lqw.eq(StringUtils.isNotBlank(bo.getContent()), ImPrivateMessage::getContent, bo.getContent()); + lqw.like(StringUtils.isNotBlank(bo.getContent()), ImPrivateMessage::getContent, bo.getContent()); lqw.eq(bo.getType() != null, ImPrivateMessage::getType, bo.getType()); lqw.eq(bo.getStatus() != null, ImPrivateMessage::getStatus, bo.getStatus()); - lqw.eq(bo.getSendTime() != null, ImPrivateMessage::getSendTime, bo.getSendTime()); + lqw.between(params.get("beginTime") != null && params.get("endTime") != null, ImPrivateMessage::getSendTime, + params.get("beginTime"), params.get("endTime")); + lqw.orderByDesc(ImPrivateMessage::getId); return lqw; } - /** - * 新增私聊消息 - * - * @param bo 私聊消息 - * @return 是否新增成功 - */ - @Override - public Boolean insertByBo(ImPrivateMessageBo bo) { - ImPrivateMessage add = MapstructUtils.convert(bo, ImPrivateMessage.class); - validEntityBeforeSave(add); - boolean flag = baseMapper.insert(add) > 0; - if (flag) { - bo.setId(add.getId()); - } - return flag; - } - - /** - * 修改私聊消息 - * - * @param bo 私聊消息 - * @return 是否修改成功 - */ - @Override - public Boolean updateByBo(ImPrivateMessageBo bo) { - ImPrivateMessage update = MapstructUtils.convert(bo, ImPrivateMessage.class); - validEntityBeforeSave(update); - return baseMapper.updateById(update) > 0; - } - - /** - * 保存前的数据校验 - */ - private void validEntityBeforeSave(ImPrivateMessage entity){ - //TODO 做一些数据校验,如唯一约束 - } - - /** - * 校验并批量删除私聊消息信息 - * - * @param ids 待删除的主键集合 - * @param isValid 是否进行有效性校验 - * @return 是否删除成功 - */ - @Override - public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { - if(isValid){ - //TODO 做一些业务上的校验,判断是否需要校验 - } - return baseMapper.deleteByIds(ids) > 0; - } }