Commit b139107717ed2830e502b9b155ca82b65a0809b0

Authored by wangwenbin10
1 parent 6686ded1

初始化 c 端的用户相关的表

Showing 31 changed files with 786 additions and 49 deletions
sql/ruoyi-vue-pro.sql
@@ -43,7 +43,7 @@ CREATE TABLE `inf_api_access_log` ( @@ -43,7 +43,7 @@ CREATE TABLE `inf_api_access_log` (
43 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', 43 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
44 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', 44 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
45 PRIMARY KEY (`id`) USING BTREE 45 PRIMARY KEY (`id`) USING BTREE
46 -) ENGINE=InnoDB AUTO_INCREMENT=1302 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='API 访问日志表'; 46 +) ENGINE=InnoDB AUTO_INCREMENT=1302 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='API 访问日志表';
47 47
48 -- ---------------------------- 48 -- ----------------------------
49 -- Records of inf_api_access_log 49 -- Records of inf_api_access_log
@@ -84,7 +84,7 @@ CREATE TABLE `inf_api_error_log` ( @@ -84,7 +84,7 @@ CREATE TABLE `inf_api_error_log` (
84 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', 84 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
85 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', 85 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
86 PRIMARY KEY (`id`) USING BTREE 86 PRIMARY KEY (`id`) USING BTREE
87 -) ENGINE=InnoDB AUTO_INCREMENT=42 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='系统异常日志'; 87 +) ENGINE=InnoDB AUTO_INCREMENT=42 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='系统异常日志';
88 88
89 -- ---------------------------- 89 -- ----------------------------
90 -- Records of inf_api_error_log 90 -- Records of inf_api_error_log
@@ -111,7 +111,7 @@ CREATE TABLE `inf_config` ( @@ -111,7 +111,7 @@ CREATE TABLE `inf_config` (
111 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', 111 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
112 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', 112 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
113 PRIMARY KEY (`id`) USING BTREE 113 PRIMARY KEY (`id`) USING BTREE
114 -) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='参数配置表'; 114 +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='参数配置表';
115 115
116 -- ---------------------------- 116 -- ----------------------------
117 -- Records of inf_config 117 -- Records of inf_config
@@ -138,7 +138,7 @@ CREATE TABLE `inf_file` ( @@ -138,7 +138,7 @@ CREATE TABLE `inf_file` (
138 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', 138 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
139 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', 139 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
140 PRIMARY KEY (`id`) USING BTREE 140 PRIMARY KEY (`id`) USING BTREE
141 -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='文件表'; 141 +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='文件表';
142 142
143 -- ---------------------------- 143 -- ----------------------------
144 -- Records of inf_file 144 -- Records of inf_file
@@ -170,7 +170,7 @@ CREATE TABLE `inf_job` ( @@ -170,7 +170,7 @@ CREATE TABLE `inf_job` (
170 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', 170 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
171 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', 171 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
172 PRIMARY KEY (`id`) USING BTREE 172 PRIMARY KEY (`id`) USING BTREE
173 -) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='定时任务表'; 173 +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='定时任务表';
174 174
175 -- ---------------------------- 175 -- ----------------------------
176 -- Records of inf_job 176 -- Records of inf_job
@@ -201,7 +201,7 @@ CREATE TABLE `inf_job_log` ( @@ -201,7 +201,7 @@ CREATE TABLE `inf_job_log` (
201 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', 201 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
202 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', 202 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
203 PRIMARY KEY (`id`) USING BTREE 203 PRIMARY KEY (`id`) USING BTREE
204 -) ENGINE=InnoDB AUTO_INCREMENT=1969 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='定时任务日志表'; 204 +) ENGINE=InnoDB AUTO_INCREMENT=1969 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='定时任务日志表';
205 205
206 -- ---------------------------- 206 -- ----------------------------
207 -- Records of inf_job_log 207 -- Records of inf_job_log
@@ -228,7 +228,7 @@ CREATE TABLE `sys_dept` ( @@ -228,7 +228,7 @@ CREATE TABLE `sys_dept` (
228 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', 228 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
229 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', 229 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
230 PRIMARY KEY (`id`) USING BTREE 230 PRIMARY KEY (`id`) USING BTREE
231 -) ENGINE=InnoDB AUTO_INCREMENT=110 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='部门表'; 231 +) ENGINE=InnoDB AUTO_INCREMENT=110 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='部门表';
232 232
233 -- ---------------------------- 233 -- ----------------------------
234 -- Records of sys_dept 234 -- Records of sys_dept
@@ -264,7 +264,7 @@ CREATE TABLE `sys_dict_data` ( @@ -264,7 +264,7 @@ CREATE TABLE `sys_dict_data` (
264 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', 264 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
265 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', 265 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
266 PRIMARY KEY (`id`) USING BTREE 266 PRIMARY KEY (`id`) USING BTREE
267 -) ENGINE=InnoDB AUTO_INCREMENT=86 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='字典数据表'; 267 +) ENGINE=InnoDB AUTO_INCREMENT=86 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='字典数据表';
268 268
269 -- ---------------------------- 269 -- ----------------------------
270 -- Records of sys_dict_data 270 -- Records of sys_dict_data
@@ -364,7 +364,7 @@ CREATE TABLE `sys_dict_type` ( @@ -364,7 +364,7 @@ CREATE TABLE `sys_dict_type` (
364 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', 364 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
365 PRIMARY KEY (`id`) USING BTREE, 365 PRIMARY KEY (`id`) USING BTREE,
366 UNIQUE KEY `dict_type` (`type`) 366 UNIQUE KEY `dict_type` (`type`)
367 -) ENGINE=InnoDB AUTO_INCREMENT=117 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='字典类型表'; 367 +) ENGINE=InnoDB AUTO_INCREMENT=117 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='字典类型表';
368 368
369 -- ---------------------------- 369 -- ----------------------------
370 -- Records of sys_dict_type 370 -- Records of sys_dict_type
@@ -412,7 +412,7 @@ CREATE TABLE `sys_error_code` ( @@ -412,7 +412,7 @@ CREATE TABLE `sys_error_code` (
412 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', 412 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
413 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', 413 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
414 PRIMARY KEY (`id`) USING BTREE 414 PRIMARY KEY (`id`) USING BTREE
415 -) ENGINE=InnoDB AUTO_INCREMENT=4019 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='错误码表'; 415 +) ENGINE=InnoDB AUTO_INCREMENT=4019 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='错误码表';
416 416
417 -- ---------------------------- 417 -- ----------------------------
418 -- Records of sys_error_code 418 -- Records of sys_error_code
@@ -520,7 +520,7 @@ CREATE TABLE `sys_login_log` ( @@ -520,7 +520,7 @@ CREATE TABLE `sys_login_log` (
520 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', 520 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
521 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', 521 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
522 PRIMARY KEY (`id`) USING BTREE 522 PRIMARY KEY (`id`) USING BTREE
523 -) ENGINE=InnoDB AUTO_INCREMENT=108 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='系统访问记录'; 523 +) ENGINE=InnoDB AUTO_INCREMENT=108 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='系统访问记录';
524 524
525 -- ---------------------------- 525 -- ----------------------------
526 -- Records of sys_login_log 526 -- Records of sys_login_log
@@ -549,7 +549,7 @@ CREATE TABLE `sys_menu` ( @@ -549,7 +549,7 @@ CREATE TABLE `sys_menu` (
549 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', 549 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
550 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', 550 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
551 PRIMARY KEY (`id`) USING BTREE 551 PRIMARY KEY (`id`) USING BTREE
552 -) ENGINE=InnoDB AUTO_INCREMENT=1117 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='菜单权限表'; 552 +) ENGINE=InnoDB AUTO_INCREMENT=1117 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='菜单权限表';
553 553
554 -- ---------------------------- 554 -- ----------------------------
555 -- Records of sys_menu 555 -- Records of sys_menu
@@ -705,7 +705,7 @@ CREATE TABLE `sys_notice` ( @@ -705,7 +705,7 @@ CREATE TABLE `sys_notice` (
705 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', 705 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
706 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', 706 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
707 PRIMARY KEY (`id`) USING BTREE 707 PRIMARY KEY (`id`) USING BTREE
708 -) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='通知公告表'; 708 +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='通知公告表';
709 709
710 -- ---------------------------- 710 -- ----------------------------
711 -- Records of sys_notice 711 -- Records of sys_notice
@@ -746,7 +746,7 @@ CREATE TABLE `sys_operate_log` ( @@ -746,7 +746,7 @@ CREATE TABLE `sys_operate_log` (
746 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', 746 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
747 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', 747 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
748 PRIMARY KEY (`id`) USING BTREE 748 PRIMARY KEY (`id`) USING BTREE
749 -) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='操作日志记录'; 749 +) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='操作日志记录';
750 750
751 -- ---------------------------- 751 -- ----------------------------
752 -- Records of sys_operate_log 752 -- Records of sys_operate_log
@@ -771,7 +771,7 @@ CREATE TABLE `sys_post` ( @@ -771,7 +771,7 @@ CREATE TABLE `sys_post` (
771 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', 771 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
772 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', 772 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
773 PRIMARY KEY (`id`) USING BTREE 773 PRIMARY KEY (`id`) USING BTREE
774 -) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='岗位信息表'; 774 +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='岗位信息表';
775 775
776 -- ---------------------------- 776 -- ----------------------------
777 -- Records of sys_post 777 -- Records of sys_post
@@ -804,7 +804,7 @@ CREATE TABLE `sys_role` ( @@ -804,7 +804,7 @@ CREATE TABLE `sys_role` (
804 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', 804 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
805 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', 805 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
806 PRIMARY KEY (`id`) USING BTREE 806 PRIMARY KEY (`id`) USING BTREE
807 -) ENGINE=InnoDB AUTO_INCREMENT=102 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='角色信息表'; 807 +) ENGINE=InnoDB AUTO_INCREMENT=102 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='角色信息表';
808 808
809 -- ---------------------------- 809 -- ----------------------------
810 -- Records of sys_role 810 -- Records of sys_role
@@ -829,7 +829,7 @@ CREATE TABLE `sys_role_menu` ( @@ -829,7 +829,7 @@ CREATE TABLE `sys_role_menu` (
829 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', 829 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
830 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', 830 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
831 PRIMARY KEY (`id`) USING BTREE 831 PRIMARY KEY (`id`) USING BTREE
832 -) ENGINE=InnoDB AUTO_INCREMENT=239 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='角色和菜单关联表'; 832 +) ENGINE=InnoDB AUTO_INCREMENT=239 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='角色和菜单关联表';
833 833
834 -- ---------------------------- 834 -- ----------------------------
835 -- Records of sys_role_menu 835 -- Records of sys_role_menu
@@ -1010,7 +1010,7 @@ CREATE TABLE `sys_sms_channel` ( @@ -1010,7 +1010,7 @@ CREATE TABLE `sys_sms_channel` (
1010 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', 1010 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
1011 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', 1011 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
1012 PRIMARY KEY (`id`) USING BTREE 1012 PRIMARY KEY (`id`) USING BTREE
1013 -) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='短信渠道'; 1013 +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='短信渠道';
1014 1014
1015 -- ---------------------------- 1015 -- ----------------------------
1016 -- Records of sys_sms_channel 1016 -- Records of sys_sms_channel
@@ -1057,7 +1057,7 @@ CREATE TABLE `sys_sms_log` ( @@ -1057,7 +1057,7 @@ CREATE TABLE `sys_sms_log` (
1057 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', 1057 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
1058 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', 1058 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
1059 PRIMARY KEY (`id`) USING BTREE 1059 PRIMARY KEY (`id`) USING BTREE
1060 -) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='短信日志'; 1060 +) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='短信日志';
1061 1061
1062 -- ---------------------------- 1062 -- ----------------------------
1063 -- Records of sys_sms_log 1063 -- Records of sys_sms_log
@@ -1087,7 +1087,7 @@ CREATE TABLE `sys_sms_template` ( @@ -1087,7 +1087,7 @@ CREATE TABLE `sys_sms_template` (
1087 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', 1087 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
1088 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', 1088 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
1089 PRIMARY KEY (`id`) USING BTREE 1089 PRIMARY KEY (`id`) USING BTREE
1090 -) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='短信模板'; 1090 +) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='短信模板';
1091 1091
1092 -- ---------------------------- 1092 -- ----------------------------
1093 -- Records of sys_sms_template 1093 -- Records of sys_sms_template
@@ -1117,9 +1117,9 @@ CREATE TABLE `sys_social_user` ( @@ -1117,9 +1117,9 @@ CREATE TABLE `sys_social_user` (
1117 `nickname` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '用户昵称', 1117 `nickname` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '用户昵称',
1118 `avatar` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '用户头像', 1118 `avatar` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '用户头像',
1119 `raw_user_info` varchar(1024) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '原始用户数据,一般是 JSON 格式', 1119 `raw_user_info` varchar(1024) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '原始用户数据,一般是 JSON 格式',
1120 - `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '创建者', 1120 + `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '创建者',
1121 `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', 1121 `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
1122 - `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '更新者', 1122 + `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '更新者',
1123 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', 1123 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
1124 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', 1124 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
1125 PRIMARY KEY (`id`) USING BTREE 1125 PRIMARY KEY (`id`) USING BTREE
@@ -1157,7 +1157,7 @@ CREATE TABLE `sys_user` ( @@ -1157,7 +1157,7 @@ CREATE TABLE `sys_user` (
1157 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', 1157 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
1158 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', 1158 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
1159 PRIMARY KEY (`id`) USING BTREE 1159 PRIMARY KEY (`id`) USING BTREE
1160 -) ENGINE=InnoDB AUTO_INCREMENT=107 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户信息表'; 1160 +) ENGINE=InnoDB AUTO_INCREMENT=107 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='用户信息表';
1161 1161
1162 -- ---------------------------- 1162 -- ----------------------------
1163 -- Records of sys_user 1163 -- Records of sys_user
@@ -1185,7 +1185,7 @@ CREATE TABLE `sys_user_role` ( @@ -1185,7 +1185,7 @@ CREATE TABLE `sys_user_role` (
1185 `update_time` datetime DEFAULT NULL COMMENT '更新时间', 1185 `update_time` datetime DEFAULT NULL COMMENT '更新时间',
1186 `deleted` bit(1) DEFAULT b'0' COMMENT '是否删除', 1186 `deleted` bit(1) DEFAULT b'0' COMMENT '是否删除',
1187 PRIMARY KEY (`id`) USING BTREE 1187 PRIMARY KEY (`id`) USING BTREE
1188 -) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户和角色关联表'; 1188 +) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='用户和角色关联表';
1189 1189
1190 -- ---------------------------- 1190 -- ----------------------------
1191 -- Records of sys_user_role 1191 -- Records of sys_user_role
@@ -1218,7 +1218,7 @@ CREATE TABLE `sys_user_session` ( @@ -1218,7 +1218,7 @@ CREATE TABLE `sys_user_session` (
1218 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', 1218 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
1219 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', 1219 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
1220 PRIMARY KEY (`id`) USING BTREE 1220 PRIMARY KEY (`id`) USING BTREE
1221 -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户在线 Session'; 1221 +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='用户在线 Session';
1222 1222
1223 -- ---------------------------- 1223 -- ----------------------------
1224 -- Records of sys_user_session 1224 -- Records of sys_user_session
@@ -1256,7 +1256,7 @@ CREATE TABLE `tool_codegen_column` ( @@ -1256,7 +1256,7 @@ CREATE TABLE `tool_codegen_column` (
1256 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', 1256 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
1257 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', 1257 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
1258 PRIMARY KEY (`id`) USING BTREE 1258 PRIMARY KEY (`id`) USING BTREE
1259 -) ENGINE=InnoDB AUTO_INCREMENT=469 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='代码生成表字段定义'; 1259 +) ENGINE=InnoDB AUTO_INCREMENT=469 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='代码生成表字段定义';
1260 1260
1261 -- ---------------------------- 1261 -- ----------------------------
1262 -- Records of tool_codegen_column 1262 -- Records of tool_codegen_column
@@ -1523,7 +1523,7 @@ CREATE TABLE `tool_codegen_table` ( @@ -1523,7 +1523,7 @@ CREATE TABLE `tool_codegen_table` (
1523 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', 1523 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
1524 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', 1524 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
1525 PRIMARY KEY (`id`) USING BTREE 1525 PRIMARY KEY (`id`) USING BTREE
1526 -) ENGINE=InnoDB AUTO_INCREMENT=39 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='代码生成表定义'; 1526 +) ENGINE=InnoDB AUTO_INCREMENT=39 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='代码生成表定义';
1527 1527
1528 -- ---------------------------- 1528 -- ----------------------------
1529 -- Records of tool_codegen_table 1529 -- Records of tool_codegen_table
@@ -1565,7 +1565,7 @@ CREATE TABLE `tool_test_demo` ( @@ -1565,7 +1565,7 @@ CREATE TABLE `tool_test_demo` (
1565 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', 1565 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
1566 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', 1566 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
1567 PRIMARY KEY (`id`) USING BTREE 1567 PRIMARY KEY (`id`) USING BTREE
1568 -) ENGINE=InnoDB AUTO_INCREMENT=108 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='字典类型表'; 1568 +) ENGINE=InnoDB AUTO_INCREMENT=108 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='字典类型表';
1569 1569
1570 -- ---------------------------- 1570 -- ----------------------------
1571 -- Records of tool_test_demo 1571 -- Records of tool_test_demo
@@ -1575,4 +1575,46 @@ INSERT INTO `tool_test_demo` VALUES (106, '老五1', 0, 1, 1, '牛逼哈2', '', @@ -1575,4 +1575,46 @@ INSERT INTO `tool_test_demo` VALUES (106, '老五1', 0, 1, 1, '牛逼哈2', '',
1575 INSERT INTO `tool_test_demo` VALUES (107, '哈哈哈哈', 1, 0, 1, 'biubiubui', '', '2021-02-06 14:00:54', '', '2021-02-06 14:00:54', b'0'); 1575 INSERT INTO `tool_test_demo` VALUES (107, '哈哈哈哈', 1, 0, 1, 'biubiubui', '', '2021-02-06 14:00:54', '', '2021-02-06 14:00:54', b'0');
1576 COMMIT; 1576 COMMIT;
1577 1577
  1578 +-- ----------------------------
  1579 +-- Table structure for mbr_user
  1580 +-- ----------------------------
  1581 +CREATE TABLE `mbr_user` (
  1582 + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号',
  1583 + `nickname` varchar(30) NOT NULL COMMENT '用户昵称',
  1584 + `avatar` varchar(255) DEFAULT NULL COMMENT '头像',
  1585 + `status` tinyint(4) NOT NULL COMMENT '状态',
  1586 + `mobile` varchar(11) NOT NULL COMMENT '手机号',
  1587 + `password` varchar(100) NOT NULL DEFAULT '' COMMENT '密码',
  1588 + `register_ip` varchar(32) NOT NULL COMMENT '注册 IP',
  1589 + `creator` varchar(64) DEFAULT '' COMMENT '创建者',
  1590 + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  1591 + `updater` varchar(64) DEFAULT '' COMMENT '更新者',
  1592 + `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  1593 + `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  1594 + PRIMARY KEY (`id`) USING BTREE,
  1595 + UNIQUE KEY `uk_mobile` (`mobile`) USING BTREE COMMENT '手机号'
  1596 +) ENGINE=InnoDB AUTO_INCREMENT=245 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='用户';
  1597 +
  1598 +-- ----------------------------
  1599 +-- Table structure for mbr_sms_code
  1600 +-- ----------------------------
  1601 +CREATE TABLE `mbr_sms_code` (
  1602 + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号',
  1603 + `mobile` varchar(11) NOT NULL COMMENT '手机号',
  1604 + `code` varchar(6) NOT NULL COMMENT '验证码',
  1605 + `create_ip` varchar(15) NOT NULL COMMENT '创建 IP',
  1606 + `scene` tinyint(4) NOT NULL COMMENT '发送场景',
  1607 + `today_index` tinyint(4) NOT NULL COMMENT '今日发送的第几条',
  1608 + `used` tinyint(4) NOT NULL COMMENT '是否使用',
  1609 + `used_time` datetime DEFAULT NULL COMMENT '使用时间',
  1610 + `used_ip` varchar(255) DEFAULT NULL COMMENT '使用 IP',
  1611 + `creator` varchar(64) DEFAULT '' COMMENT '创建者',
  1612 + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  1613 + `updater` varchar(64) DEFAULT '' COMMENT '更新者',
  1614 + `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  1615 + `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  1616 + PRIMARY KEY (`id`) USING BTREE,
  1617 + KEY `idx_mobile` (`mobile`) USING BTREE COMMENT '手机号'
  1618 +) ENGINE=InnoDB AUTO_INCREMENT=445 DEFAULT CHARSET=utf8mb4 COMMENT='手机验证码';
  1619 +
1578 SET FOREIGN_KEY_CHECKS = 1; 1620 SET FOREIGN_KEY_CHECKS = 1;
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/controller/auth/SysAuthController.java
1 package cn.iocoder.yudao.adminserver.modules.system.controller.auth; 1 package cn.iocoder.yudao.adminserver.modules.system.controller.auth;
2 2
3 -import cn.hutool.json.JSONUtil;  
4 import cn.iocoder.yudao.adminserver.modules.system.controller.auth.vo.auth.*; 3 import cn.iocoder.yudao.adminserver.modules.system.controller.auth.vo.auth.*;
5 import cn.iocoder.yudao.adminserver.modules.system.convert.auth.SysAuthConvert; 4 import cn.iocoder.yudao.adminserver.modules.system.convert.auth.SysAuthConvert;
6 import cn.iocoder.yudao.adminserver.modules.system.dal.dataobject.permission.SysMenuDO; 5 import cn.iocoder.yudao.adminserver.modules.system.dal.dataobject.permission.SysMenuDO;
7 import cn.iocoder.yudao.adminserver.modules.system.dal.dataobject.permission.SysRoleDO; 6 import cn.iocoder.yudao.adminserver.modules.system.dal.dataobject.permission.SysRoleDO;
8 import cn.iocoder.yudao.adminserver.modules.system.dal.dataobject.user.SysUserDO; 7 import cn.iocoder.yudao.adminserver.modules.system.dal.dataobject.user.SysUserDO;
9 import cn.iocoder.yudao.adminserver.modules.system.enums.permission.MenuTypeEnum; 8 import cn.iocoder.yudao.adminserver.modules.system.enums.permission.MenuTypeEnum;
10 -import cn.iocoder.yudao.adminserver.modules.system.enums.user.SysSocialTypeEnum;  
11 import cn.iocoder.yudao.adminserver.modules.system.service.auth.SysAuthService; 9 import cn.iocoder.yudao.adminserver.modules.system.service.auth.SysAuthService;
12 import cn.iocoder.yudao.adminserver.modules.system.service.permission.SysPermissionService; 10 import cn.iocoder.yudao.adminserver.modules.system.service.permission.SysPermissionService;
13 import cn.iocoder.yudao.adminserver.modules.system.service.permission.SysRoleService; 11 import cn.iocoder.yudao.adminserver.modules.system.service.permission.SysRoleService;
@@ -16,19 +14,12 @@ import cn.iocoder.yudao.adminserver.modules.system.service.user.SysUserService; @@ -16,19 +14,12 @@ import cn.iocoder.yudao.adminserver.modules.system.service.user.SysUserService;
16 import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; 14 import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
17 import cn.iocoder.yudao.framework.common.pojo.CommonResult; 15 import cn.iocoder.yudao.framework.common.pojo.CommonResult;
18 import cn.iocoder.yudao.framework.common.util.collection.SetUtils; 16 import cn.iocoder.yudao.framework.common.util.collection.SetUtils;
19 -import cn.iocoder.yudao.framework.common.util.http.HttpUtils;  
20 import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; 17 import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
21 -import com.xkcoding.justauth.AuthRequestFactory;  
22 import io.swagger.annotations.Api; 18 import io.swagger.annotations.Api;
23 import io.swagger.annotations.ApiImplicitParam; 19 import io.swagger.annotations.ApiImplicitParam;
24 import io.swagger.annotations.ApiImplicitParams; 20 import io.swagger.annotations.ApiImplicitParams;
25 import io.swagger.annotations.ApiOperation; 21 import io.swagger.annotations.ApiOperation;
26 import lombok.extern.slf4j.Slf4j; 22 import lombok.extern.slf4j.Slf4j;
27 -import me.zhyd.oauth.model.AuthCallback;  
28 -import me.zhyd.oauth.model.AuthResponse;  
29 -import me.zhyd.oauth.model.AuthUser;  
30 -import me.zhyd.oauth.request.AuthRequest;  
31 -import me.zhyd.oauth.utils.AuthStateUtils;  
32 import org.springframework.validation.annotation.Validated; 23 import org.springframework.validation.annotation.Validated;
33 import org.springframework.web.bind.annotation.*; 24 import org.springframework.web.bind.annotation.*;
34 25
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/controller/auth/vo/auth/SysAuthSocialBindReqVO.java
1 package cn.iocoder.yudao.adminserver.modules.system.controller.auth.vo.auth; 1 package cn.iocoder.yudao.adminserver.modules.system.controller.auth.vo.auth;
2 2
3 -import cn.iocoder.yudao.adminserver.modules.system.enums.user.SysSocialTypeEnum; 3 +import cn.iocoder.yudao.adminserver.modules.system.enums.social.SysSocialTypeEnum;
4 import cn.iocoder.yudao.framework.common.validation.InEnum; 4 import cn.iocoder.yudao.framework.common.validation.InEnum;
5 import io.swagger.annotations.ApiModel; 5 import io.swagger.annotations.ApiModel;
6 import io.swagger.annotations.ApiModelProperty; 6 import io.swagger.annotations.ApiModelProperty;
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/controller/auth/vo/auth/SysAuthSocialLogin2ReqVO.java
1 package cn.iocoder.yudao.adminserver.modules.system.controller.auth.vo.auth; 1 package cn.iocoder.yudao.adminserver.modules.system.controller.auth.vo.auth;
2 2
3 -import cn.iocoder.yudao.adminserver.modules.system.enums.user.SysSocialTypeEnum; 3 +import cn.iocoder.yudao.adminserver.modules.system.enums.social.SysSocialTypeEnum;
4 import cn.iocoder.yudao.framework.common.validation.InEnum; 4 import cn.iocoder.yudao.framework.common.validation.InEnum;
5 import io.swagger.annotations.ApiModel; 5 import io.swagger.annotations.ApiModel;
6 import io.swagger.annotations.ApiModelProperty; 6 import io.swagger.annotations.ApiModelProperty;
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/controller/auth/vo/auth/SysAuthSocialLoginReqVO.java
1 package cn.iocoder.yudao.adminserver.modules.system.controller.auth.vo.auth; 1 package cn.iocoder.yudao.adminserver.modules.system.controller.auth.vo.auth;
2 2
3 -import cn.iocoder.yudao.adminserver.modules.system.enums.user.SysSocialTypeEnum; 3 +import cn.iocoder.yudao.adminserver.modules.system.enums.social.SysSocialTypeEnum;
4 import cn.iocoder.yudao.framework.common.validation.InEnum; 4 import cn.iocoder.yudao.framework.common.validation.InEnum;
5 import io.swagger.annotations.ApiModel; 5 import io.swagger.annotations.ApiModel;
6 import io.swagger.annotations.ApiModelProperty; 6 import io.swagger.annotations.ApiModelProperty;
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/controller/auth/vo/auth/SysAuthSocialUnbindReqVO.java
1 package cn.iocoder.yudao.adminserver.modules.system.controller.auth.vo.auth; 1 package cn.iocoder.yudao.adminserver.modules.system.controller.auth.vo.auth;
2 2
3 -import cn.iocoder.yudao.adminserver.modules.system.enums.user.SysSocialTypeEnum; 3 +import cn.iocoder.yudao.adminserver.modules.system.enums.social.SysSocialTypeEnum;
4 import cn.iocoder.yudao.framework.common.validation.InEnum; 4 import cn.iocoder.yudao.framework.common.validation.InEnum;
5 import io.swagger.annotations.ApiModel; 5 import io.swagger.annotations.ApiModel;
6 import io.swagger.annotations.ApiModelProperty; 6 import io.swagger.annotations.ApiModelProperty;
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/dal/dataobject/user/SysUserDO.java
@@ -14,7 +14,7 @@ import java.util.Date; @@ -14,7 +14,7 @@ import java.util.Date;
14 import java.util.Set; 14 import java.util.Set;
15 15
16 /** 16 /**
17 - * 用户 DO 17 + * 管理后台的用户 DO
18 * 18 *
19 * @author ruoyi 19 * @author ruoyi
20 */ 20 */
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/enums/user/SysSocialTypeEnum.java renamed to yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/enums/social/SysSocialTypeEnum.java
1 -package cn.iocoder.yudao.adminserver.modules.system.enums.user; 1 +package cn.iocoder.yudao.adminserver.modules.system.enums.social;
2 2
3 import cn.hutool.core.collection.ListUtil; 3 import cn.hutool.core.collection.ListUtil;
4 import cn.hutool.core.util.ArrayUtil; 4 import cn.hutool.core.util.ArrayUtil;
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/service/social/SysSocialService.java
@@ -2,9 +2,8 @@ package cn.iocoder.yudao.adminserver.modules.system.service.social; @@ -2,9 +2,8 @@ package cn.iocoder.yudao.adminserver.modules.system.service.social;
2 2
3 import cn.hutool.core.util.StrUtil; 3 import cn.hutool.core.util.StrUtil;
4 import cn.iocoder.yudao.adminserver.modules.system.dal.dataobject.social.SysSocialUserDO; 4 import cn.iocoder.yudao.adminserver.modules.system.dal.dataobject.social.SysSocialUserDO;
5 -import cn.iocoder.yudao.adminserver.modules.system.enums.user.SysSocialTypeEnum; 5 +import cn.iocoder.yudao.adminserver.modules.system.enums.social.SysSocialTypeEnum;
6 import cn.iocoder.yudao.framework.common.exception.ServiceException; 6 import cn.iocoder.yudao.framework.common.exception.ServiceException;
7 -import io.swagger.models.auth.In;  
8 import me.zhyd.oauth.model.AuthUser; 7 import me.zhyd.oauth.model.AuthUser;
9 8
10 import javax.validation.constraints.NotNull; 9 import javax.validation.constraints.NotNull;
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/service/social/impl/SysSocialServiceImpl.java
@@ -4,7 +4,7 @@ import cn.hutool.core.collection.CollUtil; @@ -4,7 +4,7 @@ import cn.hutool.core.collection.CollUtil;
4 import cn.iocoder.yudao.adminserver.modules.system.dal.dataobject.social.SysSocialUserDO; 4 import cn.iocoder.yudao.adminserver.modules.system.dal.dataobject.social.SysSocialUserDO;
5 import cn.iocoder.yudao.adminserver.modules.system.dal.mysql.social.SysSocialUserMapper; 5 import cn.iocoder.yudao.adminserver.modules.system.dal.mysql.social.SysSocialUserMapper;
6 import cn.iocoder.yudao.adminserver.modules.system.dal.redis.social.SysSocialAuthUserRedisDAO; 6 import cn.iocoder.yudao.adminserver.modules.system.dal.redis.social.SysSocialAuthUserRedisDAO;
7 -import cn.iocoder.yudao.adminserver.modules.system.enums.user.SysSocialTypeEnum; 7 +import cn.iocoder.yudao.adminserver.modules.system.enums.social.SysSocialTypeEnum;
8 import cn.iocoder.yudao.adminserver.modules.system.service.social.SysSocialService; 8 import cn.iocoder.yudao.adminserver.modules.system.service.social.SysSocialService;
9 import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; 9 import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
10 import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; 10 import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/validation/ValidationUtils.java 0 → 100644
  1 +package cn.iocoder.yudao.framework.common.util.validation;
  2 +
  3 +import cn.hutool.core.util.StrUtil;
  4 +import org.springframework.util.StringUtils;
  5 +
  6 +import java.util.regex.Pattern;
  7 +
  8 +/**
  9 + * 校验工具类
  10 + *
  11 + * @author 芋道源码
  12 + */
  13 +public class ValidationUtils {
  14 +
  15 + private static Pattern PATTERN_URL = Pattern.compile("^(https?|ftp|file)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]");
  16 +
  17 + public static boolean isMobile(String mobile) {
  18 + if (StrUtil.length(mobile) != 11) {
  19 + return false;
  20 + }
  21 + // TODO 芋艿,后面完善手机校验
  22 + return true;
  23 + }
  24 +
  25 + public static boolean isURL(String url) {
  26 + return StringUtils.hasText(url)
  27 + && PATTERN_URL.matcher(url).matches();
  28 + }
  29 +
  30 +}
yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/validation/Mobile.java 0 → 100644
  1 +package cn.iocoder.yudao.framework.common.validation;
  2 +
  3 +import javax.validation.Constraint;
  4 +import javax.validation.Payload;
  5 +import java.lang.annotation.*;
  6 +
  7 +@Target({
  8 + ElementType.METHOD,
  9 + ElementType.FIELD,
  10 + ElementType.ANNOTATION_TYPE,
  11 + ElementType.CONSTRUCTOR,
  12 + ElementType.PARAMETER,
  13 + ElementType.TYPE_USE
  14 +})
  15 +@Retention(RetentionPolicy.RUNTIME)
  16 +@Documented
  17 +@Constraint(
  18 + validatedBy = MobileValidator.class
  19 +)
  20 +public @interface Mobile {
  21 +
  22 + String message() default "手机号格式不正确";
  23 +
  24 + Class<?>[] groups() default {};
  25 +
  26 + Class<? extends Payload>[] payload() default {};
  27 +
  28 +}
yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/validation/MobileValidator.java 0 → 100644
  1 +package cn.iocoder.yudao.framework.common.validation;
  2 +
  3 +import cn.hutool.core.util.StrUtil;
  4 +import cn.iocoder.yudao.framework.common.util.validation.ValidationUtils;
  5 +
  6 +import javax.validation.ConstraintValidator;
  7 +import javax.validation.ConstraintValidatorContext;
  8 +
  9 +public class MobileValidator implements ConstraintValidator<Mobile, String> {
  10 +
  11 + @Override
  12 + public void initialize(Mobile annotation) {
  13 + }
  14 +
  15 + @Override
  16 + public boolean isValid(String value, ConstraintValidatorContext context) {
  17 + // 如果手机号为空,默认不校验,即校验通过
  18 + if (StrUtil.isEmpty(value)) {
  19 + return true;
  20 + }
  21 + // 校验手机
  22 + return ValidationUtils.isMobile(value);
  23 + }
  24 +
  25 +}
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/controller/auth/MbrAuthController.java 0 → 100644
  1 +package cn.iocoder.yudao.userserver.modules.member.controller.auth;
  2 +
  3 +import cn.iocoder.yudao.framework.common.pojo.CommonResult;
  4 +import cn.iocoder.yudao.userserver.modules.member.controller.auth.vo.*;
  5 +import io.swagger.annotations.Api;
  6 +import io.swagger.annotations.ApiImplicitParam;
  7 +import io.swagger.annotations.ApiImplicitParams;
  8 +import io.swagger.annotations.ApiOperation;
  9 +import lombok.extern.slf4j.Slf4j;
  10 +import org.springframework.validation.annotation.Validated;
  11 +import org.springframework.web.bind.annotation.*;
  12 +
  13 +import javax.validation.Valid;
  14 +
  15 +@Api(tags = "认证")
  16 +@RestController
  17 +@RequestMapping("/")
  18 +@Validated
  19 +@Slf4j
  20 +public class MbrAuthController {
  21 +
  22 + @PostMapping("/login")
  23 + @ApiOperation("使用手机 + 密码登录")
  24 + public CommonResult<MbrAuthLoginRespVO> login(@RequestBody @Valid MbrAuthLoginReqVO reqVO) {
  25 +// String token = authService.login(reqVO, getClientIP(), getUserAgent());
  26 +// // 返回结果
  27 +// return success(MbrAuthLoginRespVO.builder().token(token).build());
  28 + return null;
  29 + }
  30 +
  31 + @PostMapping("/sms-login")
  32 + @ApiOperation("使用手机 + 验证码登录")
  33 + public CommonResult<MbrAuthLoginRespVO> smsLogin(@RequestBody @Valid MbrAuthLoginReqVO reqVO) {
  34 + return null;
  35 + }
  36 +
  37 + @PostMapping("/send-sms-code")
  38 + @ApiOperation("发送手机验证码")
  39 + public CommonResult<Boolean> sendSmsCode(@RequestBody @Valid MbrAuthSendSmsReqVO reqVO) {
  40 +// passportManager.sendSmsCode(sendSmsCodeDTO, HttpUtil.getIp(request));
  41 +// // 返回成功
  42 +// return success(true);
  43 + return null;
  44 + }
  45 +
  46 + @PostMapping("/reset-password")
  47 + @ApiOperation(value = "重置密码", notes = "用户忘记密码时使用")
  48 + public CommonResult<Boolean> resetPassword(@RequestBody @Valid MbrAuthResetPasswordReqVO reqVO) {
  49 + return null;
  50 + }
  51 +
  52 + // ========== 社交登录相关 ==========
  53 +
  54 + @GetMapping("/social-auth-redirect")
  55 + @ApiOperation("社交授权的跳转")
  56 + @ApiImplicitParams({
  57 + @ApiImplicitParam(name = "type", value = "社交类型", required = true, dataTypeClass = Integer.class),
  58 + @ApiImplicitParam(name = "redirectUri", value = "回调路径", dataTypeClass = String.class)
  59 + })
  60 + public CommonResult<String> socialAuthRedirect(@RequestParam("type") Integer type,
  61 + @RequestParam("redirectUri") String redirectUri) {
  62 +// return CommonResult.success(socialService.getAuthorizeUrl(type, redirectUri));
  63 + return null;
  64 + }
  65 +
  66 + @PostMapping("/social-login")
  67 + @ApiOperation("社交登录,使用 code 授权码")
  68 + public CommonResult<MbrAuthLoginRespVO> socialLogin(@RequestBody @Valid MbrAuthSocialLoginReqVO reqVO) {
  69 +// String token = authService.socialLogin(reqVO, getClientIP(), getUserAgent());
  70 +// // 返回结果
  71 +// return success(MbrAuthLoginRespVO.builder().token(token).build());
  72 + return null;
  73 + }
  74 +
  75 + @PostMapping("/social-login2")
  76 + @ApiOperation("社交登录,使用 code 授权码 + 账号密码")
  77 + public CommonResult<MbrAuthLoginRespVO> socialLogin2(@RequestBody @Valid MbrAuthSocialLogin2ReqVO reqVO) {
  78 +// String token = authService.socialLogin2(reqVO, getClientIP(), getUserAgent());
  79 +// // 返回结果
  80 +// return success(MbrAuthLoginRespVO.builder().token(token).build());
  81 + return null;
  82 + }
  83 +
  84 + @PostMapping("/social-bind")
  85 + @ApiOperation("社交绑定,使用 code 授权码")
  86 + public CommonResult<Boolean> socialBind(@RequestBody @Valid MbrAuthSocialBindReqVO reqVO) {
  87 +// authService.socialBind(getLoginUserId(), reqVO);
  88 +// return CommonResult.success(true);
  89 + return null;
  90 + }
  91 +
  92 + @DeleteMapping("/social-unbind")
  93 + @ApiOperation("取消社交绑定")
  94 + public CommonResult<Boolean> socialUnbind(@RequestBody MbrAuthSocialUnbindReqVO reqVO) {
  95 +// socialService.unbindSocialUser(getLoginUserId(), reqVO.getType(), reqVO.getUnionId());
  96 +// return CommonResult.success(true);
  97 + return null;
  98 + }
  99 +
  100 +}
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/controller/auth/vo/MbrAuthLoginReqVO.java 0 → 100644
  1 +package cn.iocoder.yudao.userserver.modules.member.controller.auth.vo;
  2 +
  3 +import cn.iocoder.yudao.framework.common.validation.Mobile;
  4 +import io.swagger.annotations.ApiModel;
  5 +import io.swagger.annotations.ApiModelProperty;
  6 +import lombok.AllArgsConstructor;
  7 +import lombok.Builder;
  8 +import lombok.Data;
  9 +import lombok.NoArgsConstructor;
  10 +import org.hibernate.validator.constraints.Length;
  11 +
  12 +import javax.validation.constraints.NotEmpty;
  13 +
  14 +@ApiModel("手机 + 密码登录 Request VO")
  15 +@Data
  16 +@NoArgsConstructor
  17 +@AllArgsConstructor
  18 +@Builder
  19 +public class MbrAuthLoginReqVO {
  20 +
  21 + @ApiModelProperty(value = "手机号", required = true, example = "15601691300")
  22 + @NotEmpty(message = "手机号不能为空")
  23 + @Mobile
  24 + private String mobile;
  25 +
  26 + @ApiModelProperty(value = "密码", required = true, example = "buzhidao")
  27 + @NotEmpty(message = "密码不能为空")
  28 + @Length(min = 4, max = 16, message = "密码长度为 4-16 位")
  29 + private String password;
  30 +
  31 +}
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/controller/auth/vo/MbrAuthLoginRespVO.java 0 → 100644
  1 +package cn.iocoder.yudao.userserver.modules.member.controller.auth.vo;
  2 +
  3 +import io.swagger.annotations.ApiModel;
  4 +import io.swagger.annotations.ApiModelProperty;
  5 +import lombok.AllArgsConstructor;
  6 +import lombok.Builder;
  7 +import lombok.Data;
  8 +import lombok.NoArgsConstructor;
  9 +
  10 +@ApiModel("手机密码登录 Response VO")
  11 +@Data
  12 +@NoArgsConstructor
  13 +@AllArgsConstructor
  14 +@Builder
  15 +public class MbrAuthLoginRespVO {
  16 +
  17 + @ApiModelProperty(value = "token", required = true, example = "yudaoyuanma")
  18 + private String token;
  19 +
  20 +}
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/controller/auth/vo/MbrAuthResetPasswordReqVO.java 0 → 100644
  1 +package cn.iocoder.yudao.userserver.modules.member.controller.auth.vo;
  2 +
  3 +import io.swagger.annotations.ApiModel;
  4 +import io.swagger.annotations.ApiModelProperty;
  5 +import lombok.AllArgsConstructor;
  6 +import lombok.Builder;
  7 +import lombok.Data;
  8 +import lombok.NoArgsConstructor;
  9 +import org.hibernate.validator.constraints.Length;
  10 +
  11 +import javax.validation.constraints.NotEmpty;
  12 +import javax.validation.constraints.Pattern;
  13 +
  14 +@ApiModel("重置密码 Request VO")
  15 +@Data
  16 +@NoArgsConstructor
  17 +@AllArgsConstructor
  18 +@Builder
  19 +public class MbrAuthResetPasswordReqVO {
  20 +
  21 + @ApiModelProperty(value = "新密码", required = true, example = "buzhidao")
  22 + @NotEmpty(message = "新密码不能为空")
  23 + @Length(min = 4, max = 16, message = "密码长度为 4-16 位")
  24 + private String password;
  25 +
  26 + @ApiModelProperty(value = "手机验证码", required = true, example = "1024")
  27 + @NotEmpty(message = "手机验证码不能为空")
  28 + @Length(min = 4, max = 6, message = "手机验证码长度为 4-6 位")
  29 + @Pattern(regexp = "^[0-9]+$", message = "手机验证码必须都是数字")
  30 + private String code;
  31 +
  32 +}
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/controller/auth/vo/MbrAuthSendSmsReqVO.java 0 → 100644
  1 +package cn.iocoder.yudao.userserver.modules.member.controller.auth.vo;
  2 +
  3 +import cn.iocoder.yudao.framework.common.validation.Mobile;
  4 +import io.swagger.annotations.ApiModel;
  5 +import io.swagger.annotations.ApiModelProperty;
  6 +import lombok.Data;
  7 +import lombok.experimental.Accessors;
  8 +
  9 +import javax.validation.constraints.NotNull;
  10 +
  11 +@ApiModel("发送手机验证码 Response VO")
  12 +@Data
  13 +@Accessors(chain = true)
  14 +public class MbrAuthSendSmsReqVO {
  15 +
  16 + @ApiModelProperty(value = "手机号", example = "15601691234")
  17 + @Mobile
  18 + private String mobile;
  19 +
  20 + @ApiModelProperty(value = "发送场景", example = "1", notes = "对应 MbrSmsSceneEnum 枚举")
  21 + @NotNull(message = "发送场景不能为空")
  22 + private Integer scene;
  23 +
  24 +}
0 \ No newline at end of file 25 \ No newline at end of file
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/controller/auth/vo/MbrAuthSmsLoginReqVO.java 0 → 100644
  1 +package cn.iocoder.yudao.userserver.modules.member.controller.auth.vo;
  2 +
  3 +import cn.iocoder.yudao.framework.common.validation.Mobile;
  4 +import io.swagger.annotations.ApiModel;
  5 +import io.swagger.annotations.ApiModelProperty;
  6 +import lombok.AllArgsConstructor;
  7 +import lombok.Builder;
  8 +import lombok.Data;
  9 +import lombok.NoArgsConstructor;
  10 +import org.hibernate.validator.constraints.Length;
  11 +
  12 +import javax.validation.constraints.NotEmpty;
  13 +import javax.validation.constraints.Pattern;
  14 +
  15 +@ApiModel("手机 + 验证码登录 Request VO")
  16 +@Data
  17 +@NoArgsConstructor
  18 +@AllArgsConstructor
  19 +@Builder
  20 +public class MbrAuthSmsLoginReqVO {
  21 +
  22 + @ApiModelProperty(value = "手机号", required = true, example = "15601691300")
  23 + @NotEmpty(message = "手机号不能为空")
  24 + @Mobile
  25 + private String mobile;
  26 +
  27 + @ApiModelProperty(value = "密码", required = true, example = "buzhidao")
  28 + @NotEmpty(message = "密码不能为空")
  29 + @Length(min = 4, max = 16, message = "密码长度为 4-16 位")
  30 + private String password;
  31 +
  32 + @ApiModelProperty(value = "手机验证码", required = true, example = "1024")
  33 + @NotEmpty(message = "手机验证码不能为空")
  34 + @Length(min = 4, max = 6, message = "手机验证码长度为 4-6 位")
  35 + @Pattern(regexp = "^[0-9]+$", message = "手机验证码必须都是数字")
  36 + private String code;
  37 +
  38 +}
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/controller/auth/vo/MbrAuthSocialBindReqVO.java 0 → 100644
  1 +package cn.iocoder.yudao.userserver.modules.member.controller.auth.vo;
  2 +
  3 +import cn.iocoder.yudao.framework.common.validation.InEnum;
  4 +import cn.iocoder.yudao.userserver.modules.member.enums.social.SysSocialTypeEnum;
  5 +import io.swagger.annotations.ApiModel;
  6 +import io.swagger.annotations.ApiModelProperty;
  7 +import lombok.AllArgsConstructor;
  8 +import lombok.Builder;
  9 +import lombok.Data;
  10 +import lombok.NoArgsConstructor;
  11 +
  12 +import javax.validation.constraints.NotEmpty;
  13 +import javax.validation.constraints.NotNull;
  14 +
  15 +@ApiModel("社交绑定 Request VO,使用 code 授权码")
  16 +@Data
  17 +@NoArgsConstructor
  18 +@AllArgsConstructor
  19 +@Builder
  20 +public class MbrAuthSocialBindReqVO {
  21 +
  22 + @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 SysUserSocialTypeEnum 枚举值")
  23 + @InEnum(SysSocialTypeEnum.class)
  24 + @NotNull(message = "社交平台的类型不能为空")
  25 + private Integer type;
  26 +
  27 + @ApiModelProperty(value = "授权码", required = true, example = "1024")
  28 + @NotEmpty(message = "授权码不能为空")
  29 + private String code;
  30 +
  31 + @ApiModelProperty(value = "state", required = true, example = "9b2ffbc1-7425-4155-9894-9d5c08541d62")
  32 + @NotEmpty(message = "state 不能为空")
  33 + private String state;
  34 +
  35 +}
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/controller/auth/vo/MbrAuthSocialLogin2ReqVO.java 0 → 100644
  1 +package cn.iocoder.yudao.userserver.modules.member.controller.auth.vo;
  2 +
  3 +import cn.iocoder.yudao.framework.common.validation.InEnum;
  4 +import cn.iocoder.yudao.userserver.modules.member.enums.social.SysSocialTypeEnum;
  5 +import io.swagger.annotations.ApiModel;
  6 +import io.swagger.annotations.ApiModelProperty;
  7 +import lombok.AllArgsConstructor;
  8 +import lombok.Builder;
  9 +import lombok.Data;
  10 +import lombok.NoArgsConstructor;
  11 +import org.hibernate.validator.constraints.Length;
  12 +
  13 +import javax.validation.constraints.NotEmpty;
  14 +import javax.validation.constraints.NotNull;
  15 +import javax.validation.constraints.Pattern;
  16 +
  17 +@ApiModel("社交登录 Request VO,使用 code 授权码 + 账号密码")
  18 +@Data
  19 +@NoArgsConstructor
  20 +@AllArgsConstructor
  21 +@Builder
  22 +public class MbrAuthSocialLogin2ReqVO {
  23 +
  24 + @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 SysUserSocialTypeEnum 枚举值")
  25 + @InEnum(SysSocialTypeEnum.class)
  26 + @NotNull(message = "社交平台的类型不能为空")
  27 + private Integer type;
  28 +
  29 + @ApiModelProperty(value = "授权码", required = true, example = "1024")
  30 + @NotEmpty(message = "授权码不能为空")
  31 + private String code;
  32 +
  33 + @ApiModelProperty(value = "state", required = true, example = "9b2ffbc1-7425-4155-9894-9d5c08541d62")
  34 + @NotEmpty(message = "state 不能为空")
  35 + private String state;
  36 +
  37 + @ApiModelProperty(value = "账号", required = true, example = "yudaoyuanma")
  38 + @NotEmpty(message = "登录账号不能为空")
  39 + @Length(min = 4, max = 16, message = "账号长度为 4-16 位")
  40 + @Pattern(regexp = "^[A-Za-z0-9]+$", message = "账号格式为数字以及字母")
  41 + private String username;
  42 +
  43 + @ApiModelProperty(value = "密码", required = true, example = "buzhidao")
  44 + @NotEmpty(message = "密码不能为空")
  45 + @Length(min = 4, max = 16, message = "密码长度为 4-16 位")
  46 + private String password;
  47 +
  48 +}
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/controller/auth/vo/MbrAuthSocialLoginReqVO.java 0 → 100644
  1 +package cn.iocoder.yudao.userserver.modules.member.controller.auth.vo;
  2 +
  3 +import cn.iocoder.yudao.framework.common.validation.InEnum;
  4 +import cn.iocoder.yudao.userserver.modules.member.enums.social.SysSocialTypeEnum;
  5 +import io.swagger.annotations.ApiModel;
  6 +import io.swagger.annotations.ApiModelProperty;
  7 +import lombok.AllArgsConstructor;
  8 +import lombok.Builder;
  9 +import lombok.Data;
  10 +import lombok.NoArgsConstructor;
  11 +
  12 +import javax.validation.constraints.NotEmpty;
  13 +import javax.validation.constraints.NotNull;
  14 +
  15 +@ApiModel("社交登录 Request VO,使用 code 授权码")
  16 +@Data
  17 +@NoArgsConstructor
  18 +@AllArgsConstructor
  19 +@Builder
  20 +public class MbrAuthSocialLoginReqVO {
  21 +
  22 + @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 SysUserSocialTypeEnum 枚举值")
  23 + @InEnum(SysSocialTypeEnum.class)
  24 + @NotNull(message = "社交平台的类型不能为空")
  25 + private Integer type;
  26 +
  27 + @ApiModelProperty(value = "授权码", required = true, example = "1024")
  28 + @NotEmpty(message = "授权码不能为空")
  29 + private String code;
  30 +
  31 + @ApiModelProperty(value = "state", required = true, example = "9b2ffbc1-7425-4155-9894-9d5c08541d62")
  32 + @NotEmpty(message = "state 不能为空")
  33 + private String state;
  34 +
  35 +}
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/controller/auth/vo/MbrAuthSocialUnbindReqVO.java 0 → 100644
  1 +package cn.iocoder.yudao.userserver.modules.member.controller.auth.vo;
  2 +
  3 +import cn.iocoder.yudao.framework.common.validation.InEnum;
  4 +import cn.iocoder.yudao.userserver.modules.member.enums.social.SysSocialTypeEnum;
  5 +import io.swagger.annotations.ApiModel;
  6 +import io.swagger.annotations.ApiModelProperty;
  7 +import lombok.AllArgsConstructor;
  8 +import lombok.Builder;
  9 +import lombok.Data;
  10 +import lombok.NoArgsConstructor;
  11 +
  12 +import javax.validation.constraints.NotEmpty;
  13 +import javax.validation.constraints.NotNull;
  14 +
  15 +@ApiModel("取消社交绑定 Request VO,使用 code 授权码")
  16 +@Data
  17 +@NoArgsConstructor
  18 +@AllArgsConstructor
  19 +@Builder
  20 +public class MbrAuthSocialUnbindReqVO {
  21 +
  22 + @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 SysUserSocialTypeEnum 枚举值")
  23 + @InEnum(SysSocialTypeEnum.class)
  24 + @NotNull(message = "社交平台的类型不能为空")
  25 + private Integer type;
  26 +
  27 + @ApiModelProperty(value = "社交的全局编号", required = true, example = "IPRmJ0wvBptiPIlGEZiPewGwiEiE")
  28 + @NotEmpty(message = "社交的全局编号不能为空")
  29 + private String unionId;
  30 +
  31 +}
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/dal/mysql/sms/MbrSmsCodeDO.java 0 → 100644
  1 +package cn.iocoder.yudao.userserver.modules.member.dal.mysql.sms;
  2 +
  3 +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
  4 +import com.baomidou.mybatisplus.annotation.TableName;
  5 +import lombok.Data;
  6 +import lombok.EqualsAndHashCode;
  7 +import lombok.experimental.Accessors;
  8 +
  9 +import java.util.Date;
  10 +
  11 +/**
  12 + * 手机验证码 DO
  13 + *
  14 + * idx_mobile 索引:基于 {@link #mobile} 字段
  15 + *
  16 + * @author 芋道源码
  17 + */
  18 +@TableName("mbr_sms_code")
  19 +@Data
  20 +@EqualsAndHashCode(callSuper = true)
  21 +@Accessors(chain = true)
  22 +public class MbrSmsCodeDO extends BaseDO {
  23 +
  24 + /**
  25 + * 编号
  26 + */
  27 + private Integer id;
  28 + /**
  29 + * 手机号
  30 + */
  31 + private String mobile;
  32 + /**
  33 + * 验证码
  34 + */
  35 + private String code;
  36 + /**
  37 + * 发送场景
  38 + *
  39 + * 枚举 {@link MbrSmsCodeDO}
  40 + */
  41 + private Integer scene;
  42 + /**
  43 + * 创建 IP
  44 + */
  45 + private String createIp;
  46 + /**
  47 + * 今日发送的第几条
  48 + */
  49 + private Integer todayIndex;
  50 + /**
  51 + * 是否使用
  52 + */
  53 + private Boolean used;
  54 + /**
  55 + * 使用时间
  56 + */
  57 + private Date usedTime;
  58 + /**
  59 + * 使用 IP
  60 + */
  61 + private String usedIp;
  62 +
  63 +}
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/dal/mysql/user/MbrUserDO.java 0 → 100644
  1 +package cn.iocoder.yudao.userserver.modules.member.dal.mysql.user;
  2 +
  3 +import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
  4 +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
  5 +import com.baomidou.mybatisplus.annotation.TableId;
  6 +import com.baomidou.mybatisplus.annotation.TableName;
  7 +import lombok.*;
  8 +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
  9 +
  10 +import java.util.Date;
  11 +
  12 +/**
  13 + * 会员中心的用户 DO
  14 + *
  15 + * uk_mobile 索引:基于 {@link #mobile} 字段
  16 + *
  17 + * @author 芋道源码
  18 + */
  19 +@TableName(value = "mbr_user", autoResultMap = true)
  20 +@Data
  21 +@EqualsAndHashCode(callSuper = true)
  22 +@Builder
  23 +@NoArgsConstructor
  24 +@AllArgsConstructor
  25 +public class MbrUserDO extends BaseDO {
  26 +
  27 + /**
  28 + * 用户ID
  29 + */
  30 + @TableId
  31 + private Long id;
  32 + /**
  33 + * 用户昵称
  34 + */
  35 + private String nickname;
  36 + /**
  37 + * 用户头像
  38 + */
  39 + private String avatar;
  40 + /**
  41 + * 帐号状态
  42 + *
  43 + * 枚举 {@link CommonStatusEnum}
  44 + */
  45 + private Integer status;
  46 +
  47 + /**
  48 + * 手机
  49 + */
  50 + private String mobile;
  51 + /**
  52 + * 加密后的密码
  53 + *
  54 + * 因为目前使用 {@link BCryptPasswordEncoder} 加密器,所以无需自己处理 salt 盐
  55 + */
  56 + private String password;
  57 + /**
  58 + * 注册 IP
  59 + */
  60 + private String registerIp;
  61 + /**
  62 + * 最后登录IP
  63 + */
  64 + private String loginIp;
  65 + /**
  66 + * 最后登录时间
  67 + */
  68 + private Date loginDate;
  69 +
  70 +}
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/enums/sms/MbrSmsSceneEnum.java 0 → 100644
  1 +package cn.iocoder.yudao.userserver.modules.member.enums.sms;
  2 +
  3 +import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
  4 +import lombok.AllArgsConstructor;
  5 +import lombok.Getter;
  6 +
  7 +import java.util.Arrays;
  8 +
  9 +/**
  10 + * 用户短信验证码发送场景的枚举
  11 + *
  12 + * @author 芋道源码
  13 + */
  14 +@Getter
  15 +@AllArgsConstructor
  16 +public enum MbrSmsSceneEnum implements IntArrayValuable {
  17 +
  18 + LOGIN_BY_SMS(1, "手机号登陆"),
  19 + CHANGE_MOBILE_BY_SMS(2, "更换手机号"),
  20 + ;
  21 +
  22 + public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(MbrSmsSceneEnum::getScene).toArray();
  23 +
  24 + private final Integer scene;
  25 + private final String name;
  26 +
  27 + @Override
  28 + public int[] array() {
  29 + return ARRAYS;
  30 + }
  31 +
  32 +}
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/enums/social/SysSocialTypeEnum.java 0 → 100644
  1 +package cn.iocoder.yudao.userserver.modules.member.enums.social;
  2 +
  3 +import cn.hutool.core.collection.ListUtil;
  4 +import cn.hutool.core.util.ArrayUtil;
  5 +import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
  6 +import lombok.AllArgsConstructor;
  7 +import lombok.Getter;
  8 +
  9 +import java.util.Arrays;
  10 +import java.util.List;
  11 +
  12 +/**
  13 + * 社交平台的类型枚举
  14 + *
  15 + * @author 芋道源码
  16 + */
  17 +@Getter
  18 +@AllArgsConstructor
  19 +public enum SysSocialTypeEnum implements IntArrayValuable {
  20 +
  21 + GITEE(10, "GITEE"), // https://gitee.com/api/v5/oauth_doc#/
  22 + DINGTALK(20, "DINGTALK"), // https://developers.dingtalk.com/document/app/obtain-identity-credentials
  23 + WECHAT_ENTERPRISE(30, "WECHAT_ENTERPRISE"), // https://xkcoding.com/2019/08/06/use-justauth-integration-wechat-enterprise.html
  24 + ;
  25 +
  26 + public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(SysSocialTypeEnum::getType).toArray();
  27 +
  28 + public static final List<Integer> WECHAT_ALL = ListUtil.toList(WECHAT_ENTERPRISE.type);
  29 +
  30 + /**
  31 + * 类型
  32 + */
  33 + private final Integer type;
  34 + /**
  35 + * 类型的标识
  36 + */
  37 + private final String source;
  38 +
  39 + @Override
  40 + public int[] array() {
  41 + return ARRAYS;
  42 + }
  43 +
  44 + public static SysSocialTypeEnum valueOfType(Integer type) {
  45 + return ArrayUtil.firstMatch(o -> o.getType().equals(type), values());
  46 + }
  47 +
  48 + public static List<Integer> getRelationTypes(Integer type) {
  49 + if (WECHAT_ALL.contains(type)) {
  50 + return WECHAT_ALL;
  51 + }
  52 + return ListUtil.toList(type);
  53 + }
  54 +
  55 +}
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/package-info.java 0 → 100644
  1 +/**
  2 + * member 包下,我们放会员业务.
  3 + * 例如说:会员中心等等
  4 + *
  5 + * 缩写:mbr
  6 + */
  7 +package cn.iocoder.yudao.userserver.modules.member;
0 \ No newline at end of file 8 \ No newline at end of file
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/system/dict/SysDictDataService.java renamed to yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/system/service/dict/SysDictDataService.java
1 -package cn.iocoder.yudao.userserver.modules.system.dict; 1 +package cn.iocoder.yudao.userserver.modules.system.service.dict;
2 2
3 import cn.iocoder.yudao.framework.dict.core.service.DictDataFrameworkService; 3 import cn.iocoder.yudao.framework.dict.core.service.DictDataFrameworkService;
4 4
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/system/dict/impl/SysDictDataServiceImpl.java renamed to yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/system/service/dict/impl/SysDictDataServiceImpl.java
1 -package cn.iocoder.yudao.userserver.modules.system.dict.impl; 1 +package cn.iocoder.yudao.userserver.modules.system.service.dict.impl;
2 2
3 import cn.hutool.core.collection.CollUtil; 3 import cn.hutool.core.collection.CollUtil;
4 import cn.iocoder.yudao.framework.dict.core.dto.DictDataRespDTO; 4 import cn.iocoder.yudao.framework.dict.core.dto.DictDataRespDTO;
@@ -6,7 +6,7 @@ import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; @@ -6,7 +6,7 @@ import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
6 import cn.iocoder.yudao.userserver.modules.system.convert.dict.SysDictDataConvert; 6 import cn.iocoder.yudao.userserver.modules.system.convert.dict.SysDictDataConvert;
7 import cn.iocoder.yudao.userserver.modules.system.dal.dataobject.dict.SysDictDataDO; 7 import cn.iocoder.yudao.userserver.modules.system.dal.dataobject.dict.SysDictDataDO;
8 import cn.iocoder.yudao.userserver.modules.system.dal.mysql.dict.SysDictDataMapper; 8 import cn.iocoder.yudao.userserver.modules.system.dal.mysql.dict.SysDictDataMapper;
9 -import cn.iocoder.yudao.userserver.modules.system.dict.SysDictDataService; 9 +import cn.iocoder.yudao.userserver.modules.system.service.dict.SysDictDataService;
10 import com.google.common.collect.ImmutableTable; 10 import com.google.common.collect.ImmutableTable;
11 import lombok.extern.slf4j.Slf4j; 11 import lombok.extern.slf4j.Slf4j;
12 import org.springframework.scheduling.annotation.Scheduled; 12 import org.springframework.scheduling.annotation.Scheduled;
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/system/service/package-info.java 0 → 100644
  1 +package cn.iocoder.yudao.userserver.modules.system.service;
0 \ No newline at end of file 2 \ No newline at end of file