新增短信服务等业务

This commit is contained in:
czx
2025-08-18 17:28:15 +08:00
parent ee869cf263
commit 2527fa6e48
44 changed files with 1732 additions and 158 deletions

View File

@@ -1,15 +1,14 @@
<h1> X-SpringBoot </h1>
![Image text](https://img.shields.io/badge/x--springboot-v6.0-green.svg)
![Image text](https://img.shields.io/badge/springboot-3.3.5-green.svg)
![Image text](https://img.shields.io/badge/MyBatis%20Plus-3.5.9-green.svg)
![Image text](https://img.shields.io/badge/springboot-3.5.4-green.svg)
![Image text](https://img.shields.io/badge/MyBatis%20Plus-3.5.12-green.svg)
[更新日志](https://github.com/yzcheng90/X-SpringBoot/tree/master/doc/updateLog.md) | [项目地址](https://github.com/yzcheng90) | [SpringCloud版本](https://github.com/yzcheng90/ms) |[前台项目地址](https://github.com/yzcheng90/x-springboot-ui)
**项目说明**
- X-SpringBoot 是一个轻量级的Java快速开发平台基于各大开源项目组合而来用于快速构建中小型API、RESTful API项目该项目已经有过多个真实项目的实践稳定、简单、快速使我们摆脱那些重复劳动。
## 项目说明
- X-SpringBoot 是一个轻量级的Java快速开发平台基于各大开源项目组合而来用于快速构建中小型API、RESTful API项目该项目已经有过多个真实企业级项目的实践稳定、简单、快速使我们摆脱那些重复劳动。
- 本项目已大量重构,精简了大量代码减少第三方依赖,最干净的脚手架。
- 引入了lombok 大量简化了代码
- 引入了MyBatis Plus 大量简化了SQL
@@ -19,25 +18,30 @@
- 前后端完全脱离,前端代码可单独部署
- 自定义Spring Security 支持获取token
- 新增RBAC接口级权限控制
- 【租户管理】,支持多租户数据管理
- 【应用管理】,可配置 appKey、appSecret针对开放API业务使用appKey、appSecret验证
- 【短信管理】可配置不同短信渠道商不断完善支持多模板支持appKey、appSecret验证
- 接下来继续丰富通用业务进行开源若有需求可提issues or contact the author
## 后台密码
- 账号密码admin/admin
**版本信息**
## 版本信息
- 核心框架Spring Boot 3.5.4
- 安全框架Spring Security 6.x
- 持久层框架MyBatis Plus 3.5.9
- 持久层框架MyBatis Plus 3.5.12
- 日志管理SLF4J 1.7、Log4j
- 页面交互Vue2.x
**环境**
## 环境
- jdk 21
- mysql 8.0
- redis
- nginx
**项目结构**
## 项目结构
```
X-SpringBoot
├─doc
@@ -61,6 +65,9 @@ X-SpringBoot
│ ├─oss 文件服务模块
│ ├─sys 权限模块
│ └─gen 代码生成
│ └─apk 安卓APK管理
│ └─application 应用管理
│ └─msg 短信
├─Application 项目启动类
@@ -70,16 +77,33 @@ X-SpringBoot
```
**系统截图**
## 系统部分截图
![Image text](https://github.com/yzcheng90/X-SpringBoot/blob/master/pic/20230122174113.png)
![Image text](https://github.com/yzcheng90/X-SpringBoot/blob/master/pic/20230122174148.png)
![Image text](https://github.com/yzcheng90/X-SpringBoot/blob/master/pic/20230122174204.png)
**最后**
## 学习交流
x-springboot 是完全开源免费的项目,目前仍然在优化迭代中,旨在帮助开发者更方便地进行快速敏捷开发,有使用问题欢迎在交流群内提问。
| Q群 | 微信群 | 作者微信 |
|:--------------------------------------------------------------------------------------------:|:------------------------------------------------------------------------------------------------:|:------------------------------------------------------------------------------------------:|
| <img src="https://github.com/yzcheng90/X-SpringBoot/blob/master/pic/qq_group.jpg" width=170> | <img src="https://github.com/yzcheng90/X-SpringBoot/blob/master/pic/wechat_group.jpg" width=170> | <img src="https://github.com/yzcheng90/X-SpringBoot/blob/master/pic/wechat.jpg" width=170> |
> 添加微信请注明来意
## 贡献
如果您发现了任何问题或有改进建议,请创建一个[issue](x-springboot/issues/new)或提交一个PR。我们欢迎您的贡献
## 支持
如果感觉本项目对你工作或学习有帮助请帮我点一个✨Star,这将是对我极大的鼓励与支持, 也可以在下方请我喝一杯咖啡
| 微信 | 支付宝 |
|:----------------------------------------------------------------------------------------------:|:------------------------------------------------------------------------------------------:|
| <img src="https://github.com/yzcheng90/X-SpringBoot/blob/master/pic/wechat_pay.jpg" width=170> | <img src="https://github.com/yzcheng90/X-SpringBoot/blob/master/pic/alipay.jpg" width=170> |
- 交流QQ群17470566
- 本人QQ913624256
- 如果喜欢记得star fork 谢谢您的关注 x-springboot会持续维护

View File

@@ -11,7 +11,7 @@
Target Server Version : 80040 (8.0.40)
File Encoding : 65001
Date: 19/04/2025 17:06:13
Date: 18/08/2025 17:25:12
*/
SET NAMES utf8mb4;
@@ -22,47 +22,40 @@ SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
DROP TABLE IF EXISTS `sys_log`;
CREATE TABLE `sys_log` (
`id` bigint NOT NULL AUTO_INCREMENT,
`username` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '用户名',
`operation` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '用户操作',
`method` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '请求方法',
`params` varchar(5000) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '请求参数',
`time` bigint NOT NULL COMMENT '执行时长(毫秒)',
`ip` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'IP地址',
`create_date` datetime NULL DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 147 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '系统日志' ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Records of sys_log
-- ----------------------------
INSERT INTO `sys_log` VALUES (1, 'admin', '修改定时任务', 'com.suke.czx.modules.job.controller.ScheduleJobController.update()', '{\"jobId\":1,\"beanName\":\"testTask\",\"methodName\":\"test\",\"params\":\"test\",\"cronExpression\":\"0 0/30 * * * ?\",\"status\":0,\"remark\":\"有参数测试\",\"createTime\":\"Dec 1, 2016 11:16:46 PM\"}', 78, '0:0:0:0:0:0:0:1', '2018-01-08 17:22:23');
INSERT INTO `sys_log` VALUES (2, 'sk', '用户登录', 'com.suke.czx.modules.sys.controller.SysLoginController.login()', '\"sk\"', 1713, '0:0:0:0:0:0:0:1', '2019-04-18 13:59:11');
INSERT INTO `sys_log` VALUES (3, 'sk', '用户登录', 'com.suke.czx.modules.sys.controller.SysLoginController.login()', '\"sk\"', 11, '0:0:0:0:0:0:0:1', '2019-04-18 13:59:43');
`id` bigint NOT NULL AUTO_INCREMENT,
`username` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '用户名',
`operation` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '用户操作',
`method` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '请求方法',
`params` varchar(5000) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '请求参数',
`time` bigint NOT NULL COMMENT '执行时长(毫秒)',
`ip` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'IP地址',
`create_date` datetime NULL DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 156 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '系统日志' ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Table structure for sys_menu_new
-- ----------------------------
DROP TABLE IF EXISTS `sys_menu_new`;
CREATE TABLE `sys_menu_new` (
`menu_id` int NOT NULL AUTO_INCREMENT COMMENT '菜单ID',
`parent_id` int NULL DEFAULT NULL COMMENT '菜单父ID',
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '路由名称',
`path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '路由路径',
`redirect` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '路由重定向,有子集 children 时',
`component` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '组件路径',
`title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '菜单名称',
`is_link` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '外链/内嵌时链接地址http:xxx.com开启外链条件`1、isLink: 链接地址不为空`',
`is_hide` int NULL DEFAULT NULL COMMENT '是否隐藏',
`is_keep_alive` int NULL DEFAULT NULL COMMENT '是否缓存',
`is_affix` int NULL DEFAULT NULL COMMENT '是否固定',
`is_iframe` int NULL DEFAULT NULL COMMENT '是否内嵌,开启条件,`1、isIframe:true 2、isLink链接地址不为空`',
`icon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '菜单图标',
`roles` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '权限标识',
`order_sort` int NULL DEFAULT NULL COMMENT '排序',
`disabled` int NULL DEFAULT NULL COMMENT '是否显示1显示0不显示',
PRIMARY KEY (`menu_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 52 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '菜单管理' ROW_FORMAT = Dynamic;
`menu_id` int NOT NULL AUTO_INCREMENT COMMENT '菜单ID',
`parent_id` int NULL DEFAULT NULL COMMENT '菜单父ID',
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '路由名称',
`path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '路由路径',
`redirect` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '路由重定向,有子集 children 时',
`component` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '组件路径',
`title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '菜单名称',
`is_link` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '外链/内嵌时链接地址http:xxx.com开启外链条件`1、isLink: 链接地址不为空`',
`is_hide` int NULL DEFAULT NULL COMMENT '是否隐藏',
`is_keep_alive` int NULL DEFAULT NULL COMMENT '是否缓存',
`is_affix` int NULL DEFAULT NULL COMMENT '是否固定',
`is_iframe` int NULL DEFAULT NULL COMMENT '是否内嵌,开启条件,`1、isIframe:true 2、isLink链接地址不为空`',
`icon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '菜单图标',
`roles` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '权限标识',
`order_sort` int NULL DEFAULT NULL COMMENT '排序',
`disabled` int NULL DEFAULT NULL COMMENT '是否显示1显示0不显示',
PRIMARY KEY (`menu_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 57 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '菜单管理' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of sys_menu_new
@@ -80,17 +73,22 @@ INSERT INTO `sys_menu_new` VALUES (31, 3, 'optionLog', '/optionLog', NULL, 'opti
INSERT INTO `sys_menu_new` VALUES (32, 3, 'loginLog', '/loginLog', NULL, 'loginLog/index', '登录日志', NULL, 0, 1, 0, 0, 'el-icon-tickets', 'admin', 2, 1);
INSERT INTO `sys_menu_new` VALUES (38, 2, 'apkVersion', '/apkVersion', NULL, 'apk/index', 'APK版本管理', NULL, 0, 1, 0, 0, 'iconfont icon-caidan', 'admin', 99, 1);
INSERT INTO `sys_menu_new` VALUES (50, 2, 'syspermission', '/syspermission', NULL, 'permission/index', '接口权限管理', NULL, 0, 1, 0, 0, 'iconfont icon-caidan', 'admin', 3, 1);
INSERT INTO `sys_menu_new` VALUES (51, 2, 'tenancy', '/tenancy', NULL, 'tenancy/index', '租户管理', NULL, 0, 1, 0, 0, 'iconfont icon-caidan', 'admin', 3, 1);
INSERT INTO `sys_menu_new` VALUES (51, 2, 'tenancy', '/tenancy', NULL, 'tenancy/defaultTenancyPage', '租户管理', NULL, 0, 1, 0, 0, 'iconfont icon-caidan', 'admin', 3, 1);
INSERT INTO `sys_menu_new` VALUES (52, 0, 'application', '/application', NULL, 'application/index', '应用服务', NULL, 0, 1, 0, 0, 'iconfont icon-caidan', 'admin', 4, 1);
INSERT INTO `sys_menu_new` VALUES (53, 0, 'msg', '/msg', '', 'layout/routerView/parent', '短信管理', NULL, 0, 1, 0, 0, 'iconfont icon-xitongshezhi', 'admin', 2, 1);
INSERT INTO `sys_menu_new` VALUES (54, 53, 'msgRecord', '/msgRecord', NULL, 'msg/record', '短信发送记录', NULL, 0, 1, 0, 0, 'iconfont icon-caidan', 'admin', 4, 1);
INSERT INTO `sys_menu_new` VALUES (55, 53, 'msgService', '/msgService', NULL, 'msg/service', '短信服务', NULL, 0, 1, 0, 0, 'iconfont icon-caidan', 'admin', 1, 1);
INSERT INTO `sys_menu_new` VALUES (56, 53, 'msgTemplate', '/msgTemplate', NULL, 'msg/template', '短信模板', NULL, 0, 1, 0, 0, 'iconfont icon-caidan', 'admin', 2, 1);
-- ----------------------------
-- Table structure for sys_oss
-- ----------------------------
DROP TABLE IF EXISTS `sys_oss`;
CREATE TABLE `sys_oss` (
`id` bigint NOT NULL AUTO_INCREMENT,
`url` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'URL地址',
`create_date` datetime NULL DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE
`id` bigint NOT NULL AUTO_INCREMENT,
`url` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'URL地址',
`create_date` datetime NULL DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '文件上传' ROW_FORMAT = DYNAMIC;
-- ----------------------------
@@ -102,14 +100,14 @@ CREATE TABLE `sys_oss` (
-- ----------------------------
DROP TABLE IF EXISTS `sys_permission`;
CREATE TABLE `sys_permission` (
`permission_id` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '权限ID',
`name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '权限名称',
`english_name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '英文名称',
`url` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'URL',
`module_name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '模块名称',
`delete_status` int NULL DEFAULT NULL COMMENT '删除状态',
`menu_id` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '菜单ID',
PRIMARY KEY (`permission_id`) USING BTREE
`permission_id` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '权限ID',
`name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '权限名称',
`english_name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '英文名称',
`url` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'URL',
`module_name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '模块名称',
`delete_status` int NULL DEFAULT NULL COMMENT '删除状态',
`menu_id` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '菜单ID',
PRIMARY KEY (`permission_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '接口权限管理' ROW_FORMAT = Dynamic;
-- ----------------------------
@@ -143,12 +141,12 @@ INSERT INTO `sys_permission` VALUES ('fdd86d3d-49ad-4d3a-b78b-e9426944bb84', '
-- ----------------------------
DROP TABLE IF EXISTS `sys_role`;
CREATE TABLE `sys_role` (
`role_id` bigint NOT NULL AUTO_INCREMENT,
`role_name` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '角色名称',
`remark` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '备注',
`create_user_id` bigint NULL DEFAULT NULL COMMENT '创建者ID',
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`role_id`) USING BTREE
`role_id` bigint NOT NULL AUTO_INCREMENT,
`role_name` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '角色名称',
`remark` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '备注',
`create_user_id` bigint NULL DEFAULT NULL COMMENT '创建者ID',
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`role_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 9 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '角色' ROW_FORMAT = DYNAMIC;
-- ----------------------------
@@ -162,10 +160,10 @@ INSERT INTO `sys_role` VALUES (5, '测试', '测试', 0, '2019-12-26 16:51:37');
-- ----------------------------
DROP TABLE IF EXISTS `sys_role_menu`;
CREATE TABLE `sys_role_menu` (
`id` bigint NOT NULL AUTO_INCREMENT,
`role_id` bigint NULL DEFAULT NULL COMMENT '角色ID',
`menu_id` bigint NULL DEFAULT NULL COMMENT '菜单ID',
PRIMARY KEY (`id`) USING BTREE
`id` bigint NOT NULL AUTO_INCREMENT,
`role_id` bigint NULL DEFAULT NULL COMMENT '角色ID',
`menu_id` bigint NULL DEFAULT NULL COMMENT '菜单ID',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 95 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '角色与菜单对应关系' ROW_FORMAT = DYNAMIC;
-- ----------------------------
@@ -184,10 +182,10 @@ INSERT INTO `sys_role_menu` VALUES (94, 5, 50);
-- ----------------------------
DROP TABLE IF EXISTS `sys_role_permission`;
CREATE TABLE `sys_role_permission` (
`permission_id` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '权限ID',
`role_id` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '角色ID',
PRIMARY KEY (`permission_id`, `role_id`) USING BTREE,
INDEX `index_1`(`role_id` ASC) USING BTREE
`permission_id` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '权限ID',
`role_id` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '角色ID',
PRIMARY KEY (`permission_id`, `role_id`) USING BTREE,
INDEX `index_1`(`role_id` ASC) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '权限和角色关联' ROW_FORMAT = Dynamic;
-- ----------------------------
@@ -221,19 +219,19 @@ INSERT INTO `sys_role_permission` VALUES ('fdd86d3d-49ad-4d3a-b78b-e9426944bb84'
-- ----------------------------
DROP TABLE IF EXISTS `sys_user`;
CREATE TABLE `sys_user` (
`user_id` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
`username` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '用户名',
`password` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '密码',
`email` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '邮箱',
`mobile` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '手机号',
`status` tinyint NULL DEFAULT NULL COMMENT '状态 0禁用 1正常',
`create_user_id` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '创建者ID',
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
`photo` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '头像',
`name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '姓名',
`tenancy_id` int NULL DEFAULT NULL COMMENT '租户ID',
PRIMARY KEY (`user_id`) USING BTREE,
UNIQUE INDEX `username`(`username` ASC) USING BTREE
`user_id` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
`username` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '用户名',
`password` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '密码',
`email` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '邮箱',
`mobile` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '手机号',
`status` tinyint NULL DEFAULT NULL COMMENT '状态 0禁用 1正常',
`create_user_id` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '创建者ID',
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
`photo` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '头像',
`name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '姓名',
`tenancy_id` int NULL DEFAULT NULL COMMENT '租户ID',
PRIMARY KEY (`user_id`) USING BTREE,
UNIQUE INDEX `username`(`username` ASC) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '系统用户' ROW_FORMAT = DYNAMIC;
-- ----------------------------
@@ -247,10 +245,10 @@ INSERT INTO `sys_user` VALUES ('53e3215ed12b227b59b6b3b9e9efb984', 'test', '$2a$
-- ----------------------------
DROP TABLE IF EXISTS `sys_user_role`;
CREATE TABLE `sys_user_role` (
`id` bigint NOT NULL AUTO_INCREMENT,
`user_id` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '用户ID',
`role_id` bigint NULL DEFAULT NULL COMMENT '角色ID',
PRIMARY KEY (`id`) USING BTREE
`id` bigint NOT NULL AUTO_INCREMENT,
`user_id` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '用户ID',
`role_id` bigint NULL DEFAULT NULL COMMENT '角色ID',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '用户与角色对应关系' ROW_FORMAT = DYNAMIC;
-- ----------------------------
@@ -263,23 +261,23 @@ INSERT INTO `sys_user_role` VALUES (4, '53e3215ed12b227b59b6b3b9e9efb984', 5);
-- ----------------------------
DROP TABLE IF EXISTS `tb_apk_version`;
CREATE TABLE `tb_apk_version` (
`id` bigint NOT NULL AUTO_INCREMENT,
`update_content` varchar(2000) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '更新内容',
`version_code` int NULL DEFAULT NULL COMMENT '版本码',
`version_name` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '版本号',
`package_name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '包名',
`download_url` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '下载地址',
`app_name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'APP名',
`md5_value` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'MD5值',
`file_name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '文件名',
`file_size` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '文件大小',
`create_time` datetime NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` datetime NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
`user_id` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '上传人',
`is_force` tinyint NULL DEFAULT NULL COMMENT '是否强制安装',
`is_ignorable` tinyint NULL DEFAULT NULL COMMENT '是否可忽略该版本',
`is_silent` tinyint NULL DEFAULT NULL COMMENT '是否静默下载',
PRIMARY KEY (`id`) USING BTREE
`id` bigint NOT NULL AUTO_INCREMENT,
`update_content` varchar(2000) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '更新内容',
`version_code` int NULL DEFAULT NULL COMMENT '版本码',
`version_name` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '版本号',
`package_name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '包名',
`download_url` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '下载地址',
`app_name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'APP名',
`md5_value` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'MD5值',
`file_name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '文件名',
`file_size` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '文件大小',
`create_time` datetime NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` datetime NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
`user_id` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '上传人',
`is_force` tinyint NULL DEFAULT NULL COMMENT '是否强制安装',
`is_ignorable` tinyint NULL DEFAULT NULL COMMENT '是否可忽略该版本',
`is_silent` tinyint NULL DEFAULT NULL COMMENT '是否静默下载',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = 'APK版本管理' ROW_FORMAT = Dynamic;
-- ----------------------------
@@ -292,43 +290,164 @@ INSERT INTO `tb_apk_version` VALUES (3, '新增v1.0.0版本', 445, '4.4.5', 'com
-- ----------------------------
DROP TABLE IF EXISTS `tb_login_log`;
CREATE TABLE `tb_login_log` (
`log_id` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '登录日志ID',
`username` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '用户名',
`option_name` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '操作',
`option_time` datetime NULL DEFAULT NULL COMMENT '操作时间',
`option_ip` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '操作IP',
`option_terminal` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '操作终端',
PRIMARY KEY (`log_id`) USING BTREE
`log_id` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '登录日志ID',
`username` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '用户名',
`option_name` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '操作',
`option_time` datetime NULL DEFAULT NULL COMMENT '操作时间',
`option_ip` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '操作IP',
`option_terminal` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '操作终端',
PRIMARY KEY (`log_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '登录日志管理' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of tb_login_log
-- ----------------------------
INSERT INTO `tb_login_log` VALUES ('0245e652cc050e6a389b9e9d67dce4d0', 'admin', '用户登录成功', '2024-11-20 14:45:46', '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36');
INSERT INTO `tb_login_log` VALUES ('02a8518ac0cb5241ab2a543d536059a9', 'admin', '用户退出成功', '2023-01-23 15:44:07', '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36');
-- ----------------------------
-- Table structure for tb_platform_tenancy
-- ----------------------------
DROP TABLE IF EXISTS `tb_platform_tenancy`;
CREATE TABLE `tb_platform_tenancy` (
`tenancy_id` int NOT NULL AUTO_INCREMENT COMMENT '渠道ID',
`tenancy_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '渠道名称',
`tenancy_remark` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '渠道备注',
`discount` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '折扣',
`ex` varchar(5000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '广告位配置',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
`tenancy_pid` bigint NULL DEFAULT NULL COMMENT '父级租户ID',
`is_default` int NULL DEFAULT NULL COMMENT '是否默认租户(只能设置一个)',
`is_delete` int NULL DEFAULT 0 COMMENT '是否删除(0否 1 是)',
`update_data` int NULL DEFAULT 0 COMMENT '是否更新数据10',
`user_id` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人ID',
PRIMARY KEY (`tenancy_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '渠道管理' ROW_FORMAT = Dynamic;
`tenancy_id` int NOT NULL AUTO_INCREMENT COMMENT '渠道ID',
`tenancy_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '渠道名称',
`tenancy_remark` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '渠道备注',
`discount` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '折扣',
`ex` varchar(5000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '广告位配置',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
`tenancy_pid` bigint NULL DEFAULT NULL COMMENT '父级租户ID',
`is_default` int NULL DEFAULT NULL COMMENT '是否默认租户(只能设置一个)',
`is_delete` int NULL DEFAULT 0 COMMENT '是否删除(0否 1 是)',
`update_data` int NULL DEFAULT 0 COMMENT '是否更新数据10',
`user_id` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人ID',
PRIMARY KEY (`tenancy_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '渠道管理' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of tb_platform_tenancy
-- ----------------------------
INSERT INTO `tb_platform_tenancy` VALUES (1, '1', '1', NULL, NULL, '2025-04-19 14:56:18', NULL, 0, 1, 0, NULL);
INSERT INTO `tb_platform_tenancy` VALUES (2, '皮皮渠道', '皮皮渠道', NULL, NULL, '2025-08-15 17:54:26', NULL, 0, 0, 0, '0');
-- ----------------------------
-- Table structure for x_application
-- ----------------------------
DROP TABLE IF EXISTS `x_application`;
CREATE TABLE `x_application` (
`app_id` int NOT NULL AUTO_INCREMENT COMMENT '应用ID',
`app_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '应用名称',
`app_key` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'AppKey',
`app_secret` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'AppSecret',
`is_enable` int NULL DEFAULT NULL COMMENT '是否可用1可用0不可用',
`tenancy_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '租户ID',
PRIMARY KEY (`app_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '应用服务' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of x_application
-- ----------------------------
INSERT INTO `x_application` VALUES (1, '皮皮虾', '6f7d3d8e5ec4af3bfb29fad6219fee99', '237271194510e1fea9b1765de4c4fcca', 1, '2');
-- ----------------------------
-- Table structure for x_message_service
-- ----------------------------
DROP TABLE IF EXISTS `x_message_service`;
CREATE TABLE `x_message_service` (
`service_id` int NOT NULL AUTO_INCREMENT COMMENT '服务ID',
`service_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '服务名称',
`service_url` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '接口URL',
`product_id` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '产品ID',
`app_key` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'AppKey',
`app_secret` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'AppSecret',
`app_code` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'AppCode',
`default_template` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '默认模板',
`is_enable` int NULL DEFAULT NULL COMMENT '是否使用1使用0未使用',
`service_class` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '服务实现类地址',
`tenancy_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '租户ID',
`app_id` int NULL DEFAULT NULL COMMENT '应用ID',
`is_default` int NULL DEFAULT NULL COMMENT '同租户下只能有一个默认服务1是0否',
PRIMARY KEY (`service_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '短信服务' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of x_message_service
-- ----------------------------
INSERT INTO `x_message_service` VALUES (1, '阿里云New', 'https://cxkjsms.market.alicloudapi.com/chuangxinsms/dxjk', '', 'xxxx', 'xxxx', 'xxxx', '【皮皮虾】您的验证码为:#code有效期5分钟请确保是本人操作不要把验证码泄露给其他人。', 1, 'com.suke.czx.modules.msg.component.AliyunNewSendMessageComponent', '2', 1, 1);
-- ----------------------------
-- Table structure for x_message_service_send_record
-- ----------------------------
DROP TABLE IF EXISTS `x_message_service_send_record`;
CREATE TABLE `x_message_service_send_record` (
`record_id` int NOT NULL AUTO_INCREMENT COMMENT '记录ID',
`record_year` int NULL DEFAULT NULL COMMENT '',
`record_month` int NULL DEFAULT NULL COMMENT '',
`record_day` int NULL DEFAULT NULL COMMENT '',
`send_mobile` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '手机号',
`send_content` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '内容',
`send_status` int NULL DEFAULT NULL COMMENT '发送状态',
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
`tenancy_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '租户ID',
`send_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '发送类型',
`send_source` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '发送来源',
`service_id` int NULL DEFAULT NULL COMMENT '服务ID',
`template_id` int NULL DEFAULT NULL COMMENT '模板ID',
`app_id` int NULL DEFAULT NULL COMMENT '应用ID',
PRIMARY KEY (`record_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '短信发送记录(按月分表)' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for x_message_service_send_record_2025_08
-- ----------------------------
DROP TABLE IF EXISTS `x_message_service_send_record_2025_08`;
CREATE TABLE `x_message_service_send_record_2025_08` (
`record_id` int NOT NULL AUTO_INCREMENT COMMENT '记录ID',
`record_year` int NULL DEFAULT NULL COMMENT '',
`record_month` int NULL DEFAULT NULL COMMENT '',
`record_day` int NULL DEFAULT NULL COMMENT '',
`send_mobile` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '手机号',
`send_content` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '内容',
`send_status` int NULL DEFAULT NULL COMMENT '发送状态',
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
`tenancy_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '租户ID',
`send_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '发送类型',
`send_source` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '发送来源',
`service_id` int NULL DEFAULT NULL COMMENT '服务ID',
`template_id` int NULL DEFAULT NULL COMMENT '模板ID',
`app_id` int NULL DEFAULT NULL COMMENT '应用ID',
PRIMARY KEY (`record_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '短信发送记录(按月分表)' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of x_message_service_send_record_2025_08
-- ----------------------------
-- ----------------------------
-- Table structure for x_message_service_template
-- ----------------------------
DROP TABLE IF EXISTS `x_message_service_template`;
CREATE TABLE `x_message_service_template` (
`template_id` int NOT NULL AUTO_INCREMENT COMMENT '模板ID',
`template_type` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '模板类型(预留,比如验证码,营销)',
`template_content` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '模板内容',
`is_enable` int NULL DEFAULT NULL COMMENT '是否启用1启动0禁用',
`remark` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
`tenancy_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '租户ID',
PRIMARY KEY (`template_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '短信模板' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of x_message_service_template
-- ----------------------------
INSERT INTO `x_message_service_template` VALUES (2, '验证码', '【皮皮虾】您的验证码是:#code有效期5分钟请勿泄露于他人', 1, '登录注册使用', '2');
-- ----------------------------
-- Table structure for x_message_service_template_config
-- ----------------------------
DROP TABLE IF EXISTS `x_message_service_template_config`;
CREATE TABLE `x_message_service_template_config` (
`service_id` int NOT NULL COMMENT '服务ID',
`template_id` int NOT NULL COMMENT '模板ID',
PRIMARY KEY (`service_id`, `template_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '短信模板配置' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of x_message_service_template_config
-- ----------------------------
SET FOREIGN_KEY_CHECKS = 1;

BIN
pic/alipay.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 KiB

BIN
pic/qq_group.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

BIN
pic/wechat.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 KiB

BIN
pic/wechat_group.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 KiB

BIN
pic/wechat_pay.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

View File

@@ -3,8 +3,10 @@ package com.suke.czx;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;
@Slf4j
@EnableScheduling
@SpringBootApplication
public class Application {

View File

@@ -8,7 +8,7 @@ import java.lang.annotation.*;
* @email yzcheng90@qq.com
* @date 2017-03-23 15:44
*/
@Target(ElementType.METHOD)
@Target({ElementType.TYPE,ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface AuthIgnore {

View File

@@ -1,16 +1,20 @@
package com.suke.czx.common.base;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.suke.czx.authentication.detail.CustomUserDetailsUser;
import com.suke.czx.common.utils.HttpContextUtils;
import com.suke.czx.common.utils.MPPageConvert;
import com.suke.czx.common.utils.UserUtil;
import com.suke.czx.modules.tenancy.entity.TbPlatformTenancy;
import com.suke.czx.modules.tenancy.entity.TenancyBase;
import com.suke.czx.modules.tenancy.service.TbPlatformTenancyService;
import jakarta.annotation.Resource;
import lombok.SneakyThrows;
import java.util.List;
import java.util.Map;
/**
@@ -54,9 +58,6 @@ public abstract class AbstractController {
/**
* 优先从参数获取租户
*
* @param params
* @return
*/
public String getTenancyId(Map<String, Object> params) {
String tenancyId = MapUtil.getStr(params, "tenancyId");
@@ -74,8 +75,6 @@ public abstract class AbstractController {
/**
* 优先从请求头获取租户
*
* @return
*/
public String getTenancyId() {
String tenancyId = HttpContextUtils.getHttpServletRequest().getHeader("tenancyId");
@@ -90,10 +89,32 @@ public abstract class AbstractController {
/**
* 获取默认租户
*
* @return
*/
public TbPlatformTenancy getDefaultTenancy() {
return tbPlatformTenancyService.getDefaultTenancy();
}
/**
* 填充租户信息
*/
public void fullTenancyInfo(List<? extends TenancyBase> list) {
if (CollUtil.isNotEmpty(list)) {
list.forEach(this::fullTenancyInfo);
}
}
public void fullTenancyInfo(IPage<? extends TenancyBase> listPage) {
if (CollUtil.isNotEmpty(listPage.getRecords())) {
this.fullTenancyInfo(listPage.getRecords());
}
}
public void fullTenancyInfo(TenancyBase info) {
if (info.getTenancyId() != null) {
TbPlatformTenancy tenancy = tbPlatformTenancyService.getById(info.getTenancyId());
if (tenancy != null) {
info.setTenancyName(tenancy.getTenancyName());
}
}
}
}

View File

@@ -1,12 +0,0 @@
package com.suke.czx.common.shardingtable;
import java.lang.annotation.*;
/**
* 分表注解
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.ANNOTATION_TYPE})
public @interface ShardingTable {
}

View File

@@ -0,0 +1,12 @@
package com.suke.czx.modules.application.annotation;
import com.suke.czx.common.annotation.AuthIgnore;
import java.lang.annotation.*;
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@AuthIgnore
public @interface ApplicationAuth {
}

View File

@@ -0,0 +1,55 @@
package com.suke.czx.modules.application.annotation;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.suke.czx.common.exception.RRException;
import com.suke.czx.common.utils.HttpContextUtils;
import com.suke.czx.modules.application.entity.XApplication;
import com.suke.czx.modules.application.service.XApplicationService;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletRequest;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;
/**
* 验证app的appKey和appSecret
*/
@Slf4j
@Aspect
@Component
public class ApplicationAuthAspect {
@Resource
public XApplicationService xApplicationService;
@Pointcut("@annotation(com.suke.czx.modules.application.annotation.ApplicationAuth)")
public void queryMethod() {
}
@Before("queryMethod()")
public void beforeAdvice(JoinPoint joinPoint) {
// 获取方法名称和参数
HttpServletRequest request = HttpContextUtils.getHttpServletRequest();
String appKey = request.getHeader("appKey");
String appSecret = request.getHeader("appSecret");
if (StrUtil.isEmpty(appKey) || StrUtil.isEmpty(appSecret)) {
throw new RRException("认证错误");
}
XApplication application = xApplicationService.getOne(Wrappers.<XApplication>lambdaQuery().eq(XApplication::getAppKey, appKey).eq(XApplication::getAppSecret, appSecret).last("limit 1"));
if (application == null) {
throw new RRException("认证错误");
}
}
@After("queryMethod()")
public void afterAdvice(JoinPoint joinPoint) {
}
}

View File

@@ -0,0 +1,101 @@
package com.suke.czx.modules.application.controller;
import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.SecureUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.suke.czx.common.annotation.AuthIgnore;
import com.suke.czx.common.annotation.ResourceAuth;
import com.suke.czx.common.annotation.SysLog;
import com.suke.czx.common.base.AbstractController;
import com.suke.czx.common.utils.R;
import com.suke.czx.modules.application.entity.XApplication;
import com.suke.czx.modules.application.service.XApplicationService;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
* 应用服务
*
* @author czx
* @email object_czx@163.com
* @date 2025-08-15 16:34:08
*/
@RestController
@AllArgsConstructor
@RequestMapping("/application/manager")
@Tag(name = "XApplicationController", description = "应用服务")
public class XApplicationController extends AbstractController {
private final XApplicationService xApplicationService;
/**
* 列表
*/
@GetMapping("/list")
@ResourceAuth(value = "应用服务列表", module = "应用服务")
public R list(@RequestParam Map<String, Object> params) {
//查询列表数据
QueryWrapper<XApplication> queryWrapper = new QueryWrapper<>();
final String keyword = mpPageConvert.getKeyword(params);
if (StrUtil.isNotEmpty(keyword)) {
}
IPage<XApplication> listPage = xApplicationService.page(mpPageConvert.<XApplication>pageParamConvert(params), queryWrapper);
return R.ok().setData(listPage);
}
@AuthIgnore
@GetMapping("/generateKey")
public R generateKey() {
String string = SecureUtil.md5(String.valueOf(System.currentTimeMillis()));
return R.ok().setData(string);
}
@AuthIgnore
@GetMapping("/select")
public R select() {
List<XApplication> list = xApplicationService.list();
return R.ok().setData(list);
}
/**
* 新增应用服务
*/
@SysLog("新增应用服务数据")
@PostMapping("/save")
@ResourceAuth(value = "新增应用服务数据", module = "应用服务")
public R save(@RequestBody XApplication param) {
xApplicationService.save(param);
return R.ok();
}
/**
* 修改
*/
@SysLog("修改应用服务数据")
@PostMapping("/update")
@ResourceAuth(value = "修改应用服务数据", module = "应用服务")
public R update(@RequestBody XApplication param) {
xApplicationService.updateById(param);
return R.ok();
}
/**
* 删除
*/
@SysLog("删除应用服务数据")
@PostMapping("/delete")
@ResourceAuth(value = "删除应用服务数据", module = "应用服务")
public R delete(@RequestBody XApplication param) {
xApplicationService.removeById(param.getAppId());
return R.ok();
}
}

View File

@@ -0,0 +1,52 @@
package com.suke.czx.modules.application.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
/**
* 应用服务
*
* @author czx
* @email object_czx@163.com
* @date 2025-08-15 16:34:08
*/
@Data
@TableName("x_application")
public class XApplication implements Serializable {
public static final long serialVersionUID = 1L;
@TableId(type = IdType.AUTO)
@Schema(description = "应用ID")
@JsonProperty(value = "appId")
public Integer appId;
@Schema(description = "AppKey")
@JsonProperty(value = "appKey")
public String appKey;
@Schema(description = "应用名称")
@JsonProperty(value = "appName")
public String appName;
@Schema(description = "AppSecret")
@JsonProperty(value = "appSecret")
public String appSecret;
@Schema(description = "是否可用1可用0不可用")
@JsonProperty(value = "isEnable")
public Integer isEnable;
@Schema(description = "租户ID")
@JsonProperty(value = "tenancyId")
public String tenancyId;
}

View File

@@ -0,0 +1,15 @@
package com.suke.czx.modules.application.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.suke.czx.modules.application.entity.XApplication;
/**
* 应用服务
*
* @author czx
* @email object_czx@163.com
* @date 2025-08-15 16:34:08
*/
public interface XApplicationMapper extends BaseMapper<XApplication> {
}

View File

@@ -0,0 +1,16 @@
package com.suke.czx.modules.application.service;
import com.suke.czx.modules.application.entity.XApplication;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 应用服务
*
* @author czx
* @email object_czx@163.com
* @date 2025-08-15 16:34:08
*/
public interface XApplicationService extends IService<XApplication> {
}

View File

@@ -0,0 +1,20 @@
package com.suke.czx.modules.application.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import com.suke.czx.modules.application.mapper.XApplicationMapper;
import com.suke.czx.modules.application.entity.XApplication;
import com.suke.czx.modules.application.service.XApplicationService;
/**
* 应用服务
*
* @author czx
* @email object_czx@163.com
* @date 2025-08-15 16:34:08
*/
@Service
public class XApplicationServiceImpl extends ServiceImpl<XApplicationMapper, XApplication> implements XApplicationService {
}

View File

@@ -0,0 +1,38 @@
package com.suke.czx.modules.msg.api;
import com.suke.czx.common.base.AbstractController;
import com.suke.czx.common.utils.R;
import com.suke.czx.modules.application.annotation.ApplicationAuth;
import com.suke.czx.modules.msg.entity.SendMsg;
import com.suke.czx.modules.msg.service.XMessageServiceSendRecordService;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 短信服务
*
* @author czx
* @email object_czx@163.com
* @date 2025-08-15 17:51:27
*/
@RestController
@AllArgsConstructor
@RequestMapping("/api/msg/service")
@Tag(name = "XMessageServiceController", description = "短信服务")
public class ApiXMessageServiceController extends AbstractController {
private final XMessageServiceSendRecordService xMessageServiceSendRecordService;
@ApplicationAuth
@PostMapping("/send")
public R list(@RequestBody SendMsg params) {
boolean bool = xMessageServiceSendRecordService.autoServiceSendMessage(params);
return R.ok().setData(bool);
}
}

View File

@@ -0,0 +1,60 @@
package com.suke.czx.modules.msg.component;
import cn.hutool.core.net.URLEncodeUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpResponse;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.suke.czx.modules.msg.component.entity.MessageBody;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.Map;
/**
* @author czx
* @title: SendMessageComponent
* @projectName task-manage
* @description: https://market.aliyun.com/apimarket/detail/cmapi029993
* @date 2023/1/2917:08
*/
@Slf4j
@Component
public class AliyunNewSendMessageComponent extends SendMessageAbstract {
@Override
public boolean sendMessage(MessageBody messageBody) {
String url = messageBody.getServiceUrl();
String mobile = messageBody.getMobile();
String code = messageBody.getCode();
String appCode = messageBody.getAppCode();
String message = messageBody.getTemplate().replaceAll("#code", code);
String host = url + "?mobile=" + mobile + "&content=" + URLEncodeUtil.encode(message);
Map<String, String> headers = new HashMap<>();
//最后在header中的格式(中间是英文空格)为Authorization:APPCODE 83359fd73fe94948385f570e3c139105
headers.put("Authorization", "APPCODE " + appCode);
try {
HttpResponse response = HttpUtil
.createPost(host)
.headerMap(headers, true)
.execute();
String body = response.body();
JSONObject entries = JSONUtil.parseObj(body);
String returnStatus = entries.getStr("ReturnStatus");
if (StrUtil.isEmpty(returnStatus) || returnStatus.equals("Faild")) {
this.sendMessageFail(messageBody, entries.getStr("Message"));
} else {
log.info("短信发送成功:{},任务ID{}", message, entries.getStr("TaskID"));
return true;
}
} catch (Exception e) {
this.sendMessageFail(messageBody, e.getMessage());
}
return false;
}
}

View File

@@ -0,0 +1,9 @@
package com.suke.czx.modules.msg.component;
import com.suke.czx.modules.msg.component.entity.MessageBody;
public interface SendMessage {
boolean sendMessage(MessageBody messageBody);
}

View File

@@ -0,0 +1,19 @@
package com.suke.czx.modules.msg.component;
import com.suke.czx.modules.msg.component.entity.MessageBody;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public abstract class SendMessageAbstract implements SendMessage {
/**
* 发送短信失败
* @param messageBody 短信参数
* @param errorInfo 错误信息
*/
public void sendMessageFail(MessageBody messageBody, String errorInfo){
log.error("短信发送失败:{}", errorInfo);
//FeishuNoticeComponent.sendErrorNotice(entries.getStr("Message"));
}
}

View File

@@ -0,0 +1,16 @@
package com.suke.czx.modules.msg.component.entity;
import com.suke.czx.modules.msg.entity.XMessageService;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = true)
public class MessageBody extends XMessageService {
public String mobile;
public String code;
public String template;
}

View File

@@ -0,0 +1,99 @@
package com.suke.czx.modules.msg.controller;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.suke.czx.common.annotation.ResourceAuth;
import com.suke.czx.common.annotation.SysLog;
import com.suke.czx.common.base.AbstractController;
import com.suke.czx.common.utils.R;
import com.suke.czx.modules.msg.entity.XMessageService;
import com.suke.czx.modules.msg.service.XMessageServiceService;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
/**
* 短信服务
*
* @author czx
* @email object_czx@163.com
* @date 2025-08-15 17:51:27
*/
@RestController
@AllArgsConstructor
@RequestMapping("/msg/service")
@Tag(name = "XMessageServiceController", description = "短信服务")
public class XMessageServiceController extends AbstractController {
private final XMessageServiceService xMessageServiceService;
/**
* 列表
*/
@GetMapping("/list")
@ResourceAuth(value = "短信服务列表", module = "短信服务")
public R list(@RequestParam Map<String, Object> params) {
//查询列表数据
QueryWrapper<XMessageService> queryWrapper = new QueryWrapper<>();
final String keyword = mpPageConvert.getKeyword(params);
if (StrUtil.isNotEmpty(keyword)) {
queryWrapper.lambda().and(func -> func.like(XMessageService::getServiceName, keyword).or().eq(XMessageService::getDefaultTemplate, keyword));
}
String tenancyId = MapUtil.getStr(params, "tenancyId");
if (StrUtil.isNotEmpty(tenancyId)) {
queryWrapper.lambda().eq(XMessageService::getTenancyId, tenancyId);
}
IPage<XMessageService> listPage = xMessageServiceService.page(mpPageConvert.<XMessageService>pageParamConvert(params), queryWrapper);
this.fullTenancyInfo(listPage);
return R.ok().setData(listPage);
}
/**
* 新增短信服务
*/
@SysLog("新增短信服务数据")
@PostMapping("/save")
@ResourceAuth(value = "新增短信服务数据", module = "短信服务")
public R save(@RequestBody XMessageService param) {
xMessageServiceService.saveInfo(param);
return R.ok();
}
/**
* 修改
*/
@SysLog("修改短信服务数据")
@PostMapping("/update")
@ResourceAuth(value = "修改短信服务数据", module = "短信服务")
public R update(@RequestBody XMessageService param) {
if (param.getServiceId() == null) {
return R.error("服务ID为空");
}
xMessageServiceService.updateInfo(param);
return R.ok();
}
/**
* 删除
*/
@SysLog("删除短信服务数据")
@PostMapping("/delete")
@ResourceAuth(value = "删除短信服务数据", module = "短信服务")
public R delete(@RequestBody XMessageService param) {
if (param.getServiceId() == null) {
return R.error("服务ID为空");
}
xMessageServiceService.deleteInfo(param);
return R.ok();
}
}

View File

@@ -0,0 +1,63 @@
package com.suke.czx.modules.msg.controller;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.suke.czx.common.annotation.ResourceAuth;
import com.suke.czx.common.base.AbstractController;
import com.suke.czx.common.shardingtable.ShardingQueryData;
import com.suke.czx.common.utils.R;
import com.suke.czx.modules.msg.entity.XMessageServiceSendRecord;
import com.suke.czx.modules.msg.service.XMessageServiceSendRecordService;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
/**
* 短信发送记录(按月分表)
*
* @author czx
* @email object_czx@163.com
* @date 2025-08-15 17:40:53
*/
@RestController
@AllArgsConstructor
@RequestMapping("/msg/record")
@Tag(name = "XMessageServiceSendRecordController", description = "短信发送记录(按月分表)")
public class XMessageServiceSendRecordController extends AbstractController {
private final XMessageServiceSendRecordService xMessageServiceSendRecordService;
/**
* 列表
*/
@ShardingQueryData(tableEntity = XMessageServiceSendRecord.class)
@GetMapping("/list")
@ResourceAuth(value = "短信发送记录(按月分表)列表", module = "短信发送记录(按月分表)")
public R list(@RequestParam Map<String, Object> params) {
//查询列表数据
QueryWrapper<XMessageServiceSendRecord> queryWrapper = new QueryWrapper<>();
final String keyword = mpPageConvert.getKeyword(params);
if (StrUtil.isNotEmpty(keyword)) {
queryWrapper.lambda().and(func -> {
func.like(XMessageServiceSendRecord::getSendContent, keyword).or().eq(XMessageServiceSendRecord::getSendMobile, keyword);
});
}
String tenancyId = MapUtil.getStr(params, "tenancyId");
if (StrUtil.isNotEmpty(tenancyId)) {
queryWrapper.lambda().eq(XMessageServiceSendRecord::getTenancyId, tenancyId);
}
IPage<XMessageServiceSendRecord> listPage = xMessageServiceSendRecordService.page(mpPageConvert.<XMessageServiceSendRecord>pageParamConvert(params), queryWrapper);
this.fullTenancyInfo(listPage);
return R.ok().setData(listPage);
}
}

View File

@@ -0,0 +1,121 @@
package com.suke.czx.modules.msg.controller;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.suke.czx.common.annotation.ResourceAuth;
import com.suke.czx.common.annotation.SysLog;
import com.suke.czx.common.base.AbstractController;
import com.suke.czx.common.utils.R;
import com.suke.czx.modules.msg.entity.XMessageServiceTemplate;
import com.suke.czx.modules.msg.entity.XMessageServiceTemplateConfig;
import com.suke.czx.modules.msg.service.XMessageServiceTemplateConfigService;
import com.suke.czx.modules.msg.service.XMessageServiceTemplateService;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
* 短信模板
*
* @author czx
* @email object_czx@163.com
* @date 2025-08-15 17:48:07
*/
@RestController
@AllArgsConstructor
@RequestMapping("/msg/template")
@Tag(name = "XMessageServiceTemplateController", description = "短信模板")
public class XMessageServiceTemplateController extends AbstractController {
private final XMessageServiceTemplateService xMessageServiceTemplateService;
private final XMessageServiceTemplateConfigService xMessageServiceTemplateConfigService;
/**
* 列表
*/
@GetMapping("/list")
@ResourceAuth(value = "短信模板列表", module = "短信模板")
public R list(@RequestParam Map<String, Object> params) {
//查询列表数据
QueryWrapper<XMessageServiceTemplate> queryWrapper = new QueryWrapper<>();
final String keyword = mpPageConvert.getKeyword(params);
if (StrUtil.isNotEmpty(keyword)) {
queryWrapper.lambda().and(func -> {
func.like(XMessageServiceTemplate::getTemplateContent, keyword).or().eq(XMessageServiceTemplate::getTenancyName, keyword);
});
}
String tenancyId = MapUtil.getStr(params, "tenancyId");
if (StrUtil.isNotEmpty(tenancyId)) {
queryWrapper.lambda().eq(XMessageServiceTemplate::getTenancyId, tenancyId);
}
IPage<XMessageServiceTemplate> listPage = xMessageServiceTemplateService.page(mpPageConvert.<XMessageServiceTemplate>pageParamConvert(params), queryWrapper);
this.fullTenancyInfo(listPage);
return R.ok().setData(listPage);
}
@GetMapping("/select")
@ResourceAuth(value = "选择短信模板", module = "短信模板")
public R select(@RequestParam Map<String, Object> params) {
//查询列表数据
QueryWrapper<XMessageServiceTemplate> queryWrapper = new QueryWrapper<>();
String tenancyId = MapUtil.getStr(params, "tenancyId");
if (StrUtil.isNotEmpty(tenancyId)) {
queryWrapper.lambda().eq(XMessageServiceTemplate::getTenancyId, tenancyId);
}
List<XMessageServiceTemplate> list = xMessageServiceTemplateService.list(queryWrapper);
return R.ok().setData(list);
}
/**
* 新增短信模板
*/
@SysLog("新增短信模板数据")
@PostMapping("/save")
@ResourceAuth(value = "新增短信模板数据", module = "短信模板")
public R save(@RequestBody XMessageServiceTemplate param) {
xMessageServiceTemplateService.save(param);
return R.ok();
}
/**
* 修改
*/
@SysLog("修改短信模板数据")
@PostMapping("/update")
@ResourceAuth(value = "修改短信模板数据", module = "短信模板")
public R update(@RequestBody XMessageServiceTemplate param) {
xMessageServiceTemplateService.updateById(param);
return R.ok();
}
/**
* 删除
*/
@SysLog("删除短信模板数据")
@PostMapping("/delete")
@ResourceAuth(value = "删除短信模板数据", module = "短信模板")
public R delete(@RequestBody XMessageServiceTemplate param) {
if (param.getTemplateId() == null) {
return R.error("模板ID为空");
}
long count = xMessageServiceTemplateConfigService.count(Wrappers.<XMessageServiceTemplateConfig>lambdaQuery().eq(XMessageServiceTemplateConfig::getServiceId, param.getTemplateId()));
if (count > 0) {
return R.error("当前模板已被使用");
}
xMessageServiceTemplateService.removeById(param.getTemplateId());
return R.ok();
}
}

View File

@@ -0,0 +1,40 @@
package com.suke.czx.modules.msg.entity;
import com.suke.czx.modules.tenancy.entity.TenancyBase;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = true)
public class SendMsg extends TenancyBase {
/**
* 手机号
*/
public String mobile;
/**
* 验证码
*/
public String code;
/**
* 内容,如果验证码不为空,优先使用验证码进行替换
*/
public String content;
/**
* 服务ID
*/
public Integer serviceId;
/**
* 模板ID
*/
public Integer templateId;
/**
* 模板类型
*/
public String templateType;
}

View File

@@ -0,0 +1,84 @@
package com.suke.czx.modules.msg.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.suke.czx.modules.tenancy.entity.TenancyBase;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
/**
* 短信服务
*
* @author czx
* @email object_czx@163.com
* @date 2025-08-15 17:51:27
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("x_message_service")
public class XMessageService extends TenancyBase implements Serializable {
public static final long serialVersionUID = 1L;
@TableId(type = IdType.AUTO)
@Schema(description = "服务ID")
@JsonProperty(value = "serviceId")
public Integer serviceId;
@Schema(description = "AppCode")
@JsonProperty(value = "appCode")
public String appCode;
@Schema(description = "应用ID")
@JsonProperty(value = "appId")
public Integer appId;
@Schema(description = "AppKey")
@JsonProperty(value = "appKey")
public String appKey;
@Schema(description = "AppSecret")
@JsonProperty(value = "appSecret")
public String appSecret;
@Schema(description = "默认模板")
@JsonProperty(value = "defaultTemplate")
public String defaultTemplate;
@Schema(description = "是否使用1使用0未使用")
@JsonProperty(value = "isEnable")
public Integer isEnable;
@Schema(description = "同租户下只能有一个默认服务1是0否")
@JsonProperty(value = "isDefault")
public Integer isDefault;
@Schema(description = "产品ID")
@JsonProperty(value = "productId")
public String productId;
@Schema(description = "服务实现类地址")
@JsonProperty(value = "serviceClass")
public String serviceClass;
@Schema(description = "服务名称")
@JsonProperty(value = "serviceName")
public String serviceName;
@Schema(description = "接口URL")
@JsonProperty(value = "serviceUrl")
public String serviceUrl;
/**
* 选择的模板
*/
@TableField(exist = false)
public Integer[] templateIds;
}

View File

@@ -0,0 +1,87 @@
package com.suke.czx.modules.msg.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.suke.czx.common.annotation.ShardingTable;
import com.suke.czx.modules.tenancy.entity.TenancyBase;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
/**
* 短信发送记录(按月分表)
*
* @author czx
* @email object_czx@163.com
* @date 2025-08-15 17:40:53
*/
@Data
@ShardingTable
@EqualsAndHashCode(callSuper = true)
@TableName("x_message_service_send_record")
public class XMessageServiceSendRecord extends TenancyBase implements Serializable {
public static final long serialVersionUID = 1L;
@TableId(type = IdType.AUTO)
@Schema(description = "记录ID")
@JsonProperty(value = "recordId")
public Integer recordId;
@Schema(description = "应用ID")
@JsonProperty(value = "appId")
public Integer appId;
@Schema(description = "创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@JsonProperty(value = "createTime")
public Date createTime;
@Schema(description = "")
@JsonProperty(value = "recordDay")
public Integer recordDay;
@Schema(description = "")
@JsonProperty(value = "recordMonth")
public Integer recordMonth;
@Schema(description = "")
@JsonProperty(value = "recordYear")
public Integer recordYear;
@Schema(description = "内容")
@JsonProperty(value = "sendContent")
public String sendContent;
@Schema(description = "手机号")
@JsonProperty(value = "sendMobile")
public String sendMobile;
@Schema(description = "发送来源")
@JsonProperty(value = "sendSource")
public String sendSource;
@Schema(description = "发送状态")
@JsonProperty(value = "sendStatus")
public Integer sendStatus;
@Schema(description = "发送类型")
@JsonProperty(value = "sendType")
public String sendType;
@Schema(description = "服务ID")
@JsonProperty(value = "serviceId")
public Integer serviceId;
@Schema(description = "模板ID")
@JsonProperty(value = "templateId")
public Integer templateId;
}

View File

@@ -0,0 +1,52 @@
package com.suke.czx.modules.msg.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.suke.czx.modules.tenancy.entity.TenancyBase;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
/**
* 短信模板
*
* @author czx
* @email object_czx@163.com
* @date 2025-08-15 17:48:07
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("x_message_service_template")
public class XMessageServiceTemplate extends TenancyBase implements Serializable {
public static final long serialVersionUID = 1L;
@TableId(type = IdType.AUTO)
@Schema(description = "模板ID")
@JsonProperty(value = "templateId")
public Integer templateId;
@Schema(description = "是否启用1启动0禁用")
@JsonProperty(value = "isEnable")
public Integer isEnable;
@Schema(description = "备注")
@JsonProperty(value = "remark")
public String remark;
@Schema(description = "模板内容")
@JsonProperty(value = "templateContent")
public String templateContent;
@Schema(description = "模板类型(预留,比如验证码,营销)")
@JsonProperty(value = "templateType")
public String templateType;
}

View File

@@ -0,0 +1,36 @@
package com.suke.czx.modules.msg.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
/**
* 短信模板配置
*
* @author czx
* @email object_czx@163.com
* @date 2025-08-15 17:53:22
*/
@Data
@TableName("x_message_service_template_config")
public class XMessageServiceTemplateConfig implements Serializable {
public static final long serialVersionUID = 1L;
@TableId(type = IdType.INPUT)
@Schema(description = "服务ID")
@JsonProperty(value = "serviceId")
public Integer serviceId;
@Schema(description = "模板ID")
@JsonProperty(value = "templateId")
public Integer templateId;
}

View File

@@ -0,0 +1,15 @@
package com.suke.czx.modules.msg.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.suke.czx.modules.msg.entity.XMessageService;
/**
* 短信服务
*
* @author czx
* @email object_czx@163.com
* @date 2025-08-15 17:51:27
*/
public interface XMessageServiceMapper extends BaseMapper<XMessageService> {
}

View File

@@ -0,0 +1,15 @@
package com.suke.czx.modules.msg.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.suke.czx.modules.msg.entity.XMessageServiceSendRecord;
/**
* 短信发送记录(按月分表)
*
* @author czx
* @email object_czx@163.com
* @date 2025-08-15 17:40:53
*/
public interface XMessageServiceSendRecordMapper extends BaseMapper<XMessageServiceSendRecord> {
}

View File

@@ -0,0 +1,15 @@
package com.suke.czx.modules.msg.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.suke.czx.modules.msg.entity.XMessageServiceTemplateConfig;
/**
* 短信模板配置
*
* @author czx
* @email object_czx@163.com
* @date 2025-08-15 17:53:22
*/
public interface XMessageServiceTemplateConfigMapper extends BaseMapper<XMessageServiceTemplateConfig> {
}

View File

@@ -0,0 +1,25 @@
package com.suke.czx.modules.msg.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.suke.czx.modules.msg.entity.XMessageServiceTemplate;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
/**
* 短信模板
*
* @author czx
* @email object_czx@163.com
* @date 2025-08-15 17:48:07
*/
public interface XMessageServiceTemplateMapper extends BaseMapper<XMessageServiceTemplate> {
@Select("select t2.* from x_message_service_template_config t1,x_message_service_template t2 " +
"where " +
"t1.template_id = t2.template_id " +
"and t1.template_id = #{templateId} " +
"and t1.service_id = #{serviceId} and t2.is_enable = 1 limit 1;")
XMessageServiceTemplate queryTemplate(@Param("templateId") Integer templateId,@Param("serviceId") Integer serviceId);
}

View File

@@ -0,0 +1,22 @@
package com.suke.czx.modules.msg.service;
import com.suke.czx.modules.msg.entity.SendMsg;
import com.suke.czx.modules.msg.entity.XMessageService;
import com.suke.czx.modules.msg.entity.XMessageServiceSendRecord;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 短信发送记录(按月分表)
*
* @author czx
* @email object_czx@163.com
* @date 2025-08-15 17:40:53
*/
public interface XMessageServiceSendRecordService extends IService<XMessageServiceSendRecord> {
boolean autoServiceSendMessage(SendMsg msg);
boolean sendMessage(XMessageService messageService, SendMsg msg);
}

View File

@@ -0,0 +1,22 @@
package com.suke.czx.modules.msg.service;
import com.suke.czx.modules.msg.entity.XMessageService;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 短信服务
*
* @author czx
* @email object_czx@163.com
* @date 2025-08-15 17:51:27
*/
public interface XMessageServiceService extends IService<XMessageService> {
void saveInfo(XMessageService param);
void updateInfo(XMessageService param);
void deleteInfo(XMessageService param);
}

View File

@@ -0,0 +1,16 @@
package com.suke.czx.modules.msg.service;
import com.suke.czx.modules.msg.entity.XMessageServiceTemplateConfig;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 短信模板配置
*
* @author czx
* @email object_czx@163.com
* @date 2025-08-15 17:53:22
*/
public interface XMessageServiceTemplateConfigService extends IService<XMessageServiceTemplateConfig> {
}

View File

@@ -0,0 +1,16 @@
package com.suke.czx.modules.msg.service;
import com.suke.czx.modules.msg.entity.XMessageServiceTemplate;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 短信模板
*
* @author czx
* @email object_czx@163.com
* @date 2025-08-15 17:48:07
*/
public interface XMessageServiceTemplateService extends IService<XMessageServiceTemplate> {
}

View File

@@ -0,0 +1,149 @@
package com.suke.czx.modules.msg.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.suke.czx.common.exception.RRException;
import com.suke.czx.common.utils.SpringContextUtils;
import com.suke.czx.modules.msg.component.SendMessage;
import com.suke.czx.modules.msg.component.entity.MessageBody;
import com.suke.czx.modules.msg.entity.SendMsg;
import com.suke.czx.modules.msg.entity.XMessageService;
import com.suke.czx.modules.msg.entity.XMessageServiceSendRecord;
import com.suke.czx.modules.msg.entity.XMessageServiceTemplate;
import com.suke.czx.modules.msg.mapper.XMessageServiceMapper;
import com.suke.czx.modules.msg.mapper.XMessageServiceSendRecordMapper;
import com.suke.czx.modules.msg.mapper.XMessageServiceTemplateMapper;
import com.suke.czx.modules.msg.service.XMessageServiceSendRecordService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.regex.Pattern;
/**
* 短信发送记录(按月分表)
*
* @author czx
* @email object_czx@163.com
* @date 2025-08-15 17:40:53
*/
@Slf4j
@Service
@AllArgsConstructor
public class XMessageServiceSendRecordServiceImpl extends ServiceImpl<XMessageServiceSendRecordMapper, XMessageServiceSendRecord> implements XMessageServiceSendRecordService {
public final XMessageServiceMapper xMessageServiceMapper;
public final XMessageServiceTemplateMapper xMessageServiceTemplateMapper;
@Override
public boolean autoServiceSendMessage(SendMsg msg) {
if (msg == null) {
return false;
}
String mobile = msg.getMobile();
// 正则表达式匹配中国大陆11位手机号
String telRegex = "^1" +
"((3[0-9])|" + // 13x-139
"(4[014-9])|" + // 14x
"(5[0-35-9])|" + // 15x (排除154)
"(6[2567])|" + // 16x (160/161已作他用)
"(7[0-8])|" + // 17x (179已作它用)
"(8[0-9])|" + // 18x
"(9[0-35-9]))" + // 19x
"[0-9]{8}$";
if (!Pattern.matches(telRegex, mobile)) {
throw new RRException("手机号错误");
}
Integer tenancyId = msg.getTenancyId();
if (tenancyId == null) {
throw new RRException("租户错误");
}
XMessageService messageService;
Integer serviceId = msg.getServiceId();
// 根据服务查询,如果没有传服务,就查询当前租户下的默认服务
if (serviceId != null) {
messageService = xMessageServiceMapper.selectById(serviceId);
} else {
messageService = xMessageServiceMapper.selectOne(Wrappers
.<XMessageService>lambdaQuery()
.eq(XMessageService::getTenancyId, tenancyId)
.eq(XMessageService::getIsEnable, 1)
.eq(XMessageService::getIsDefault, 1)
.last("limit 1"));
}
if (messageService == null) {
throw new RRException("短信服务未配置");
}
if (StrUtil.isNotEmpty(msg.getContent())) {
// 设置模板
messageService.setDefaultTemplate(msg.getContent());
} else {
// 如果有指定模板ID就使用指定模板
Integer templateId = msg.getTemplateId();
if (templateId != null) {
XMessageServiceTemplate serviceTemplate = xMessageServiceTemplateMapper.queryTemplate(templateId, serviceId);
if (serviceTemplate != null) {
// 设置模板
messageService.setDefaultTemplate(serviceTemplate.getTemplateContent());
}
}
}
return this.sendMessage(messageService, msg);
}
@Override
public boolean sendMessage(XMessageService messageService, SendMsg msg) {
try {
String serviceClass = messageService.getServiceClass();
if (StrUtil.isEmpty(serviceClass)) {
throw new RRException("短信服务配置错误");
}
// 使用反射选择对应服务类进行发送
SendMessage sendMessage = (SendMessage) SpringContextUtils.getBean(Class.forName(messageService.getServiceClass()));
// 发送短信
String mobile = msg.getMobile();
String code = msg.getCode();
Integer tenancyId = msg.getTenancyId();
MessageBody messageBody = new MessageBody();
BeanUtil.copyProperties(messageService, messageBody);
messageBody.setMobile(mobile);
messageBody.setCode(code);
messageBody.setTemplate(messageService.getDefaultTemplate());
boolean bool = sendMessage.sendMessage(messageBody);
// 保存短信发送记录
String message = messageBody.getTemplate().replaceAll("#code", code);
this.saveMessageRecord(mobile, message, bool, msg.getTemplateType(), tenancyId);
} catch (Exception e) {
log.error("发送失败,短信服务配置错误:{}", e.getMessage());
throw new RRException("发送失败,短信服务配置错误");
}
return false;
}
/**
* 保存短信发送记录
*/
public void saveMessageRecord(String mobile, String message, boolean status, String type, Integer tenancyId) {
XMessageServiceSendRecord record = new XMessageServiceSendRecord();
record.setSendContent(message);
record.setSendMobile(mobile);
record.setSendType(type);
Date date = new Date();
record.setCreateTime(date);
record.setRecordYear(DateUtil.year(date));
record.setRecordMonth(DateUtil.month(date) + 1);
record.setRecordDay(DateUtil.dayOfMonth(date));
record.setSendStatus(status ? 1 : 0);
record.setTenancyId(tenancyId);
baseMapper.insert(record);
}
}

View File

@@ -0,0 +1,70 @@
package com.suke.czx.modules.msg.service.impl;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.suke.czx.modules.msg.entity.XMessageService;
import com.suke.czx.modules.msg.entity.XMessageServiceTemplateConfig;
import com.suke.czx.modules.msg.mapper.XMessageServiceMapper;
import com.suke.czx.modules.msg.mapper.XMessageServiceTemplateConfigMapper;
import com.suke.czx.modules.msg.service.XMessageServiceService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
/**
* 短信服务
*
* @author czx
* @email object_czx@163.com
* @date 2025-08-15 17:51:27
*/
@Service
@AllArgsConstructor
public class XMessageServiceServiceImpl extends ServiceImpl<XMessageServiceMapper, XMessageService> implements XMessageServiceService {
private final XMessageServiceTemplateConfigMapper xMessageServiceTemplateConfigMapper;
@Override
@Transactional
public void saveInfo(XMessageService param) {
baseMapper.insert(param);
this.saveConfig(param);
}
@Override
@Transactional
public void updateInfo(XMessageService param) {
baseMapper.updateById(param);
if (param.getTemplateIds() != null) {
xMessageServiceTemplateConfigMapper.delete(Wrappers.<XMessageServiceTemplateConfig>lambdaQuery().eq(XMessageServiceTemplateConfig::getServiceId, param.getServiceId()));
this.saveConfig(param);
}
}
@Override
@Transactional
public void deleteInfo(XMessageService param) {
xMessageServiceTemplateConfigMapper.delete(Wrappers.<XMessageServiceTemplateConfig>lambdaQuery().eq(XMessageServiceTemplateConfig::getServiceId, param.getServiceId()));
baseMapper.deleteById(param.getServiceId());
}
@Transactional
public void saveConfig(XMessageService param) {
if (param.getTemplateIds() != null) {
List<XMessageServiceTemplateConfig> configs = Arrays.stream(param.getTemplateIds()).map(item -> {
XMessageServiceTemplateConfig config = new XMessageServiceTemplateConfig();
config.setServiceId(param.getServiceId());
config.setTemplateId(item);
return config;
}).toList();
if (CollUtil.isNotEmpty(configs)) {
xMessageServiceTemplateConfigMapper.insert(configs);
}
}
}
}

View File

@@ -0,0 +1,20 @@
package com.suke.czx.modules.msg.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import com.suke.czx.modules.msg.mapper.XMessageServiceTemplateConfigMapper;
import com.suke.czx.modules.msg.entity.XMessageServiceTemplateConfig;
import com.suke.czx.modules.msg.service.XMessageServiceTemplateConfigService;
/**
* 短信模板配置
*
* @author czx
* @email object_czx@163.com
* @date 2025-08-15 17:53:22
*/
@Service
public class XMessageServiceTemplateConfigServiceImpl extends ServiceImpl<XMessageServiceTemplateConfigMapper, XMessageServiceTemplateConfig> implements XMessageServiceTemplateConfigService {
}

View File

@@ -0,0 +1,20 @@
package com.suke.czx.modules.msg.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import com.suke.czx.modules.msg.mapper.XMessageServiceTemplateMapper;
import com.suke.czx.modules.msg.entity.XMessageServiceTemplate;
import com.suke.czx.modules.msg.service.XMessageServiceTemplateService;
/**
* 短信模板
*
* @author czx
* @email object_czx@163.com
* @date 2025-08-15 17:48:07
*/
@Service
public class XMessageServiceTemplateServiceImpl extends ServiceImpl<XMessageServiceTemplateMapper, XMessageServiceTemplate> implements XMessageServiceTemplateService {
}

View File

@@ -0,0 +1,20 @@
package com.suke.czx.modules.tenancy.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Data
public class TenancyBase {
@Schema(description = "渠道ID")
@JsonProperty(value = "tenancyId")
public Integer tenancyId;
@TableField(exist = false)
@Schema(description = "渠道名称")
@JsonProperty(value = "tenancyName")
public String tenancyName;
}