From ff79c6546cf18d60683704fe8b39990ad6979f71 Mon Sep 17 00:00:00 2001 From: xsx <825657193@qq.com> Date: Mon, 30 Dec 2024 01:03:56 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 122 +++---- db/im-admin.sql | 21 +- im-admin-ui/package.json | 8 +- im-admin-ui/src/api/im/systemMessage/types.ts | 11 +- im-admin-ui/src/components/Editor/index.vue | 306 +++++------------- .../src/components/ImagePreview/index.vue | 2 +- .../src/components/ImageUpload/index.vue | 145 +++++++++ .../src/views/im/message/system/index.vue | 139 +++----- im-admin-ui/src/views/system/notice/index.vue | 2 +- im-admin-ui/vite.config.ts | 6 - .../src/main/resources/common-mybatis.yml | 2 +- .../org/dromara/im/domain/ImBaseEntity.java | 57 ++++ .../java/org/dromara/im/domain/ImGroup.java | 3 - .../org/dromara/im/domain/ImGroupMessage.java | 4 - .../dromara/im/domain/ImPrivateMessage.java | 3 - .../dromara/im/domain/ImSensitiveWord.java | 8 +- .../org/dromara/im/domain/ImSmPushTask.java | 3 - .../dromara/im/domain/ImSystemMessage.java | 37 +-- .../java/org/dromara/im/domain/ImUser.java | 6 +- .../im/domain/bo/ImSystemMessageBo.java | 12 +- .../im/domain/vo/ImGroupMessageVo.java | 4 - .../org/dromara/im/domain/vo/ImGroupVo.java | 4 - .../im/domain/vo/ImPrivateMessageVo.java | 4 - .../im/domain/vo/ImSensitiveWordVo.java | 4 - .../dromara/im/domain/vo/ImSmPushTaskVo.java | 7 +- .../im/domain/vo/ImSystemMessageVo.java | 39 +-- .../org/dromara/im/domain/vo/ImUserVo.java | 6 +- .../im/service/IImSystemMessageService.java | 3 + .../impl/ImSystemMessageServiceImpl.java | 42 +-- .../controller/system/SysFileController.java | 36 +++ .../org/dromara/system/domain/SysClient.java | 2 +- .../org/dromara/system/domain/SysDept.java | 2 +- .../org/dromara/system/domain/SysRole.java | 2 +- .../org/dromara/system/domain/SysTenant.java | 2 +- .../system/domain/SysTenantPackage.java | 2 +- .../org/dromara/system/domain/SysUser.java | 2 +- 36 files changed, 489 insertions(+), 569 deletions(-) create mode 100644 im-admin-ui/src/components/ImageUpload/index.vue create mode 100644 im-admin/ruoyi-im/src/main/java/org/dromara/im/domain/ImBaseEntity.java create mode 100644 im-admin/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysFileController.java diff --git a/README.md b/README.md index 9c3c03a..61026a1 100644 --- a/README.md +++ b/README.md @@ -1,93 +1,67 @@ -# 盒子IM商业版后台 +# 盒子IM后台管理 +#### 介绍 +本项目为盒子IM后台管理,主要为盒子IM提供用户管理、群组管理、消息管理、敏感词管理等后台功能。 +盒子IM前台代码地址:https://gitee.com/bluexsx/box-im +详细文档: https://www.yuque.com/u1475064/mufu2a -## Getting started -To make it easy for you to get started with GitLab, here's a list of recommended next steps. +#### 基于maku框架 +为了减少重复工作,达到快速开发目的,本项目选择了一款优秀的开源脚手架-maku进行二次开发。 -Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)! +maku的仓库: +https://gitee.com/makunet/maku-boot +https://gitee.com/makunet/maku-admin -## Add your files +maku的文档: +https://maku.net/docs/maku-boot/index -- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files -- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command: +#### 框架改造说明 +为了更好地与盒子IM的业务相结合,同时保持代码的简洁性,对ruoyi-vue-plus框架进行了以下改造: +1. 移除了定时任务、监控、工作流模块 +2. 添加minio模块替代原先的oss模块 +3. 加入了ruoyi-im模块,此模块即为盒子IM的核心后台模块 +4. 为了兼容历史数据,逻辑删除值由'2'修改为'1' -``` -cd existing_repo -git remote add origin http://113.45.141.159:8099/commerce/box-im-admin-ry.git -git branch -M main -git push -uf origin main -``` - -## Integrate with your tools - -- [ ] [Set up project integrations](http://113.45.141.159:8099/commerce/box-im-admin-ry/-/settings/integrations) - -## Collaborate with your team - -- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/) -- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html) -- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically) -- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/) -- [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html) - -## Test and Deploy - -Use the built-in continuous integration in GitLab. - -- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html) -- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/) -- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html) -- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/) -- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html) - -*** - -# Editing this README +#### 本地快速启动 -When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template. +1.安装运行环境 +- 安装node:v18.19.0 +- 安装jdk:17 +- 安装maven:3.9.6 +- 安装mysql:8.0,密码分别为root/root,创建名为im_admin的数据库,并执行db/im-admin.sql +- 安装redis:6.2 +- 安装minio:RELEASE.2024-xx,使用默认账号、密码、端口 -## Suggestions for a good README +注: 盒子IM的后台服务同时还依赖im-platform的数据库,请在启动前先初始化该数据库 -Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information. - -## Name -Choose a self-explaining name for your project. - -## Description -Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors. - -## Badges -On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge. - -## Visuals -Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method. - -## Installation -Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection. - -## Usage -Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README. +2.启动后端服务 +进入 im-admin目录,打开控制台 +``` +mvn clean package +java -jar ./maku-server/target/im-admin.jar +``` -## Support -Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc. +3.启动前端 +进入 maku-admin目录,打开控制台 +``` +npm install +npm run dev +``` +访问 http://localhost:3000 -## Roadmap -If you have ideas for releases in the future, it is a good idea to list them in the README. +#### 界面截图: +![输入图片说明](%E6%88%AA%E5%9B%BE/1.png) -## Contributing -State if you are open to contributions and what your requirements are for accepting them. +![输入图片说明](%E6%88%AA%E5%9B%BE/2.png) -For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self. +![输入图片说明](%E6%88%AA%E5%9B%BE/3.png) -You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser. +![输入图片说明](%E6%88%AA%E5%9B%BE/4.png) -## Authors and acknowledgment -Show your appreciation to those who have contributed to the project. +![输入图片说明](%E6%88%AA%E5%9B%BE/5.png) -## License -For open source projects, say how it is licensed. -## Project status -If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers. +#### 点下star吧 +如果项目对您有帮助,请点亮右上方的star,支持一下作者吧! \ No newline at end of file diff --git a/db/im-admin.sql b/db/im-admin.sql index 7d7cc4a..704e64b 100644 --- a/db/im-admin.sql +++ b/db/im-admin.sql @@ -344,15 +344,22 @@ insert into sys_menu values('5002', '群聊封禁', '5', '2', '#', '', '', 1, 0 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-私聊管理 +-- 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, ''); --- IM-群聊管理 +-- IM-群聊消息 insert into sys_menu values('61', '群聊消息', '6', '2', 'group', 'im/message/group/index', '', 1, 0, 'C', '0', '0', 'im:groupMessage:list', 'category', 103, 1, sysdate(), null, null, 'IM群聊消息'); insert into sys_menu values('6101', '群聊消息查询', '61', '1', '#', '', '', 1, 0, 'F', '0', '0', 'im:groupMessage:query', '#', 103, 1, sysdate(), null, null, ''); +-- IM-系统消息 +insert into sys_menu values('62', '系统消息', '6', '4', 'system', 'im/message/system/index', '', 1, 0, 'C', '0', '0', 'im:systemMessage:list', 'category', 103, 1, sysdate(), null, null, 'IM系统消息'); +insert into sys_menu values('6201', '系统消息查询', '6', '1', '#', '', '', 1, 0, 'F', '0', '0', 'im:systemMessage:query', '#', 103, 1, sysdate(), null, null, ''); +insert into sys_menu values('6202', '系统消息添加', '6', '2', '#', '', '', 1, 0, 'F', '0', '0', 'im:systemMessage:add', '#', 103, 1, sysdate(), null, null, ''); +insert into sys_menu values('6203', '系统消息删除', '6', '3', '#', '', '', 1, 0, 'F', '0', '0', 'im:systemMessage:remove', '#', 103, 1, sysdate(), null, null, ''); +insert into sys_menu values('6204', '系统消息修改', '6', '4', '#', '', '', 1, 0, 'F', '0', '0', 'im:systemMessage:edit', '#', 103, 1, sysdate(), null, null, ''); + -- IM-敏感词管理 insert into sys_menu values('7', '敏感词管理', '0', '2', 'im/sensitiveWord', 'im/sensitiveWord/index', '', 1, 0, 'C', '0', '0', 'im:sensitiveWord:list', 'documentation', 103, 1, sysdate(), null, null, 'IM敏感词管理'); insert into sys_menu values('7001', '敏感词查询', '7', '1', '#', '', '', 1, 0, 'F', '0', '0', 'im:sensitiveWord:query', '#', 103, 1, sysdate(), null, null, ''); @@ -361,6 +368,8 @@ insert into sys_menu values('7003', '敏感词删除', '7', '3', '#', '', '', 1 insert into sys_menu values('7004', '敏感词修改', '7', '4', '#', '', '', 1, 0, 'F', '0', '0', 'im:sensitiveWord:edit', '#', 103, 1, sysdate(), null, null, ''); insert into sys_menu values('7005', '敏感词导出', '7', '5', '#', '', '', 1, 0, 'F', '0', '0', 'im:sensitiveWord:export', '#', 103, 1, sysdate(), null, null, ''); + + -- ---------------------------- -- 6、用户和角色关联表 用户N-1角色 -- ---------------------------- @@ -470,6 +479,8 @@ insert into sys_dict_type values(13, '000000', '布尔值', 'im_bool', 103, 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消息类型'); +insert into sys_dict_type values(17, '000000', '系统消息内容类型', 'im_sm_content_type', 103, 1, sysdate(), null, null, 'IM系统消息内容类型'); +insert into sys_dict_type values(18, '000000', '系统消息推送状态', 'im_sm_push_status', 103, 1, sysdate(), null, null, 'IM系统消息推送状态'); -- ---------------------------- @@ -545,6 +556,12 @@ insert into sys_dict_data values(51, '000000', 5, '视频', '4', 'im_messa 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, ''); +insert into sys_dict_data values(55, '000000', 1, '富文本', '0', 'im_sm_content_type', '', 'primary', 'N', 103, 1, sysdate(), null, null, ''); +insert into sys_dict_data values(56, '000000', 2, '外部链接', '1', 'im_sm_content_type', '', 'primary', 'N', 103, 1, sysdate(), null, null, ''); +insert into sys_dict_data values(57, '000000', 1, '待发送', '1', 'im_sm_push_status', '', 'warn', 'N', 103, 1, sysdate(), null, null, ''); +insert into sys_dict_data values(58, '000000', 2, '发送中', '2', 'im_sm_push_status', '', 'primary', 'N', 103, 1, sysdate(), null, null, ''); +insert into sys_dict_data values(59, '000000', 3, '已发送', '3', 'im_sm_push_status', '', 'success', 'N', 103, 1, sysdate(), null, null, ''); +insert into sys_dict_data values(60, '000000', 4, '已取消', '4', 'im_sm_push_status', '', 'danger', 'N', 103, 1, sysdate(), null, null, ''); -- ---------------------------- diff --git a/im-admin-ui/package.json b/im-admin-ui/package.json index 5c69acd..77479ff 100644 --- a/im-admin-ui/package.json +++ b/im-admin-ui/package.json @@ -16,8 +16,9 @@ "dependencies": { "@element-plus/icons-vue": "2.3.1", "@highlightjs/vue-plugin": "2.1.0", - "@vueup/vue-quill": "1.2.0", "@vueuse/core": "10.9.0", + "@wangeditor/editor": "^5.1.23", + "@wangeditor/editor-for-vue": "^5.1.12", "animate.css": "4.1.1", "await-to-js": "3.0.0", "axios": "1.6.8", @@ -31,6 +32,7 @@ "fuse.js": "7.0.0", "highlight.js": "11.9.0", "image-conversion": "^2.1.1", + "js-base64": "^3.7.7", "js-cookie": "3.0.5", "jsencrypt": "3.3.2", "nprogress": "0.2.0", @@ -62,10 +64,10 @@ "eslint": "8.57.0", "eslint-config-prettier": "9.1.0", "eslint-define-config": "2.1.0", + "eslint-plugin-import": "2.29.1", + "eslint-plugin-node": "11.1.0", "eslint-plugin-prettier": "5.1.3", "eslint-plugin-promise": "6.1.1", - "eslint-plugin-node": "11.1.0", - "eslint-plugin-import": "2.29.1", "eslint-plugin-vue": "9.23.0", "fast-glob": "3.3.2", "postcss": "8.4.36", diff --git a/im-admin-ui/src/api/im/systemMessage/types.ts b/im-admin-ui/src/api/im/systemMessage/types.ts index efc7055..9b435d4 100644 --- a/im-admin-ui/src/api/im/systemMessage/types.ts +++ b/im-admin-ui/src/api/im/systemMessage/types.ts @@ -34,20 +34,15 @@ export interface SystemMessageVO { */ externLink: string; - /** - * 删除标识 0:正常 1:已删除 - */ - deleted: number; - /** * 创建者 */ creator: number; - + /** - * 更新者 + * 创建者 */ - updater: number; + creatorName: string } diff --git a/im-admin-ui/src/components/Editor/index.vue b/im-admin-ui/src/components/Editor/index.vue index ba70fbb..bfad600 100644 --- a/im-admin-ui/src/components/Editor/index.vue +++ b/im-admin-ui/src/components/Editor/index.vue @@ -1,244 +1,88 @@ - +// 组件销毁时,也及时销毁编辑器 +onBeforeUnmount(() => { + const editor = editorRef.value + if (editor == null) { + return + } + console.log("onBeforeUnmount") + editor.destroy() +}) - + diff --git a/im-admin-ui/src/components/ImagePreview/index.vue b/im-admin-ui/src/components/ImagePreview/index.vue index e8950c3..5685f0c 100644 --- a/im-admin-ui/src/components/ImagePreview/index.vue +++ b/im-admin-ui/src/components/ImagePreview/index.vue @@ -1,5 +1,5 @@