Commit fd53bf329642a4322400ad48f07ccc3651545532
1 parent
16c25904
多模块重构 4:system 模块的调整,解决单元测试报错的问题
Showing
177 changed files
with
1447 additions
and
1525 deletions
yudao-admin-server/src/main/resources/application.yaml
| ... | ... | @@ -75,7 +75,7 @@ yudao: |
| 75 | 75 | error-code: # 错误码相关配置项 |
| 76 | 76 | constants-class-list: |
| 77 | 77 | - cn.iocoder.yudao.adminserver.modules.infra.enums.InfErrorCodeConstants |
| 78 | - - cn.iocoder.yudao.module.system.enums.SysErrorCodeConstants | |
| 78 | + - cn.iocoder.yudao.module.system.enums.ErrorCodeConstants | |
| 79 | 79 | - cn.iocoder.yudao.adminserver.modules.bpm.enums.BpmErrorCodeConstants |
| 80 | 80 | tenant: # 多租户相关配置项 |
| 81 | 81 | tables: # 配置需要开启多租户的表;如果实体已经继承 TenantBaseDO 类,则无需重复配置 | ... | ... |
yudao-admin-server/src/test/resources/sql/clean.sql
| ... | ... | @@ -6,26 +6,6 @@ DELETE FROM "inf_job_log"; |
| 6 | 6 | DELETE FROM "inf_api_access_log"; |
| 7 | 7 | DELETE FROM "inf_api_error_log"; |
| 8 | 8 | |
| 9 | --- sys 开头的 DB | |
| 10 | -DELETE FROM "sys_dept"; | |
| 11 | -DELETE FROM "sys_dict_data"; | |
| 12 | -DELETE FROM "sys_role"; | |
| 13 | -DELETE FROM "sys_role_menu"; | |
| 14 | -DELETE FROM "sys_menu"; | |
| 15 | -DELETE FROM "sys_user_role"; | |
| 16 | -DELETE FROM "sys_dict_type"; | |
| 17 | -DELETE FROM "sys_user_session"; | |
| 18 | -DELETE FROM "sys_post"; | |
| 19 | -DELETE FROM "sys_login_log"; | |
| 20 | -DELETE FROM "sys_operate_log"; | |
| 21 | -DELETE FROM "sys_user"; | |
| 22 | -DELETE FROM "sys_sms_channel"; | |
| 23 | -DELETE FROM "sys_sms_template"; | |
| 24 | -DELETE FROM "sys_sms_log"; | |
| 25 | -DELETE FROM "sys_error_code"; | |
| 26 | -DELETE FROM "sys_social_user"; | |
| 27 | -DELETE FROM "sys_tenant"; | |
| 28 | - | |
| 29 | 9 | -- pay 开头的 DB |
| 30 | 10 | DELETE FROM pay_merchant; |
| 31 | 11 | DELETE FROM pay_app; | ... | ... |
yudao-admin-server/src/test/resources/sql/create_tables.sql
| ... | ... | @@ -67,413 +67,6 @@ CREATE TABLE IF NOT EXISTS "inf_job_log" ( |
| 67 | 67 | PRIMARY KEY ("id") |
| 68 | 68 | )COMMENT='定时任务日志表'; |
| 69 | 69 | |
| 70 | --- sys 开头的 DB | |
| 71 | - | |
| 72 | -CREATE TABLE IF NOT EXISTS "sys_dept" ( | |
| 73 | - "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, | |
| 74 | - "name" varchar(30) NOT NULL DEFAULT '', | |
| 75 | - "parent_id" bigint NOT NULL DEFAULT '0', | |
| 76 | - "sort" int NOT NULL DEFAULT '0', | |
| 77 | - "leader_user_id" bigint DEFAULT NULL, | |
| 78 | - "phone" varchar(11) DEFAULT NULL, | |
| 79 | - "email" varchar(50) DEFAULT NULL, | |
| 80 | - "status" tinyint NOT NULL, | |
| 81 | - "creator" varchar(64) DEFAULT '', | |
| 82 | - "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 83 | - "updater" varchar(64) DEFAULT '', | |
| 84 | - "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 85 | - "deleted" bit NOT NULL DEFAULT FALSE, | |
| 86 | - "tenant_id" bigint not null default '0', | |
| 87 | - PRIMARY KEY ("id") | |
| 88 | -) COMMENT '部门表'; | |
| 89 | - | |
| 90 | -CREATE TABLE IF NOT EXISTS "sys_dict_data" ( | |
| 91 | - "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, | |
| 92 | - "sort" int NOT NULL DEFAULT '0', | |
| 93 | - "label" varchar(100) NOT NULL DEFAULT '', | |
| 94 | - "value" varchar(100) NOT NULL DEFAULT '', | |
| 95 | - "dict_type" varchar(100) NOT NULL DEFAULT '', | |
| 96 | - "status" tinyint NOT NULL DEFAULT '0', | |
| 97 | - "remark" varchar(500) DEFAULT NULL, | |
| 98 | - "creator" varchar(64) DEFAULT '', | |
| 99 | - "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 100 | - "updater" varchar(64) DEFAULT '', | |
| 101 | - "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 102 | - "deleted" bit NOT NULL DEFAULT FALSE, | |
| 103 | - PRIMARY KEY ("id") | |
| 104 | -) COMMENT '字典数据表'; | |
| 105 | - | |
| 106 | -CREATE TABLE IF NOT EXISTS "sys_role" ( | |
| 107 | - "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, | |
| 108 | - "name" varchar(30) NOT NULL, | |
| 109 | - "code" varchar(100) NOT NULL, | |
| 110 | - "sort" int NOT NULL, | |
| 111 | - "data_scope" tinyint NOT NULL DEFAULT '1', | |
| 112 | - "data_scope_dept_ids" varchar(500) NOT NULL DEFAULT '', | |
| 113 | - "status" tinyint NOT NULL, | |
| 114 | - "type" tinyint NOT NULL, | |
| 115 | - "remark" varchar(500) DEFAULT NULL, | |
| 116 | - "creator" varchar(64) DEFAULT '', | |
| 117 | - "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 118 | - "updater" varchar(64) DEFAULT '', | |
| 119 | - "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 120 | - "deleted" bit NOT NULL DEFAULT FALSE, | |
| 121 | - PRIMARY KEY ("id") | |
| 122 | -) COMMENT '角色信息表'; | |
| 123 | - | |
| 124 | -CREATE TABLE IF NOT EXISTS "sys_role_menu" ( | |
| 125 | - "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, | |
| 126 | - "role_id" bigint NOT NULL, | |
| 127 | - "menu_id" bigint NOT NULL, | |
| 128 | - "creator" varchar(64) DEFAULT '', | |
| 129 | - "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 130 | - "updater" varchar(64) DEFAULT '', | |
| 131 | - "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 132 | - "deleted" bit NOT NULL DEFAULT FALSE, | |
| 133 | - PRIMARY KEY ("id") | |
| 134 | -) COMMENT '角色和菜单关联表'; | |
| 135 | - | |
| 136 | -CREATE TABLE IF NOT EXISTS "sys_menu" ( | |
| 137 | - "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, | |
| 138 | - "name" varchar(50) NOT NULL, | |
| 139 | - "permission" varchar(100) NOT NULL DEFAULT '', | |
| 140 | - "menu_type" tinyint NOT NULL, | |
| 141 | - "sort" int NOT NULL DEFAULT '0', | |
| 142 | - "parent_id" bigint NOT NULL DEFAULT '0', | |
| 143 | - "path" varchar(200) DEFAULT '', | |
| 144 | - "icon" varchar(100) DEFAULT '#', | |
| 145 | - "component" varchar(255) DEFAULT NULL, | |
| 146 | - "status" tinyint NOT NULL DEFAULT '0', | |
| 147 | - "creator" varchar(64) DEFAULT '', | |
| 148 | - "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 149 | - "updater" varchar(64) DEFAULT '', | |
| 150 | - "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 151 | - "deleted" bit NOT NULL DEFAULT FALSE, | |
| 152 | - PRIMARY KEY ("id") | |
| 153 | -) COMMENT '菜单权限表'; | |
| 154 | - | |
| 155 | -CREATE TABLE IF NOT EXISTS "sys_user_role" ( | |
| 156 | - "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, | |
| 157 | - "user_id" bigint NOT NULL, | |
| 158 | - "role_id" bigint NOT NULL, | |
| 159 | - "creator" varchar(64) DEFAULT '', | |
| 160 | - "create_time" timestamp DEFAULT NULL, | |
| 161 | - "updater" varchar(64) DEFAULT '', | |
| 162 | - "update_time" timestamp DEFAULT NULL, | |
| 163 | - "deleted" bit DEFAULT FALSE, | |
| 164 | - PRIMARY KEY ("id") | |
| 165 | -) COMMENT '用户和角色关联表'; | |
| 166 | - | |
| 167 | -CREATE TABLE IF NOT EXISTS "sys_dict_type" ( | |
| 168 | - "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, | |
| 169 | - "name" varchar(100) NOT NULL DEFAULT '', | |
| 170 | - "type" varchar(100) NOT NULL DEFAULT '', | |
| 171 | - "status" tinyint NOT NULL DEFAULT '0', | |
| 172 | - "remark" varchar(500) DEFAULT NULL, | |
| 173 | - "creator" varchar(64) DEFAULT '', | |
| 174 | - "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 175 | - "updater" varchar(64) DEFAULT '', | |
| 176 | - "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 177 | - "deleted" bit NOT NULL DEFAULT FALSE, | |
| 178 | - PRIMARY KEY ("id") | |
| 179 | -) COMMENT '字典类型表'; | |
| 180 | - | |
| 181 | -CREATE TABLE IF NOT EXISTS `sys_user_session` ( | |
| 182 | - `id` varchar(32) NOT NULL, | |
| 183 | - `user_id` bigint DEFAULT NULL, | |
| 184 | - "user_type" tinyint NOT NULL, | |
| 185 | - `username` varchar(50) NOT NULL DEFAULT '', | |
| 186 | - `user_ip` varchar(50) DEFAULT NULL, | |
| 187 | - `user_agent` varchar(512) DEFAULT NULL, | |
| 188 | - `session_timeout` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 189 | - "creator" varchar(64) DEFAULT '', | |
| 190 | - "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 191 | - `updater` varchar(64) DEFAULT '' , | |
| 192 | - "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 193 | - "deleted" bit NOT NULL DEFAULT FALSE, | |
| 194 | - "tenant_id" bigint not null default '0', | |
| 195 | - PRIMARY KEY (`id`) | |
| 196 | -) COMMENT '用户在线 Session'; | |
| 197 | - | |
| 198 | -CREATE TABLE IF NOT EXISTS "sys_post" ( | |
| 199 | - "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, | |
| 200 | - "code" varchar(64) NOT NULL, | |
| 201 | - "name" varchar(50) NOT NULL, | |
| 202 | - "sort" integer NOT NULL, | |
| 203 | - "status" tinyint NOT NULL, | |
| 204 | - "remark" varchar(500) DEFAULT NULL, | |
| 205 | - "creator" varchar(64) DEFAULT '', | |
| 206 | - "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 207 | - "updater" varchar(64) DEFAULT '', | |
| 208 | - "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 209 | - "deleted" bit NOT NULL DEFAULT FALSE, | |
| 210 | - "tenant_id" bigint not null default '0', | |
| 211 | - PRIMARY KEY ("id") | |
| 212 | -) COMMENT '岗位信息表'; | |
| 213 | - | |
| 214 | -CREATE TABLE IF NOT EXISTS "sys_notice" ( | |
| 215 | - "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, | |
| 216 | - "title" varchar(50) NOT NULL COMMENT '公告标题', | |
| 217 | - "content" text NOT NULL COMMENT '公告内容', | |
| 218 | - "notice_type" tinyint NOT NULL COMMENT '公告类型(1通知 2公告)', | |
| 219 | - "status" tinyint NOT NULL DEFAULT '0' COMMENT '公告状态(0正常 1关闭)', | |
| 220 | - "creator" varchar(64) DEFAULT '' COMMENT '创建者', | |
| 221 | - "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', | |
| 222 | - "updater" varchar(64) DEFAULT '' COMMENT '更新者', | |
| 223 | - "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', | |
| 224 | - "deleted" bit NOT NULL DEFAULT 0 COMMENT '是否删除', | |
| 225 | - "tenant_id" bigint not null default '0', | |
| 226 | - PRIMARY KEY("id") | |
| 227 | -) COMMENT '通知公告表'; | |
| 228 | - | |
| 229 | -CREATE TABLE IF NOT EXISTS `sys_login_log` ( | |
| 230 | - `id` bigint(20) NOT NULL GENERATED BY DEFAULT AS IDENTITY, | |
| 231 | - `log_type` bigint(4) NOT NULL, | |
| 232 | - "user_id" bigint not null default '0', | |
| 233 | - "user_type" tinyint NOT NULL, | |
| 234 | - `trace_id` varchar(64) NOT NULL DEFAULT '', | |
| 235 | - `username` varchar(50) NOT NULL DEFAULT '', | |
| 236 | - `result` tinyint(4) NOT NULL, | |
| 237 | - `user_ip` varchar(50) NOT NULL, | |
| 238 | - `user_agent` varchar(512) NOT NULL, | |
| 239 | - `creator` varchar(64) DEFAULT '', | |
| 240 | - `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 241 | - `updater` varchar(64) DEFAULT '', | |
| 242 | - `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | |
| 243 | - `deleted` bit(1) NOT NULL DEFAULT '0', | |
| 244 | - PRIMARY KEY (`id`) | |
| 245 | -) COMMENT ='系统访问记录'; | |
| 246 | - | |
| 247 | -CREATE TABLE IF NOT EXISTS `sys_operate_log` ( | |
| 248 | - `id` bigint(20) NOT NULL GENERATED BY DEFAULT AS IDENTITY, | |
| 249 | - `trace_id` varchar(64) NOT NULL DEFAULT '', | |
| 250 | - `user_id` bigint(20) NOT NULL, | |
| 251 | - `module` varchar(50) NOT NULL, | |
| 252 | - `name` varchar(50) NOT NULL, | |
| 253 | - `operate_type` bigint(4) NOT NULL DEFAULT '0', | |
| 254 | - `content` varchar(2000) NOT NULL DEFAULT '', | |
| 255 | - `exts` varchar(512) NOT NULL DEFAULT '', | |
| 256 | - `request_method` varchar(16) DEFAULT '', | |
| 257 | - `request_url` varchar(255) DEFAULT '', | |
| 258 | - `user_ip` varchar(50) DEFAULT NULL, | |
| 259 | - `user_agent` varchar(200) DEFAULT NULL, | |
| 260 | - `java_method` varchar(512) NOT NULL DEFAULT '', | |
| 261 | - `java_method_args` varchar(8000) DEFAULT '', | |
| 262 | - `start_time` datetime NOT NULL, | |
| 263 | - `duration` int(11) NOT NULL, | |
| 264 | - `result_code` int(11) NOT NULL DEFAULT '0', | |
| 265 | - `result_msg` varchar(512) DEFAULT '', | |
| 266 | - `result_data` varchar(4000) DEFAULT '', | |
| 267 | - `creator` varchar(64) DEFAULT '', | |
| 268 | - `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 269 | - `updater` varchar(64) DEFAULT '', | |
| 270 | - `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | |
| 271 | - `deleted` bit(1) NOT NULL DEFAULT '0', | |
| 272 | - "tenant_id" bigint not null default '0', | |
| 273 | - PRIMARY KEY (`id`) | |
| 274 | -) COMMENT ='操作日志记录'; | |
| 275 | - | |
| 276 | -CREATE TABLE IF NOT EXISTS "sys_user" ( | |
| 277 | - "id" bigint not null GENERATED BY DEFAULT AS IDENTITY, | |
| 278 | - "username" varchar(30) not null, | |
| 279 | - "password" varchar(100) not null default '', | |
| 280 | - "nickname" varchar(30) not null, | |
| 281 | - "remark" varchar(500) default null, | |
| 282 | - "dept_id" bigint default null, | |
| 283 | - "post_ids" varchar(255) default null, | |
| 284 | - "email" varchar(50) default '', | |
| 285 | - "mobile" varchar(11) default '', | |
| 286 | - "sex" tinyint default '0', | |
| 287 | - "avatar" varchar(100) default '', | |
| 288 | - "status" tinyint not null default '0', | |
| 289 | - "login_ip" varchar(50) default '', | |
| 290 | - "login_date" timestamp default null, | |
| 291 | - "creator" varchar(64) default '', | |
| 292 | - "create_time" timestamp not null default current_timestamp, | |
| 293 | - "updater" varchar(64) default '', | |
| 294 | - "update_time" timestamp not null default current_timestamp, | |
| 295 | - "deleted" bit not null default false, | |
| 296 | - "tenant_id" bigint not null default '0', | |
| 297 | - primary key ("id") | |
| 298 | -) comment '用户信息表'; | |
| 299 | - | |
| 300 | -CREATE TABLE IF NOT EXISTS "inf_api_access_log" ( | |
| 301 | - "id" bigint not null GENERATED BY DEFAULT AS IDENTITY, | |
| 302 | - "trace_id" varchar(64) not null default '', | |
| 303 | - "user_id" bigint not null default '0', | |
| 304 | - "user_type" tinyint not null default '0', | |
| 305 | - "application_name" varchar(50) not null, | |
| 306 | - "request_method" varchar(16) not null default '', | |
| 307 | - "request_url" varchar(255) not null default '', | |
| 308 | - "request_params" varchar(8000) not null default '', | |
| 309 | - "user_ip" varchar(50) not null, | |
| 310 | - "user_agent" varchar(512) not null, | |
| 311 | - "begin_time" timestamp not null, | |
| 312 | - "end_time" timestamp not null, | |
| 313 | - "duration" integer not null, | |
| 314 | - "result_code" integer not null default '0', | |
| 315 | - "result_msg" varchar(512) default '', | |
| 316 | - "creator" varchar(64) default '', | |
| 317 | - "create_time" timestamp not null default current_timestamp, | |
| 318 | - "updater" varchar(64) default '', | |
| 319 | - "update_time" timestamp not null default current_timestamp, | |
| 320 | - "deleted" bit not null default false, | |
| 321 | - "tenant_id" bigint not null default '0', | |
| 322 | - primary key ("id") | |
| 323 | -) COMMENT 'API 访问日志表'; | |
| 324 | - | |
| 325 | -CREATE TABLE IF NOT EXISTS "inf_api_error_log" ( | |
| 326 | - "id" bigint not null GENERATED BY DEFAULT AS IDENTITY, | |
| 327 | - "trace_id" varchar(64) not null, | |
| 328 | - "user_id" bigint not null default '0', | |
| 329 | - "user_type" tinyint not null default '0', | |
| 330 | - "application_name" varchar(50) not null, | |
| 331 | - "request_method" varchar(16) not null, | |
| 332 | - "request_url" varchar(255) not null, | |
| 333 | - "request_params" varchar(8000) not null, | |
| 334 | - "user_ip" varchar(50) not null, | |
| 335 | - "user_agent" varchar(512) not null, | |
| 336 | - "exception_time" timestamp not null, | |
| 337 | - "exception_name" varchar(128) not null default '', | |
| 338 | - "exception_message" clob not null, | |
| 339 | - "exception_root_cause_message" clob not null, | |
| 340 | - "exception_stack_trace" clob not null, | |
| 341 | - "exception_class_name" varchar(512) not null, | |
| 342 | - "exception_file_name" varchar(512) not null, | |
| 343 | - "exception_method_name" varchar(512) not null, | |
| 344 | - "exception_line_number" integer not null, | |
| 345 | - "process_status" tinyint not null, | |
| 346 | - "process_time" timestamp default null, | |
| 347 | - "process_user_id" bigint default '0', | |
| 348 | - "creator" varchar(64) default '', | |
| 349 | - "create_time" timestamp not null default current_timestamp, | |
| 350 | - "updater" varchar(64) default '', | |
| 351 | - "update_time" timestamp not null default current_timestamp, | |
| 352 | - "deleted" bit not null default false, | |
| 353 | - "tenant_id" bigint not null default '0', | |
| 354 | - primary key ("id") | |
| 355 | -) COMMENT '系统异常日志'; | |
| 356 | - | |
| 357 | -CREATE TABLE IF NOT EXISTS "sys_sms_channel" ( | |
| 358 | - "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, | |
| 359 | - "signature" varchar(10) NOT NULL, | |
| 360 | - "code" varchar(63) NOT NULL, | |
| 361 | - "status" tinyint NOT NULL, | |
| 362 | - "remark" varchar(255) DEFAULT NULL, | |
| 363 | - "api_key" varchar(63) NOT NULL, | |
| 364 | - "api_secret" varchar(63) DEFAULT NULL, | |
| 365 | - "callback_url" varchar(255) DEFAULT NULL, | |
| 366 | - "creator" varchar(64) DEFAULT '', | |
| 367 | - "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 368 | - "updater" varchar(64) DEFAULT '', | |
| 369 | - "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 370 | - "deleted" bit NOT NULL DEFAULT FALSE, | |
| 371 | - PRIMARY KEY ("id") | |
| 372 | -) COMMENT '短信渠道'; | |
| 373 | - | |
| 374 | -CREATE TABLE IF NOT EXISTS "sys_sms_template" ( | |
| 375 | - "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, | |
| 376 | - "type" tinyint NOT NULL, | |
| 377 | - "status" tinyint NOT NULL, | |
| 378 | - "code" varchar(63) NOT NULL, | |
| 379 | - "name" varchar(63) NOT NULL, | |
| 380 | - "content" varchar(255) NOT NULL, | |
| 381 | - "params" varchar(255) NOT NULL, | |
| 382 | - "remark" varchar(255) DEFAULT NULL, | |
| 383 | - "api_template_id" varchar(63) NOT NULL, | |
| 384 | - "channel_id" bigint NOT NULL, | |
| 385 | - "channel_code" varchar(63) NOT NULL, | |
| 386 | - "creator" varchar(64) DEFAULT '', | |
| 387 | - "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 388 | - "updater" varchar(64) DEFAULT '', | |
| 389 | - "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 390 | - "deleted" bit NOT NULL DEFAULT FALSE, | |
| 391 | - PRIMARY KEY ("id") | |
| 392 | -) COMMENT '短信模板'; | |
| 393 | - | |
| 394 | -CREATE TABLE IF NOT EXISTS "sys_sms_log" ( | |
| 395 | - "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, | |
| 396 | - "channel_id" bigint NOT NULL, | |
| 397 | - "channel_code" varchar(63) NOT NULL, | |
| 398 | - "template_id" bigint NOT NULL, | |
| 399 | - "template_code" varchar(63) NOT NULL, | |
| 400 | - "template_type" tinyint NOT NULL, | |
| 401 | - "template_content" varchar(255) NOT NULL, | |
| 402 | - "template_params" varchar(255) NOT NULL, | |
| 403 | - "api_template_id" varchar(63) NOT NULL, | |
| 404 | - "mobile" varchar(11) NOT NULL, | |
| 405 | - "user_id" bigint DEFAULT '0', | |
| 406 | - "user_type" tinyint DEFAULT '0', | |
| 407 | - "send_status" tinyint NOT NULL DEFAULT '0', | |
| 408 | - "send_time" timestamp DEFAULT NULL, | |
| 409 | - "send_code" int DEFAULT NULL, | |
| 410 | - "send_msg" varchar(255) DEFAULT NULL, | |
| 411 | - "api_send_code" varchar(63) DEFAULT NULL, | |
| 412 | - "api_send_msg" varchar(255) DEFAULT NULL, | |
| 413 | - "api_request_id" varchar(255) DEFAULT NULL, | |
| 414 | - "api_serial_no" varchar(255) DEFAULT NULL, | |
| 415 | - "receive_status" tinyint NOT NULL DEFAULT '0', | |
| 416 | - "receive_time" timestamp DEFAULT NULL, | |
| 417 | - "api_receive_code" varchar(63) DEFAULT NULL, | |
| 418 | - "api_receive_msg" varchar(255) DEFAULT NULL, | |
| 419 | - "creator" varchar(64) DEFAULT '', | |
| 420 | - "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 421 | - "updater" varchar(64) DEFAULT '', | |
| 422 | - "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 423 | - "deleted" bit NOT NULL DEFAULT FALSE, | |
| 424 | - PRIMARY KEY ("id") | |
| 425 | -) COMMENT '短信日志'; | |
| 426 | - | |
| 427 | -CREATE TABLE IF NOT EXISTS "sys_error_code" ( | |
| 428 | - "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, | |
| 429 | - "type" tinyint NOT NULL DEFAULT '0', | |
| 430 | - "application_name" varchar(50) NOT NULL, | |
| 431 | - "code" int NOT NULL DEFAULT '0', | |
| 432 | - "message" varchar(512) NOT NULL DEFAULT '', | |
| 433 | - "memo" varchar(512) DEFAULT '', | |
| 434 | - "creator" varchar(64) DEFAULT '', | |
| 435 | - "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 436 | - "updater" varchar(64) DEFAULT '', | |
| 437 | - "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 438 | - "deleted" bit NOT NULL DEFAULT FALSE, | |
| 439 | - PRIMARY KEY ("id") | |
| 440 | -) COMMENT '错误码表'; | |
| 441 | - | |
| 442 | -CREATE TABLE IF NOT EXISTS "sys_social_user" ( | |
| 443 | - "id" number NOT NULL GENERATED BY DEFAULT AS IDENTITY, | |
| 444 | - "user_id" bigint NOT NULL, | |
| 445 | - "user_type" tinyint NOT NULL DEFAULT '0', | |
| 446 | - "type" tinyint NOT NULL, | |
| 447 | - "openid" varchar(32) NOT NULL, | |
| 448 | - "token" varchar(256) DEFAULT NULL, | |
| 449 | - "union_id" varchar(32) NOT NULL, | |
| 450 | - "raw_token_info" varchar(1024) NOT NULL, | |
| 451 | - "nickname" varchar(32) NOT NULL, | |
| 452 | - "avatar" varchar(255) DEFAULT NULL, | |
| 453 | - "raw_user_info" varchar(1024) NOT NULL, | |
| 454 | - "creator" varchar(64) DEFAULT '', | |
| 455 | - "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 456 | - "updater" varchar(64) DEFAULT '', | |
| 457 | - "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 458 | - "deleted" bit NOT NULL DEFAULT FALSE, | |
| 459 | - PRIMARY KEY ("id") | |
| 460 | -) COMMENT '社交用户'; | |
| 461 | - | |
| 462 | -CREATE TABLE IF NOT EXISTS "sys_tenant" ( | |
| 463 | - "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, | |
| 464 | - "name" varchar(63) NOT NULL, | |
| 465 | - "contact_name" varchar(255) NOT NULL, | |
| 466 | - "contact_mobile" varchar(255), | |
| 467 | - "status" tinyint NOT NULL, | |
| 468 | - "creator" varchar(64) DEFAULT '', | |
| 469 | - "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 470 | - "updater" varchar(64) DEFAULT '', | |
| 471 | - "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 472 | - "deleted" bit NOT NULL DEFAULT FALSE, | |
| 473 | - PRIMARY KEY ("id") | |
| 474 | -) COMMENT '租户'; | |
| 475 | - | |
| 476 | - | |
| 477 | 70 | CREATE TABLE IF NOT EXISTS "pay_merchant" |
| 478 | 71 | ( |
| 479 | 72 | "id" number NOT NULL GENERATED BY DEFAULT AS IDENTITY, | ... | ... |
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthCheckCodeReqVO.java
| ... | ... | @@ -34,7 +34,7 @@ public class AppAuthCheckCodeReqVO { |
| 34 | 34 | @Pattern(regexp = "^[0-9]+$", message = "手机验证码必须都是数字") |
| 35 | 35 | private String code; |
| 36 | 36 | |
| 37 | - @ApiModelProperty(value = "发送场景", example = "1", notes = "对应 MbrSmsSceneEnum 枚举") | |
| 37 | + @ApiModelProperty(value = "发送场景", example = "1", notes = "对应 SmsSceneEnum 枚举") | |
| 38 | 38 | @NotNull(message = "发送场景不能为空") |
| 39 | 39 | @InEnum(SmsSceneEnum.class) |
| 40 | 40 | private Integer scene; | ... | ... |
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthSendSmsReqVO.java
| ... | ... | @@ -19,7 +19,7 @@ public class AppAuthSendSmsReqVO { |
| 19 | 19 | @Mobile |
| 20 | 20 | private String mobile; |
| 21 | 21 | |
| 22 | - @ApiModelProperty(value = "发送场景", example = "1", notes = "对应 MbrSmsSceneEnum 枚举") | |
| 22 | + @ApiModelProperty(value = "发送场景", example = "1", notes = "对应 SmsSceneEnum 枚举") | |
| 23 | 23 | @NotNull(message = "发送场景不能为空") |
| 24 | 24 | @InEnum(SmsSceneEnum.class) |
| 25 | 25 | private Integer scene; | ... | ... |
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthServiceImpl.java
| ... | ... | @@ -281,9 +281,8 @@ public class MemberAuthServiceImpl implements MemberAuthService { |
| 281 | 281 | MemberUserDO userDO = checkOldPassword(userId, reqVO.getOldPassword()); |
| 282 | 282 | |
| 283 | 283 | // 更新用户密码 |
| 284 | - MemberUserDO mbrUserDO = MemberUserDO.builder().id(userDO.getId()) | |
| 285 | - .password(passwordEncoder.encode(reqVO.getPassword())).build(); | |
| 286 | - userMapper.updateById(mbrUserDO); | |
| 284 | + userMapper.updateById(MemberUserDO.builder().id(userDO.getId()) | |
| 285 | + .password(passwordEncoder.encode(reqVO.getPassword())).build()); | |
| 287 | 286 | } |
| 288 | 287 | |
| 289 | 288 | @Override |
| ... | ... | @@ -296,10 +295,8 @@ public class MemberAuthServiceImpl implements MemberAuthService { |
| 296 | 295 | getClientIP())); |
| 297 | 296 | |
| 298 | 297 | // 更新密码 |
| 299 | - MemberUserDO mbrUserDO = MemberUserDO.builder().build(); | |
| 300 | - mbrUserDO.setId(userDO.getId()); | |
| 301 | - mbrUserDO.setPassword(passwordEncoder.encode(reqVO.getPassword())); | |
| 302 | - userMapper.updateById(mbrUserDO); | |
| 298 | + userMapper.updateById(MemberUserDO.builder().id(userDO.getId()) | |
| 299 | + .password(passwordEncoder.encode(reqVO.getPassword())).build()); | |
| 303 | 300 | } |
| 304 | 301 | |
| 305 | 302 | @Override | ... | ... |
yudao-module-member/yudao-module-member-impl/src/test/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthServiceTest.java
| ... | ... | @@ -53,7 +53,7 @@ public class MemberAuthServiceTest extends BaseDbAndRedisUnitTest { |
| 53 | 53 | @MockBean |
| 54 | 54 | private PasswordEncoder passwordEncoder; |
| 55 | 55 | @Resource |
| 56 | - private MemberUserMapper mbrUserMapper; | |
| 56 | + private MemberUserMapper memberUserMapper; | |
| 57 | 57 | @Resource |
| 58 | 58 | private MemberAuthServiceImpl authService; |
| 59 | 59 | |
| ... | ... | @@ -61,7 +61,7 @@ public class MemberAuthServiceTest extends BaseDbAndRedisUnitTest { |
| 61 | 61 | public void testUpdatePassword_success(){ |
| 62 | 62 | // 准备参数 |
| 63 | 63 | MemberUserDO userDO = randomUserDO(); |
| 64 | - mbrUserMapper.insert(userDO); | |
| 64 | + memberUserMapper.insert(userDO); | |
| 65 | 65 | |
| 66 | 66 | // 新密码 |
| 67 | 67 | String newPassword = randomString(); |
| ... | ... | @@ -79,14 +79,14 @@ public class MemberAuthServiceTest extends BaseDbAndRedisUnitTest { |
| 79 | 79 | |
| 80 | 80 | // 更新用户密码 |
| 81 | 81 | authService.updatePassword(userDO.getId(), reqVO); |
| 82 | - assertEquals(mbrUserMapper.selectById(userDO.getId()).getPassword(),newPassword); | |
| 82 | + assertEquals(memberUserMapper.selectById(userDO.getId()).getPassword(),newPassword); | |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | @Test |
| 86 | 86 | public void testResetPassword_success(){ |
| 87 | 87 | // 准备参数 |
| 88 | 88 | MemberUserDO userDO = randomUserDO(); |
| 89 | - mbrUserMapper.insert(userDO); | |
| 89 | + memberUserMapper.insert(userDO); | |
| 90 | 90 | |
| 91 | 91 | // 随机密码 |
| 92 | 92 | String password = randomNumbers(11); |
| ... | ... | @@ -103,7 +103,7 @@ public class MemberAuthServiceTest extends BaseDbAndRedisUnitTest { |
| 103 | 103 | reqVO.setCode(code); |
| 104 | 104 | |
| 105 | 105 | authService.resetPassword(reqVO); |
| 106 | - assertEquals(mbrUserMapper.selectById(userDO.getId()).getPassword(),password); | |
| 106 | + assertEquals(memberUserMapper.selectById(userDO.getId()).getPassword(),password); | |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | ... | ... |
yudao-module-member/yudao-module-member-impl/src/test/java/cn/iocoder/yudao/module/member/service/user/MemberUserServiceImplTest.java
| ... | ... | @@ -37,7 +37,7 @@ import static org.mockito.Mockito.*; |
| 37 | 37 | public class MemberUserServiceImplTest extends BaseDbAndRedisUnitTest { |
| 38 | 38 | |
| 39 | 39 | @Resource |
| 40 | - private MemberUserServiceImpl mbrUserService; | |
| 40 | + private MemberUserServiceImpl memberUserService; | |
| 41 | 41 | |
| 42 | 42 | @Resource |
| 43 | 43 | private StringRedisTemplate stringRedisTemplate; |
| ... | ... | @@ -67,9 +67,9 @@ public class MemberUserServiceImplTest extends BaseDbAndRedisUnitTest { |
| 67 | 67 | String newNickName = randomString(); |
| 68 | 68 | |
| 69 | 69 | // 调用接口修改昵称 |
| 70 | - mbrUserService.updateUserNickname(userDO.getId(),newNickName); | |
| 70 | + memberUserService.updateUserNickname(userDO.getId(),newNickName); | |
| 71 | 71 | // 查询新修改后的昵称 |
| 72 | - String nickname = mbrUserService.getUser(userDO.getId()).getNickname(); | |
| 72 | + String nickname = memberUserService.getUser(userDO.getId()).getNickname(); | |
| 73 | 73 | // 断言 |
| 74 | 74 | assertEquals(newNickName,nickname); |
| 75 | 75 | } |
| ... | ... | @@ -88,7 +88,7 @@ public class MemberUserServiceImplTest extends BaseDbAndRedisUnitTest { |
| 88 | 88 | String avatar = randomString(); |
| 89 | 89 | when(fileCoreService.createFile(anyString(), eq(avatarFileBytes))).thenReturn(avatar); |
| 90 | 90 | // 调用 |
| 91 | - String str = mbrUserService.updateUserAvatar(userId, avatarFile); | |
| 91 | + String str = memberUserService.updateUserAvatar(userId, avatarFile); | |
| 92 | 92 | // 断言 |
| 93 | 93 | assertEquals(avatar, str); |
| 94 | 94 | } |
| ... | ... | @@ -119,9 +119,9 @@ public class MemberUserServiceImplTest extends BaseDbAndRedisUnitTest { |
| 119 | 119 | reqVO.setCode(newCode); |
| 120 | 120 | reqVO.setOldMobile(oldMobile); |
| 121 | 121 | reqVO.setOldCode(oldCode); |
| 122 | - mbrUserService.updateUserMobile(userDO.getId(),reqVO); | |
| 122 | + memberUserService.updateUserMobile(userDO.getId(),reqVO); | |
| 123 | 123 | |
| 124 | - assertEquals(mbrUserService.getUser(userDO.getId()).getMobile(),newMobile); | |
| 124 | + assertEquals(memberUserService.getUser(userDO.getId()).getMobile(),newMobile); | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | // ========== 随机对象 ========== | ... | ... |
yudao-module-member/yudao-module-member-impl/src/test/resources/application-unit-test.yaml
| ... | ... | @@ -45,5 +45,7 @@ mybatis: |
| 45 | 45 | yudao: |
| 46 | 46 | info: |
| 47 | 47 | base-package: cn.iocoder.yudao.module.member.dal.mysql |
| 48 | + member-package: cn.iocoder.yudao.module.member # TODO 芋艿:要清理掉 | |
| 49 | + system-package: cn.iocoder.yudao.module.system # TODO 芋艿:要清理掉 | |
| 48 | 50 | core-service: |
| 49 | 51 | base-package: cn.iocoder.yudao.module.member.dal.mysql # TODO 芋艿:要清理掉 | ... | ... |
yudao-module-member/yudao-module-member-impl/src/test/resources/sql/clean.sql
yudao-module-member/yudao-module-member-impl/src/test/resources/sql/create_tables.sql
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java
| ... | ... | @@ -50,7 +50,7 @@ public class AuthController { |
| 50 | 50 | @Resource |
| 51 | 51 | private PermissionService permissionService; |
| 52 | 52 | @Resource |
| 53 | - private SocialUserService socialCoreService; | |
| 53 | + private SocialUserService socialUserService; | |
| 54 | 54 | |
| 55 | 55 | @PostMapping("/login") |
| 56 | 56 | @ApiOperation("使用账号密码登录") |
| ... | ... | @@ -102,7 +102,7 @@ public class AuthController { |
| 102 | 102 | }) |
| 103 | 103 | public CommonResult<String> socialAuthRedirect(@RequestParam("type") Integer type, |
| 104 | 104 | @RequestParam("redirectUri") String redirectUri) { |
| 105 | - return CommonResult.success(socialCoreService.getAuthorizeUrl(type, redirectUri)); | |
| 105 | + return CommonResult.success(socialUserService.getAuthorizeUrl(type, redirectUri)); | |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | @PostMapping("/social-login") |
| ... | ... | @@ -133,7 +133,7 @@ public class AuthController { |
| 133 | 133 | @DeleteMapping("/social-unbind") |
| 134 | 134 | @ApiOperation("取消社交绑定") |
| 135 | 135 | public CommonResult<Boolean> socialUnbind(@RequestBody AuthSocialUnbindReqVO reqVO) { |
| 136 | - socialCoreService.unbindSocialUser(getLoginUserId(), UserTypeEnum.ADMIN.getValue(), reqVO.getType(), reqVO.getUnionId()); | |
| 136 | + socialUserService.unbindSocialUser(getLoginUserId(), UserTypeEnum.ADMIN.getValue(), reqVO.getType(), reqVO.getUnionId()); | |
| 137 | 137 | return CommonResult.success(true); |
| 138 | 138 | } |
| 139 | 139 | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/UserSessionController.java
| ... | ... | @@ -3,9 +3,9 @@ package cn.iocoder.yudao.module.system.controller.admin.auth; |
| 3 | 3 | import cn.iocoder.yudao.module.system.controller.admin.auth.vo.session.UserSessionPageItemRespVO; |
| 4 | 4 | import cn.iocoder.yudao.module.system.controller.admin.auth.vo.session.UserSessionPageReqVO; |
| 5 | 5 | import cn.iocoder.yudao.module.system.convert.auth.UserSessionConvert; |
| 6 | -import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysDeptDO; | |
| 6 | +import cn.iocoder.yudao.module.system.dal.dataobject.auth.UserSessionDO; | |
| 7 | +import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO; | |
| 7 | 8 | import cn.iocoder.yudao.module.system.service.auth.UserSessionService; |
| 8 | -import cn.iocoder.yudao.module.system.dal.dataobject.auth.SysUserSessionDO; | |
| 9 | 9 | import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; |
| 10 | 10 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 11 | 11 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| ... | ... | @@ -45,12 +45,12 @@ public class UserSessionController { |
| 45 | 45 | @PreAuthorize("@ss.hasPermission('system:user-session:page')") |
| 46 | 46 | public CommonResult<PageResult<UserSessionPageItemRespVO>> getUserSessionPage(@Validated UserSessionPageReqVO reqVO) { |
| 47 | 47 | // 获得 Session 分页 |
| 48 | - PageResult<SysUserSessionDO> pageResult = userSessionService.getUserSessionPage(reqVO); | |
| 48 | + PageResult<UserSessionDO> pageResult = userSessionService.getUserSessionPage(reqVO); | |
| 49 | 49 | |
| 50 | 50 | // 获得拼接需要的数据 |
| 51 | 51 | Map<Long, AdminUserDO> userMap = userService.getUserMap( |
| 52 | - convertList(pageResult.getList(), SysUserSessionDO::getUserId)); | |
| 53 | - Map<Long, SysDeptDO> deptMap = deptService.getDeptMap( | |
| 52 | + convertList(pageResult.getList(), UserSessionDO::getUserId)); | |
| 53 | + Map<Long, DeptDO> deptMap = deptService.getDeptMap( | |
| 54 | 54 | convertList(userMap.values(), AdminUserDO::getDeptId)); |
| 55 | 55 | // 拼接结果返回 |
| 56 | 56 | List<UserSessionPageItemRespVO> sessionList = new ArrayList<>(pageResult.getList().size()); | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/auth/AuthSocialBindReqVO.java
| ... | ... | @@ -19,7 +19,7 @@ import javax.validation.constraints.NotNull; |
| 19 | 19 | @Builder |
| 20 | 20 | public class AuthSocialBindReqVO { |
| 21 | 21 | |
| 22 | - @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 SysUserSocialTypeEnum 枚举值") | |
| 22 | + @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 UserSocialTypeEnum 枚举值") | |
| 23 | 23 | @InEnum(SocialTypeEnum.class) |
| 24 | 24 | @NotNull(message = "社交平台的类型不能为空") |
| 25 | 25 | private Integer type; | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/auth/AuthSocialLogin2ReqVO.java
| ... | ... | @@ -21,7 +21,7 @@ import javax.validation.constraints.Pattern; |
| 21 | 21 | @Builder |
| 22 | 22 | public class AuthSocialLogin2ReqVO { |
| 23 | 23 | |
| 24 | - @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 SysUserSocialTypeEnum 枚举值") | |
| 24 | + @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 UserSocialTypeEnum 枚举值") | |
| 25 | 25 | @InEnum(SocialTypeEnum.class) |
| 26 | 26 | @NotNull(message = "社交平台的类型不能为空") |
| 27 | 27 | private Integer type; | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/auth/AuthSocialLoginReqVO.java
| ... | ... | @@ -19,7 +19,7 @@ import javax.validation.constraints.NotNull; |
| 19 | 19 | @Builder |
| 20 | 20 | public class AuthSocialLoginReqVO { |
| 21 | 21 | |
| 22 | - @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 SysUserSocialTypeEnum 枚举值") | |
| 22 | + @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 UserSocialTypeEnum 枚举值") | |
| 23 | 23 | @InEnum(SocialTypeEnum.class) |
| 24 | 24 | @NotNull(message = "社交平台的类型不能为空") |
| 25 | 25 | private Integer type; | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/auth/AuthSocialUnbindReqVO.java
| ... | ... | @@ -19,7 +19,7 @@ import javax.validation.constraints.NotNull; |
| 19 | 19 | @Builder |
| 20 | 20 | public class AuthSocialUnbindReqVO { |
| 21 | 21 | |
| 22 | - @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 SysUserSocialTypeEnum 枚举值") | |
| 22 | + @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 UserSocialTypeEnum 枚举值") | |
| 23 | 23 | @InEnum(SocialTypeEnum.class) |
| 24 | 24 | @NotNull(message = "社交平台的类型不能为空") |
| 25 | 25 | private Integer type; | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/DeptController.java
| ... | ... | @@ -4,7 +4,7 @@ import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; |
| 4 | 4 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 5 | 5 | import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.*; |
| 6 | 6 | import cn.iocoder.yudao.module.system.convert.dept.DeptConvert; |
| 7 | -import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysDeptDO; | |
| 7 | +import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO; | |
| 8 | 8 | import cn.iocoder.yudao.module.system.service.dept.DeptService; |
| 9 | 9 | import io.swagger.annotations.Api; |
| 10 | 10 | import io.swagger.annotations.ApiImplicitParam; |
| ... | ... | @@ -58,8 +58,8 @@ public class DeptController { |
| 58 | 58 | @ApiOperation("获取部门列表") |
| 59 | 59 | @PreAuthorize("@ss.hasPermission('system:dept:query')") |
| 60 | 60 | public CommonResult<List<DeptRespVO>> listDepts(DeptListReqVO reqVO) { |
| 61 | - List<SysDeptDO> list = deptService.getSimpleDepts(reqVO); | |
| 62 | - list.sort(Comparator.comparing(SysDeptDO::getSort)); | |
| 61 | + List<DeptDO> list = deptService.getSimpleDepts(reqVO); | |
| 62 | + list.sort(Comparator.comparing(DeptDO::getSort)); | |
| 63 | 63 | return success(DeptConvert.INSTANCE.convertList(list)); |
| 64 | 64 | } |
| 65 | 65 | |
| ... | ... | @@ -69,9 +69,9 @@ public class DeptController { |
| 69 | 69 | // 获得部门列表,只要开启状态的 |
| 70 | 70 | DeptListReqVO reqVO = new DeptListReqVO(); |
| 71 | 71 | reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); |
| 72 | - List<SysDeptDO> list = deptService.getSimpleDepts(reqVO); | |
| 72 | + List<DeptDO> list = deptService.getSimpleDepts(reqVO); | |
| 73 | 73 | // 排序后,返回给前端 |
| 74 | - list.sort(Comparator.comparing(SysDeptDO::getSort)); | |
| 74 | + list.sort(Comparator.comparing(DeptDO::getSort)); | |
| 75 | 75 | return success(DeptConvert.INSTANCE.convertList02(list)); |
| 76 | 76 | } |
| 77 | 77 | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/PostController.java
| ... | ... | @@ -7,7 +7,7 @@ import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; |
| 7 | 7 | import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; |
| 8 | 8 | import cn.iocoder.yudao.module.system.controller.admin.dept.vo.post.*; |
| 9 | 9 | import cn.iocoder.yudao.module.system.convert.dept.PostConvert; |
| 10 | -import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysPostDO; | |
| 10 | +import cn.iocoder.yudao.module.system.dal.dataobject.dept.PostDO; | |
| 11 | 11 | import cn.iocoder.yudao.module.system.service.dept.PostService; |
| 12 | 12 | import io.swagger.annotations.Api; |
| 13 | 13 | import io.swagger.annotations.ApiImplicitParam; |
| ... | ... | @@ -72,9 +72,9 @@ public class PostController { |
| 72 | 72 | @ApiOperation(value = "获取岗位精简信息列表", notes = "只包含被开启的岗位,主要用于前端的下拉选项") |
| 73 | 73 | public CommonResult<List<PostSimpleRespVO>> getSimplePosts() { |
| 74 | 74 | // 获得岗位列表,只要开启状态的 |
| 75 | - List<SysPostDO> list = postService.getPosts(null, Collections.singleton(CommonStatusEnum.ENABLE.getStatus())); | |
| 75 | + List<PostDO> list = postService.getPosts(null, Collections.singleton(CommonStatusEnum.ENABLE.getStatus())); | |
| 76 | 76 | // 排序后,返回给前端 |
| 77 | - list.sort(Comparator.comparing(SysPostDO::getSort)); | |
| 77 | + list.sort(Comparator.comparing(PostDO::getSort)); | |
| 78 | 78 | return success(PostConvert.INSTANCE.convertList02(list)); |
| 79 | 79 | } |
| 80 | 80 | |
| ... | ... | @@ -90,7 +90,7 @@ public class PostController { |
| 90 | 90 | @PreAuthorize("@ss.hasPermission('system:post:export')") |
| 91 | 91 | @OperateLog(type = EXPORT) |
| 92 | 92 | public void export(HttpServletResponse response, @Validated PostExportReqVO reqVO) throws IOException { |
| 93 | - List<SysPostDO> posts = postService.getPosts(reqVO); | |
| 93 | + List<PostDO> posts = postService.getPosts(reqVO); | |
| 94 | 94 | List<PostExcelVO> data = PostConvert.INSTANCE.convertList03(posts); |
| 95 | 95 | // 输出 |
| 96 | 96 | ExcelUtils.write(response, "岗位数据.xls", "岗位列表", PostExcelVO.class, data); | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptBaseVO.java
| ... | ... | @@ -40,7 +40,7 @@ public class DeptBaseVO { |
| 40 | 40 | @Size(max = 50, message = "邮箱长度不能超过50个字符") |
| 41 | 41 | private String email; |
| 42 | 42 | |
| 43 | - @ApiModelProperty(value = "状态", required = true, example = "1", notes = "见 SysCommonStatusEnum 枚举") | |
| 43 | + @ApiModelProperty(value = "状态", required = true, example = "1", notes = "见 CommonStatusEnum 枚举") | |
| 44 | 44 | @NotNull(message = "状态不能为空") |
| 45 | 45 | // @InEnum(value = CommonStatusEnum.class, message = "修改状态必须是 {value}") |
| 46 | 46 | private Integer status; | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptListReqVO.java
| ... | ... | @@ -11,7 +11,7 @@ public class DeptListReqVO { |
| 11 | 11 | @ApiModelProperty(value = "部门名称", example = "芋道", notes = "模糊匹配") |
| 12 | 12 | private String name; |
| 13 | 13 | |
| 14 | - @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 SysCommonStatusEnum 枚举类") | |
| 14 | + @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类") | |
| 15 | 15 | private Integer status; |
| 16 | 16 | |
| 17 | 17 | } | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptRespVO.java
| ... | ... | @@ -15,7 +15,7 @@ public class DeptRespVO extends DeptBaseVO { |
| 15 | 15 | @ApiModelProperty(value = "部门编号", required = true, example = "1024") |
| 16 | 16 | private Long id; |
| 17 | 17 | |
| 18 | - @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 SysCommonStatusEnum 枚举类") | |
| 18 | + @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举类") | |
| 19 | 19 | private Integer status; |
| 20 | 20 | |
| 21 | 21 | @ApiModelProperty(value = "创建时间", required = true, example = "时间戳格式") | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/post/PostBaseVO.java
| ... | ... | @@ -28,7 +28,7 @@ public class PostBaseVO { |
| 28 | 28 | @NotNull(message = "显示顺序不能为空") |
| 29 | 29 | private Integer sort; |
| 30 | 30 | |
| 31 | - @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 SysCommonStatusEnum 枚举类") | |
| 31 | + @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举类") | |
| 32 | 32 | private Integer status; |
| 33 | 33 | |
| 34 | 34 | @ApiModelProperty(value = "备注", example = "快乐的备注") | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/post/PostExportReqVO.java
| ... | ... | @@ -4,7 +4,7 @@ import io.swagger.annotations.ApiModel; |
| 4 | 4 | import io.swagger.annotations.ApiModelProperty; |
| 5 | 5 | import lombok.Data; |
| 6 | 6 | |
| 7 | -@ApiModel(value = "管理后台 - 岗位导出 Request VO", description = "参数和 SysPostExcelVO 是一致的") | |
| 7 | +@ApiModel(value = "管理后台 - 岗位导出 Request VO", description = "参数和 PostExcelVO 是一致的") | |
| 8 | 8 | @Data |
| 9 | 9 | public class PostExportReqVO { |
| 10 | 10 | |
| ... | ... | @@ -14,7 +14,7 @@ public class PostExportReqVO { |
| 14 | 14 | @ApiModelProperty(value = "岗位名称", example = "芋道", notes = "模糊匹配") |
| 15 | 15 | private String name; |
| 16 | 16 | |
| 17 | - @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 SysCommonStatusEnum 枚举类") | |
| 17 | + @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类") | |
| 18 | 18 | private Integer status; |
| 19 | 19 | |
| 20 | 20 | } | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/post/PostListReqVO.java
| ... | ... | @@ -13,7 +13,7 @@ public class PostListReqVO extends PostBaseVO { |
| 13 | 13 | @ApiModelProperty(value = "岗位名称", example = "芋道", notes = "模糊匹配") |
| 14 | 14 | private String name; |
| 15 | 15 | |
| 16 | - @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 SysCommonStatusEnum 枚举类") | |
| 16 | + @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类") | |
| 17 | 17 | private Integer status; |
| 18 | 18 | |
| 19 | 19 | } | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/post/PostPageReqVO.java
| ... | ... | @@ -17,7 +17,7 @@ public class PostPageReqVO extends PageParam { |
| 17 | 17 | @ApiModelProperty(value = "岗位名称", example = "芋道", notes = "模糊匹配") |
| 18 | 18 | private String name; |
| 19 | 19 | |
| 20 | - @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 SysCommonStatusEnum 枚举类") | |
| 20 | + @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类") | |
| 21 | 21 | private Integer status; |
| 22 | 22 | |
| 23 | 23 | } | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/DictDataController.java
| 1 | 1 | package cn.iocoder.yudao.module.system.controller.admin.dict; |
| 2 | 2 | |
| 3 | -import cn.iocoder.yudao.module.system.dal.dataobject.dict.SysDictDataDO; | |
| 3 | +import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictDataDO; | |
| 4 | 4 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 5 | 5 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 6 | 6 | import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; |
| ... | ... | @@ -62,7 +62,7 @@ public class DictDataController { |
| 62 | 62 | @ApiOperation(value = "获得全部字典数据列表", notes = "一般用于管理后台缓存字典数据在本地") |
| 63 | 63 | // 无需添加权限认证,因为前端全局都需要 |
| 64 | 64 | public CommonResult<List<DictDataSimpleRespVO>> getSimpleDictDatas() { |
| 65 | - List<SysDictDataDO> list = dictDataService.getDictDatas(); | |
| 65 | + List<DictDataDO> list = dictDataService.getDictDatas(); | |
| 66 | 66 | return success(DictDataConvert.INSTANCE.convertList(list)); |
| 67 | 67 | } |
| 68 | 68 | |
| ... | ... | @@ -86,7 +86,7 @@ public class DictDataController { |
| 86 | 86 | @PreAuthorize("@ss.hasPermission('system:dict:export')") |
| 87 | 87 | @OperateLog(type = EXPORT) |
| 88 | 88 | public void export(HttpServletResponse response, @Valid DictDataExportReqVO reqVO) throws IOException { |
| 89 | - List<SysDictDataDO> list = dictDataService.getDictDatas(reqVO); | |
| 89 | + List<DictDataDO> list = dictDataService.getDictDatas(reqVO); | |
| 90 | 90 | List<DictDataExcelVO> data = DictDataConvert.INSTANCE.convertList02(list); |
| 91 | 91 | // 输出 |
| 92 | 92 | ExcelUtils.write(response, "字典数据.xls", "数据列表", DictDataExcelVO.class, data); | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/data/DictDataBaseVO.java
| ... | ... | @@ -33,9 +33,9 @@ public class DictDataBaseVO { |
| 33 | 33 | @Size(max = 100, message = "字典类型长度不能超过100个字符") |
| 34 | 34 | private String dictType; |
| 35 | 35 | |
| 36 | - @ApiModelProperty(value = "状态", required = true, example = "1", notes = "见 SysCommonStatusEnum 枚举") | |
| 36 | + @ApiModelProperty(value = "状态", required = true, example = "1", notes = "见 CommonStatusEnum 枚举") | |
| 37 | 37 | @NotNull(message = "状态不能为空") |
| 38 | -// @InEnum(value = SysCommonStatusEnum.class, message = "修改状态必须是 {value}") | |
| 38 | +// @InEnum(value = CommonStatusEnum.class, message = "修改状态必须是 {value}") | |
| 39 | 39 | private Integer status; |
| 40 | 40 | |
| 41 | 41 | @ApiModelProperty(value = "备注", example = "我是一个角色") | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/data/DictDataExportReqVO.java
| ... | ... | @@ -18,7 +18,7 @@ public class DictDataExportReqVO { |
| 18 | 18 | @Size(max = 100, message = "字典类型类型长度不能超过100个字符") |
| 19 | 19 | private String dictType; |
| 20 | 20 | |
| 21 | - @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 SysCommonStatusEnum 枚举类") | |
| 21 | + @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类") | |
| 22 | 22 | private Integer status; |
| 23 | 23 | |
| 24 | 24 | } | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/data/DictDataPageReqVO.java
| ... | ... | @@ -21,7 +21,7 @@ public class DictDataPageReqVO extends PageParam { |
| 21 | 21 | @Size(max = 100, message = "字典类型类型长度不能超过100个字符") |
| 22 | 22 | private String dictType; |
| 23 | 23 | |
| 24 | - @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 SysCommonStatusEnum 枚举类") | |
| 24 | + @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类") | |
| 25 | 25 | private Integer status; |
| 26 | 26 | |
| 27 | 27 | } | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/type/DictTypeExportReqVO.java
| ... | ... | @@ -19,7 +19,7 @@ public class DictTypeExportReqVO { |
| 19 | 19 | @ApiModelProperty(value = "字典类型", example = "sys_common_sex", notes = "模糊匹配") |
| 20 | 20 | private String type; |
| 21 | 21 | |
| 22 | - @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 SysCommonStatusEnum 枚举类") | |
| 22 | + @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类") | |
| 23 | 23 | private Integer status; |
| 24 | 24 | |
| 25 | 25 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/type/DictTypePageReqVO.java
| ... | ... | @@ -24,7 +24,7 @@ public class DictTypePageReqVO extends PageParam { |
| 24 | 24 | @Size(max = 100, message = "字典类型类型长度不能超过100个字符") |
| 25 | 25 | private String type; |
| 26 | 26 | |
| 27 | - @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 SysCommonStatusEnum 枚举类") | |
| 27 | + @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类") | |
| 28 | 28 | private Integer status; |
| 29 | 29 | |
| 30 | 30 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/errorcode/vo/ErrorCodePageReqVO.java
| ... | ... | @@ -18,7 +18,7 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ |
| 18 | 18 | @ToString(callSuper = true) |
| 19 | 19 | public class ErrorCodePageReqVO extends PageParam { |
| 20 | 20 | |
| 21 | - @ApiModelProperty(value = "错误码类型", example = "1", notes = "参见 SysErrorCodeTypeEnum 枚举类") | |
| 21 | + @ApiModelProperty(value = "错误码类型", example = "1", notes = "参见 ErrorCodeTypeEnum 枚举类") | |
| 22 | 22 | private Integer type; |
| 23 | 23 | |
| 24 | 24 | @ApiModelProperty(value = "应用名", example = "dashboard") | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/errorcode/vo/ErrorCodeRespVO.java
| ... | ... | @@ -17,7 +17,7 @@ public class ErrorCodeRespVO extends ErrorCodeBaseVO { |
| 17 | 17 | @ApiModelProperty(value = "错误码编号", required = true, example = "1024") |
| 18 | 18 | private Long id; |
| 19 | 19 | |
| 20 | - @ApiModelProperty(value = "错误码类型", required = true, example = "1", notes = "参见 SysErrorCodeTypeEnum 枚举类") | |
| 20 | + @ApiModelProperty(value = "错误码类型", required = true, example = "1", notes = "参见 ErrorCodeTypeEnum 枚举类") | |
| 21 | 21 | private Integer type; |
| 22 | 22 | |
| 23 | 23 | @ApiModelProperty(value = "创建时间", required = true) | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/LoginLogController.java
| 1 | 1 | package cn.iocoder.yudao.module.system.controller.admin.logger; |
| 2 | 2 | |
| 3 | -import cn.iocoder.yudao.module.system.dal.dataobject.logger.SysLoginLogDO; | |
| 3 | +import cn.iocoder.yudao.module.system.dal.dataobject.logger.LoginLogDO; | |
| 4 | 4 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 5 | 5 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 6 | 6 | import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; |
| ... | ... | @@ -40,7 +40,7 @@ public class LoginLogController { |
| 40 | 40 | @ApiOperation("获得登录日志分页列表") |
| 41 | 41 | @PreAuthorize("@ss.hasPermission('system:login-log:query')") |
| 42 | 42 | public CommonResult<PageResult<LoginLogRespVO>> getLoginLogPage(@Valid LoginLogPageReqVO reqVO) { |
| 43 | - PageResult<SysLoginLogDO> page = loginLogService.getLoginLogPage(reqVO); | |
| 43 | + PageResult<LoginLogDO> page = loginLogService.getLoginLogPage(reqVO); | |
| 44 | 44 | return CommonResult.success(LoginLogConvert.INSTANCE.convertPage(page)); |
| 45 | 45 | } |
| 46 | 46 | |
| ... | ... | @@ -49,7 +49,7 @@ public class LoginLogController { |
| 49 | 49 | @PreAuthorize("@ss.hasPermission('system:login-log:export')") |
| 50 | 50 | @OperateLog(type = EXPORT) |
| 51 | 51 | public void exportLoginLog(HttpServletResponse response, @Valid LoginLogExportReqVO reqVO) throws IOException { |
| 52 | - List<SysLoginLogDO> list = loginLogService.getLoginLogList(reqVO); | |
| 52 | + List<LoginLogDO> list = loginLogService.getLoginLogList(reqVO); | |
| 53 | 53 | // 拼接数据 |
| 54 | 54 | List<LoginLogExcelVO> data = LoginLogConvert.INSTANCE.convertList(list); |
| 55 | 55 | // 输出 | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/loginlog/LoginLogBaseVO.java
| ... | ... | @@ -15,7 +15,7 @@ import javax.validation.constraints.Size; |
| 15 | 15 | @Data |
| 16 | 16 | public class LoginLogBaseVO { |
| 17 | 17 | |
| 18 | - @ApiModelProperty(value = "日志类型", required = true, example = "1", notes = "参见 SysLoginLogTypeEnum 枚举类") | |
| 18 | + @ApiModelProperty(value = "日志类型", required = true, example = "1", notes = "参见 LoginLogTypeEnum 枚举类") | |
| 19 | 19 | @NotNull(message = "日志类型不能为空") |
| 20 | 20 | private Integer logType; |
| 21 | 21 | |
| ... | ... | @@ -28,7 +28,7 @@ public class LoginLogBaseVO { |
| 28 | 28 | @Size(max = 30, message = "用户账号长度不能超过30个字符") |
| 29 | 29 | private String username; |
| 30 | 30 | |
| 31 | - @ApiModelProperty(value = "登录结果", required = true, example = "1", notes = "参见 SysLoginResultEnum 枚举类") | |
| 31 | + @ApiModelProperty(value = "登录结果", required = true, example = "1", notes = "参见 LoginResultEnum 枚举类") | |
| 32 | 32 | @NotNull(message = "登录结果不能为空") |
| 33 | 33 | private Integer result; |
| 34 | 34 | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/operatelog/OperateLogBaseVO.java
| ... | ... | @@ -31,7 +31,7 @@ public class OperateLogBaseVO { |
| 31 | 31 | @NotEmpty(message = "操作名") |
| 32 | 32 | private String name; |
| 33 | 33 | |
| 34 | - @ApiModelProperty(value = "操作分类", required = true, example = "1", notes = "参见 SysOperateLogTypeEnum 枚举类") | |
| 34 | + @ApiModelProperty(value = "操作分类", required = true, example = "1", notes = "参见 OperateLogTypeEnum 枚举类") | |
| 35 | 35 | @NotNull(message = "操作分类不能为空") |
| 36 | 36 | private Integer type; |
| 37 | 37 | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/operatelog/OperateLogExportReqVO.java
| ... | ... | @@ -19,7 +19,7 @@ public class OperateLogExportReqVO { |
| 19 | 19 | @ApiModelProperty(value = "用户昵称", example = "芋道", notes = "模拟匹配") |
| 20 | 20 | private String userNickname; |
| 21 | 21 | |
| 22 | - @ApiModelProperty(value = "操作分类", example = "1", notes = "参见 SysOperateLogTypeEnum 枚举类") | |
| 22 | + @ApiModelProperty(value = "操作分类", example = "1", notes = "参见 OperateLogTypeEnum 枚举类") | |
| 23 | 23 | private Integer type; |
| 24 | 24 | |
| 25 | 25 | @ApiModelProperty(value = "操作状态", example = "true") | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/operatelog/OperateLogPageReqVO.java
| ... | ... | @@ -20,7 +20,7 @@ public class OperateLogPageReqVO extends PageParam { |
| 20 | 20 | @ApiModelProperty(value = "用户昵称", example = "芋道", notes = "模拟匹配") |
| 21 | 21 | private String userNickname; |
| 22 | 22 | |
| 23 | - @ApiModelProperty(value = "操作分类", example = "1", notes = "参见 SysOperateLogTypeEnum 枚举类") | |
| 23 | + @ApiModelProperty(value = "操作分类", example = "1", notes = "参见 OperateLogTypeEnum 枚举类") | |
| 24 | 24 | private Integer type; |
| 25 | 25 | |
| 26 | 26 | @ApiModelProperty(value = "操作状态", example = "true") | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notice/vo/NoticeBaseVO.java
| ... | ... | @@ -26,7 +26,7 @@ public class NoticeBaseVO { |
| 26 | 26 | @ApiModelProperty(value = "公告内容", required = true, example = "半生编码") |
| 27 | 27 | private String content; |
| 28 | 28 | |
| 29 | - @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 SysCommonStatusEnum 枚举类") | |
| 29 | + @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举类") | |
| 30 | 30 | private Integer status; |
| 31 | 31 | |
| 32 | 32 | } | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notice/vo/NoticePageReqVO.java
| ... | ... | @@ -14,7 +14,7 @@ public class NoticePageReqVO extends PageParam { |
| 14 | 14 | @ApiModelProperty(value = "通知公告名称", example = "芋道", notes = "模糊匹配") |
| 15 | 15 | private String title; |
| 16 | 16 | |
| 17 | - @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 SysCommonStatusEnum 枚举类") | |
| 17 | + @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类") | |
| 18 | 18 | private Integer status; |
| 19 | 19 | |
| 20 | 20 | } | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/menu/MenuBaseVO.java
| ... | ... | @@ -23,7 +23,7 @@ public class MenuBaseVO { |
| 23 | 23 | @Size(max = 100) |
| 24 | 24 | private String permission; |
| 25 | 25 | |
| 26 | - @ApiModelProperty(value = "类型", required = true, example = "1", notes = "参见 SysMenuTypeEnum 枚举类") | |
| 26 | + @ApiModelProperty(value = "类型", required = true, example = "1", notes = "参见 MenuTypeEnum 枚举类") | |
| 27 | 27 | @NotNull(message = "菜单类型不能为空") |
| 28 | 28 | private Integer type; |
| 29 | 29 | |
| ... | ... | @@ -46,7 +46,7 @@ public class MenuBaseVO { |
| 46 | 46 | @Size(max = 200, message = "组件路径不能超过255个字符") |
| 47 | 47 | private String component; |
| 48 | 48 | |
| 49 | - @ApiModelProperty(value = "状态", required = true, example = "1", notes = "见 SysCommonStatusEnum 枚举") | |
| 49 | + @ApiModelProperty(value = "状态", required = true, example = "1", notes = "见 CommonStatusEnum 枚举") | |
| 50 | 50 | @NotNull(message = "状态不能为空") |
| 51 | 51 | private Integer status; |
| 52 | 52 | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/menu/MenuListReqVO.java
| ... | ... | @@ -11,7 +11,7 @@ public class MenuListReqVO { |
| 11 | 11 | @ApiModelProperty(value = "菜单名称", example = "芋道", notes = "模糊匹配") |
| 12 | 12 | private String name; |
| 13 | 13 | |
| 14 | - @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 SysCommonStatusEnum 枚举类") | |
| 14 | + @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类") | |
| 15 | 15 | private Integer status; |
| 16 | 16 | |
| 17 | 17 | } | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/menu/MenuRespVO.java
| ... | ... | @@ -19,7 +19,7 @@ public class MenuRespVO extends MenuBaseVO { |
| 19 | 19 | @ApiModelProperty(value = "菜单编号", required = true, example = "1024") |
| 20 | 20 | private Long id; |
| 21 | 21 | |
| 22 | - @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 SysCommonStatusEnum 枚举类") | |
| 22 | + @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举类") | |
| 23 | 23 | private Integer status; |
| 24 | 24 | |
| 25 | 25 | @ApiModelProperty(value = "创建时间", required = true, example = "时间戳格式") | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/permission/PermissionAssignRoleDataScopeReqVO.java
| ... | ... | @@ -16,7 +16,7 @@ public class PermissionAssignRoleDataScopeReqVO { |
| 16 | 16 | @NotNull(message = "角色编号不能为空") |
| 17 | 17 | private Long roleId; |
| 18 | 18 | |
| 19 | - @ApiModelProperty(value = "数据范围", required = true, example = "1", notes = "参见 SysDataScopeEnum 枚举类") | |
| 19 | + @ApiModelProperty(value = "数据范围", required = true, example = "1", notes = "参见 DataScopeEnum 枚举类") | |
| 20 | 20 | @NotNull(message = "数据范围不能为空") |
| 21 | 21 | // TODO 这里要多一个枚举校验 |
| 22 | 22 | private Integer dataScope; | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RoleBaseVO.java
| ... | ... | @@ -28,7 +28,7 @@ public class RoleBaseVO { |
| 28 | 28 | @NotNull(message = "显示顺序不能为空") |
| 29 | 29 | private Integer sort; |
| 30 | 30 | |
| 31 | - @ApiModelProperty(value = "角色类型", required = true, example = "1", notes = "见 SysRoleTypeEnum 枚举") | |
| 31 | + @ApiModelProperty(value = "角色类型", required = true, example = "1", notes = "见 RoleTypeEnum 枚举") | |
| 32 | 32 | private Integer type; |
| 33 | 33 | |
| 34 | 34 | @ApiModelProperty(value = "备注", example = "我是一个角色") | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RoleExportReqVO.java
| ... | ... | @@ -19,7 +19,7 @@ public class RoleExportReqVO { |
| 19 | 19 | @ApiModelProperty(value = "角色标识", example = "yudao", notes = "模糊匹配") |
| 20 | 20 | private String code; |
| 21 | 21 | |
| 22 | - @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 SysCommonStatusEnum 枚举类") | |
| 22 | + @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类") | |
| 23 | 23 | private Integer status; |
| 24 | 24 | |
| 25 | 25 | @ApiModelProperty(value = "开始时间", example = "2020-10-24") | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RolePageReqVO.java
| ... | ... | @@ -22,7 +22,7 @@ public class RolePageReqVO extends PageParam { |
| 22 | 22 | @ApiModelProperty(value = "角色标识", example = "yudao", notes = "模糊匹配") |
| 23 | 23 | private String code; |
| 24 | 24 | |
| 25 | - @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 SysCommonStatusEnum 枚举类") | |
| 25 | + @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类") | |
| 26 | 26 | private Integer status; |
| 27 | 27 | |
| 28 | 28 | @ApiModelProperty(value = "开始时间", example = "2020-10-24") | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RoleRespVO.java
| ... | ... | @@ -26,10 +26,10 @@ public class RoleRespVO extends RoleBaseVO { |
| 26 | 26 | @ApiModelProperty(value = "数据范围(指定部门数组)", example = "1") |
| 27 | 27 | private Set<Long> dataScopeDeptIds; |
| 28 | 28 | |
| 29 | - @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 SysCommonStatusEnum 枚举类") | |
| 29 | + @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举类") | |
| 30 | 30 | private Integer status; |
| 31 | 31 | |
| 32 | - @ApiModelProperty(value = "角色类型", required = true, example = "1", notes = "参见 SysRoleTypeEnum 枚举类") | |
| 32 | + @ApiModelProperty(value = "角色类型", required = true, example = "1", notes = "参见 RoleTypeEnum 枚举类") | |
| 33 | 33 | private Integer type; |
| 34 | 34 | |
| 35 | 35 | @ApiModelProperty(value = "创建时间", required = true, example = "时间戳格式") | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RoleUpdateStatusReqVO.java
| 1 | 1 | package cn.iocoder.yudao.module.system.controller.admin.permission.vo.role; |
| 2 | 2 | |
| 3 | -import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; | |
| 4 | -import cn.iocoder.yudao.framework.common.validation.InEnum; | |
| 5 | 3 | import io.swagger.annotations.ApiModel; |
| 6 | 4 | import io.swagger.annotations.ApiModelProperty; |
| 7 | 5 | import lombok.Data; |
| ... | ... | @@ -16,7 +14,7 @@ public class RoleUpdateStatusReqVO { |
| 16 | 14 | @NotNull(message = "角色编号不能为空") |
| 17 | 15 | private Long id; |
| 18 | 16 | |
| 19 | - @ApiModelProperty(value = "状态", required = true, example = "1", notes = "见 SysCommonStatusEnum 枚举") | |
| 17 | + @ApiModelProperty(value = "状态", required = true, example = "1", notes = "见 CommonStatusEnum 枚举") | |
| 20 | 18 | @NotNull(message = "状态不能为空") |
| 21 | 19 | // @InEnum(value = CommonStatusEnum.class, message = "修改状态必须是 {value}") |
| 22 | 20 | private Integer status; | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsCallbackController.java
| ... | ... | @@ -25,7 +25,7 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| 25 | 25 | public class SmsCallbackController { |
| 26 | 26 | |
| 27 | 27 | @Resource |
| 28 | - private SmsSendService smsCoreService; | |
| 28 | + private SmsSendService smsSendService; | |
| 29 | 29 | |
| 30 | 30 | @PostMapping("/sms/yunpian") |
| 31 | 31 | @ApiOperation(value = "云片短信的回调", notes = "参见 https://www.yunpian.com/official/document/sms/zh_cn/domestic_push_report 文档") |
| ... | ... | @@ -33,7 +33,7 @@ public class SmsCallbackController { |
| 33 | 33 | @OperateLog(enable = false) |
| 34 | 34 | public String receiveYunpianSmsStatus(@RequestParam("sms_status") String smsStatus) throws Throwable { |
| 35 | 35 | String text = URLUtil.decode(smsStatus); // decode 解码参数,因为它被 encode |
| 36 | - smsCoreService.receiveSmsStatus(SmsChannelEnum.YUN_PIAN.getCode(), text); | |
| 36 | + smsSendService.receiveSmsStatus(SmsChannelEnum.YUN_PIAN.getCode(), text); | |
| 37 | 37 | return "SUCCESS"; // 约定返回 SUCCESS 为成功 |
| 38 | 38 | } |
| 39 | 39 | |
| ... | ... | @@ -42,7 +42,7 @@ public class SmsCallbackController { |
| 42 | 42 | @OperateLog(enable = false) |
| 43 | 43 | public CommonResult<Boolean> receiveAliyunSmsStatus(HttpServletRequest request) throws Throwable { |
| 44 | 44 | String text = ServletUtil.getBody(request); |
| 45 | - smsCoreService.receiveSmsStatus(SmsChannelEnum.ALIYUN.getCode(), text); | |
| 45 | + smsSendService.receiveSmsStatus(SmsChannelEnum.ALIYUN.getCode(), text); | |
| 46 | 46 | return success(true); |
| 47 | 47 | } |
| 48 | 48 | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsChannelController.java
| ... | ... | @@ -2,8 +2,8 @@ package cn.iocoder.yudao.module.system.controller.admin.sms; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.module.system.controller.admin.sms.vo.channel.*; |
| 4 | 4 | import cn.iocoder.yudao.module.system.convert.sms.SmsChannelConvert; |
| 5 | +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsChannelDO; | |
| 5 | 6 | import cn.iocoder.yudao.module.system.service.sms.SmsChannelService; |
| 6 | -import cn.iocoder.yudao.module.system.dal.dataobject.sms.SysSmsChannelDO; | |
| 7 | 7 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 8 | 8 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 9 | 9 | import io.swagger.annotations.Api; |
| ... | ... | @@ -56,7 +56,7 @@ public class SmsChannelController { |
| 56 | 56 | @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) |
| 57 | 57 | @PreAuthorize("@ss.hasPermission('system:sms-channel:query')") |
| 58 | 58 | public CommonResult<SmsChannelRespVO> getSmsChannel(@RequestParam("id") Long id) { |
| 59 | - SysSmsChannelDO smsChannel = smsChannelService.getSmsChannel(id); | |
| 59 | + SmsChannelDO smsChannel = smsChannelService.getSmsChannel(id); | |
| 60 | 60 | return success(SmsChannelConvert.INSTANCE.convert(smsChannel)); |
| 61 | 61 | } |
| 62 | 62 | |
| ... | ... | @@ -64,16 +64,16 @@ public class SmsChannelController { |
| 64 | 64 | @ApiOperation("获得短信渠道分页") |
| 65 | 65 | @PreAuthorize("@ss.hasPermission('system:sms-channel:query')") |
| 66 | 66 | public CommonResult<PageResult<SmsChannelRespVO>> getSmsChannelPage(@Valid SmsChannelPageReqVO pageVO) { |
| 67 | - PageResult<SysSmsChannelDO> pageResult = smsChannelService.getSmsChannelPage(pageVO); | |
| 67 | + PageResult<SmsChannelDO> pageResult = smsChannelService.getSmsChannelPage(pageVO); | |
| 68 | 68 | return success(SmsChannelConvert.INSTANCE.convertPage(pageResult)); |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | @GetMapping("/list-all-simple") |
| 72 | 72 | @ApiOperation(value = "获得短信渠道精简列表", notes = "包含被禁用的短信渠道") |
| 73 | 73 | public CommonResult<List<SmsChannelSimpleRespVO>> getSimpleSmsChannels() { |
| 74 | - List<SysSmsChannelDO> list = smsChannelService.getSmsChannelList(); | |
| 74 | + List<SmsChannelDO> list = smsChannelService.getSmsChannelList(); | |
| 75 | 75 | // 排序后,返回给前端 |
| 76 | - list.sort(Comparator.comparing(SysSmsChannelDO::getId)); | |
| 76 | + list.sort(Comparator.comparing(SmsChannelDO::getId)); | |
| 77 | 77 | return success(SmsChannelConvert.INSTANCE.convertList03(list)); |
| 78 | 78 | } |
| 79 | 79 | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsLogController.java
| ... | ... | @@ -3,10 +3,10 @@ package cn.iocoder.yudao.module.system.controller.admin.sms; |
| 3 | 3 | import cn.iocoder.yudao.module.system.controller.admin.sms.vo.log.SmsLogExcelVO; |
| 4 | 4 | import cn.iocoder.yudao.module.system.controller.admin.sms.vo.log.SmsLogExportReqVO; |
| 5 | 5 | import cn.iocoder.yudao.module.system.controller.admin.sms.vo.log.SmsLogPageReqVO; |
| 6 | -import cn.iocoder.yudao.module.system.controller.admin.sms.vo.log.SysSmsLogRespVO; | |
| 6 | +import cn.iocoder.yudao.module.system.controller.admin.sms.vo.log.SmsLogRespVO; | |
| 7 | 7 | import cn.iocoder.yudao.module.system.convert.sms.SmsLogConvert; |
| 8 | +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsLogDO; | |
| 8 | 9 | import cn.iocoder.yudao.module.system.service.sms.SmsLogService; |
| 9 | -import cn.iocoder.yudao.module.system.dal.dataobject.sms.SysSmsLogDO; | |
| 10 | 10 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 11 | 11 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 12 | 12 | import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; |
| ... | ... | @@ -40,8 +40,8 @@ public class SmsLogController { |
| 40 | 40 | @GetMapping("/page") |
| 41 | 41 | @ApiOperation("获得短信日志分页") |
| 42 | 42 | @PreAuthorize("@ss.hasPermission('system:sms-log:query')") |
| 43 | - public CommonResult<PageResult<SysSmsLogRespVO>> getSmsLogPage(@Valid SmsLogPageReqVO pageVO) { | |
| 44 | - PageResult<SysSmsLogDO> pageResult = smsLogService.getSmsLogPage(pageVO); | |
| 43 | + public CommonResult<PageResult<SmsLogRespVO>> getSmsLogPage(@Valid SmsLogPageReqVO pageVO) { | |
| 44 | + PageResult<SmsLogDO> pageResult = smsLogService.getSmsLogPage(pageVO); | |
| 45 | 45 | return success(SmsLogConvert.INSTANCE.convertPage(pageResult)); |
| 46 | 46 | } |
| 47 | 47 | |
| ... | ... | @@ -51,7 +51,7 @@ public class SmsLogController { |
| 51 | 51 | @OperateLog(type = EXPORT) |
| 52 | 52 | public void exportSmsLogExcel(@Valid SmsLogExportReqVO exportReqVO, |
| 53 | 53 | HttpServletResponse response) throws IOException { |
| 54 | - List<SysSmsLogDO> list = smsLogService.getSmsLogList(exportReqVO); | |
| 54 | + List<SmsLogDO> list = smsLogService.getSmsLogList(exportReqVO); | |
| 55 | 55 | // 导出 Excel |
| 56 | 56 | List<SmsLogExcelVO> datas = SmsLogConvert.INSTANCE.convertList02(list); |
| 57 | 57 | ExcelUtils.write(response, "短信日志.xls", "数据", SmsLogExcelVO.class, datas); | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsTemplateController.java
| ... | ... | @@ -2,8 +2,8 @@ package cn.iocoder.yudao.module.system.controller.admin.sms; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.module.system.controller.admin.sms.vo.template.*; |
| 4 | 4 | import cn.iocoder.yudao.module.system.convert.sms.SmsTemplateConvert; |
| 5 | +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsTemplateDO; | |
| 5 | 6 | import cn.iocoder.yudao.module.system.service.sms.SmsTemplateService; |
| 6 | -import cn.iocoder.yudao.module.system.dal.dataobject.sms.SysSmsTemplateDO; | |
| 7 | 7 | import cn.iocoder.yudao.module.system.service.sms.SmsSendService; |
| 8 | 8 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 9 | 9 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| ... | ... | @@ -32,7 +32,7 @@ public class SmsTemplateController { |
| 32 | 32 | @Resource |
| 33 | 33 | private SmsTemplateService smsTemplateService; |
| 34 | 34 | @Resource |
| 35 | - private SmsSendService smsCoreService; | |
| 35 | + private SmsSendService smsSendService; | |
| 36 | 36 | |
| 37 | 37 | @PostMapping("/create") |
| 38 | 38 | @ApiOperation("创建短信模板") |
| ... | ... | @@ -63,7 +63,7 @@ public class SmsTemplateController { |
| 63 | 63 | @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) |
| 64 | 64 | @PreAuthorize("@ss.hasPermission('system:sms-template:query')") |
| 65 | 65 | public CommonResult<SmsTemplateRespVO> getSmsTemplate(@RequestParam("id") Long id) { |
| 66 | - SysSmsTemplateDO smsTemplate = smsTemplateService.getSmsTemplate(id); | |
| 66 | + SmsTemplateDO smsTemplate = smsTemplateService.getSmsTemplate(id); | |
| 67 | 67 | return success(SmsTemplateConvert.INSTANCE.convert(smsTemplate)); |
| 68 | 68 | } |
| 69 | 69 | |
| ... | ... | @@ -71,7 +71,7 @@ public class SmsTemplateController { |
| 71 | 71 | @ApiOperation("获得短信模板分页") |
| 72 | 72 | @PreAuthorize("@ss.hasPermission('system:sms-template:query')") |
| 73 | 73 | public CommonResult<PageResult<SmsTemplateRespVO>> getSmsTemplatePage(@Valid SmsTemplatePageReqVO pageVO) { |
| 74 | - PageResult<SysSmsTemplateDO> pageResult = smsTemplateService.getSmsTemplatePage(pageVO); | |
| 74 | + PageResult<SmsTemplateDO> pageResult = smsTemplateService.getSmsTemplatePage(pageVO); | |
| 75 | 75 | return success(SmsTemplateConvert.INSTANCE.convertPage(pageResult)); |
| 76 | 76 | } |
| 77 | 77 | |
| ... | ... | @@ -81,7 +81,7 @@ public class SmsTemplateController { |
| 81 | 81 | @OperateLog(type = EXPORT) |
| 82 | 82 | public void exportSmsTemplateExcel(@Valid SmsTemplateExportReqVO exportReqVO, |
| 83 | 83 | HttpServletResponse response) throws IOException { |
| 84 | - List<SysSmsTemplateDO> list = smsTemplateService.getSmsTemplateList(exportReqVO); | |
| 84 | + List<SmsTemplateDO> list = smsTemplateService.getSmsTemplateList(exportReqVO); | |
| 85 | 85 | // 导出 Excel |
| 86 | 86 | List<SmsTemplateExcelVO> datas = SmsTemplateConvert.INSTANCE.convertList02(list); |
| 87 | 87 | ExcelUtils.write(response, "短信模板.xls", "数据", SmsTemplateExcelVO.class, datas); |
| ... | ... | @@ -91,7 +91,7 @@ public class SmsTemplateController { |
| 91 | 91 | @ApiOperation("发送短信") |
| 92 | 92 | @PreAuthorize("@ss.hasPermission('system:sms-template:send-sms')") |
| 93 | 93 | public CommonResult<Long> sendSms(@Valid @RequestBody SmsTemplateSendReqVO sendReqVO) { |
| 94 | - return success(smsCoreService.sendSingleSmsToAdmin(sendReqVO.getMobile(), null, | |
| 94 | + return success(smsSendService.sendSingleSmsToAdmin(sendReqVO.getMobile(), null, | |
| 95 | 95 | sendReqVO.getTemplateCode(), sendReqVO.getTemplateParams())); |
| 96 | 96 | } |
| 97 | 97 | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/log/SmsLogExportReqVO.java
| ... | ... | @@ -9,7 +9,7 @@ import java.util.Date; |
| 9 | 9 | |
| 10 | 10 | import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
| 11 | 11 | |
| 12 | -@ApiModel(value = "管理后台 - 短信日志 Excel 导出 Request VO", description = "参数和 SysSmsLogPageReqVO 是一致的") | |
| 12 | +@ApiModel(value = "管理后台 - 短信日志 Excel 导出 Request VO", description = "参数和 SmsLogPageReqVO 是一致的") | |
| 13 | 13 | @Data |
| 14 | 14 | public class SmsLogExportReqVO { |
| 15 | 15 | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/log/SmsLogPageReqVO.java
| ... | ... | @@ -27,7 +27,7 @@ public class SmsLogPageReqVO extends PageParam { |
| 27 | 27 | @ApiModelProperty(value = "手机号", example = "15601691300") |
| 28 | 28 | private String mobile; |
| 29 | 29 | |
| 30 | - @ApiModelProperty(value = "发送状态", example = "1", notes = "参见 SysSmsSendStatusEnum 枚举类") | |
| 30 | + @ApiModelProperty(value = "发送状态", example = "1", notes = "参见 SmsSendStatusEnum 枚举类") | |
| 31 | 31 | private Integer sendStatus; |
| 32 | 32 | |
| 33 | 33 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
| ... | ... | @@ -38,7 +38,7 @@ public class SmsLogPageReqVO extends PageParam { |
| 38 | 38 | @ApiModelProperty(value = "结束发送时间") |
| 39 | 39 | private Date endSendTime; |
| 40 | 40 | |
| 41 | - @ApiModelProperty(value = "接收状态", example = "0", notes = "参见 SysSmsReceiveStatusEnum 枚举类") | |
| 41 | + @ApiModelProperty(value = "接收状态", example = "0", notes = "参见 SmsReceiveStatusEnum 枚举类") | |
| 42 | 42 | private Integer receiveStatus; |
| 43 | 43 | |
| 44 | 44 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/log/SysSmsLogRespVO.java renamed to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/log/SmsLogRespVO.java
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/template/SmsTemplateBaseVO.java
| ... | ... | @@ -12,7 +12,7 @@ import javax.validation.constraints.NotNull; |
| 12 | 12 | @Data |
| 13 | 13 | public class SmsTemplateBaseVO { |
| 14 | 14 | |
| 15 | - @ApiModelProperty(value = "短信类型", required = true, example = "1", notes = "参见 SysSmsTemplateTypeEnum 枚举类") | |
| 15 | + @ApiModelProperty(value = "短信类型", required = true, example = "1", notes = "参见 SmsTemplateTypeEnum 枚举类") | |
| 16 | 16 | @NotNull(message = "短信类型不能为空") |
| 17 | 17 | private Integer type; |
| 18 | 18 | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/template/SmsTemplateExportReqVO.java
| ... | ... | @@ -9,7 +9,7 @@ import java.util.Date; |
| 9 | 9 | |
| 10 | 10 | import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
| 11 | 11 | |
| 12 | -@ApiModel(value = "管理后台 - 短信模板 Excel 导出 Request VO", description = "参数和 SysSmsTemplatePageReqVO 是一致的") | |
| 12 | +@ApiModel(value = "管理后台 - 短信模板 Excel 导出 Request VO", description = "参数和 SmsTemplatePageReqVO 是一致的") | |
| 13 | 13 | @Data |
| 14 | 14 | public class SmsTemplateExportReqVO { |
| 15 | 15 | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/TenantController.java
| ... | ... | @@ -2,8 +2,8 @@ package cn.iocoder.yudao.module.system.controller.admin.tenant; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.*; |
| 4 | 4 | import cn.iocoder.yudao.module.system.convert.tenant.TenantConvert; |
| 5 | +import cn.iocoder.yudao.module.system.dal.dataobject.tenant.TenantDO; | |
| 5 | 6 | import cn.iocoder.yudao.module.system.service.tenant.TenantService; |
| 6 | -import cn.iocoder.yudao.module.system.dal.dataobject.tenant.SysTenantDO; | |
| 7 | 7 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 8 | 8 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 9 | 9 | import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; |
| ... | ... | @@ -36,7 +36,7 @@ public class TenantController { |
| 36 | 36 | @ApiOperation(value = "使用租户名,获得租户编号", notes = "登录界面,根据用户的租户名,获得租户编号") |
| 37 | 37 | @ApiImplicitParam(name = "name", value = "租户名", required = true, example = "芋道源码", dataTypeClass = Long.class) |
| 38 | 38 | public CommonResult<Long> getTenantIdByName(@RequestParam("name") String name) { |
| 39 | - SysTenantDO tenantDO = tenantService.getTenantByName(name); | |
| 39 | + TenantDO tenantDO = tenantService.getTenantByName(name); | |
| 40 | 40 | return success(tenantDO != null ? tenantDO.getId() : null); |
| 41 | 41 | } |
| 42 | 42 | |
| ... | ... | @@ -69,7 +69,7 @@ public class TenantController { |
| 69 | 69 | @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) |
| 70 | 70 | @PreAuthorize("@ss.hasPermission('system:tenant:query')") |
| 71 | 71 | public CommonResult<TenantRespVO> getTenant(@RequestParam("id") Long id) { |
| 72 | - SysTenantDO tenant = tenantService.getTenant(id); | |
| 72 | + TenantDO tenant = tenantService.getTenant(id); | |
| 73 | 73 | return success(TenantConvert.INSTANCE.convert(tenant)); |
| 74 | 74 | } |
| 75 | 75 | |
| ... | ... | @@ -78,7 +78,7 @@ public class TenantController { |
| 78 | 78 | @ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class) |
| 79 | 79 | @PreAuthorize("@ss.hasPermission('system:tenant:query')") |
| 80 | 80 | public CommonResult<List<TenantRespVO>> getTenantList(@RequestParam("ids") Collection<Long> ids) { |
| 81 | - List<SysTenantDO> list = tenantService.getTenantList(ids); | |
| 81 | + List<TenantDO> list = tenantService.getTenantList(ids); | |
| 82 | 82 | return success(TenantConvert.INSTANCE.convertList(list)); |
| 83 | 83 | } |
| 84 | 84 | |
| ... | ... | @@ -86,7 +86,7 @@ public class TenantController { |
| 86 | 86 | @ApiOperation("获得租户分页") |
| 87 | 87 | @PreAuthorize("@ss.hasPermission('system:tenant:query')") |
| 88 | 88 | public CommonResult<PageResult<TenantRespVO>> getTenantPage(@Valid TenantPageReqVO pageVO) { |
| 89 | - PageResult<SysTenantDO> pageResult = tenantService.getTenantPage(pageVO); | |
| 89 | + PageResult<TenantDO> pageResult = tenantService.getTenantPage(pageVO); | |
| 90 | 90 | return success(TenantConvert.INSTANCE.convertPage(pageResult)); |
| 91 | 91 | } |
| 92 | 92 | |
| ... | ... | @@ -96,7 +96,7 @@ public class TenantController { |
| 96 | 96 | @OperateLog(type = EXPORT) |
| 97 | 97 | public void exportTenantExcel(@Valid TenantExportReqVO exportReqVO, |
| 98 | 98 | HttpServletResponse response) throws IOException { |
| 99 | - List<SysTenantDO> list = tenantService.getTenantList(exportReqVO); | |
| 99 | + List<TenantDO> list = tenantService.getTenantList(exportReqVO); | |
| 100 | 100 | // 导出 Excel |
| 101 | 101 | List<TenantExcelVO> datas = TenantConvert.INSTANCE.convertList02(list); |
| 102 | 102 | ExcelUtils.write(response, "租户.xls", "数据", TenantExcelVO.class, datas); | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/TenantExportReqVO.java
| ... | ... | @@ -9,7 +9,7 @@ import java.util.Date; |
| 9 | 9 | |
| 10 | 10 | import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
| 11 | 11 | |
| 12 | -@ApiModel(value = "管理后台 - 租户 Excel 导出 Request VO", description = "参数和 SysTenantPageReqVO 是一致的") | |
| 12 | +@ApiModel(value = "管理后台 - 租户 Excel 导出 Request VO", description = "参数和 TenantPageReqVO 是一致的") | |
| 13 | 13 | @Data |
| 14 | 14 | public class TenantExportReqVO { |
| 15 | 15 | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/UserController.java
| ... | ... | @@ -3,11 +3,11 @@ package cn.iocoder.yudao.module.system.controller.admin.user; |
| 3 | 3 | import cn.hutool.core.collection.CollUtil; |
| 4 | 4 | import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.*; |
| 5 | 5 | import cn.iocoder.yudao.module.system.convert.user.UserConvert; |
| 6 | -import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysDeptDO; | |
| 6 | +import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO; | |
| 7 | 7 | import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; |
| 8 | 8 | import cn.iocoder.yudao.module.system.service.dept.DeptService; |
| 9 | 9 | import cn.iocoder.yudao.module.system.service.user.AdminUserService; |
| 10 | -import cn.iocoder.yudao.module.system.enums.common.SysSexEnum; | |
| 10 | +import cn.iocoder.yudao.module.system.enums.common.SexEnum; | |
| 11 | 11 | import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; |
| 12 | 12 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 13 | 13 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| ... | ... | @@ -98,7 +98,7 @@ public class UserController { |
| 98 | 98 | |
| 99 | 99 | // 获得拼接需要的数据 |
| 100 | 100 | Collection<Long> deptIds = convertList(pageResult.getList(), AdminUserDO::getDeptId); |
| 101 | - Map<Long, SysDeptDO> deptMap = deptService.getDeptMap(deptIds); | |
| 101 | + Map<Long, DeptDO> deptMap = deptService.getDeptMap(deptIds); | |
| 102 | 102 | // 拼接结果返回 |
| 103 | 103 | List<UserPageItemRespVO> userList = new ArrayList<>(pageResult.getList().size()); |
| 104 | 104 | pageResult.getList().forEach(user -> { |
| ... | ... | @@ -137,9 +137,9 @@ public class UserController { |
| 137 | 137 | |
| 138 | 138 | // 获得拼接需要的数据 |
| 139 | 139 | Collection<Long> deptIds = convertList(users, AdminUserDO::getDeptId); |
| 140 | - Map<Long, SysDeptDO> deptMap = deptService.getDeptMap(deptIds); | |
| 140 | + Map<Long, DeptDO> deptMap = deptService.getDeptMap(deptIds); | |
| 141 | 141 | Map<Long, AdminUserDO> deptLeaderUserMap = userService.getUserMap( |
| 142 | - convertSet(deptMap.values(), SysDeptDO::getLeaderUserId)); | |
| 142 | + convertSet(deptMap.values(), DeptDO::getLeaderUserId)); | |
| 143 | 143 | // 拼接数据 |
| 144 | 144 | List<UserExcelVO> excelUsers = new ArrayList<>(users.size()); |
| 145 | 145 | users.forEach(user -> { |
| ... | ... | @@ -164,9 +164,9 @@ public class UserController { |
| 164 | 164 | // 手动创建导出 demo |
| 165 | 165 | List<UserImportExcelVO> list = Arrays.asList( |
| 166 | 166 | UserImportExcelVO.builder().username("yudao").deptId(1L).email("yudao@iocoder.cn").mobile("15601691300") |
| 167 | - .nickname("芋道").status(CommonStatusEnum.ENABLE.getStatus()).sex(SysSexEnum.MALE.getSex()).build(), | |
| 167 | + .nickname("芋道").status(CommonStatusEnum.ENABLE.getStatus()).sex(SexEnum.MALE.getSex()).build(), | |
| 168 | 168 | UserImportExcelVO.builder().username("yuanma").deptId(2L).email("yuanma@iocoder.cn").mobile("15601701300") |
| 169 | - .nickname("源码").status(CommonStatusEnum.DISABLE.getStatus()).sex(SysSexEnum.FEMALE.getSex()).build() | |
| 169 | + .nickname("源码").status(CommonStatusEnum.DISABLE.getStatus()).sex(SexEnum.FEMALE.getSex()).build() | |
| 170 | 170 | ); |
| 171 | 171 | |
| 172 | 172 | // 输出 | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/UserProfileController.java
| ... | ... | @@ -5,16 +5,16 @@ import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfi |
| 5 | 5 | import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfileUpdatePasswordReqVO; |
| 6 | 6 | import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfileUpdateReqVO; |
| 7 | 7 | import cn.iocoder.yudao.module.system.convert.user.UserConvert; |
| 8 | +import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO; | |
| 9 | +import cn.iocoder.yudao.module.system.dal.dataobject.social.SocialUserDO; | |
| 8 | 10 | import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; |
| 9 | 11 | import cn.iocoder.yudao.module.system.service.dept.DeptService; |
| 10 | 12 | import cn.iocoder.yudao.module.system.service.dept.PostService; |
| 11 | 13 | import cn.iocoder.yudao.module.system.service.permission.PermissionService; |
| 12 | 14 | import cn.iocoder.yudao.module.system.service.permission.RoleService; |
| 13 | 15 | import cn.iocoder.yudao.module.system.service.user.AdminUserService; |
| 14 | -import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysDeptDO; | |
| 15 | -import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysPostDO; | |
| 16 | +import cn.iocoder.yudao.module.system.dal.dataobject.dept.PostDO; | |
| 16 | 17 | import cn.iocoder.yudao.module.system.dal.dataobject.permission.RoleDO; |
| 17 | -import cn.iocoder.yudao.module.system.dal.dataobject.social.SysSocialUserDO; | |
| 18 | 18 | import cn.iocoder.yudao.module.system.service.social.SocialUserService; |
| 19 | 19 | import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; |
| 20 | 20 | import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil; |
| ... | ... | @@ -67,16 +67,16 @@ public class UserProfileController { |
| 67 | 67 | resp.setRoles(UserConvert.INSTANCE.convertList(userRoles)); |
| 68 | 68 | // 获得部门信息 |
| 69 | 69 | if (user.getDeptId() != null) { |
| 70 | - SysDeptDO dept = deptService.getDept(user.getDeptId()); | |
| 70 | + DeptDO dept = deptService.getDept(user.getDeptId()); | |
| 71 | 71 | resp.setDept(UserConvert.INSTANCE.convert02(dept)); |
| 72 | 72 | } |
| 73 | 73 | // 获得岗位信息 |
| 74 | 74 | if (CollUtil.isNotEmpty(user.getPostIds())) { |
| 75 | - List<SysPostDO> posts = postService.getPosts(user.getPostIds()); | |
| 75 | + List<PostDO> posts = postService.getPosts(user.getPostIds()); | |
| 76 | 76 | resp.setPosts(UserConvert.INSTANCE.convertList02(posts)); |
| 77 | 77 | } |
| 78 | 78 | // 获得社交用户信息 |
| 79 | - List<SysSocialUserDO> socialUsers = socialService.getSocialUserList(user.getId(), UserTypeEnum.ADMIN.getValue()); | |
| 79 | + List<SocialUserDO> socialUsers = socialService.getSocialUserList(user.getId(), UserTypeEnum.ADMIN.getValue()); | |
| 80 | 80 | resp.setSocialUsers(UserConvert.INSTANCE.convertList03(socialUsers)); |
| 81 | 81 | return success(resp); |
| 82 | 82 | } | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/profile/UserProfileRespVO.java
| ... | ... | @@ -22,7 +22,7 @@ public class UserProfileRespVO extends UserBaseVO { |
| 22 | 22 | @ApiModelProperty(value = "用户编号", required = true, example = "1") |
| 23 | 23 | private Long id; |
| 24 | 24 | |
| 25 | - @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 SysCommonStatusEnum 枚举类") | |
| 25 | + @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举类") | |
| 26 | 26 | private Integer status; |
| 27 | 27 | |
| 28 | 28 | @ApiModelProperty(value = "最后登录 IP", required = true, example = "192.168.1.1") |
| ... | ... | @@ -93,7 +93,7 @@ public class UserProfileRespVO extends UserBaseVO { |
| 93 | 93 | @Data |
| 94 | 94 | public static class SocialUser { |
| 95 | 95 | |
| 96 | - @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 SysSocialTypeEnum 枚举类") | |
| 96 | + @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 SocialTypeEnum 枚举类") | |
| 97 | 97 | private Integer type; |
| 98 | 98 | |
| 99 | 99 | @ApiModelProperty(value = "社交的全局编号", required = true, example = "IPRmJ0wvBptiPIlGEZiPewGwiEiE") | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/profile/UserProfileUpdateReqVO.java
| ... | ... | @@ -25,7 +25,7 @@ public class UserProfileUpdateReqVO { |
| 25 | 25 | @Length(min = 11, max = 11, message = "手机号长度必须 11 位") |
| 26 | 26 | private String mobile; |
| 27 | 27 | |
| 28 | - @ApiModelProperty(value = "用户性别", example = "1", notes = "参见 SysSexEnum 枚举类") | |
| 28 | + @ApiModelProperty(value = "用户性别", example = "1", notes = "参见 SexEnum 枚举类") | |
| 29 | 29 | private Integer sex; |
| 30 | 30 | |
| 31 | 31 | } | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserBaseVO.java
| ... | ... | @@ -43,10 +43,10 @@ public class UserBaseVO { |
| 43 | 43 | @Length(min = 11, max = 11, message = "手机号长度必须 11 位") |
| 44 | 44 | private String mobile; |
| 45 | 45 | |
| 46 | - @ApiModelProperty(value = "用户性别", example = "1", notes = "参见 SysSexEnum 枚举类") | |
| 46 | + @ApiModelProperty(value = "用户性别", example = "1", notes = "参见 SexEnum 枚举类") | |
| 47 | 47 | private Integer sex; |
| 48 | 48 | |
| 49 | - @ApiModelProperty(value = "用户头像", example = "http://www.iocoder.cn/xxx.png") | |
| 49 | + @ApiModelProperty(value = "用户头像", example = "https://www.iocoder.cn/xxx.png") | |
| 50 | 50 | private String avatar; |
| 51 | 51 | |
| 52 | 52 | } | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserExportReqVO.java
| ... | ... | @@ -11,7 +11,7 @@ import java.util.Date; |
| 11 | 11 | |
| 12 | 12 | import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
| 13 | 13 | |
| 14 | -@ApiModel(value = "管理后台 - 用户导出 Request VO", description = "参数和 SysUserPageReqVO 是一致的") | |
| 14 | +@ApiModel(value = "管理后台 - 用户导出 Request VO", description = "参数和 UserPageReqVO 是一致的") | |
| 15 | 15 | @Data |
| 16 | 16 | @NoArgsConstructor |
| 17 | 17 | @AllArgsConstructor |
| ... | ... | @@ -23,7 +23,7 @@ public class UserExportReqVO { |
| 23 | 23 | @ApiModelProperty(value = "手机号码", example = "yudao", notes = "模糊匹配") |
| 24 | 24 | private String mobile; |
| 25 | 25 | |
| 26 | - @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 SysCommonStatusEnum 枚举类") | |
| 26 | + @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类") | |
| 27 | 27 | private Integer status; |
| 28 | 28 | |
| 29 | 29 | @ApiModelProperty(value = "开始时间", example = "2020-10-24") | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserPageReqVO.java
| ... | ... | @@ -26,7 +26,7 @@ public class UserPageReqVO extends PageParam { |
| 26 | 26 | @ApiModelProperty(value = "手机号码", example = "yudao", notes = "模糊匹配") |
| 27 | 27 | private String mobile; |
| 28 | 28 | |
| 29 | - @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 SysCommonStatusEnum 枚举类") | |
| 29 | + @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类") | |
| 30 | 30 | private Integer status; |
| 31 | 31 | |
| 32 | 32 | @ApiModelProperty(value = "开始时间", example = "2020-10-24") | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserRespVO.java
| ... | ... | @@ -16,7 +16,7 @@ public class UserRespVO extends UserBaseVO { |
| 16 | 16 | @ApiModelProperty(value = "用户编号", required = true, example = "1") |
| 17 | 17 | private Long id; |
| 18 | 18 | |
| 19 | - @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 SysCommonStatusEnum 枚举类") | |
| 19 | + @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举类") | |
| 20 | 20 | private Integer status; |
| 21 | 21 | |
| 22 | 22 | @ApiModelProperty(value = "最后登录 IP", required = true, example = "192.168.1.1") | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserUpdateStatusReqVO.java
| ... | ... | @@ -14,9 +14,9 @@ public class UserUpdateStatusReqVO { |
| 14 | 14 | @NotNull(message = "角色编号不能为空") |
| 15 | 15 | private Long id; |
| 16 | 16 | |
| 17 | - @ApiModelProperty(value = "状态", required = true, example = "1", notes = "见 SysCommonStatusEnum 枚举") | |
| 17 | + @ApiModelProperty(value = "状态", required = true, example = "1", notes = "见 CommonStatusEnum 枚举") | |
| 18 | 18 | @NotNull(message = "状态不能为空") |
| 19 | -// @InEnum(value = SysCommonStatusEnum.class, message = "修改状态必须是 {value}") | |
| 19 | +// @InEnum(value = CommonStatusEnum.class, message = "修改状态必须是 {value}") | |
| 20 | 20 | private Integer status; |
| 21 | 21 | |
| 22 | 22 | } | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/auth/UserSessionConvert.java
| 1 | 1 | package cn.iocoder.yudao.module.system.convert.auth; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.module.system.controller.admin.auth.vo.session.UserSessionPageItemRespVO; |
| 4 | -import cn.iocoder.yudao.module.system.dal.dataobject.auth.SysUserSessionDO; | |
| 4 | +import cn.iocoder.yudao.module.system.dal.dataobject.auth.UserSessionDO; | |
| 5 | 5 | import org.mapstruct.Mapper; |
| 6 | 6 | import org.mapstruct.factory.Mappers; |
| 7 | 7 | |
| ... | ... | @@ -10,6 +10,6 @@ public interface UserSessionConvert { |
| 10 | 10 | |
| 11 | 11 | UserSessionConvert INSTANCE = Mappers.getMapper(UserSessionConvert.class); |
| 12 | 12 | |
| 13 | - UserSessionPageItemRespVO convert(SysUserSessionDO session); | |
| 13 | + UserSessionPageItemRespVO convert(UserSessionDO session); | |
| 14 | 14 | |
| 15 | 15 | } | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/dept/DeptConvert.java
| ... | ... | @@ -4,7 +4,7 @@ import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptCreateRe |
| 4 | 4 | import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptRespVO; |
| 5 | 5 | import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptSimpleRespVO; |
| 6 | 6 | import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptUpdateReqVO; |
| 7 | -import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysDeptDO; | |
| 7 | +import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO; | |
| 8 | 8 | import org.mapstruct.Mapper; |
| 9 | 9 | import org.mapstruct.factory.Mappers; |
| 10 | 10 | |
| ... | ... | @@ -15,14 +15,14 @@ public interface DeptConvert { |
| 15 | 15 | |
| 16 | 16 | DeptConvert INSTANCE = Mappers.getMapper(DeptConvert.class); |
| 17 | 17 | |
| 18 | - List<DeptRespVO> convertList(List<SysDeptDO> list); | |
| 18 | + List<DeptRespVO> convertList(List<DeptDO> list); | |
| 19 | 19 | |
| 20 | - List<DeptSimpleRespVO> convertList02(List<SysDeptDO> list); | |
| 20 | + List<DeptSimpleRespVO> convertList02(List<DeptDO> list); | |
| 21 | 21 | |
| 22 | - DeptRespVO convert(SysDeptDO bean); | |
| 22 | + DeptRespVO convert(DeptDO bean); | |
| 23 | 23 | |
| 24 | - SysDeptDO convert(DeptCreateReqVO bean); | |
| 24 | + DeptDO convert(DeptCreateReqVO bean); | |
| 25 | 25 | |
| 26 | - SysDeptDO convert(DeptUpdateReqVO bean); | |
| 26 | + DeptDO convert(DeptUpdateReqVO bean); | |
| 27 | 27 | |
| 28 | 28 | } | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/dept/PostConvert.java
| ... | ... | @@ -2,7 +2,7 @@ package cn.iocoder.yudao.module.system.convert.dept; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 4 | 4 | import cn.iocoder.yudao.module.system.controller.admin.dept.vo.post.*; |
| 5 | -import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysPostDO; | |
| 5 | +import cn.iocoder.yudao.module.system.dal.dataobject.dept.PostDO; | |
| 6 | 6 | import org.mapstruct.Mapper; |
| 7 | 7 | import org.mapstruct.factory.Mappers; |
| 8 | 8 | |
| ... | ... | @@ -13,16 +13,16 @@ public interface PostConvert { |
| 13 | 13 | |
| 14 | 14 | PostConvert INSTANCE = Mappers.getMapper(PostConvert.class); |
| 15 | 15 | |
| 16 | - List<PostSimpleRespVO> convertList02(List<SysPostDO> list); | |
| 16 | + List<PostSimpleRespVO> convertList02(List<PostDO> list); | |
| 17 | 17 | |
| 18 | - PageResult<PostRespVO> convertPage(PageResult<SysPostDO> page); | |
| 18 | + PageResult<PostRespVO> convertPage(PageResult<PostDO> page); | |
| 19 | 19 | |
| 20 | - PostRespVO convert(SysPostDO id); | |
| 20 | + PostRespVO convert(PostDO id); | |
| 21 | 21 | |
| 22 | - SysPostDO convert(PostCreateReqVO bean); | |
| 22 | + PostDO convert(PostCreateReqVO bean); | |
| 23 | 23 | |
| 24 | - SysPostDO convert(PostUpdateReqVO reqVO); | |
| 24 | + PostDO convert(PostUpdateReqVO reqVO); | |
| 25 | 25 | |
| 26 | - List<PostExcelVO> convertList03(List<SysPostDO> list); | |
| 26 | + List<PostExcelVO> convertList03(List<PostDO> list); | |
| 27 | 27 | |
| 28 | 28 | } | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/dict/DictDataConvert.java
| 1 | 1 | package cn.iocoder.yudao.module.system.convert.dict; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.*; |
| 4 | -import cn.iocoder.yudao.module.system.dal.dataobject.dict.SysDictDataDO; | |
| 4 | +import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictDataDO; | |
| 5 | 5 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 6 | 6 | import cn.iocoder.yudao.framework.dict.core.dto.DictDataRespDTO; |
| 7 | 7 | import org.mapstruct.Mapper; |
| ... | ... | @@ -15,20 +15,20 @@ public interface DictDataConvert { |
| 15 | 15 | |
| 16 | 16 | DictDataConvert INSTANCE = Mappers.getMapper(DictDataConvert.class); |
| 17 | 17 | |
| 18 | - List<DictDataSimpleRespVO> convertList(List<SysDictDataDO> list); | |
| 18 | + List<DictDataSimpleRespVO> convertList(List<DictDataDO> list); | |
| 19 | 19 | |
| 20 | - DictDataRespVO convert(SysDictDataDO bean); | |
| 20 | + DictDataRespVO convert(DictDataDO bean); | |
| 21 | 21 | |
| 22 | - PageResult<DictDataRespVO> convertPage(PageResult<SysDictDataDO> page); | |
| 22 | + PageResult<DictDataRespVO> convertPage(PageResult<DictDataDO> page); | |
| 23 | 23 | |
| 24 | - SysDictDataDO convert(DictDataUpdateReqVO bean); | |
| 24 | + DictDataDO convert(DictDataUpdateReqVO bean); | |
| 25 | 25 | |
| 26 | - SysDictDataDO convert(DictDataCreateReqVO bean); | |
| 26 | + DictDataDO convert(DictDataCreateReqVO bean); | |
| 27 | 27 | |
| 28 | - List<DictDataExcelVO> convertList02(List<SysDictDataDO> bean); | |
| 28 | + List<DictDataExcelVO> convertList02(List<DictDataDO> bean); | |
| 29 | 29 | |
| 30 | - DictDataRespDTO convert02(SysDictDataDO bean); | |
| 30 | + DictDataRespDTO convert02(DictDataDO bean); | |
| 31 | 31 | |
| 32 | - List<DictDataRespDTO> convertList03(Collection<SysDictDataDO> list); | |
| 32 | + List<DictDataRespDTO> convertList03(Collection<DictDataDO> list); | |
| 33 | 33 | |
| 34 | 34 | } | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/dict/SysDictDataCoreConvert.java deleted
| 1 | -package cn.iocoder.yudao.module.system.convert.dict; | |
| 2 | - | |
| 3 | -import cn.iocoder.yudao.module.system.dal.dataobject.dict.SysDictDataDO; | |
| 4 | -import cn.iocoder.yudao.framework.dict.core.dto.DictDataRespDTO; | |
| 5 | -import org.mapstruct.Mapper; | |
| 6 | -import org.mapstruct.factory.Mappers; | |
| 7 | - | |
| 8 | -import java.util.Collection; | |
| 9 | -import java.util.List; | |
| 10 | - | |
| 11 | -@Mapper | |
| 12 | -public interface SysDictDataCoreConvert { | |
| 13 | - | |
| 14 | - SysDictDataCoreConvert INSTANCE = Mappers.getMapper(SysDictDataCoreConvert.class); | |
| 15 | - | |
| 16 | - DictDataRespDTO convert02(SysDictDataDO bean); | |
| 17 | - | |
| 18 | - List<DictDataRespDTO> convertList03(Collection<SysDictDataDO> list); | |
| 19 | - | |
| 20 | -} |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/logger/LoginLogConvert.java
| 1 | 1 | package cn.iocoder.yudao.module.system.convert.logger; |
| 2 | 2 | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.module.system.api.logger.dto.LoginLogCreateReqDTO; | |
| 3 | 5 | import cn.iocoder.yudao.module.system.controller.admin.logger.vo.loginlog.LoginLogExcelVO; |
| 4 | 6 | import cn.iocoder.yudao.module.system.controller.admin.logger.vo.loginlog.LoginLogRespVO; |
| 5 | -import cn.iocoder.yudao.module.system.dal.dataobject.logger.SysLoginLogDO; | |
| 6 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 7 | +import cn.iocoder.yudao.module.system.dal.dataobject.logger.LoginLogDO; | |
| 7 | 8 | import org.mapstruct.Mapper; |
| 8 | 9 | import org.mapstruct.factory.Mappers; |
| 9 | 10 | |
| ... | ... | @@ -14,8 +15,10 @@ public interface LoginLogConvert { |
| 14 | 15 | |
| 15 | 16 | LoginLogConvert INSTANCE = Mappers.getMapper(LoginLogConvert.class); |
| 16 | 17 | |
| 17 | - PageResult<LoginLogRespVO> convertPage(PageResult<SysLoginLogDO> page); | |
| 18 | + PageResult<LoginLogRespVO> convertPage(PageResult<LoginLogDO> page); | |
| 19 | + | |
| 20 | + List<LoginLogExcelVO> convertList(List<LoginLogDO> list); | |
| 18 | 21 | |
| 19 | - List<LoginLogExcelVO> convertList(List<SysLoginLogDO> list); | |
| 22 | + LoginLogDO convert(LoginLogCreateReqDTO bean); | |
| 20 | 23 | |
| 21 | 24 | } | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/logger/SysLoginLogCoreConvert.java deleted
| 1 | -package cn.iocoder.yudao.module.system.convert.logger; | |
| 2 | - | |
| 3 | -import cn.iocoder.yudao.module.system.dal.dataobject.logger.SysLoginLogDO; | |
| 4 | -import cn.iocoder.yudao.module.system.api.logger.dto.LoginLogCreateReqDTO; | |
| 5 | -import org.mapstruct.Mapper; | |
| 6 | -import org.mapstruct.factory.Mappers; | |
| 7 | - | |
| 8 | -@Mapper | |
| 9 | -public interface SysLoginLogCoreConvert { | |
| 10 | - | |
| 11 | - SysLoginLogCoreConvert INSTANCE = Mappers.getMapper(SysLoginLogCoreConvert.class); | |
| 12 | - | |
| 13 | - SysLoginLogDO convert(LoginLogCreateReqDTO bean); | |
| 14 | - | |
| 15 | -} |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/sms/SmsChannelConvert.java
| ... | ... | @@ -4,7 +4,7 @@ import cn.iocoder.yudao.module.system.controller.admin.sms.vo.channel.SmsChannel |
| 4 | 4 | import cn.iocoder.yudao.module.system.controller.admin.sms.vo.channel.SmsChannelRespVO; |
| 5 | 5 | import cn.iocoder.yudao.module.system.controller.admin.sms.vo.channel.SmsChannelSimpleRespVO; |
| 6 | 6 | import cn.iocoder.yudao.module.system.controller.admin.sms.vo.channel.SmsChannelUpdateReqVO; |
| 7 | -import cn.iocoder.yudao.module.system.dal.dataobject.sms.SysSmsChannelDO; | |
| 7 | +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsChannelDO; | |
| 8 | 8 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 9 | 9 | import cn.iocoder.yudao.framework.sms.core.property.SmsChannelProperties; |
| 10 | 10 | import org.mapstruct.Mapper; |
| ... | ... | @@ -22,18 +22,18 @@ public interface SmsChannelConvert { |
| 22 | 22 | |
| 23 | 23 | SmsChannelConvert INSTANCE = Mappers.getMapper(SmsChannelConvert.class); |
| 24 | 24 | |
| 25 | - SysSmsChannelDO convert(SmsChannelCreateReqVO bean); | |
| 25 | + SmsChannelDO convert(SmsChannelCreateReqVO bean); | |
| 26 | 26 | |
| 27 | - SysSmsChannelDO convert(SmsChannelUpdateReqVO bean); | |
| 27 | + SmsChannelDO convert(SmsChannelUpdateReqVO bean); | |
| 28 | 28 | |
| 29 | - SmsChannelRespVO convert(SysSmsChannelDO bean); | |
| 29 | + SmsChannelRespVO convert(SmsChannelDO bean); | |
| 30 | 30 | |
| 31 | - List<SmsChannelRespVO> convertList(List<SysSmsChannelDO> list); | |
| 31 | + List<SmsChannelRespVO> convertList(List<SmsChannelDO> list); | |
| 32 | 32 | |
| 33 | - PageResult<SmsChannelRespVO> convertPage(PageResult<SysSmsChannelDO> page); | |
| 33 | + PageResult<SmsChannelRespVO> convertPage(PageResult<SmsChannelDO> page); | |
| 34 | 34 | |
| 35 | - List<SmsChannelProperties> convertList02(List<SysSmsChannelDO> list); | |
| 35 | + List<SmsChannelProperties> convertList02(List<SmsChannelDO> list); | |
| 36 | 36 | |
| 37 | - List<SmsChannelSimpleRespVO> convertList03(List<SysSmsChannelDO> list); | |
| 37 | + List<SmsChannelSimpleRespVO> convertList03(List<SmsChannelDO> list); | |
| 38 | 38 | |
| 39 | 39 | } | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/sms/SmsLogConvert.java
| 1 | 1 | package cn.iocoder.yudao.module.system.convert.sms; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.module.system.controller.admin.sms.vo.log.SmsLogExcelVO; |
| 4 | -import cn.iocoder.yudao.module.system.controller.admin.sms.vo.log.SysSmsLogRespVO; | |
| 5 | -import cn.iocoder.yudao.module.system.dal.dataobject.sms.SysSmsLogDO; | |
| 4 | +import cn.iocoder.yudao.module.system.controller.admin.sms.vo.log.SmsLogRespVO; | |
| 5 | +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsLogDO; | |
| 6 | 6 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 7 | 7 | import org.mapstruct.Mapper; |
| 8 | 8 | import org.mapstruct.factory.Mappers; |
| ... | ... | @@ -19,12 +19,12 @@ public interface SmsLogConvert { |
| 19 | 19 | |
| 20 | 20 | SmsLogConvert INSTANCE = Mappers.getMapper(SmsLogConvert.class); |
| 21 | 21 | |
| 22 | - SysSmsLogRespVO convert(SysSmsLogDO bean); | |
| 22 | + SmsLogRespVO convert(SmsLogDO bean); | |
| 23 | 23 | |
| 24 | - List<SysSmsLogRespVO> convertList(List<SysSmsLogDO> list); | |
| 24 | + List<SmsLogRespVO> convertList(List<SmsLogDO> list); | |
| 25 | 25 | |
| 26 | - PageResult<SysSmsLogRespVO> convertPage(PageResult<SysSmsLogDO> page); | |
| 26 | + PageResult<SmsLogRespVO> convertPage(PageResult<SmsLogDO> page); | |
| 27 | 27 | |
| 28 | - List<SmsLogExcelVO> convertList02(List<SysSmsLogDO> list); | |
| 28 | + List<SmsLogExcelVO> convertList02(List<SmsLogDO> list); | |
| 29 | 29 | |
| 30 | 30 | } | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/sms/SmsTemplateConvert.java
| ... | ... | @@ -4,7 +4,7 @@ import cn.iocoder.yudao.module.system.controller.admin.sms.vo.template.SmsTempla |
| 4 | 4 | import cn.iocoder.yudao.module.system.controller.admin.sms.vo.template.SmsTemplateExcelVO; |
| 5 | 5 | import cn.iocoder.yudao.module.system.controller.admin.sms.vo.template.SmsTemplateRespVO; |
| 6 | 6 | import cn.iocoder.yudao.module.system.controller.admin.sms.vo.template.SmsTemplateUpdateReqVO; |
| 7 | -import cn.iocoder.yudao.module.system.dal.dataobject.sms.SysSmsTemplateDO; | |
| 7 | +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsTemplateDO; | |
| 8 | 8 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 9 | 9 | import org.mapstruct.Mapper; |
| 10 | 10 | import org.mapstruct.factory.Mappers; |
| ... | ... | @@ -16,16 +16,16 @@ public interface SmsTemplateConvert { |
| 16 | 16 | |
| 17 | 17 | SmsTemplateConvert INSTANCE = Mappers.getMapper(SmsTemplateConvert.class); |
| 18 | 18 | |
| 19 | - SysSmsTemplateDO convert(SmsTemplateCreateReqVO bean); | |
| 19 | + SmsTemplateDO convert(SmsTemplateCreateReqVO bean); | |
| 20 | 20 | |
| 21 | - SysSmsTemplateDO convert(SmsTemplateUpdateReqVO bean); | |
| 21 | + SmsTemplateDO convert(SmsTemplateUpdateReqVO bean); | |
| 22 | 22 | |
| 23 | - SmsTemplateRespVO convert(SysSmsTemplateDO bean); | |
| 23 | + SmsTemplateRespVO convert(SmsTemplateDO bean); | |
| 24 | 24 | |
| 25 | - List<SmsTemplateRespVO> convertList(List<SysSmsTemplateDO> list); | |
| 25 | + List<SmsTemplateRespVO> convertList(List<SmsTemplateDO> list); | |
| 26 | 26 | |
| 27 | - PageResult<SmsTemplateRespVO> convertPage(PageResult<SysSmsTemplateDO> page); | |
| 27 | + PageResult<SmsTemplateRespVO> convertPage(PageResult<SmsTemplateDO> page); | |
| 28 | 28 | |
| 29 | - List<SmsTemplateExcelVO> convertList02(List<SysSmsTemplateDO> list); | |
| 29 | + List<SmsTemplateExcelVO> convertList02(List<SmsTemplateDO> list); | |
| 30 | 30 | |
| 31 | 31 | } | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/tenant/TenantConvert.java
| ... | ... | @@ -4,7 +4,7 @@ import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.TenantCreateReq |
| 4 | 4 | import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.TenantExcelVO; |
| 5 | 5 | import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.TenantRespVO; |
| 6 | 6 | import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.TenantUpdateReqVO; |
| 7 | -import cn.iocoder.yudao.module.system.dal.dataobject.tenant.SysTenantDO; | |
| 7 | +import cn.iocoder.yudao.module.system.dal.dataobject.tenant.TenantDO; | |
| 8 | 8 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 9 | 9 | import org.mapstruct.Mapper; |
| 10 | 10 | import org.mapstruct.factory.Mappers; |
| ... | ... | @@ -21,16 +21,16 @@ public interface TenantConvert { |
| 21 | 21 | |
| 22 | 22 | TenantConvert INSTANCE = Mappers.getMapper(TenantConvert.class); |
| 23 | 23 | |
| 24 | - SysTenantDO convert(TenantCreateReqVO bean); | |
| 24 | + TenantDO convert(TenantCreateReqVO bean); | |
| 25 | 25 | |
| 26 | - SysTenantDO convert(TenantUpdateReqVO bean); | |
| 26 | + TenantDO convert(TenantUpdateReqVO bean); | |
| 27 | 27 | |
| 28 | - TenantRespVO convert(SysTenantDO bean); | |
| 28 | + TenantRespVO convert(TenantDO bean); | |
| 29 | 29 | |
| 30 | - List<TenantRespVO> convertList(List<SysTenantDO> list); | |
| 30 | + List<TenantRespVO> convertList(List<TenantDO> list); | |
| 31 | 31 | |
| 32 | - PageResult<TenantRespVO> convertPage(PageResult<SysTenantDO> page); | |
| 32 | + PageResult<TenantRespVO> convertPage(PageResult<TenantDO> page); | |
| 33 | 33 | |
| 34 | - List<TenantExcelVO> convertList02(List<SysTenantDO> list); | |
| 34 | + List<TenantExcelVO> convertList02(List<TenantDO> list); | |
| 35 | 35 | |
| 36 | 36 | } | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/user/UserConvert.java
| ... | ... | @@ -4,10 +4,10 @@ import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfi |
| 4 | 4 | import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfileUpdatePasswordReqVO; |
| 5 | 5 | import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfileUpdateReqVO; |
| 6 | 6 | import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.*; |
| 7 | -import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysDeptDO; | |
| 8 | -import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysPostDO; | |
| 7 | +import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO; | |
| 8 | +import cn.iocoder.yudao.module.system.dal.dataobject.dept.PostDO; | |
| 9 | 9 | import cn.iocoder.yudao.module.system.dal.dataobject.permission.RoleDO; |
| 10 | -import cn.iocoder.yudao.module.system.dal.dataobject.social.SysSocialUserDO; | |
| 10 | +import cn.iocoder.yudao.module.system.dal.dataobject.social.SocialUserDO; | |
| 11 | 11 | import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; |
| 12 | 12 | import org.mapstruct.Mapper; |
| 13 | 13 | import org.mapstruct.factory.Mappers; |
| ... | ... | @@ -21,7 +21,7 @@ public interface UserConvert { |
| 21 | 21 | |
| 22 | 22 | UserPageItemRespVO convert(AdminUserDO bean); |
| 23 | 23 | |
| 24 | - UserPageItemRespVO.Dept convert(SysDeptDO bean); | |
| 24 | + UserPageItemRespVO.Dept convert(DeptDO bean); | |
| 25 | 25 | |
| 26 | 26 | AdminUserDO convert(UserCreateReqVO bean); |
| 27 | 27 | |
| ... | ... | @@ -35,15 +35,15 @@ public interface UserConvert { |
| 35 | 35 | |
| 36 | 36 | List<UserProfileRespVO.Role> convertList(List<RoleDO> list); |
| 37 | 37 | |
| 38 | - UserProfileRespVO.Dept convert02(SysDeptDO bean); | |
| 38 | + UserProfileRespVO.Dept convert02(DeptDO bean); | |
| 39 | 39 | |
| 40 | 40 | AdminUserDO convert(UserProfileUpdateReqVO bean); |
| 41 | 41 | |
| 42 | 42 | AdminUserDO convert(UserProfileUpdatePasswordReqVO bean); |
| 43 | 43 | |
| 44 | - List<UserProfileRespVO.Post> convertList02(List<SysPostDO> list); | |
| 44 | + List<UserProfileRespVO.Post> convertList02(List<PostDO> list); | |
| 45 | 45 | |
| 46 | - List<UserProfileRespVO.SocialUser> convertList03(List<SysSocialUserDO> list); | |
| 46 | + List<UserProfileRespVO.SocialUser> convertList03(List<SocialUserDO> list); | |
| 47 | 47 | |
| 48 | 48 | List<UserSimpleRespVO> convertList04(List<AdminUserDO> list); |
| 49 | 49 | } | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/auth/SysUserSessionDO.java renamed to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/auth/UserSessionDO.java
| ... | ... | @@ -17,15 +17,15 @@ import java.util.Date; |
| 17 | 17 | * |
| 18 | 18 | * 我们已经将 {@link LoginUser} 缓存在 Redis 当中。 |
| 19 | 19 | * 这里额外存储在线用户到 MySQL 中,目的是为了方便管理界面可以灵活查询。 |
| 20 | - * 同时,通过定时轮询 SysUserSessionDO 表,可以主动删除 Redis 的缓存,因为 Redis 的过期删除是延迟的。 | |
| 20 | + * 同时,通过定时轮询 UserSessionDO 表,可以主动删除 Redis 的缓存,因为 Redis 的过期删除是延迟的。 | |
| 21 | 21 | * |
| 22 | 22 | * @author 芋道源码 |
| 23 | 23 | */ |
| 24 | -@TableName(value = "sys_user_session", autoResultMap = true) | |
| 24 | +@TableName(value = "system_user_session", autoResultMap = true) | |
| 25 | 25 | @Data |
| 26 | 26 | @Builder |
| 27 | 27 | @EqualsAndHashCode(callSuper = true) |
| 28 | -public class SysUserSessionDO extends TenantBaseDO { | |
| 28 | +public class UserSessionDO extends TenantBaseDO { | |
| 29 | 29 | |
| 30 | 30 | /** |
| 31 | 31 | * 会话编号, 即 sessionId |
| ... | ... | @@ -35,7 +35,7 @@ public class SysUserSessionDO extends TenantBaseDO { |
| 35 | 35 | /** |
| 36 | 36 | * 用户编号 |
| 37 | 37 | * |
| 38 | - * 关联 SysUserDO.id 或者 MbrUserDO.id | |
| 38 | + * 关联 AdminUserDO.id 或者 MemberUserDO.id | |
| 39 | 39 | */ |
| 40 | 40 | private Long userId; |
| 41 | 41 | /** | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/dept/SysDeptDO.java renamed to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/dept/DeptDO.java
| ... | ... | @@ -14,10 +14,10 @@ import lombok.EqualsAndHashCode; |
| 14 | 14 | * @author ruoyi |
| 15 | 15 | * @author 芋道源码 |
| 16 | 16 | */ |
| 17 | -@TableName("sys_dept") | |
| 17 | +@TableName("system_dept") | |
| 18 | 18 | @Data |
| 19 | 19 | @EqualsAndHashCode(callSuper = true) |
| 20 | -public class SysDeptDO extends TenantBaseDO { | |
| 20 | +public class DeptDO extends TenantBaseDO { | |
| 21 | 21 | |
| 22 | 22 | /** |
| 23 | 23 | * 部门ID | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/dept/SysPostDO.java renamed to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/dept/PostDO.java
| ... | ... | @@ -12,10 +12,10 @@ import lombok.EqualsAndHashCode; |
| 12 | 12 | * |
| 13 | 13 | * @author ruoyi |
| 14 | 14 | */ |
| 15 | -@TableName("sys_post") | |
| 15 | +@TableName("system_post") | |
| 16 | 16 | @Data |
| 17 | 17 | @EqualsAndHashCode(callSuper = true) |
| 18 | -public class SysPostDO extends TenantBaseDO { | |
| 18 | +public class PostDO extends TenantBaseDO { | |
| 19 | 19 | |
| 20 | 20 | /** |
| 21 | 21 | * 岗位序号 | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/dict/SysDictDataDO.java renamed to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/dict/DictDataDO.java
| ... | ... | @@ -12,10 +12,10 @@ import lombok.EqualsAndHashCode; |
| 12 | 12 | * |
| 13 | 13 | * @author ruoyi |
| 14 | 14 | */ |
| 15 | -@TableName("sys_dict_data") | |
| 15 | +@TableName("system_dict_data") | |
| 16 | 16 | @Data |
| 17 | 17 | @EqualsAndHashCode(callSuper = true) |
| 18 | -public class SysDictDataDO extends BaseDO { | |
| 18 | +public class DictDataDO extends BaseDO { | |
| 19 | 19 | |
| 20 | 20 | /** |
| 21 | 21 | * 字典数据编号 |
| ... | ... | @@ -37,7 +37,7 @@ public class SysDictDataDO extends BaseDO { |
| 37 | 37 | /** |
| 38 | 38 | * 字典类型 |
| 39 | 39 | * |
| 40 | - * 冗余 {@link SysDictDataDO#getDictType()} | |
| 40 | + * 冗余 {@link DictDataDO#getDictType()} | |
| 41 | 41 | */ |
| 42 | 42 | private String dictType; |
| 43 | 43 | /** | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/logger/SysLoginLogDO.java renamed to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/logger/LoginLogDO.java
| ... | ... | @@ -16,11 +16,11 @@ import lombok.ToString; |
| 16 | 16 | * |
| 17 | 17 | * @author 芋道源码 |
| 18 | 18 | */ |
| 19 | -@TableName("sys_login_log") | |
| 19 | +@TableName("system_login_log") | |
| 20 | 20 | @Data |
| 21 | 21 | @EqualsAndHashCode(callSuper = true) |
| 22 | 22 | @ToString(callSuper = true) |
| 23 | -public class SysLoginLogDO extends BaseDO { | |
| 23 | +public class LoginLogDO extends BaseDO { | |
| 24 | 24 | |
| 25 | 25 | /** |
| 26 | 26 | * 日志主键 | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/permission/MenuDO.java
| ... | ... | @@ -34,7 +34,7 @@ public class MenuDO extends BaseDO { |
| 34 | 34 | * 一般格式为:${系统}:${模块}:${操作} |
| 35 | 35 | * 例如说:system:admin:add,即 system 服务的添加管理员。 |
| 36 | 36 | * |
| 37 | - * 当我们把该 SysMenuDO 赋予给角色后,意味着该角色有该资源: | |
| 37 | + * 当我们把该 MenuDO 赋予给角色后,意味着该角色有该资源: | |
| 38 | 38 | * - 对于后端,配合 @PreAuthorize 注解,配置 API 接口需要该权限,从而对 API 接口进行权限控制。 |
| 39 | 39 | * - 对于前端,配合前端标签,配置按钮是否展示,避免用户没有该权限时,结果可以看到该操作。 |
| 40 | 40 | */ | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/sms/SysSmsChannelDO.java renamed to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/sms/SmsChannelDO.java
| ... | ... | @@ -14,11 +14,11 @@ import lombok.ToString; |
| 14 | 14 | * @author zzf |
| 15 | 15 | * @since 2021-01-25 |
| 16 | 16 | */ |
| 17 | -@TableName(value = "sys_sms_channel", autoResultMap = true) | |
| 17 | +@TableName(value = "system_sms_channel", autoResultMap = true) | |
| 18 | 18 | @Data |
| 19 | 19 | @EqualsAndHashCode(callSuper = true) |
| 20 | 20 | @ToString(callSuper = true) |
| 21 | -public class SysSmsChannelDO extends BaseDO { | |
| 21 | +public class SmsChannelDO extends BaseDO { | |
| 22 | 22 | |
| 23 | 23 | /** |
| 24 | 24 | * 渠道编号 | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/sms/SysSmsLogDO.java renamed to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/sms/SmsLogDO.java
| 1 | 1 | package cn.iocoder.yudao.module.system.dal.dataobject.sms; |
| 2 | 2 | |
| 3 | -import cn.iocoder.yudao.module.system.enums.sms.SysSmsReceiveStatusEnum; | |
| 4 | -import cn.iocoder.yudao.module.system.enums.sms.SysSmsSendStatusEnum; | |
| 3 | +import cn.iocoder.yudao.module.system.enums.sms.SmsReceiveStatusEnum; | |
| 4 | +import cn.iocoder.yudao.module.system.enums.sms.SmsSendStatusEnum; | |
| 5 | 5 | import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; |
| 6 | 6 | import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; |
| 7 | 7 | import cn.iocoder.yudao.framework.sms.core.enums.SmsFrameworkErrorCodeConstants; |
| ... | ... | @@ -19,14 +19,14 @@ import java.util.Map; |
| 19 | 19 | * @author zzf |
| 20 | 20 | * @since 2021-01-25 |
| 21 | 21 | */ |
| 22 | -@TableName(value = "sys_sms_log", autoResultMap = true) | |
| 22 | +@TableName(value = "system_sms_log", autoResultMap = true) | |
| 23 | 23 | @Data |
| 24 | 24 | @EqualsAndHashCode(callSuper = true) |
| 25 | 25 | @ToString(callSuper = true) |
| 26 | 26 | @Builder |
| 27 | 27 | @AllArgsConstructor |
| 28 | 28 | @NoArgsConstructor |
| 29 | -public class SysSmsLogDO extends BaseDO { | |
| 29 | +public class SmsLogDO extends BaseDO { | |
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | 32 | * 自增编号 |
| ... | ... | @@ -38,13 +38,13 @@ public class SysSmsLogDO extends BaseDO { |
| 38 | 38 | /** |
| 39 | 39 | * 短信渠道编号 |
| 40 | 40 | * |
| 41 | - * 关联 {@link SysSmsChannelDO#getId()} | |
| 41 | + * 关联 {@link SmsChannelDO#getId()} | |
| 42 | 42 | */ |
| 43 | 43 | private Long channelId; |
| 44 | 44 | /** |
| 45 | 45 | * 短信渠道编码 |
| 46 | 46 | * |
| 47 | - * 冗余 {@link SysSmsChannelDO#getCode()} | |
| 47 | + * 冗余 {@link SmsChannelDO#getCode()} | |
| 48 | 48 | */ |
| 49 | 49 | private String channelCode; |
| 50 | 50 | |
| ... | ... | @@ -53,34 +53,34 @@ public class SysSmsLogDO extends BaseDO { |
| 53 | 53 | /** |
| 54 | 54 | * 模板编号 |
| 55 | 55 | * |
| 56 | - * 关联 {@link SysSmsTemplateDO#getId()} | |
| 56 | + * 关联 {@link SmsTemplateDO#getId()} | |
| 57 | 57 | */ |
| 58 | 58 | private Long templateId; |
| 59 | 59 | /** |
| 60 | 60 | * 模板编码 |
| 61 | 61 | * |
| 62 | - * 冗余 {@link SysSmsTemplateDO#getCode()} | |
| 62 | + * 冗余 {@link SmsTemplateDO#getCode()} | |
| 63 | 63 | */ |
| 64 | 64 | private String templateCode; |
| 65 | 65 | /** |
| 66 | 66 | * 短信类型 |
| 67 | 67 | * |
| 68 | - * 冗余 {@link SysSmsTemplateDO#getType()} | |
| 68 | + * 冗余 {@link SmsTemplateDO#getType()} | |
| 69 | 69 | */ |
| 70 | 70 | private Integer templateType; |
| 71 | 71 | /** |
| 72 | - * 基于 {@link SysSmsTemplateDO#getContent()} 格式化后的内容 | |
| 72 | + * 基于 {@link SmsTemplateDO#getContent()} 格式化后的内容 | |
| 73 | 73 | */ |
| 74 | 74 | private String templateContent; |
| 75 | 75 | /** |
| 76 | - * 基于 {@link SysSmsTemplateDO#getParams()} 输入后的参数 | |
| 76 | + * 基于 {@link SmsTemplateDO#getParams()} 输入后的参数 | |
| 77 | 77 | */ |
| 78 | 78 | @TableField(typeHandler = JacksonTypeHandler.class) |
| 79 | 79 | private Map<String, Object> templateParams; |
| 80 | 80 | /** |
| 81 | 81 | * 短信 API 的模板编号 |
| 82 | 82 | * |
| 83 | - * 冗余 {@link SysSmsTemplateDO#getApiTemplateId()} | |
| 83 | + * 冗余 {@link SmsTemplateDO#getApiTemplateId()} | |
| 84 | 84 | */ |
| 85 | 85 | private String apiTemplateId; |
| 86 | 86 | |
| ... | ... | @@ -106,7 +106,7 @@ public class SysSmsLogDO extends BaseDO { |
| 106 | 106 | /** |
| 107 | 107 | * 发送状态 |
| 108 | 108 | * |
| 109 | - * 枚举 {@link SysSmsSendStatusEnum} | |
| 109 | + * 枚举 {@link SmsSendStatusEnum} | |
| 110 | 110 | */ |
| 111 | 111 | private Integer sendStatus; |
| 112 | 112 | /** |
| ... | ... | @@ -154,7 +154,7 @@ public class SysSmsLogDO extends BaseDO { |
| 154 | 154 | /** |
| 155 | 155 | * 接收状态 |
| 156 | 156 | * |
| 157 | - * 枚举 {@link SysSmsReceiveStatusEnum} | |
| 157 | + * 枚举 {@link SmsReceiveStatusEnum} | |
| 158 | 158 | */ |
| 159 | 159 | private Integer receiveStatus; |
| 160 | 160 | /** | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/sms/SysSmsTemplateDO.java renamed to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/sms/SmsTemplateDO.java
| 1 | 1 | package cn.iocoder.yudao.module.system.dal.dataobject.sms; |
| 2 | 2 | |
| 3 | -import cn.iocoder.yudao.module.system.enums.sms.SysSmsTemplateTypeEnum; | |
| 3 | +import cn.iocoder.yudao.module.system.enums.sms.SmsTemplateTypeEnum; | |
| 4 | 4 | import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; |
| 5 | 5 | import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; |
| 6 | 6 | import com.baomidou.mybatisplus.annotation.TableField; |
| ... | ... | @@ -18,11 +18,11 @@ import java.util.List; |
| 18 | 18 | * @author zzf |
| 19 | 19 | * @since 2021-01-25 |
| 20 | 20 | */ |
| 21 | -@TableName(value = "sys_sms_template", autoResultMap = true) | |
| 21 | +@TableName(value = "system_sms_template", autoResultMap = true) | |
| 22 | 22 | @Data |
| 23 | 23 | @EqualsAndHashCode(callSuper = true) |
| 24 | 24 | @ToString(callSuper = true) |
| 25 | -public class SysSmsTemplateDO extends BaseDO { | |
| 25 | +public class SmsTemplateDO extends BaseDO { | |
| 26 | 26 | |
| 27 | 27 | /** |
| 28 | 28 | * 自增编号 |
| ... | ... | @@ -34,7 +34,7 @@ public class SysSmsTemplateDO extends BaseDO { |
| 34 | 34 | /** |
| 35 | 35 | * 短信类型 |
| 36 | 36 | * |
| 37 | - * 枚举 {@link SysSmsTemplateTypeEnum} | |
| 37 | + * 枚举 {@link SmsTemplateTypeEnum} | |
| 38 | 38 | */ |
| 39 | 39 | private Integer type; |
| 40 | 40 | /** |
| ... | ... | @@ -76,13 +76,13 @@ public class SysSmsTemplateDO extends BaseDO { |
| 76 | 76 | /** |
| 77 | 77 | * 短信渠道编号 |
| 78 | 78 | * |
| 79 | - * 关联 {@link SysSmsChannelDO#getId()} | |
| 79 | + * 关联 {@link SmsChannelDO#getId()} | |
| 80 | 80 | */ |
| 81 | 81 | private Long channelId; |
| 82 | 82 | /** |
| 83 | 83 | * 短信渠道编码 |
| 84 | 84 | * |
| 85 | - * 冗余 {@link SysSmsChannelDO#getCode()} | |
| 85 | + * 冗余 {@link SmsChannelDO#getCode()} | |
| 86 | 86 | */ |
| 87 | 87 | private String channelCode; |
| 88 | 88 | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/social/SysSocialUserDO.java renamed to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/social/SocialUserDO.java
| ... | ... | @@ -9,17 +9,17 @@ import lombok.*; |
| 9 | 9 | |
| 10 | 10 | /** |
| 11 | 11 | * 社交用户 |
| 12 | - * 通过 {@link SysSocialUserDO#getUserId()} 关联到对应的 {@link AdminUserDO} | |
| 12 | + * 通过 {@link SocialUserDO#getUserId()} 关联到对应的 {@link AdminUserDO} | |
| 13 | 13 | * |
| 14 | 14 | * @author weir |
| 15 | 15 | */ |
| 16 | -@TableName(value = "sys_social_user", autoResultMap = true) | |
| 16 | +@TableName(value = "system_social_user", autoResultMap = true) | |
| 17 | 17 | @Data |
| 18 | 18 | @EqualsAndHashCode(callSuper = true) |
| 19 | 19 | @Builder |
| 20 | 20 | @NoArgsConstructor |
| 21 | 21 | @AllArgsConstructor |
| 22 | -public class SysSocialUserDO extends BaseDO { | |
| 22 | +public class SocialUserDO extends BaseDO { | |
| 23 | 23 | |
| 24 | 24 | /** |
| 25 | 25 | * 自增主键 | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/tenant/SysTenantDO.java renamed to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/tenant/TenantDO.java
| ... | ... | @@ -10,14 +10,14 @@ import lombok.*; |
| 10 | 10 | * |
| 11 | 11 | * @author 芋道源码 |
| 12 | 12 | */ |
| 13 | -@TableName(value = "sys_tenant", autoResultMap = true) | |
| 13 | +@TableName(value = "system_tenant", autoResultMap = true) | |
| 14 | 14 | @Data |
| 15 | 15 | @EqualsAndHashCode(callSuper = true) |
| 16 | 16 | @ToString(callSuper = true) |
| 17 | 17 | @Builder |
| 18 | 18 | @AllArgsConstructor |
| 19 | 19 | @NoArgsConstructor |
| 20 | -public class SysTenantDO extends BaseDO { | |
| 20 | +public class TenantDO extends BaseDO { | |
| 21 | 21 | |
| 22 | 22 | /** |
| 23 | 23 | * 租户编号,自增 | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/user/AdminUserDO.java
| 1 | 1 | package cn.iocoder.yudao.module.system.dal.dataobject.user; |
| 2 | 2 | |
| 3 | -import cn.iocoder.yudao.module.system.enums.common.SysSexEnum; | |
| 3 | +import cn.iocoder.yudao.module.system.enums.common.SexEnum; | |
| 4 | 4 | import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; |
| 5 | 5 | import cn.iocoder.yudao.framework.mybatis.core.type.JsonLongSetTypeHandler; |
| 6 | 6 | import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO; |
| ... | ... | @@ -18,7 +18,7 @@ import java.util.Set; |
| 18 | 18 | * |
| 19 | 19 | * @author 芋道源码 |
| 20 | 20 | */ |
| 21 | -@TableName(value = "sys_user", autoResultMap = true) | |
| 21 | +@TableName(value = "system_user", autoResultMap = true) | |
| 22 | 22 | @Data |
| 23 | 23 | @EqualsAndHashCode(callSuper = true) |
| 24 | 24 | @Builder |
| ... | ... | @@ -69,7 +69,7 @@ public class AdminUserDO extends TenantBaseDO { |
| 69 | 69 | /** |
| 70 | 70 | * 用户性别 |
| 71 | 71 | * |
| 72 | - * 枚举类 {@link SysSexEnum} | |
| 72 | + * 枚举类 {@link SexEnum} | |
| 73 | 73 | */ |
| 74 | 74 | private Integer sex; |
| 75 | 75 | /** | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/auth/SysUserSessionCoreMapper.java deleted
| 1 | -package cn.iocoder.yudao.module.system.dal.mysql.auth; | |
| 2 | - | |
| 3 | -import cn.iocoder.yudao.module.system.dal.dataobject.auth.SysUserSessionDO; | |
| 4 | -import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | |
| 5 | -import org.apache.ibatis.annotations.Mapper; | |
| 6 | - | |
| 7 | -@Mapper | |
| 8 | -public interface SysUserSessionCoreMapper extends BaseMapperX<SysUserSessionDO> { | |
| 9 | - | |
| 10 | -} |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/auth/SysUserSessionMapper.java renamed to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/auth/UserSessionMapper.java
| 1 | 1 | package cn.iocoder.yudao.module.system.dal.mysql.auth; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.module.system.controller.admin.auth.vo.session.UserSessionPageReqVO; |
| 4 | -import cn.iocoder.yudao.module.system.dal.dataobject.auth.SysUserSessionDO; | |
| 4 | +import cn.iocoder.yudao.module.system.dal.dataobject.auth.UserSessionDO; | |
| 5 | 5 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 6 | 6 | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; |
| 7 | 7 | import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX; |
| ... | ... | @@ -12,16 +12,16 @@ import java.util.Date; |
| 12 | 12 | import java.util.List; |
| 13 | 13 | |
| 14 | 14 | @Mapper |
| 15 | -public interface SysUserSessionMapper extends BaseMapperX<SysUserSessionDO> { | |
| 15 | +public interface UserSessionMapper extends BaseMapperX<UserSessionDO> { | |
| 16 | 16 | |
| 17 | - default PageResult<SysUserSessionDO> selectPage(UserSessionPageReqVO reqVO, Collection<Long> userIds) { | |
| 18 | - return selectPage(reqVO, new QueryWrapperX<SysUserSessionDO>() | |
| 17 | + default PageResult<UserSessionDO> selectPage(UserSessionPageReqVO reqVO, Collection<Long> userIds) { | |
| 18 | + return selectPage(reqVO, new QueryWrapperX<UserSessionDO>() | |
| 19 | 19 | .inIfPresent("user_id", userIds) |
| 20 | 20 | .likeIfPresent("user_ip", reqVO.getUserIp())); |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | - default List<SysUserSessionDO> selectListBySessionTimoutLt() { | |
| 24 | - return selectList(new QueryWrapperX<SysUserSessionDO>().lt("session_timeout",new Date())); | |
| 23 | + default List<UserSessionDO> selectListBySessionTimoutLt() { | |
| 24 | + return selectList(new QueryWrapperX<UserSessionDO>().lt("session_timeout",new Date())); | |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | } | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dept/SysDeptMapper.java renamed to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dept/DeptMapper.java
| ... | ... | @@ -4,7 +4,7 @@ import cn.iocoder.yudao.framework.mybatis.core.enums.SqlConstants; |
| 4 | 4 | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; |
| 5 | 5 | import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; |
| 6 | 6 | import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptListReqVO; |
| 7 | -import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysDeptDO; | |
| 7 | +import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO; | |
| 8 | 8 | import com.baomidou.mybatisplus.annotation.InterceptorIgnore; |
| 9 | 9 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| 10 | 10 | import org.apache.ibatis.annotations.Mapper; |
| ... | ... | @@ -13,26 +13,26 @@ import java.util.Date; |
| 13 | 13 | import java.util.List; |
| 14 | 14 | |
| 15 | 15 | @Mapper |
| 16 | -public interface SysDeptMapper extends BaseMapperX<SysDeptDO> { | |
| 16 | +public interface DeptMapper extends BaseMapperX<DeptDO> { | |
| 17 | 17 | |
| 18 | - default List<SysDeptDO> selectList(DeptListReqVO reqVO) { | |
| 19 | - return selectList(new LambdaQueryWrapperX<SysDeptDO>().likeIfPresent(SysDeptDO::getName, reqVO.getName()) | |
| 20 | - .eqIfPresent(SysDeptDO::getStatus, reqVO.getStatus())); | |
| 18 | + default List<DeptDO> selectList(DeptListReqVO reqVO) { | |
| 19 | + return selectList(new LambdaQueryWrapperX<DeptDO>().likeIfPresent(DeptDO::getName, reqVO.getName()) | |
| 20 | + .eqIfPresent(DeptDO::getStatus, reqVO.getStatus())); | |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | - default SysDeptDO selectByParentIdAndName(Long parentId, String name) { | |
| 24 | - return selectOne(new LambdaQueryWrapper<SysDeptDO>().eq(SysDeptDO::getParentId, parentId) | |
| 25 | - .eq(SysDeptDO::getName, name)); | |
| 23 | + default DeptDO selectByParentIdAndName(Long parentId, String name) { | |
| 24 | + return selectOne(new LambdaQueryWrapper<DeptDO>().eq(DeptDO::getParentId, parentId) | |
| 25 | + .eq(DeptDO::getName, name)); | |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | default Integer selectCountByParentId(Long parentId) { |
| 29 | - return selectCount(SysDeptDO::getParentId, parentId); | |
| 29 | + return selectCount(DeptDO::getParentId, parentId); | |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | @InterceptorIgnore(tenantLine = "on") // 该方法忽略多租户。原因:该方法被异步 task 调用,此时获取不到租户编号 |
| 33 | 33 | default boolean selectExistsByUpdateTimeAfter(Date maxUpdateTime) { |
| 34 | - return selectOne(new LambdaQueryWrapper<SysDeptDO>().select(SysDeptDO::getId) | |
| 35 | - .gt(SysDeptDO::getUpdateTime, maxUpdateTime).last(SqlConstants.LIMIT1)) != null; | |
| 34 | + return selectOne(new LambdaQueryWrapper<DeptDO>().select(DeptDO::getId) | |
| 35 | + .gt(DeptDO::getUpdateTime, maxUpdateTime).last(SqlConstants.LIMIT1)) != null; | |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | } | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dept/SysPostMapper.java renamed to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dept/PostMapper.java
| ... | ... | @@ -5,7 +5,7 @@ import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; |
| 5 | 5 | import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX; |
| 6 | 6 | import cn.iocoder.yudao.module.system.controller.admin.dept.vo.post.PostExportReqVO; |
| 7 | 7 | import cn.iocoder.yudao.module.system.controller.admin.dept.vo.post.PostPageReqVO; |
| 8 | -import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysPostDO; | |
| 8 | +import cn.iocoder.yudao.module.system.dal.dataobject.dept.PostDO; | |
| 9 | 9 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| 10 | 10 | import org.apache.ibatis.annotations.Mapper; |
| 11 | 11 | |
| ... | ... | @@ -13,33 +13,33 @@ import java.util.Collection; |
| 13 | 13 | import java.util.List; |
| 14 | 14 | |
| 15 | 15 | @Mapper |
| 16 | -public interface SysPostMapper extends BaseMapperX<SysPostDO> { | |
| 16 | +public interface PostMapper extends BaseMapperX<PostDO> { | |
| 17 | 17 | |
| 18 | - default List<SysPostDO> selectList(Collection<Long> ids, Collection<Integer> statuses) { | |
| 19 | - return selectList(new QueryWrapperX<SysPostDO>().inIfPresent("id", ids) | |
| 18 | + default List<PostDO> selectList(Collection<Long> ids, Collection<Integer> statuses) { | |
| 19 | + return selectList(new QueryWrapperX<PostDO>().inIfPresent("id", ids) | |
| 20 | 20 | .inIfPresent("status", statuses)); |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | - default PageResult<SysPostDO> selectPage(PostPageReqVO reqVO) { | |
| 24 | - return selectPage(reqVO, new QueryWrapperX<SysPostDO>() | |
| 23 | + default PageResult<PostDO> selectPage(PostPageReqVO reqVO) { | |
| 24 | + return selectPage(reqVO, new QueryWrapperX<PostDO>() | |
| 25 | 25 | .likeIfPresent("code", reqVO.getCode()) |
| 26 | 26 | .likeIfPresent("name", reqVO.getName()) |
| 27 | 27 | .eqIfPresent("status", reqVO.getStatus())); |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | - default List<SysPostDO> selectList(PostExportReqVO reqVO) { | |
| 31 | - return selectList(new QueryWrapperX<SysPostDO>() | |
| 30 | + default List<PostDO> selectList(PostExportReqVO reqVO) { | |
| 31 | + return selectList(new QueryWrapperX<PostDO>() | |
| 32 | 32 | .likeIfPresent("code", reqVO.getCode()) |
| 33 | 33 | .likeIfPresent("name", reqVO.getName()) |
| 34 | 34 | .eqIfPresent("status", reqVO.getStatus())); |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | - default SysPostDO selectByName(String name) { | |
| 38 | - return selectOne(new QueryWrapper<SysPostDO>().eq("name", name)); | |
| 37 | + default PostDO selectByName(String name) { | |
| 38 | + return selectOne(new QueryWrapper<PostDO>().eq("name", name)); | |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - default SysPostDO selectByCode(String code) { | |
| 42 | - return selectOne(new QueryWrapper<SysPostDO>().eq("code", code)); | |
| 41 | + default PostDO selectByCode(String code) { | |
| 42 | + return selectOne(new QueryWrapper<PostDO>().eq("code", code)); | |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | } | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dept/SysDeptCoreMapper.java deleted
| 1 | -package cn.iocoder.yudao.module.system.dal.mysql.dept; | |
| 2 | - | |
| 3 | -import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysDeptDO; | |
| 4 | -import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | |
| 5 | -import org.apache.ibatis.annotations.Mapper; | |
| 6 | - | |
| 7 | -@Mapper | |
| 8 | -public interface SysDeptCoreMapper extends BaseMapperX<SysDeptDO> { | |
| 9 | -} |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dept/SysPostCoreMapper.java deleted
| 1 | -package cn.iocoder.yudao.module.system.dal.mysql.dept; | |
| 2 | - | |
| 3 | -import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysPostDO; | |
| 4 | -import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | |
| 5 | -import org.apache.ibatis.annotations.Mapper; | |
| 6 | - | |
| 7 | -@Mapper | |
| 8 | -public interface SysPostCoreMapper extends BaseMapperX<SysPostDO> { | |
| 9 | -} |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dict/DictDataMapper.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.dal.mysql.dict; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.mybatis.core.enums.SqlConstants; | |
| 4 | +import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataExportReqVO; | |
| 5 | +import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataPageReqVO; | |
| 6 | +import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictDataDO; | |
| 7 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 8 | +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | |
| 9 | +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | |
| 10 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
| 11 | +import org.apache.ibatis.annotations.Mapper; | |
| 12 | + | |
| 13 | +import java.util.Arrays; | |
| 14 | +import java.util.Collection; | |
| 15 | +import java.util.Date; | |
| 16 | +import java.util.List; | |
| 17 | + | |
| 18 | +@Mapper | |
| 19 | +public interface DictDataMapper extends BaseMapperX<DictDataDO> { | |
| 20 | + | |
| 21 | + default DictDataDO selectByDictTypeAndValue(String dictType, String value) { | |
| 22 | + return selectOne(new LambdaQueryWrapper<DictDataDO>().eq(DictDataDO::getDictType, dictType) | |
| 23 | + .eq(DictDataDO::getValue, value)); | |
| 24 | + } | |
| 25 | + | |
| 26 | + default List<DictDataDO> selectByDictTypeAndValues(String dictType, Collection<String> values) { | |
| 27 | + return selectList(new LambdaQueryWrapper<DictDataDO>().eq(DictDataDO::getDictType, dictType) | |
| 28 | + .in(DictDataDO::getValue, values)); | |
| 29 | + } | |
| 30 | + | |
| 31 | + default int selectCountByDictType(String dictType) { | |
| 32 | + return selectCount(DictDataDO::getDictType, dictType); | |
| 33 | + } | |
| 34 | + | |
| 35 | + default PageResult<DictDataDO> selectPage(DictDataPageReqVO reqVO) { | |
| 36 | + return selectPage(reqVO, new LambdaQueryWrapperX<DictDataDO>() | |
| 37 | + .likeIfPresent(DictDataDO::getLabel, reqVO.getLabel()) | |
| 38 | + .likeIfPresent(DictDataDO::getDictType, reqVO.getDictType()) | |
| 39 | + .eqIfPresent(DictDataDO::getStatus, reqVO.getStatus()) | |
| 40 | + .orderByAsc(Arrays.asList(DictDataDO::getDictType, DictDataDO::getSort))); | |
| 41 | + } | |
| 42 | + | |
| 43 | + default List<DictDataDO> selectList(DictDataExportReqVO reqVO) { | |
| 44 | + return selectList(new LambdaQueryWrapperX<DictDataDO>().likeIfPresent(DictDataDO::getLabel, reqVO.getLabel()) | |
| 45 | + .likeIfPresent(DictDataDO::getDictType, reqVO.getDictType()) | |
| 46 | + .eqIfPresent(DictDataDO::getStatus, reqVO.getStatus())); | |
| 47 | + } | |
| 48 | + | |
| 49 | + default boolean selectExistsByUpdateTimeAfter(Date maxUpdateTime) { | |
| 50 | + return selectOne(new LambdaQueryWrapper<DictDataDO>().select(DictDataDO::getId) | |
| 51 | + .gt(DictDataDO::getUpdateTime, maxUpdateTime).last(SqlConstants.LIMIT1)) != null; | |
| 52 | + } | |
| 53 | + | |
| 54 | +} | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dict/SysDictTypeMapper.java renamed to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dict/DictTypeMapper.java
| ... | ... | @@ -11,7 +11,7 @@ import org.apache.ibatis.annotations.Mapper; |
| 11 | 11 | import java.util.List; |
| 12 | 12 | |
| 13 | 13 | @Mapper |
| 14 | -public interface SysDictTypeMapper extends BaseMapperX<DictTypeDO> { | |
| 14 | +public interface DictTypeMapper extends BaseMapperX<DictTypeDO> { | |
| 15 | 15 | |
| 16 | 16 | default PageResult<DictTypeDO> selectPage(DictTypePageReqVO reqVO) { |
| 17 | 17 | return selectPage(reqVO, new QueryWrapperX<DictTypeDO>() | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dict/SysDictDataMapper.java deleted
| 1 | -package cn.iocoder.yudao.module.system.dal.mysql.dict; | |
| 2 | - | |
| 3 | -import cn.iocoder.yudao.framework.mybatis.core.enums.SqlConstants; | |
| 4 | -import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataExportReqVO; | |
| 5 | -import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataPageReqVO; | |
| 6 | -import cn.iocoder.yudao.module.system.dal.dataobject.dict.SysDictDataDO; | |
| 7 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 8 | -import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | |
| 9 | -import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | |
| 10 | -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
| 11 | -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |
| 12 | -import org.apache.ibatis.annotations.Mapper; | |
| 13 | - | |
| 14 | -import java.util.Arrays; | |
| 15 | -import java.util.Collection; | |
| 16 | -import java.util.Date; | |
| 17 | -import java.util.List; | |
| 18 | - | |
| 19 | -@Mapper | |
| 20 | -public interface SysDictDataMapper extends BaseMapperX<SysDictDataDO> { | |
| 21 | - | |
| 22 | - default SysDictDataDO selectByDictTypeAndValue(String dictType, String value) { | |
| 23 | - return selectOne(new LambdaQueryWrapper<SysDictDataDO>().eq(SysDictDataDO::getDictType, dictType) | |
| 24 | - .eq(SysDictDataDO::getValue, value)); | |
| 25 | - } | |
| 26 | - | |
| 27 | - default List<SysDictDataDO> selectByDictTypeAndValues(String dictType, Collection<String> values) { | |
| 28 | - return selectList(new LambdaQueryWrapper<SysDictDataDO>().eq(SysDictDataDO::getDictType, dictType) | |
| 29 | - .in(SysDictDataDO::getValue, values)); | |
| 30 | - } | |
| 31 | - | |
| 32 | - default int selectCountByDictType(String dictType) { | |
| 33 | - return selectCount(SysDictDataDO::getDictType, dictType); | |
| 34 | - } | |
| 35 | - | |
| 36 | - default PageResult<SysDictDataDO> selectPage(DictDataPageReqVO reqVO) { | |
| 37 | - return selectPage(reqVO, new LambdaQueryWrapperX<SysDictDataDO>() | |
| 38 | - .likeIfPresent(SysDictDataDO::getLabel, reqVO.getLabel()) | |
| 39 | - .likeIfPresent(SysDictDataDO::getDictType, reqVO.getDictType()) | |
| 40 | - .eqIfPresent(SysDictDataDO::getStatus, reqVO.getStatus()) | |
| 41 | - .orderByAsc(Arrays.asList(SysDictDataDO::getDictType, SysDictDataDO::getSort))); | |
| 42 | - } | |
| 43 | - | |
| 44 | - default List<SysDictDataDO> selectList(DictDataExportReqVO reqVO) { | |
| 45 | - return selectList(new LambdaQueryWrapperX<SysDictDataDO>().likeIfPresent(SysDictDataDO::getLabel, reqVO.getLabel()) | |
| 46 | - .likeIfPresent(SysDictDataDO::getDictType, reqVO.getDictType()) | |
| 47 | - .eqIfPresent(SysDictDataDO::getStatus, reqVO.getStatus())); | |
| 48 | - } | |
| 49 | - | |
| 50 | - default boolean selectExistsByUpdateTimeAfter(Date maxUpdateTime) { | |
| 51 | - return selectOne(new LambdaQueryWrapper<SysDictDataDO>().select(SysDictDataDO::getId) | |
| 52 | - .gt(SysDictDataDO::getUpdateTime, maxUpdateTime).last(SqlConstants.LIMIT1)) != null; | |
| 53 | - } | |
| 54 | - | |
| 55 | -} |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/errorcode/SysErrorCodeMapper.java renamed to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/errorcode/ErrorCodeMapper.java
| ... | ... | @@ -14,7 +14,7 @@ import java.util.Date; |
| 14 | 14 | import java.util.List; |
| 15 | 15 | |
| 16 | 16 | @Mapper |
| 17 | -public interface SysErrorCodeMapper extends BaseMapperX<ErrorCodeDO> { | |
| 17 | +public interface ErrorCodeMapper extends BaseMapperX<ErrorCodeDO> { | |
| 18 | 18 | |
| 19 | 19 | default PageResult<ErrorCodeDO> selectPage(ErrorCodePageReqVO reqVO) { |
| 20 | 20 | return selectPage(reqVO, new QueryWrapperX<ErrorCodeDO>() | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/logger/LoginLogMapper.java
| 1 | 1 | package cn.iocoder.yudao.module.system.dal.mysql.logger; |
| 2 | 2 | |
| 3 | -import cn.iocoder.yudao.module.system.dal.dataobject.logger.SysLoginLogDO; | |
| 3 | +import cn.iocoder.yudao.module.system.dal.dataobject.logger.LoginLogDO; | |
| 4 | 4 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 5 | 5 | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; |
| 6 | 6 | import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX; |
| ... | ... | @@ -12,10 +12,10 @@ import org.apache.ibatis.annotations.Mapper; |
| 12 | 12 | import java.util.List; |
| 13 | 13 | |
| 14 | 14 | @Mapper |
| 15 | -public interface LoginLogMapper extends BaseMapperX<SysLoginLogDO> { | |
| 15 | +public interface LoginLogMapper extends BaseMapperX<LoginLogDO> { | |
| 16 | 16 | |
| 17 | - default PageResult<SysLoginLogDO> selectPage(LoginLogPageReqVO reqVO) { | |
| 18 | - QueryWrapperX<SysLoginLogDO> query = new QueryWrapperX<SysLoginLogDO>() | |
| 17 | + default PageResult<LoginLogDO> selectPage(LoginLogPageReqVO reqVO) { | |
| 18 | + QueryWrapperX<LoginLogDO> query = new QueryWrapperX<LoginLogDO>() | |
| 19 | 19 | .likeIfPresent("user_ip", reqVO.getUserIp()) |
| 20 | 20 | .likeIfPresent("username", reqVO.getUsername()) |
| 21 | 21 | .betweenIfPresent("create_time", reqVO.getBeginTime(), reqVO.getEndTime()); |
| ... | ... | @@ -28,8 +28,8 @@ public interface LoginLogMapper extends BaseMapperX<SysLoginLogDO> { |
| 28 | 28 | return selectPage(reqVO, query); |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | - default List<SysLoginLogDO> selectList(LoginLogExportReqVO reqVO) { | |
| 32 | - QueryWrapperX<SysLoginLogDO> query = new QueryWrapperX<SysLoginLogDO>() | |
| 31 | + default List<LoginLogDO> selectList(LoginLogExportReqVO reqVO) { | |
| 32 | + QueryWrapperX<LoginLogDO> query = new QueryWrapperX<LoginLogDO>() | |
| 33 | 33 | .likeIfPresent("user_ip", reqVO.getUserIp()) |
| 34 | 34 | .likeIfPresent("username", reqVO.getUsername()) |
| 35 | 35 | .betweenIfPresent("create_time", reqVO.getBeginTime(), reqVO.getEndTime()); | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/logger/SysLoginLogCoreMapper.java deleted
| 1 | -package cn.iocoder.yudao.module.system.dal.mysql.logger; | |
| 2 | - | |
| 3 | -import cn.iocoder.yudao.module.system.dal.dataobject.logger.SysLoginLogDO; | |
| 4 | -import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | |
| 5 | -import org.apache.ibatis.annotations.Mapper; | |
| 6 | - | |
| 7 | -@Mapper | |
| 8 | -public interface SysLoginLogCoreMapper extends BaseMapperX<SysLoginLogDO> { | |
| 9 | - | |
| 10 | -} |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/notice/SysNoticeMapper.java renamed to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/notice/NoticeMapper.java
| ... | ... | @@ -8,7 +8,7 @@ import cn.iocoder.yudao.module.system.dal.dataobject.notice.NoticeDO; |
| 8 | 8 | import org.apache.ibatis.annotations.Mapper; |
| 9 | 9 | |
| 10 | 10 | @Mapper |
| 11 | -public interface SysNoticeMapper extends BaseMapperX<NoticeDO> { | |
| 11 | +public interface NoticeMapper extends BaseMapperX<NoticeDO> { | |
| 12 | 12 | |
| 13 | 13 | default PageResult<NoticeDO> selectPage(NoticePageReqVO reqVO) { |
| 14 | 14 | return selectPage(reqVO, new QueryWrapperX<NoticeDO>() | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/permission/RoleMenuMapper.java
| ... | ... | @@ -42,7 +42,7 @@ public interface RoleMenuMapper extends BaseMapperX<RoleMenuDO> { |
| 42 | 42 | delete(new QueryWrapper<RoleMenuDO>().eq("role_id", roleId)); |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - @Select("SELECT id FROM sys_role_menu WHERE update_time > #{maxUpdateTime} LIMIT 1") | |
| 45 | + @Select("SELECT id FROM system_role_menu WHERE update_time > #{maxUpdateTime} LIMIT 1") | |
| 46 | 46 | Long selectExistsByUpdateTimeAfter(Date maxUpdateTime); |
| 47 | 47 | |
| 48 | 48 | } | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/sms/SmsChannelMapper.java
| 1 | 1 | package cn.iocoder.yudao.module.system.dal.mysql.sms; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.module.system.controller.admin.sms.vo.channel.SmsChannelPageReqVO; |
| 4 | -import cn.iocoder.yudao.module.system.dal.dataobject.sms.SysSmsChannelDO; | |
| 4 | +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsChannelDO; | |
| 5 | 5 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 6 | 6 | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; |
| 7 | 7 | import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX; |
| ... | ... | @@ -11,17 +11,17 @@ import org.apache.ibatis.annotations.Select; |
| 11 | 11 | import java.util.Date; |
| 12 | 12 | |
| 13 | 13 | @Mapper |
| 14 | -public interface SmsChannelMapper extends BaseMapperX<SysSmsChannelDO> { | |
| 14 | +public interface SmsChannelMapper extends BaseMapperX<SmsChannelDO> { | |
| 15 | 15 | |
| 16 | - default PageResult<SysSmsChannelDO> selectPage(SmsChannelPageReqVO reqVO) { | |
| 17 | - return selectPage(reqVO, new QueryWrapperX<SysSmsChannelDO>() | |
| 16 | + default PageResult<SmsChannelDO> selectPage(SmsChannelPageReqVO reqVO) { | |
| 17 | + return selectPage(reqVO, new QueryWrapperX<SmsChannelDO>() | |
| 18 | 18 | .likeIfPresent("signature", reqVO.getSignature()) |
| 19 | 19 | .eqIfPresent("status", reqVO.getStatus()) |
| 20 | 20 | .betweenIfPresent("create_time", reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) |
| 21 | 21 | .orderByDesc("id")); |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | - @Select("SELECT id FROM sys_sms_channel WHERE update_time > #{maxUpdateTime} LIMIT 1") | |
| 24 | + @Select("SELECT id FROM system_sms_channel WHERE update_time > #{maxUpdateTime} LIMIT 1") | |
| 25 | 25 | Long selectExistsByUpdateTimeAfter(Date maxUpdateTime); |
| 26 | 26 | |
| 27 | 27 | } | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/sms/SmsLogMapper.java
| ... | ... | @@ -2,7 +2,7 @@ package cn.iocoder.yudao.module.system.dal.mysql.sms; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.module.system.controller.admin.sms.vo.log.SmsLogExportReqVO; |
| 4 | 4 | import cn.iocoder.yudao.module.system.controller.admin.sms.vo.log.SmsLogPageReqVO; |
| 5 | -import cn.iocoder.yudao.module.system.dal.dataobject.sms.SysSmsLogDO; | |
| 5 | +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsLogDO; | |
| 6 | 6 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 7 | 7 | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; |
| 8 | 8 | import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX; |
| ... | ... | @@ -11,10 +11,10 @@ import org.apache.ibatis.annotations.Mapper; |
| 11 | 11 | import java.util.List; |
| 12 | 12 | |
| 13 | 13 | @Mapper |
| 14 | -public interface SmsLogMapper extends BaseMapperX<SysSmsLogDO> { | |
| 14 | +public interface SmsLogMapper extends BaseMapperX<SmsLogDO> { | |
| 15 | 15 | |
| 16 | - default PageResult<SysSmsLogDO> selectPage(SmsLogPageReqVO reqVO) { | |
| 17 | - return selectPage(reqVO, new QueryWrapperX<SysSmsLogDO>() | |
| 16 | + default PageResult<SmsLogDO> selectPage(SmsLogPageReqVO reqVO) { | |
| 17 | + return selectPage(reqVO, new QueryWrapperX<SmsLogDO>() | |
| 18 | 18 | .eqIfPresent("channel_id", reqVO.getChannelId()) |
| 19 | 19 | .eqIfPresent("template_id", reqVO.getTemplateId()) |
| 20 | 20 | .likeIfPresent("mobile", reqVO.getMobile()) |
| ... | ... | @@ -25,8 +25,8 @@ public interface SmsLogMapper extends BaseMapperX<SysSmsLogDO> { |
| 25 | 25 | .orderByDesc("id")); |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | - default List<SysSmsLogDO> selectList(SmsLogExportReqVO reqVO) { | |
| 29 | - return selectList(new QueryWrapperX<SysSmsLogDO>() | |
| 28 | + default List<SmsLogDO> selectList(SmsLogExportReqVO reqVO) { | |
| 29 | + return selectList(new QueryWrapperX<SmsLogDO>() | |
| 30 | 30 | .eqIfPresent("channel_id", reqVO.getChannelId()) |
| 31 | 31 | .eqIfPresent("template_id", reqVO.getTemplateId()) |
| 32 | 32 | .likeIfPresent("mobile", reqVO.getMobile()) | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/sms/SmsTemplateMapper.java
| ... | ... | @@ -4,7 +4,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 4 | 4 | import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; |
| 5 | 5 | import cn.iocoder.yudao.module.system.controller.admin.sms.vo.template.SmsTemplateExportReqVO; |
| 6 | 6 | import cn.iocoder.yudao.module.system.controller.admin.sms.vo.template.SmsTemplatePageReqVO; |
| 7 | -import cn.iocoder.yudao.module.system.dal.dataobject.sms.SysSmsTemplateDO; | |
| 7 | +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsTemplateDO; | |
| 8 | 8 | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; |
| 9 | 9 | import org.apache.ibatis.annotations.Mapper; |
| 10 | 10 | import org.apache.ibatis.annotations.Select; |
| ... | ... | @@ -13,41 +13,41 @@ import java.util.Date; |
| 13 | 13 | import java.util.List; |
| 14 | 14 | |
| 15 | 15 | @Mapper |
| 16 | -public interface SmsTemplateMapper extends BaseMapperX<SysSmsTemplateDO> { | |
| 16 | +public interface SmsTemplateMapper extends BaseMapperX<SmsTemplateDO> { | |
| 17 | 17 | |
| 18 | - @Select("SELECT id FROM sys_sms_template WHERE update_time > #{maxUpdateTime} LIMIT 1") | |
| 18 | + @Select("SELECT id FROM system_sms_template WHERE update_time > #{maxUpdateTime} LIMIT 1") | |
| 19 | 19 | Long selectExistsByUpdateTimeAfter(Date maxUpdateTime); |
| 20 | 20 | |
| 21 | - default SysSmsTemplateDO selectByCode(String code) { | |
| 22 | - return selectOne(SysSmsTemplateDO::getCode, code); | |
| 21 | + default SmsTemplateDO selectByCode(String code) { | |
| 22 | + return selectOne(SmsTemplateDO::getCode, code); | |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | - default PageResult<SysSmsTemplateDO> selectPage(SmsTemplatePageReqVO reqVO) { | |
| 26 | - return selectPage(reqVO, new LambdaQueryWrapperX<SysSmsTemplateDO>() | |
| 27 | - .eqIfPresent(SysSmsTemplateDO::getType, reqVO.getType()) | |
| 28 | - .eqIfPresent(SysSmsTemplateDO::getStatus, reqVO.getStatus()) | |
| 29 | - .likeIfPresent(SysSmsTemplateDO::getCode, reqVO.getCode()) | |
| 30 | - .likeIfPresent(SysSmsTemplateDO::getContent, reqVO.getContent()) | |
| 31 | - .likeIfPresent(SysSmsTemplateDO::getApiTemplateId, reqVO.getApiTemplateId()) | |
| 32 | - .eqIfPresent(SysSmsTemplateDO::getChannelId, reqVO.getChannelId()) | |
| 33 | - .betweenIfPresent(SysSmsTemplateDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) | |
| 34 | - .orderByDesc(SysSmsTemplateDO::getId)); | |
| 25 | + default PageResult<SmsTemplateDO> selectPage(SmsTemplatePageReqVO reqVO) { | |
| 26 | + return selectPage(reqVO, new LambdaQueryWrapperX<SmsTemplateDO>() | |
| 27 | + .eqIfPresent(SmsTemplateDO::getType, reqVO.getType()) | |
| 28 | + .eqIfPresent(SmsTemplateDO::getStatus, reqVO.getStatus()) | |
| 29 | + .likeIfPresent(SmsTemplateDO::getCode, reqVO.getCode()) | |
| 30 | + .likeIfPresent(SmsTemplateDO::getContent, reqVO.getContent()) | |
| 31 | + .likeIfPresent(SmsTemplateDO::getApiTemplateId, reqVO.getApiTemplateId()) | |
| 32 | + .eqIfPresent(SmsTemplateDO::getChannelId, reqVO.getChannelId()) | |
| 33 | + .betweenIfPresent(SmsTemplateDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) | |
| 34 | + .orderByDesc(SmsTemplateDO::getId)); | |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | - default List<SysSmsTemplateDO> selectList(SmsTemplateExportReqVO reqVO) { | |
| 38 | - return selectList(new LambdaQueryWrapperX<SysSmsTemplateDO>() | |
| 39 | - .eqIfPresent(SysSmsTemplateDO::getType, reqVO.getType()) | |
| 40 | - .eqIfPresent(SysSmsTemplateDO::getStatus, reqVO.getStatus()) | |
| 41 | - .likeIfPresent(SysSmsTemplateDO::getCode, reqVO.getCode()) | |
| 42 | - .likeIfPresent(SysSmsTemplateDO::getContent, reqVO.getContent()) | |
| 43 | - .likeIfPresent(SysSmsTemplateDO::getApiTemplateId, reqVO.getApiTemplateId()) | |
| 44 | - .eqIfPresent(SysSmsTemplateDO::getChannelId, reqVO.getChannelId()) | |
| 45 | - .betweenIfPresent(SysSmsTemplateDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) | |
| 46 | - .orderByDesc(SysSmsTemplateDO::getId)); | |
| 37 | + default List<SmsTemplateDO> selectList(SmsTemplateExportReqVO reqVO) { | |
| 38 | + return selectList(new LambdaQueryWrapperX<SmsTemplateDO>() | |
| 39 | + .eqIfPresent(SmsTemplateDO::getType, reqVO.getType()) | |
| 40 | + .eqIfPresent(SmsTemplateDO::getStatus, reqVO.getStatus()) | |
| 41 | + .likeIfPresent(SmsTemplateDO::getCode, reqVO.getCode()) | |
| 42 | + .likeIfPresent(SmsTemplateDO::getContent, reqVO.getContent()) | |
| 43 | + .likeIfPresent(SmsTemplateDO::getApiTemplateId, reqVO.getApiTemplateId()) | |
| 44 | + .eqIfPresent(SmsTemplateDO::getChannelId, reqVO.getChannelId()) | |
| 45 | + .betweenIfPresent(SmsTemplateDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) | |
| 46 | + .orderByDesc(SmsTemplateDO::getId)); | |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | default Integer selectCountByChannelId(Long channelId) { |
| 50 | - return selectCount(SysSmsTemplateDO::getChannelId, channelId); | |
| 50 | + return selectCount(SmsTemplateDO::getChannelId, channelId); | |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | } | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/social/SysSocialUserMapper.java renamed to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/social/SocialUserMapper.java
| 1 | 1 | package cn.iocoder.yudao.module.system.dal.mysql.social; |
| 2 | 2 | |
| 3 | -import cn.iocoder.yudao.module.system.dal.dataobject.social.SysSocialUserDO; | |
| 3 | +import cn.iocoder.yudao.module.system.dal.dataobject.social.SocialUserDO; | |
| 4 | 4 | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; |
| 5 | 5 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| 6 | 6 | import org.apache.ibatis.annotations.Mapper; |
| ... | ... | @@ -9,20 +9,20 @@ import java.util.Collection; |
| 9 | 9 | import java.util.List; |
| 10 | 10 | |
| 11 | 11 | @Mapper |
| 12 | -public interface SysSocialUserMapper extends BaseMapperX<SysSocialUserDO> { | |
| 12 | +public interface SocialUserMapper extends BaseMapperX<SocialUserDO> { | |
| 13 | 13 | |
| 14 | - default List<SysSocialUserDO> selectListByTypeAndUnionId(Integer userType, Collection<Integer> types, String unionId) { | |
| 15 | - return selectList(new QueryWrapper<SysSocialUserDO>().eq("user_type", userType) | |
| 14 | + default List<SocialUserDO> selectListByTypeAndUnionId(Integer userType, Collection<Integer> types, String unionId) { | |
| 15 | + return selectList(new QueryWrapper<SocialUserDO>().eq("user_type", userType) | |
| 16 | 16 | .in("type", types).eq("union_id", unionId)); |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | - default List<SysSocialUserDO> selectListByTypeAndUserId(Integer userType, Collection<Integer> types, Long userId) { | |
| 20 | - return selectList(new QueryWrapper<SysSocialUserDO>().eq("user_type", userType) | |
| 19 | + default List<SocialUserDO> selectListByTypeAndUserId(Integer userType, Collection<Integer> types, Long userId) { | |
| 20 | + return selectList(new QueryWrapper<SocialUserDO>().eq("user_type", userType) | |
| 21 | 21 | .in("type", types).eq("user_id", userId)); |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | - default List<SysSocialUserDO> selectListByUserId(Integer userType, Long userId) { | |
| 25 | - return selectList(new QueryWrapper<SysSocialUserDO>().eq("user_type", userType).eq("user_id", userId)); | |
| 24 | + default List<SocialUserDO> selectListByUserId(Integer userType, Long userId) { | |
| 25 | + return selectList(new QueryWrapper<SocialUserDO>().eq("user_type", userType).eq("user_id", userId)); | |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | } | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/tenant/SysTenantCoreMapper.java deleted
| 1 | -package cn.iocoder.yudao.module.system.dal.mysql.tenant; | |
| 2 | - | |
| 3 | -import cn.iocoder.yudao.module.system.dal.dataobject.tenant.SysTenantDO; | |
| 4 | -import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | |
| 5 | -import org.apache.ibatis.annotations.Mapper; | |
| 6 | - | |
| 7 | -@Mapper | |
| 8 | -public interface SysTenantCoreMapper extends BaseMapperX<SysTenantDO> { | |
| 9 | -} |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/tenant/SysTenantMapper.java deleted
| 1 | -package cn.iocoder.yudao.module.system.dal.mysql.tenant; | |
| 2 | - | |
| 3 | -import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.TenantExportReqVO; | |
| 4 | -import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.TenantPageReqVO; | |
| 5 | -import cn.iocoder.yudao.module.system.dal.dataobject.tenant.SysTenantDO; | |
| 6 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 7 | -import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | |
| 8 | -import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | |
| 9 | -import org.apache.ibatis.annotations.Mapper; | |
| 10 | - | |
| 11 | -import java.util.List; | |
| 12 | - | |
| 13 | -/** | |
| 14 | - * 租户 Mapper | |
| 15 | - * | |
| 16 | - * @author 芋道源码 | |
| 17 | - */ | |
| 18 | -@Mapper | |
| 19 | -public interface SysTenantMapper extends BaseMapperX<SysTenantDO> { | |
| 20 | - | |
| 21 | - default PageResult<SysTenantDO> selectPage(TenantPageReqVO reqVO) { | |
| 22 | - return selectPage(reqVO, new LambdaQueryWrapperX<SysTenantDO>() | |
| 23 | - .likeIfPresent(SysTenantDO::getName, reqVO.getName()) | |
| 24 | - .likeIfPresent(SysTenantDO::getContactName, reqVO.getContactName()) | |
| 25 | - .likeIfPresent(SysTenantDO::getContactMobile, reqVO.getContactMobile()) | |
| 26 | - .eqIfPresent(SysTenantDO::getStatus, reqVO.getStatus()) | |
| 27 | - .betweenIfPresent(SysTenantDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) | |
| 28 | - .orderByDesc(SysTenantDO::getId)); | |
| 29 | - } | |
| 30 | - | |
| 31 | - default List<SysTenantDO> selectList(TenantExportReqVO reqVO) { | |
| 32 | - return selectList(new LambdaQueryWrapperX<SysTenantDO>() | |
| 33 | - .likeIfPresent(SysTenantDO::getName, reqVO.getName()) | |
| 34 | - .likeIfPresent(SysTenantDO::getContactName, reqVO.getContactName()) | |
| 35 | - .likeIfPresent(SysTenantDO::getContactMobile, reqVO.getContactMobile()) | |
| 36 | - .eqIfPresent(SysTenantDO::getStatus, reqVO.getStatus()) | |
| 37 | - .betweenIfPresent(SysTenantDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) | |
| 38 | - .orderByDesc(SysTenantDO::getId)); | |
| 39 | - } | |
| 40 | - | |
| 41 | - default SysTenantDO selectByName(String name) { | |
| 42 | - return selectOne(SysTenantDO::getName, name); | |
| 43 | - } | |
| 44 | -} |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/tenant/TenantMapper.java
0 → 100755
| 1 | +package cn.iocoder.yudao.module.system.dal.mysql.tenant; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.TenantExportReqVO; | |
| 4 | +import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.TenantPageReqVO; | |
| 5 | +import cn.iocoder.yudao.module.system.dal.dataobject.tenant.TenantDO; | |
| 6 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 7 | +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | |
| 8 | +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | |
| 9 | +import org.apache.ibatis.annotations.Mapper; | |
| 10 | + | |
| 11 | +import java.util.List; | |
| 12 | + | |
| 13 | +/** | |
| 14 | + * 租户 Mapper | |
| 15 | + * | |
| 16 | + * @author 芋道源码 | |
| 17 | + */ | |
| 18 | +@Mapper | |
| 19 | +public interface TenantMapper extends BaseMapperX<TenantDO> { | |
| 20 | + | |
| 21 | + default PageResult<TenantDO> selectPage(TenantPageReqVO reqVO) { | |
| 22 | + return selectPage(reqVO, new LambdaQueryWrapperX<TenantDO>() | |
| 23 | + .likeIfPresent(TenantDO::getName, reqVO.getName()) | |
| 24 | + .likeIfPresent(TenantDO::getContactName, reqVO.getContactName()) | |
| 25 | + .likeIfPresent(TenantDO::getContactMobile, reqVO.getContactMobile()) | |
| 26 | + .eqIfPresent(TenantDO::getStatus, reqVO.getStatus()) | |
| 27 | + .betweenIfPresent(TenantDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) | |
| 28 | + .orderByDesc(TenantDO::getId)); | |
| 29 | + } | |
| 30 | + | |
| 31 | + default List<TenantDO> selectList(TenantExportReqVO reqVO) { | |
| 32 | + return selectList(new LambdaQueryWrapperX<TenantDO>() | |
| 33 | + .likeIfPresent(TenantDO::getName, reqVO.getName()) | |
| 34 | + .likeIfPresent(TenantDO::getContactName, reqVO.getContactName()) | |
| 35 | + .likeIfPresent(TenantDO::getContactMobile, reqVO.getContactMobile()) | |
| 36 | + .eqIfPresent(TenantDO::getStatus, reqVO.getStatus()) | |
| 37 | + .betweenIfPresent(TenantDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) | |
| 38 | + .orderByDesc(TenantDO::getId)); | |
| 39 | + } | |
| 40 | + | |
| 41 | + default TenantDO selectByName(String name) { | |
| 42 | + return selectOne(TenantDO::getName, name); | |
| 43 | + } | |
| 44 | +} | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/redis/SysRedisKeyConstants.java renamed to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/redis/RedisKeyConstants.java
| ... | ... | @@ -13,7 +13,7 @@ import static cn.iocoder.yudao.framework.redis.core.RedisKeyDefine.KeyTypeEnum.S |
| 13 | 13 | * |
| 14 | 14 | * @author 芋道源码 |
| 15 | 15 | */ |
| 16 | -public interface SysRedisKeyConstants { | |
| 16 | +public interface RedisKeyConstants { | |
| 17 | 17 | |
| 18 | 18 | RedisKeyDefine CAPTCHA_CODE = new RedisKeyDefine("验证码的缓存", |
| 19 | 19 | "captcha_code:%s", // 参数为 uuid |
| ... | ... | @@ -30,5 +30,5 @@ public interface SysRedisKeyConstants { |
| 30 | 30 | RedisKeyDefine SOCIAL_AUTH_STATE = new RedisKeyDefine("社交登陆的 state", |
| 31 | 31 | "social_auth_state:%s", // 参数为 state |
| 32 | 32 | STRING, String.class, Duration.ofHours(24)); // 值为 state |
| 33 | - | |
| 33 | + | |
| 34 | 34 | } | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/redis/SysRedisKeyCoreConstants.java deleted
| 1 | -package cn.iocoder.yudao.module.system.dal.redis; | |
| 2 | - | |
| 3 | -import cn.iocoder.yudao.framework.redis.core.RedisKeyDefine; | |
| 4 | -import cn.iocoder.yudao.framework.security.core.LoginUser; | |
| 5 | -import me.zhyd.oauth.model.AuthUser; | |
| 6 | - | |
| 7 | -import java.time.Duration; | |
| 8 | - | |
| 9 | -import static cn.iocoder.yudao.framework.redis.core.RedisKeyDefine.KeyTypeEnum.STRING; | |
| 10 | - | |
| 11 | -/** | |
| 12 | - * System Redis Key 枚举类 | |
| 13 | - * | |
| 14 | - * @author 芋道源码 | |
| 15 | - */ | |
| 16 | -public interface SysRedisKeyCoreConstants { | |
| 17 | - | |
| 18 | -} |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/redis/auth/LoginUserRedisDAO.java
| ... | ... | @@ -8,7 +8,7 @@ import org.springframework.stereotype.Repository; |
| 8 | 8 | |
| 9 | 9 | import javax.annotation.Resource; |
| 10 | 10 | |
| 11 | -import static cn.iocoder.yudao.module.system.dal.redis.SysRedisKeyConstants.LOGIN_USER; | |
| 11 | +import static cn.iocoder.yudao.module.system.dal.redis.RedisKeyConstants.LOGIN_USER; | |
| 12 | 12 | |
| 13 | 13 | /** |
| 14 | 14 | * {@link LoginUser} 的 RedisDAO | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/redis/common/CaptchaRedisDAO.java
| ... | ... | @@ -6,7 +6,7 @@ import org.springframework.stereotype.Repository; |
| 6 | 6 | import javax.annotation.Resource; |
| 7 | 7 | import java.time.Duration; |
| 8 | 8 | |
| 9 | -import static cn.iocoder.yudao.module.system.dal.redis.SysRedisKeyConstants.CAPTCHA_CODE; | |
| 9 | +import static cn.iocoder.yudao.module.system.dal.redis.RedisKeyConstants.CAPTCHA_CODE; | |
| 10 | 10 | |
| 11 | 11 | /** |
| 12 | 12 | * 验证码的 Redis DAO | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/redis/social/SocialAuthUserRedisDAO.java
| ... | ... | @@ -8,7 +8,7 @@ import org.springframework.stereotype.Repository; |
| 8 | 8 | |
| 9 | 9 | import javax.annotation.Resource; |
| 10 | 10 | |
| 11 | -import static cn.iocoder.yudao.module.system.dal.redis.SysRedisKeyConstants.SOCIAL_AUTH_USER; | |
| 11 | +import static cn.iocoder.yudao.module.system.dal.redis.RedisKeyConstants.SOCIAL_AUTH_USER; | |
| 12 | 12 | |
| 13 | 13 | |
| 14 | 14 | /** | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/enums/common/SysSexEnum.java renamed to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/enums/common/SexEnum.java
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/enums/sms/SysSmsReceiveStatusEnum.java renamed to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/enums/sms/SmsReceiveStatusEnum.java
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/enums/sms/SysSmsSendStatusEnum.java renamed to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/enums/sms/SmsSendStatusEnum.java
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/enums/sms/SysSmsTemplateTypeEnum.java renamed to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/enums/sms/SmsTemplateTypeEnum.java
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/framework/datapermission/config/DataPermissionConfiguration.java
| 1 | 1 | package cn.iocoder.yudao.module.system.framework.datapermission.config; |
| 2 | 2 | |
| 3 | -import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysDeptDO; | |
| 3 | +import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO; | |
| 4 | 4 | import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; |
| 5 | 5 | import cn.iocoder.yudao.framework.datapermission.core.dept.rule.DeptDataPermissionRuleCustomizer; |
| 6 | 6 | import org.springframework.context.annotation.Bean; |
| ... | ... | @@ -18,7 +18,7 @@ public class DataPermissionConfiguration { |
| 18 | 18 | public DeptDataPermissionRuleCustomizer sysDeptDataPermissionRuleCustomizer() { |
| 19 | 19 | return rule -> { |
| 20 | 20 | rule.addDeptColumn(AdminUserDO.class); |
| 21 | - rule.addDeptColumn(SysDeptDO.class, "id"); | |
| 21 | + rule.addDeptColumn(DeptDO.class, "id"); | |
| 22 | 22 | }; |
| 23 | 23 | } |
| 24 | 24 | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/mq/consumer/sms/SmsSendConsumer.java
| ... | ... | @@ -19,12 +19,12 @@ import javax.annotation.Resource; |
| 19 | 19 | public class SmsSendConsumer extends AbstractStreamMessageListener<SmsSendMessage> { |
| 20 | 20 | |
| 21 | 21 | @Resource |
| 22 | - private SmsSendService smsCoreService; | |
| 22 | + private SmsSendService smsSendService; | |
| 23 | 23 | |
| 24 | 24 | @Override |
| 25 | 25 | public void onMessage(SmsSendMessage message) { |
| 26 | 26 | log.info("[onMessage][消息内容({})]", message); |
| 27 | - smsCoreService.doSendSms(message); | |
| 27 | + smsSendService.doSendSms(message); | |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | } | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthServiceImpl.java
| ... | ... | @@ -12,7 +12,7 @@ import cn.iocoder.yudao.module.system.controller.admin.auth.vo.auth.AuthSocialBi |
| 12 | 12 | import cn.iocoder.yudao.module.system.controller.admin.auth.vo.auth.AuthSocialLogin2ReqVO; |
| 13 | 13 | import cn.iocoder.yudao.module.system.controller.admin.auth.vo.auth.AuthSocialLoginReqVO; |
| 14 | 14 | import cn.iocoder.yudao.module.system.convert.auth.AuthConvert; |
| 15 | -import cn.iocoder.yudao.module.system.dal.dataobject.social.SysSocialUserDO; | |
| 15 | +import cn.iocoder.yudao.module.system.dal.dataobject.social.SocialUserDO; | |
| 16 | 16 | import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; |
| 17 | 17 | import cn.iocoder.yudao.module.system.enums.logger.LoginLogTypeEnum; |
| 18 | 18 | import cn.iocoder.yudao.module.system.enums.logger.LoginResultEnum; |
| ... | ... | @@ -74,7 +74,7 @@ public class AdminAuthServiceImpl implements AdminAuthService { |
| 74 | 74 | |
| 75 | 75 | @Override |
| 76 | 76 | public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { |
| 77 | - // 获取 username 对应的 SysUserDO | |
| 77 | + // 获取 username 对应的 AdminUserDO | |
| 78 | 78 | AdminUserDO user = userService.getUserByUsername(username); |
| 79 | 79 | if (user == null) { |
| 80 | 80 | throw new UsernameNotFoundException(username); |
| ... | ... | @@ -85,7 +85,7 @@ public class AdminAuthServiceImpl implements AdminAuthService { |
| 85 | 85 | |
| 86 | 86 | @Override |
| 87 | 87 | public LoginUser mockLogin(Long userId) { |
| 88 | - // 获取用户编号对应的 SysUserDO | |
| 88 | + // 获取用户编号对应的 AdminUserDO | |
| 89 | 89 | AdminUserDO user = userService.getUser(userId); |
| 90 | 90 | if (user == null) { |
| 91 | 91 | throw new UsernameNotFoundException(String.valueOf(userId)); |
| ... | ... | @@ -196,9 +196,9 @@ public class AdminAuthServiceImpl implements AdminAuthService { |
| 196 | 196 | AuthUser authUser = socialService.getAuthUser(reqVO.getType(), reqVO.getCode(), reqVO.getState()); |
| 197 | 197 | Assert.notNull(authUser, "授权用户不为空"); |
| 198 | 198 | |
| 199 | - // 如果未绑定 SysSocialUserDO 用户,则无法自动登录,进行报错 | |
| 199 | + // 如果未绑定 SocialUserDO 用户,则无法自动登录,进行报错 | |
| 200 | 200 | String unionId = socialService.getAuthUserUnionId(authUser); |
| 201 | - List<SysSocialUserDO> socialUsers = socialService.getAllSocialUserList(reqVO.getType(), unionId, getUserType().getValue()); | |
| 201 | + List<SocialUserDO> socialUsers = socialService.getAllSocialUserList(reqVO.getType(), unionId, getUserType().getValue()); | |
| 202 | 202 | if (CollUtil.isEmpty(socialUsers)) { |
| 203 | 203 | throw exception(AUTH_THIRD_LOGIN_NOT_BIND); |
| 204 | 204 | } |
| ... | ... | @@ -295,7 +295,7 @@ public class AdminAuthServiceImpl implements AdminAuthService { |
| 295 | 295 | return loginUser; |
| 296 | 296 | } |
| 297 | 297 | |
| 298 | - // 重新加载 SysUserDO 信息 | |
| 298 | + // 重新加载 AdminUserDO 信息 | |
| 299 | 299 | AdminUserDO user = userService.getUser(loginUser.getId()); |
| 300 | 300 | if (user == null || CommonStatusEnum.DISABLE.getStatus().equals(user.getStatus())) { |
| 301 | 301 | throw exception(AUTH_TOKEN_EXPIRED); // 校验 token 时,用户被禁用的情况下,也认为 token 过期,方便前端跳转到登录界面 | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/auth/UserSessionService.java
| ... | ... | @@ -2,7 +2,7 @@ package cn.iocoder.yudao.module.system.service.auth; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.security.core.LoginUser; |
| 4 | 4 | import cn.iocoder.yudao.module.system.controller.admin.auth.vo.session.UserSessionPageReqVO; |
| 5 | -import cn.iocoder.yudao.module.system.dal.dataobject.auth.SysUserSessionDO; | |
| 5 | +import cn.iocoder.yudao.module.system.dal.dataobject.auth.UserSessionDO; | |
| 6 | 6 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 7 | 7 | |
| 8 | 8 | /** |
| ... | ... | @@ -18,7 +18,7 @@ public interface UserSessionService { |
| 18 | 18 | * @param reqVO 分页条件 |
| 19 | 19 | * @return 份额与列表 |
| 20 | 20 | */ |
| 21 | - PageResult<SysUserSessionDO> getUserSessionPage(UserSessionPageReqVO reqVO); | |
| 21 | + PageResult<UserSessionDO> getUserSessionPage(UserSessionPageReqVO reqVO); | |
| 22 | 22 | |
| 23 | 23 | /** |
| 24 | 24 | * 移除超时的在线用户 | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/auth/UserSessionServiceImpl.java
| ... | ... | @@ -6,13 +6,13 @@ import cn.hutool.core.util.StrUtil; |
| 6 | 6 | import cn.iocoder.yudao.framework.security.config.SecurityProperties; |
| 7 | 7 | import cn.iocoder.yudao.framework.security.core.LoginUser; |
| 8 | 8 | import cn.iocoder.yudao.module.system.controller.admin.auth.vo.session.UserSessionPageReqVO; |
| 9 | +import cn.iocoder.yudao.module.system.dal.dataobject.auth.UserSessionDO; | |
| 9 | 10 | import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; |
| 10 | -import cn.iocoder.yudao.module.system.dal.mysql.auth.SysUserSessionMapper; | |
| 11 | +import cn.iocoder.yudao.module.system.dal.mysql.auth.UserSessionMapper; | |
| 11 | 12 | import cn.iocoder.yudao.module.system.enums.logger.LoginLogTypeEnum; |
| 12 | 13 | import cn.iocoder.yudao.module.system.enums.logger.LoginResultEnum; |
| 13 | 14 | import cn.iocoder.yudao.module.system.service.logger.LoginLogService; |
| 14 | 15 | import cn.iocoder.yudao.module.system.service.user.AdminUserService; |
| 15 | -import cn.iocoder.yudao.module.system.dal.dataobject.auth.SysUserSessionDO; | |
| 16 | 16 | import cn.iocoder.yudao.module.system.dal.redis.auth.LoginUserRedisDAO; |
| 17 | 17 | import cn.iocoder.yudao.module.system.api.logger.dto.LoginLogCreateReqDTO; |
| 18 | 18 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| ... | ... | @@ -39,7 +39,7 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.addTime; |
| 39 | 39 | public class UserSessionServiceImpl implements UserSessionService { |
| 40 | 40 | |
| 41 | 41 | @Resource |
| 42 | - private SysUserSessionMapper userSessionMapper; | |
| 42 | + private UserSessionMapper userSessionMapper; | |
| 43 | 43 | |
| 44 | 44 | @Resource |
| 45 | 45 | private AdminUserService userService; |
| ... | ... | @@ -47,13 +47,13 @@ public class UserSessionServiceImpl implements UserSessionService { |
| 47 | 47 | private LoginLogService loginLogService; |
| 48 | 48 | |
| 49 | 49 | @Resource |
| 50 | - private LoginUserRedisDAO loginUserCoreRedisDAO; | |
| 50 | + private LoginUserRedisDAO loginUserRedisDAO; | |
| 51 | 51 | |
| 52 | 52 | @Resource |
| 53 | 53 | private SecurityProperties securityProperties; |
| 54 | 54 | |
| 55 | 55 | @Override |
| 56 | - public PageResult<SysUserSessionDO> getUserSessionPage(UserSessionPageReqVO reqVO) { | |
| 56 | + public PageResult<UserSessionDO> getUserSessionPage(UserSessionPageReqVO reqVO) { | |
| 57 | 57 | // 处理基于用户昵称的查询 |
| 58 | 58 | Collection<Long> userIds = null; |
| 59 | 59 | if (StrUtil.isNotEmpty(reqVO.getUsername())) { |
| ... | ... | @@ -69,11 +69,11 @@ public class UserSessionServiceImpl implements UserSessionService { |
| 69 | 69 | @Override |
| 70 | 70 | public long clearSessionTimeout() { |
| 71 | 71 | // 获取db里已经超时的用户列表 |
| 72 | - List<SysUserSessionDO> sessionTimeoutDOS = userSessionMapper.selectListBySessionTimoutLt(); | |
| 73 | - Map<String, SysUserSessionDO> timeoutSessionDOMap = sessionTimeoutDOS | |
| 72 | + List<UserSessionDO> sessionTimeoutDOS = userSessionMapper.selectListBySessionTimoutLt(); | |
| 73 | + Map<String, UserSessionDO> timeoutSessionDOMap = sessionTimeoutDOS | |
| 74 | 74 | .stream() |
| 75 | - .filter(sessionDO -> loginUserCoreRedisDAO.get(sessionDO.getId()) == null) | |
| 76 | - .collect(Collectors.toMap(SysUserSessionDO::getId, o -> o)); | |
| 75 | + .filter(sessionDO -> loginUserRedisDAO.get(sessionDO.getId()) == null) | |
| 76 | + .collect(Collectors.toMap(UserSessionDO::getId, o -> o)); | |
| 77 | 77 | // 确认已经超时,按批次移出在线用户列表 |
| 78 | 78 | if (CollUtil.isNotEmpty(timeoutSessionDOMap)) { |
| 79 | 79 | Lists.partition(new ArrayList<>(timeoutSessionDOMap.keySet()), 100) |
| ... | ... | @@ -84,8 +84,8 @@ public class UserSessionServiceImpl implements UserSessionService { |
| 84 | 84 | return timeoutSessionDOMap.size(); |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | - private void createTimeoutLogoutLog(Collection<SysUserSessionDO> timeoutSessionDOS) { | |
| 88 | - for (SysUserSessionDO timeoutSessionDO : timeoutSessionDOS) { | |
| 87 | + private void createTimeoutLogoutLog(Collection<UserSessionDO> timeoutSessionDOS) { | |
| 88 | + for (UserSessionDO timeoutSessionDO : timeoutSessionDOS) { | |
| 89 | 89 | LoginLogCreateReqDTO reqDTO = new LoginLogCreateReqDTO(); |
| 90 | 90 | reqDTO.setLogType(LoginLogTypeEnum.LOGOUT_TIMEOUT.getType()); |
| 91 | 91 | reqDTO.setTraceId(TracerUtils.getTraceId()); |
| ... | ... | @@ -105,9 +105,9 @@ public class UserSessionServiceImpl implements UserSessionService { |
| 105 | 105 | String sessionId = generateSessionId(); |
| 106 | 106 | // 写入 Redis 缓存 |
| 107 | 107 | loginUser.setUpdateTime(new Date()); |
| 108 | - loginUserCoreRedisDAO.set(sessionId, loginUser); | |
| 108 | + loginUserRedisDAO.set(sessionId, loginUser); | |
| 109 | 109 | // 写入 DB 中 |
| 110 | - SysUserSessionDO userSession = SysUserSessionDO.builder().id(sessionId) | |
| 110 | + UserSessionDO userSession = UserSessionDO.builder().id(sessionId) | |
| 111 | 111 | .userId(loginUser.getId()).userType(loginUser.getUserType()) |
| 112 | 112 | .userIp(userIp).userAgent(userAgent).username(loginUser.getUsername()) |
| 113 | 113 | .sessionTimeout(addTime(Duration.ofMillis(getSessionTimeoutMillis()))) |
| ... | ... | @@ -121,9 +121,9 @@ public class UserSessionServiceImpl implements UserSessionService { |
| 121 | 121 | public void refreshUserSession(String sessionId, LoginUser loginUser) { |
| 122 | 122 | // 写入 Redis 缓存 |
| 123 | 123 | loginUser.setUpdateTime(new Date()); |
| 124 | - loginUserCoreRedisDAO.set(sessionId, loginUser); | |
| 124 | + loginUserRedisDAO.set(sessionId, loginUser); | |
| 125 | 125 | // 更新 DB 中 |
| 126 | - SysUserSessionDO updateObj = SysUserSessionDO.builder().id(sessionId).build(); | |
| 126 | + UserSessionDO updateObj = UserSessionDO.builder().id(sessionId).build(); | |
| 127 | 127 | updateObj.setUsername(loginUser.getUsername()); |
| 128 | 128 | updateObj.setUpdateTime(new Date()); |
| 129 | 129 | updateObj.setSessionTimeout(addTime(Duration.ofMillis(getSessionTimeoutMillis()))); |
| ... | ... | @@ -133,14 +133,14 @@ public class UserSessionServiceImpl implements UserSessionService { |
| 133 | 133 | @Override |
| 134 | 134 | public void deleteUserSession(String sessionId) { |
| 135 | 135 | // 删除 Redis 缓存 |
| 136 | - loginUserCoreRedisDAO.delete(sessionId); | |
| 136 | + loginUserRedisDAO.delete(sessionId); | |
| 137 | 137 | // 删除 DB 记录 |
| 138 | 138 | userSessionMapper.deleteById(sessionId); |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | @Override |
| 142 | 142 | public LoginUser getLoginUser(String sessionId) { |
| 143 | - return loginUserCoreRedisDAO.get(sessionId); | |
| 143 | + return loginUserRedisDAO.get(sessionId); | |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | @Override | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptService.java
| ... | ... | @@ -5,7 +5,7 @@ import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; |
| 5 | 5 | import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptCreateReqVO; |
| 6 | 6 | import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptListReqVO; |
| 7 | 7 | import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptUpdateReqVO; |
| 8 | -import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysDeptDO; | |
| 8 | +import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO; | |
| 9 | 9 | |
| 10 | 10 | import java.util.Collection; |
| 11 | 11 | import java.util.Collections; |
| ... | ... | @@ -53,7 +53,7 @@ public interface DeptService { |
| 53 | 53 | * @param reqVO 筛选条件请求 VO |
| 54 | 54 | * @return 部门列表 |
| 55 | 55 | */ |
| 56 | - List<SysDeptDO> getSimpleDepts(DeptListReqVO reqVO); | |
| 56 | + List<DeptDO> getSimpleDepts(DeptListReqVO reqVO); | |
| 57 | 57 | |
| 58 | 58 | /** |
| 59 | 59 | * 获得所有子部门,从缓存中 |
| ... | ... | @@ -62,7 +62,7 @@ public interface DeptService { |
| 62 | 62 | * @param recursive 是否递归获取所有 |
| 63 | 63 | * @return 子部门列表 |
| 64 | 64 | */ |
| 65 | - List<SysDeptDO> getDeptsByParentIdFromCache(Long parentId, boolean recursive); | |
| 65 | + List<DeptDO> getDeptsByParentIdFromCache(Long parentId, boolean recursive); | |
| 66 | 66 | |
| 67 | 67 | /** |
| 68 | 68 | * 获得部门信息数组 |
| ... | ... | @@ -70,7 +70,7 @@ public interface DeptService { |
| 70 | 70 | * @param ids 部门编号数组 |
| 71 | 71 | * @return 部门信息数组 |
| 72 | 72 | */ |
| 73 | - List<SysDeptDO> getDepts(Collection<Long> ids); | |
| 73 | + List<DeptDO> getDepts(Collection<Long> ids); | |
| 74 | 74 | |
| 75 | 75 | /** |
| 76 | 76 | * 获得部门信息 |
| ... | ... | @@ -78,7 +78,7 @@ public interface DeptService { |
| 78 | 78 | * @param id 部门编号 |
| 79 | 79 | * @return 部门信息 |
| 80 | 80 | */ |
| 81 | - SysDeptDO getDept(Long id); | |
| 81 | + DeptDO getDept(Long id); | |
| 82 | 82 | |
| 83 | 83 | /** |
| 84 | 84 | * 校验部门们是否有效。如下情况,视为无效: |
| ... | ... | @@ -95,7 +95,7 @@ public interface DeptService { |
| 95 | 95 | * @param ids 部门编号数组 |
| 96 | 96 | * @return 部门列表 |
| 97 | 97 | */ |
| 98 | - List<SysDeptDO> getSimpleDepts(Collection<Long> ids); | |
| 98 | + List<DeptDO> getSimpleDepts(Collection<Long> ids); | |
| 99 | 99 | |
| 100 | 100 | /** |
| 101 | 101 | * 获得指定编号的部门 Map |
| ... | ... | @@ -103,11 +103,11 @@ public interface DeptService { |
| 103 | 103 | * @param ids 部门编号数组 |
| 104 | 104 | * @return 部门 Map |
| 105 | 105 | */ |
| 106 | - default Map<Long, SysDeptDO> getDeptMap(Collection<Long> ids) { | |
| 106 | + default Map<Long, DeptDO> getDeptMap(Collection<Long> ids) { | |
| 107 | 107 | if (CollUtil.isEmpty(ids)) { |
| 108 | 108 | return Collections.emptyMap(); |
| 109 | 109 | } |
| 110 | - List<SysDeptDO> list = getSimpleDepts(ids); | |
| 111 | - return CollectionUtils.convertMap(list, SysDeptDO::getId); | |
| 110 | + List<DeptDO> list = getSimpleDepts(ids); | |
| 111 | + return CollectionUtils.convertMap(list, DeptDO::getId); | |
| 112 | 112 | } |
| 113 | 113 | } | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptServiceImpl.java
| ... | ... | @@ -9,8 +9,8 @@ import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptCreateRe |
| 9 | 9 | import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptListReqVO; |
| 10 | 10 | import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptUpdateReqVO; |
| 11 | 11 | import cn.iocoder.yudao.module.system.convert.dept.DeptConvert; |
| 12 | -import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysDeptDO; | |
| 13 | -import cn.iocoder.yudao.module.system.dal.mysql.dept.SysDeptMapper; | |
| 12 | +import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO; | |
| 13 | +import cn.iocoder.yudao.module.system.dal.mysql.dept.DeptMapper; | |
| 14 | 14 | import cn.iocoder.yudao.module.system.enums.dept.DeptIdEnum; |
| 15 | 15 | import cn.iocoder.yudao.module.system.mq.producer.dept.DeptProducer; |
| 16 | 16 | import com.google.common.collect.ImmutableMap; |
| ... | ... | @@ -46,27 +46,27 @@ public class DeptServiceImpl implements DeptService { |
| 46 | 46 | |
| 47 | 47 | /** |
| 48 | 48 | * 部门缓存 |
| 49 | - * key:部门编号 {@link SysDeptDO#getId()} | |
| 49 | + * key:部门编号 {@link DeptDO#getId()} | |
| 50 | 50 | * |
| 51 | 51 | * 这里声明 volatile 修饰的原因是,每次刷新时,直接修改指向 |
| 52 | 52 | */ |
| 53 | 53 | @SuppressWarnings("FieldCanBeLocal") |
| 54 | - private volatile Map<Long, SysDeptDO> deptCache; | |
| 54 | + private volatile Map<Long, DeptDO> deptCache; | |
| 55 | 55 | /** |
| 56 | 56 | * 父部门缓存 |
| 57 | - * key:部门编号 {@link SysDeptDO#getParentId()} | |
| 57 | + * key:部门编号 {@link DeptDO#getParentId()} | |
| 58 | 58 | * value: 直接子部门列表 |
| 59 | 59 | * |
| 60 | 60 | * 这里声明 volatile 修饰的原因是,每次刷新时,直接修改指向 |
| 61 | 61 | */ |
| 62 | - private volatile Multimap<Long, SysDeptDO> parentDeptCache; | |
| 62 | + private volatile Multimap<Long, DeptDO> parentDeptCache; | |
| 63 | 63 | /** |
| 64 | 64 | * 缓存部门的最大更新时间,用于后续的增量轮询,判断是否有更新 |
| 65 | 65 | */ |
| 66 | 66 | private volatile Date maxUpdateTime; |
| 67 | 67 | |
| 68 | 68 | @Resource |
| 69 | - private SysDeptMapper deptMapper; | |
| 69 | + private DeptMapper deptMapper; | |
| 70 | 70 | |
| 71 | 71 | @Resource |
| 72 | 72 | private DeptProducer deptProducer; |
| ... | ... | @@ -75,14 +75,14 @@ public class DeptServiceImpl implements DeptService { |
| 75 | 75 | @PostConstruct |
| 76 | 76 | public synchronized void initLocalCache() { |
| 77 | 77 | // 获取部门列表,如果有更新 |
| 78 | - List<SysDeptDO> deptList = this.loadDeptIfUpdate(maxUpdateTime); | |
| 78 | + List<DeptDO> deptList = this.loadDeptIfUpdate(maxUpdateTime); | |
| 79 | 79 | if (CollUtil.isEmpty(deptList)) { |
| 80 | 80 | return; |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | // 构建缓存 |
| 84 | - ImmutableMap.Builder<Long, SysDeptDO> builder = ImmutableMap.builder(); | |
| 85 | - ImmutableMultimap.Builder<Long, SysDeptDO> parentBuilder = ImmutableMultimap.builder(); | |
| 84 | + ImmutableMap.Builder<Long, DeptDO> builder = ImmutableMap.builder(); | |
| 85 | + ImmutableMultimap.Builder<Long, DeptDO> parentBuilder = ImmutableMultimap.builder(); | |
| 86 | 86 | deptList.forEach(sysRoleDO -> { |
| 87 | 87 | builder.put(sysRoleDO.getId(), sysRoleDO); |
| 88 | 88 | parentBuilder.put(sysRoleDO.getParentId(), sysRoleDO); |
| ... | ... | @@ -107,7 +107,7 @@ public class DeptServiceImpl implements DeptService { |
| 107 | 107 | * @param maxUpdateTime 当前部门的最大更新时间 |
| 108 | 108 | * @return 部门列表 |
| 109 | 109 | */ |
| 110 | - private List<SysDeptDO> loadDeptIfUpdate(Date maxUpdateTime) { | |
| 110 | + private List<DeptDO> loadDeptIfUpdate(Date maxUpdateTime) { | |
| 111 | 111 | // 第一步,判断是否要更新。 |
| 112 | 112 | if (maxUpdateTime == null) { // 如果更新时间为空,说明 DB 一定有新数据 |
| 113 | 113 | log.info("[loadMenuIfUpdate][首次加载全量部门]"); |
| ... | ... | @@ -126,7 +126,7 @@ public class DeptServiceImpl implements DeptService { |
| 126 | 126 | // 校验正确性 |
| 127 | 127 | checkCreateOrUpdate(null, reqVO.getParentId(), reqVO.getName()); |
| 128 | 128 | // 插入部门 |
| 129 | - SysDeptDO dept = DeptConvert.INSTANCE.convert(reqVO); | |
| 129 | + DeptDO dept = DeptConvert.INSTANCE.convert(reqVO); | |
| 130 | 130 | deptMapper.insert(dept); |
| 131 | 131 | // 发送刷新消息 |
| 132 | 132 | deptProducer.sendDeptRefreshMessage(); |
| ... | ... | @@ -138,7 +138,7 @@ public class DeptServiceImpl implements DeptService { |
| 138 | 138 | // 校验正确性 |
| 139 | 139 | checkCreateOrUpdate(reqVO.getId(), reqVO.getParentId(), reqVO.getName()); |
| 140 | 140 | // 更新部门 |
| 141 | - SysDeptDO updateObj = DeptConvert.INSTANCE.convert(reqVO); | |
| 141 | + DeptDO updateObj = DeptConvert.INSTANCE.convert(reqVO); | |
| 142 | 142 | deptMapper.updateById(updateObj); |
| 143 | 143 | // 发送刷新消息 |
| 144 | 144 | deptProducer.sendDeptRefreshMessage(); |
| ... | ... | @@ -159,16 +159,16 @@ public class DeptServiceImpl implements DeptService { |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | @Override |
| 162 | - public List<SysDeptDO> getSimpleDepts(DeptListReqVO reqVO) { | |
| 162 | + public List<DeptDO> getSimpleDepts(DeptListReqVO reqVO) { | |
| 163 | 163 | return deptMapper.selectList(reqVO); |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | @Override |
| 167 | - public List<SysDeptDO> getDeptsByParentIdFromCache(Long parentId, boolean recursive) { | |
| 167 | + public List<DeptDO> getDeptsByParentIdFromCache(Long parentId, boolean recursive) { | |
| 168 | 168 | if (parentId == null) { |
| 169 | 169 | return Collections.emptyList(); |
| 170 | 170 | } |
| 171 | - List<SysDeptDO> result = new ArrayList<>(); // TODO 芋艿:待优化,新增缓存,避免每次遍历的计算 | |
| 171 | + List<DeptDO> result = new ArrayList<>(); // TODO 芋艿:待优化,新增缓存,避免每次遍历的计算 | |
| 172 | 172 | // 递归,简单粗暴 |
| 173 | 173 | this.getDeptsByParentIdFromCache(result, parentId, |
| 174 | 174 | recursive ? Integer.MAX_VALUE : 1, // 如果递归获取,则无限;否则,只递归 1 次 |
| ... | ... | @@ -184,14 +184,14 @@ public class DeptServiceImpl implements DeptService { |
| 184 | 184 | * @param recursiveCount 递归次数 |
| 185 | 185 | * @param parentDeptMap 父部门 Map,使用缓存,避免变化 |
| 186 | 186 | */ |
| 187 | - private void getDeptsByParentIdFromCache(List<SysDeptDO> result, Long parentId, int recursiveCount, | |
| 188 | - Multimap<Long, SysDeptDO> parentDeptMap) { | |
| 187 | + private void getDeptsByParentIdFromCache(List<DeptDO> result, Long parentId, int recursiveCount, | |
| 188 | + Multimap<Long, DeptDO> parentDeptMap) { | |
| 189 | 189 | // 递归次数为 0,结束! |
| 190 | 190 | if (recursiveCount == 0) { |
| 191 | 191 | return; |
| 192 | 192 | } |
| 193 | 193 | // 获得子部门 |
| 194 | - Collection<SysDeptDO> depts = parentDeptMap.get(parentId); | |
| 194 | + Collection<DeptDO> depts = parentDeptMap.get(parentId); | |
| 195 | 195 | if (CollUtil.isEmpty(depts)) { |
| 196 | 196 | return; |
| 197 | 197 | } |
| ... | ... | @@ -219,7 +219,7 @@ public class DeptServiceImpl implements DeptService { |
| 219 | 219 | throw ServiceExceptionUtil.exception(DEPT_PARENT_ERROR); |
| 220 | 220 | } |
| 221 | 221 | // 父岗位不存在 |
| 222 | - SysDeptDO dept = deptMapper.selectById(parentId); | |
| 222 | + DeptDO dept = deptMapper.selectById(parentId); | |
| 223 | 223 | if (dept == null) { |
| 224 | 224 | throw ServiceExceptionUtil.exception(DEPT_PARENT_NOT_EXITS); |
| 225 | 225 | } |
| ... | ... | @@ -228,7 +228,7 @@ public class DeptServiceImpl implements DeptService { |
| 228 | 228 | throw ServiceExceptionUtil.exception(DEPT_NOT_ENABLE); |
| 229 | 229 | } |
| 230 | 230 | // 父部门不能是原来的子部门 |
| 231 | - List<SysDeptDO> children = this.getDeptsByParentIdFromCache(id, true); | |
| 231 | + List<DeptDO> children = this.getDeptsByParentIdFromCache(id, true); | |
| 232 | 232 | if (children.stream().anyMatch(dept1 -> dept1.getId().equals(parentId))) { |
| 233 | 233 | throw ServiceExceptionUtil.exception(DEPT_PARENT_IS_CHILD); |
| 234 | 234 | } |
| ... | ... | @@ -238,14 +238,14 @@ public class DeptServiceImpl implements DeptService { |
| 238 | 238 | if (id == null) { |
| 239 | 239 | return; |
| 240 | 240 | } |
| 241 | - SysDeptDO dept = deptMapper.selectById(id); | |
| 241 | + DeptDO dept = deptMapper.selectById(id); | |
| 242 | 242 | if (dept == null) { |
| 243 | 243 | throw ServiceExceptionUtil.exception(DEPT_NOT_FOUND); |
| 244 | 244 | } |
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | private void checkDeptNameUnique(Long id, Long parentId, String name) { |
| 248 | - SysDeptDO menu = deptMapper.selectByParentIdAndName(parentId, name); | |
| 248 | + DeptDO menu = deptMapper.selectByParentIdAndName(parentId, name); | |
| 249 | 249 | if (menu == null) { |
| 250 | 250 | return; |
| 251 | 251 | } |
| ... | ... | @@ -259,12 +259,12 @@ public class DeptServiceImpl implements DeptService { |
| 259 | 259 | } |
| 260 | 260 | |
| 261 | 261 | @Override |
| 262 | - public List<SysDeptDO> getDepts(Collection<Long> ids) { | |
| 262 | + public List<DeptDO> getDepts(Collection<Long> ids) { | |
| 263 | 263 | return deptMapper.selectBatchIds(ids); |
| 264 | 264 | } |
| 265 | 265 | |
| 266 | 266 | @Override |
| 267 | - public SysDeptDO getDept(Long id) { | |
| 267 | + public DeptDO getDept(Long id) { | |
| 268 | 268 | return deptMapper.selectById(id); |
| 269 | 269 | } |
| 270 | 270 | |
| ... | ... | @@ -274,11 +274,11 @@ public class DeptServiceImpl implements DeptService { |
| 274 | 274 | return; |
| 275 | 275 | } |
| 276 | 276 | // 获得科室信息 |
| 277 | - List<SysDeptDO> depts = deptMapper.selectBatchIds(ids); | |
| 278 | - Map<Long, SysDeptDO> deptMap = CollectionUtils.convertMap(depts, SysDeptDO::getId); | |
| 277 | + List<DeptDO> depts = deptMapper.selectBatchIds(ids); | |
| 278 | + Map<Long, DeptDO> deptMap = CollectionUtils.convertMap(depts, DeptDO::getId); | |
| 279 | 279 | // 校验 |
| 280 | 280 | ids.forEach(id -> { |
| 281 | - SysDeptDO dept = deptMap.get(id); | |
| 281 | + DeptDO dept = deptMap.get(id); | |
| 282 | 282 | if (dept == null) { |
| 283 | 283 | throw exception(DEPT_NOT_FOUND); |
| 284 | 284 | } |
| ... | ... | @@ -289,7 +289,7 @@ public class DeptServiceImpl implements DeptService { |
| 289 | 289 | } |
| 290 | 290 | |
| 291 | 291 | @Override |
| 292 | - public List<SysDeptDO> getSimpleDepts(Collection<Long> ids) { | |
| 292 | + public List<DeptDO> getSimpleDepts(Collection<Long> ids) { | |
| 293 | 293 | return deptMapper.selectBatchIds(ids); |
| 294 | 294 | } |
| 295 | 295 | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/dept/PostService.java
| ... | ... | @@ -6,7 +6,7 @@ import cn.iocoder.yudao.module.system.controller.admin.dept.vo.post.PostCreateRe |
| 6 | 6 | import cn.iocoder.yudao.module.system.controller.admin.dept.vo.post.PostExportReqVO; |
| 7 | 7 | import cn.iocoder.yudao.module.system.controller.admin.dept.vo.post.PostPageReqVO; |
| 8 | 8 | import cn.iocoder.yudao.module.system.controller.admin.dept.vo.post.PostUpdateReqVO; |
| 9 | -import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysPostDO; | |
| 9 | +import cn.iocoder.yudao.module.system.dal.dataobject.dept.PostDO; | |
| 10 | 10 | import org.springframework.lang.Nullable; |
| 11 | 11 | |
| 12 | 12 | import java.util.Collection; |
| ... | ... | @@ -49,7 +49,7 @@ public interface PostService { |
| 49 | 49 | * @param ids 岗位编号数组。如果为空,不进行筛选 |
| 50 | 50 | * @return 部门列表 |
| 51 | 51 | */ |
| 52 | - default List<SysPostDO> getPosts(@Nullable Collection<Long> ids) { | |
| 52 | + default List<PostDO> getPosts(@Nullable Collection<Long> ids) { | |
| 53 | 53 | return getPosts(ids, asSet(CommonStatusEnum.ENABLE.getStatus(), CommonStatusEnum.DISABLE.getStatus())); |
| 54 | 54 | } |
| 55 | 55 | |
| ... | ... | @@ -60,7 +60,7 @@ public interface PostService { |
| 60 | 60 | * @param statuses 状态数组。如果为空,不进行筛选 |
| 61 | 61 | * @return 部门列表 |
| 62 | 62 | */ |
| 63 | - List<SysPostDO> getPosts(@Nullable Collection<Long> ids, @Nullable Collection<Integer> statuses); | |
| 63 | + List<PostDO> getPosts(@Nullable Collection<Long> ids, @Nullable Collection<Integer> statuses); | |
| 64 | 64 | |
| 65 | 65 | /** |
| 66 | 66 | * 获得岗位分页列表 |
| ... | ... | @@ -68,7 +68,7 @@ public interface PostService { |
| 68 | 68 | * @param reqVO 分页条件 |
| 69 | 69 | * @return 部门分页列表 |
| 70 | 70 | */ |
| 71 | - PageResult<SysPostDO> getPostPage(PostPageReqVO reqVO); | |
| 71 | + PageResult<PostDO> getPostPage(PostPageReqVO reqVO); | |
| 72 | 72 | |
| 73 | 73 | /** |
| 74 | 74 | * 获得岗位列表 |
| ... | ... | @@ -76,7 +76,7 @@ public interface PostService { |
| 76 | 76 | * @param reqVO 查询条件 |
| 77 | 77 | * @return 部门列表 |
| 78 | 78 | */ |
| 79 | - List<SysPostDO> getPosts(PostExportReqVO reqVO); | |
| 79 | + List<PostDO> getPosts(PostExportReqVO reqVO); | |
| 80 | 80 | |
| 81 | 81 | /** |
| 82 | 82 | * 获得岗位信息 |
| ... | ... | @@ -84,7 +84,7 @@ public interface PostService { |
| 84 | 84 | * @param id 岗位编号 |
| 85 | 85 | * @return 岗位信息 |
| 86 | 86 | */ |
| 87 | - SysPostDO getPost(Long id); | |
| 87 | + PostDO getPost(Long id); | |
| 88 | 88 | |
| 89 | 89 | /** |
| 90 | 90 | * 校验岗位们是否有效。如下情况,视为无效: | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/dept/PostServiceImpl.java
| ... | ... | @@ -9,8 +9,8 @@ import cn.iocoder.yudao.module.system.controller.admin.dept.vo.post.PostExportRe |
| 9 | 9 | import cn.iocoder.yudao.module.system.controller.admin.dept.vo.post.PostPageReqVO; |
| 10 | 10 | import cn.iocoder.yudao.module.system.controller.admin.dept.vo.post.PostUpdateReqVO; |
| 11 | 11 | import cn.iocoder.yudao.module.system.convert.dept.PostConvert; |
| 12 | -import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysPostDO; | |
| 13 | -import cn.iocoder.yudao.module.system.dal.mysql.dept.SysPostMapper; | |
| 12 | +import cn.iocoder.yudao.module.system.dal.dataobject.dept.PostDO; | |
| 13 | +import cn.iocoder.yudao.module.system.dal.mysql.dept.PostMapper; | |
| 14 | 14 | import org.springframework.stereotype.Service; |
| 15 | 15 | import org.springframework.validation.annotation.Validated; |
| 16 | 16 | |
| ... | ... | @@ -33,14 +33,14 @@ import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*; |
| 33 | 33 | public class PostServiceImpl implements PostService { |
| 34 | 34 | |
| 35 | 35 | @Resource |
| 36 | - private SysPostMapper postMapper; | |
| 36 | + private PostMapper postMapper; | |
| 37 | 37 | |
| 38 | 38 | @Override |
| 39 | 39 | public Long createPost(PostCreateReqVO reqVO) { |
| 40 | 40 | // 校验正确性 |
| 41 | 41 | this.checkCreateOrUpdate(null, reqVO.getName(), reqVO.getCode()); |
| 42 | 42 | // 插入岗位 |
| 43 | - SysPostDO post = PostConvert.INSTANCE.convert(reqVO); | |
| 43 | + PostDO post = PostConvert.INSTANCE.convert(reqVO); | |
| 44 | 44 | postMapper.insert(post); |
| 45 | 45 | return post.getId(); |
| 46 | 46 | } |
| ... | ... | @@ -50,7 +50,7 @@ public class PostServiceImpl implements PostService { |
| 50 | 50 | // 校验正确性 |
| 51 | 51 | this.checkCreateOrUpdate(reqVO.getId(), reqVO.getName(), reqVO.getCode()); |
| 52 | 52 | // 更新岗位 |
| 53 | - SysPostDO updateObj = PostConvert.INSTANCE.convert(reqVO); | |
| 53 | + PostDO updateObj = PostConvert.INSTANCE.convert(reqVO); | |
| 54 | 54 | postMapper.updateById(updateObj); |
| 55 | 55 | } |
| 56 | 56 | |
| ... | ... | @@ -63,22 +63,22 @@ public class PostServiceImpl implements PostService { |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | @Override |
| 66 | - public List<SysPostDO> getPosts(Collection<Long> ids, Collection<Integer> statuses) { | |
| 66 | + public List<PostDO> getPosts(Collection<Long> ids, Collection<Integer> statuses) { | |
| 67 | 67 | return postMapper.selectList(ids, statuses); |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | @Override |
| 71 | - public PageResult<SysPostDO> getPostPage(PostPageReqVO reqVO) { | |
| 71 | + public PageResult<PostDO> getPostPage(PostPageReqVO reqVO) { | |
| 72 | 72 | return postMapper.selectPage(reqVO); |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | @Override |
| 76 | - public List<SysPostDO> getPosts(PostExportReqVO reqVO) { | |
| 76 | + public List<PostDO> getPosts(PostExportReqVO reqVO) { | |
| 77 | 77 | return postMapper.selectList(reqVO); |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | @Override |
| 81 | - public SysPostDO getPost(Long id) { | |
| 81 | + public PostDO getPost(Long id) { | |
| 82 | 82 | return postMapper.selectById(id); |
| 83 | 83 | } |
| 84 | 84 | |
| ... | ... | @@ -92,7 +92,7 @@ public class PostServiceImpl implements PostService { |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | private void checkPostNameUnique(Long id, String name) { |
| 95 | - SysPostDO post = postMapper.selectByName(name); | |
| 95 | + PostDO post = postMapper.selectByName(name); | |
| 96 | 96 | if (post == null) { |
| 97 | 97 | return; |
| 98 | 98 | } |
| ... | ... | @@ -106,7 +106,7 @@ public class PostServiceImpl implements PostService { |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | private void checkPostCodeUnique(Long id, String code) { |
| 109 | - SysPostDO post = postMapper.selectByCode(code); | |
| 109 | + PostDO post = postMapper.selectByCode(code); | |
| 110 | 110 | if (post == null) { |
| 111 | 111 | return; |
| 112 | 112 | } |
| ... | ... | @@ -123,7 +123,7 @@ public class PostServiceImpl implements PostService { |
| 123 | 123 | if (id == null) { |
| 124 | 124 | return; |
| 125 | 125 | } |
| 126 | - SysPostDO post = postMapper.selectById(id); | |
| 126 | + PostDO post = postMapper.selectById(id); | |
| 127 | 127 | if (post == null) { |
| 128 | 128 | throw ServiceExceptionUtil.exception(POST_NOT_FOUND); |
| 129 | 129 | } |
| ... | ... | @@ -135,11 +135,11 @@ public class PostServiceImpl implements PostService { |
| 135 | 135 | return; |
| 136 | 136 | } |
| 137 | 137 | // 获得岗位信息 |
| 138 | - List<SysPostDO> posts = postMapper.selectBatchIds(ids); | |
| 139 | - Map<Long, SysPostDO> postMap = convertMap(posts, SysPostDO::getId); | |
| 138 | + List<PostDO> posts = postMapper.selectBatchIds(ids); | |
| 139 | + Map<Long, PostDO> postMap = convertMap(posts, PostDO::getId); | |
| 140 | 140 | // 校验 |
| 141 | 141 | ids.forEach(id -> { |
| 142 | - SysPostDO post = postMap.get(id); | |
| 142 | + PostDO post = postMap.get(id); | |
| 143 | 143 | if (post == null) { |
| 144 | 144 | throw exception(POST_NOT_FOUND); |
| 145 | 145 | } | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictDataService.java
| 1 | 1 | package cn.iocoder.yudao.module.system.service.dict; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.dict.core.service.DictDataFrameworkService; |
| 4 | -import cn.iocoder.yudao.module.system.dal.dataobject.dict.SysDictDataDO; | |
| 4 | +import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictDataDO; | |
| 5 | 5 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 6 | 6 | import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataCreateReqVO; |
| 7 | 7 | import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataExportReqVO; |
| ... | ... | @@ -50,7 +50,7 @@ public interface DictDataService extends DictDataFrameworkService { |
| 50 | 50 | * |
| 51 | 51 | * @return 字典数据全列表 |
| 52 | 52 | */ |
| 53 | - List<SysDictDataDO> getDictDatas(); | |
| 53 | + List<DictDataDO> getDictDatas(); | |
| 54 | 54 | |
| 55 | 55 | /** |
| 56 | 56 | * 获得字典数据分页列表 |
| ... | ... | @@ -58,7 +58,7 @@ public interface DictDataService extends DictDataFrameworkService { |
| 58 | 58 | * @param reqVO 分页请求 |
| 59 | 59 | * @return 字典数据分页列表 |
| 60 | 60 | */ |
| 61 | - PageResult<SysDictDataDO> getDictDataPage(DictDataPageReqVO reqVO); | |
| 61 | + PageResult<DictDataDO> getDictDataPage(DictDataPageReqVO reqVO); | |
| 62 | 62 | |
| 63 | 63 | /** |
| 64 | 64 | * 获得字典数据列表 |
| ... | ... | @@ -66,7 +66,7 @@ public interface DictDataService extends DictDataFrameworkService { |
| 66 | 66 | * @param reqVO 列表请求 |
| 67 | 67 | * @return 字典数据列表 |
| 68 | 68 | */ |
| 69 | - List<SysDictDataDO> getDictDatas(DictDataExportReqVO reqVO); | |
| 69 | + List<DictDataDO> getDictDatas(DictDataExportReqVO reqVO); | |
| 70 | 70 | |
| 71 | 71 | /** |
| 72 | 72 | * 获得字典数据详情 |
| ... | ... | @@ -74,7 +74,7 @@ public interface DictDataService extends DictDataFrameworkService { |
| 74 | 74 | * @param id 字典数据编号 |
| 75 | 75 | * @return 字典数据 |
| 76 | 76 | */ |
| 77 | - SysDictDataDO getDictData(Long id); | |
| 77 | + DictDataDO getDictData(Long id); | |
| 78 | 78 | |
| 79 | 79 | /** |
| 80 | 80 | * 获得指定字典类型的数据数量 | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictDataServiceImpl.java
| ... | ... | @@ -10,10 +10,9 @@ import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataExpo |
| 10 | 10 | import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataPageReqVO; |
| 11 | 11 | import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataUpdateReqVO; |
| 12 | 12 | import cn.iocoder.yudao.module.system.convert.dict.DictDataConvert; |
| 13 | -import cn.iocoder.yudao.module.system.convert.dict.SysDictDataCoreConvert; | |
| 13 | +import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictDataDO; | |
| 14 | 14 | import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictTypeDO; |
| 15 | -import cn.iocoder.yudao.module.system.dal.dataobject.dict.SysDictDataDO; | |
| 16 | -import cn.iocoder.yudao.module.system.dal.mysql.dict.SysDictDataMapper; | |
| 15 | +import cn.iocoder.yudao.module.system.dal.mysql.dict.DictDataMapper; | |
| 17 | 16 | import cn.iocoder.yudao.module.system.mq.producer.dict.DictDataProducer; |
| 18 | 17 | import com.google.common.annotations.VisibleForTesting; |
| 19 | 18 | import com.google.common.collect.ImmutableMap; |
| ... | ... | @@ -44,9 +43,9 @@ public class DictDataServiceImpl implements DictDataService { |
| 44 | 43 | /** |
| 45 | 44 | * 排序 dictType > sort |
| 46 | 45 | */ |
| 47 | - private static final Comparator<SysDictDataDO> COMPARATOR_TYPE_AND_SORT = Comparator | |
| 48 | - .comparing(SysDictDataDO::getDictType) | |
| 49 | - .thenComparingInt(SysDictDataDO::getSort); | |
| 46 | + private static final Comparator<DictDataDO> COMPARATOR_TYPE_AND_SORT = Comparator | |
| 47 | + .comparing(DictDataDO::getDictType) | |
| 48 | + .thenComparingInt(DictDataDO::getSort); | |
| 50 | 49 | |
| 51 | 50 | /** |
| 52 | 51 | * 定时执行 {@link #schedulePeriodicRefresh()} 的周期 |
| ... | ... | @@ -58,7 +57,7 @@ public class DictDataServiceImpl implements DictDataService { |
| 58 | 57 | private DictTypeService dictTypeService; |
| 59 | 58 | |
| 60 | 59 | @Resource |
| 61 | - private SysDictDataMapper dictDataMapper; | |
| 60 | + private DictDataMapper dictDataMapper; | |
| 62 | 61 | |
| 63 | 62 | @Resource |
| 64 | 63 | private DictDataProducer dictDataProducer; |
| ... | ... | @@ -69,14 +68,14 @@ public class DictDataServiceImpl implements DictDataService { |
| 69 | 68 | * key1:字典类型 dictType |
| 70 | 69 | * key2:字典标签 label |
| 71 | 70 | */ |
| 72 | - private ImmutableTable<String, String, SysDictDataDO> labelDictDataCache; | |
| 71 | + private ImmutableTable<String, String, DictDataDO> labelDictDataCache; | |
| 73 | 72 | /** |
| 74 | 73 | * 字典数据缓存,第二个 key 使用 value |
| 75 | 74 | * |
| 76 | 75 | * key1:字典类型 dictType |
| 77 | 76 | * key2:字典值 value |
| 78 | 77 | */ |
| 79 | - private ImmutableTable<String, String, SysDictDataDO> valueDictDataCache; | |
| 78 | + private ImmutableTable<String, String, DictDataDO> valueDictDataCache; | |
| 80 | 79 | /** |
| 81 | 80 | * 缓存字典数据的最大更新时间,用于后续的增量轮询,判断是否有更新 |
| 82 | 81 | */ |
| ... | ... | @@ -86,14 +85,14 @@ public class DictDataServiceImpl implements DictDataService { |
| 86 | 85 | @PostConstruct |
| 87 | 86 | public synchronized void initLocalCache() { |
| 88 | 87 | // 获取字典数据列表,如果有更新 |
| 89 | - List<SysDictDataDO> dataList = loadDictDataIfUpdate(maxUpdateTime); | |
| 88 | + List<DictDataDO> dataList = loadDictDataIfUpdate(maxUpdateTime); | |
| 90 | 89 | if (CollUtil.isEmpty(dataList)) { |
| 91 | 90 | return; |
| 92 | 91 | } |
| 93 | 92 | |
| 94 | 93 | // 构建缓存 |
| 95 | - ImmutableTable.Builder<String, String, SysDictDataDO> labelDictDataBuilder = ImmutableTable.builder(); | |
| 96 | - ImmutableTable.Builder<String, String, SysDictDataDO> valueDictDataBuilder = ImmutableTable.builder(); | |
| 94 | + ImmutableTable.Builder<String, String, DictDataDO> labelDictDataBuilder = ImmutableTable.builder(); | |
| 95 | + ImmutableTable.Builder<String, String, DictDataDO> valueDictDataBuilder = ImmutableTable.builder(); | |
| 97 | 96 | dataList.forEach(dictData -> { |
| 98 | 97 | labelDictDataBuilder.put(dictData.getDictType(), dictData.getLabel(), dictData); |
| 99 | 98 | valueDictDataBuilder.put(dictData.getDictType(), dictData.getValue(), dictData); |
| ... | ... | @@ -112,7 +111,7 @@ public class DictDataServiceImpl implements DictDataService { |
| 112 | 111 | * @param maxUpdateTime 当前字典数据的最大更新时间 |
| 113 | 112 | * @return 字典数据列表 |
| 114 | 113 | */ |
| 115 | - private List<SysDictDataDO> loadDictDataIfUpdate(Date maxUpdateTime) { | |
| 114 | + private List<DictDataDO> loadDictDataIfUpdate(Date maxUpdateTime) { | |
| 116 | 115 | // 第一步,判断是否要更新。 |
| 117 | 116 | if (maxUpdateTime == null) { // 如果更新时间为空,说明 DB 一定有新数据 |
| 118 | 117 | log.info("[loadDictDataIfUpdate][首次加载全量字典数据]"); |
| ... | ... | @@ -132,42 +131,42 @@ public class DictDataServiceImpl implements DictDataService { |
| 132 | 131 | } |
| 133 | 132 | |
| 134 | 133 | @Override |
| 135 | - public List<SysDictDataDO> getDictDatas() { | |
| 136 | - List<SysDictDataDO> list = dictDataMapper.selectList(); | |
| 134 | + public List<DictDataDO> getDictDatas() { | |
| 135 | + List<DictDataDO> list = dictDataMapper.selectList(); | |
| 137 | 136 | list.sort(COMPARATOR_TYPE_AND_SORT); |
| 138 | 137 | return list; |
| 139 | 138 | } |
| 140 | 139 | |
| 141 | 140 | @Override |
| 142 | - public PageResult<SysDictDataDO> getDictDataPage(DictDataPageReqVO reqVO) { | |
| 141 | + public PageResult<DictDataDO> getDictDataPage(DictDataPageReqVO reqVO) { | |
| 143 | 142 | return dictDataMapper.selectPage(reqVO); |
| 144 | 143 | } |
| 145 | 144 | |
| 146 | 145 | @Override |
| 147 | - public List<SysDictDataDO> getDictDatas(DictDataExportReqVO reqVO) { | |
| 148 | - List<SysDictDataDO> list = dictDataMapper.selectList(reqVO); | |
| 146 | + public List<DictDataDO> getDictDatas(DictDataExportReqVO reqVO) { | |
| 147 | + List<DictDataDO> list = dictDataMapper.selectList(reqVO); | |
| 149 | 148 | list.sort(COMPARATOR_TYPE_AND_SORT); |
| 150 | 149 | return list; |
| 151 | 150 | } |
| 152 | 151 | |
| 153 | 152 | @Override |
| 154 | - public SysDictDataDO getDictData(Long id) { | |
| 153 | + public DictDataDO getDictData(Long id) { | |
| 155 | 154 | return dictDataMapper.selectById(id); |
| 156 | 155 | } |
| 157 | 156 | |
| 158 | 157 | @Override |
| 159 | 158 | public DictDataRespDTO getDictDataFromCache(String type, String value) { |
| 160 | - return SysDictDataCoreConvert.INSTANCE.convert02(valueDictDataCache.get(type, value)); | |
| 159 | + return DictDataConvert.INSTANCE.convert02(valueDictDataCache.get(type, value)); | |
| 161 | 160 | } |
| 162 | 161 | |
| 163 | 162 | @Override |
| 164 | 163 | public DictDataRespDTO parseDictDataFromCache(String type, String label) { |
| 165 | - return SysDictDataCoreConvert.INSTANCE.convert02(labelDictDataCache.get(type, label)); | |
| 164 | + return DictDataConvert.INSTANCE.convert02(labelDictDataCache.get(type, label)); | |
| 166 | 165 | } |
| 167 | 166 | |
| 168 | 167 | @Override |
| 169 | 168 | public List<DictDataRespDTO> listDictDatasFromCache(String type) { |
| 170 | - return SysDictDataCoreConvert.INSTANCE.convertList03(labelDictDataCache.row(type).values()); | |
| 169 | + return DictDataConvert.INSTANCE.convertList03(labelDictDataCache.row(type).values()); | |
| 171 | 170 | } |
| 172 | 171 | |
| 173 | 172 | @Override |
| ... | ... | @@ -176,7 +175,7 @@ public class DictDataServiceImpl implements DictDataService { |
| 176 | 175 | checkCreateOrUpdate(null, reqVO.getValue(), reqVO.getDictType()); |
| 177 | 176 | |
| 178 | 177 | // 插入字典类型 |
| 179 | - SysDictDataDO dictData = DictDataConvert.INSTANCE.convert(reqVO); | |
| 178 | + DictDataDO dictData = DictDataConvert.INSTANCE.convert(reqVO); | |
| 180 | 179 | dictDataMapper.insert(dictData); |
| 181 | 180 | |
| 182 | 181 | // 发送刷新消息 |
| ... | ... | @@ -190,7 +189,7 @@ public class DictDataServiceImpl implements DictDataService { |
| 190 | 189 | checkCreateOrUpdate(reqVO.getId(), reqVO.getValue(), reqVO.getDictType()); |
| 191 | 190 | |
| 192 | 191 | // 更新字典类型 |
| 193 | - SysDictDataDO updateObj = DictDataConvert.INSTANCE.convert(reqVO); | |
| 192 | + DictDataDO updateObj = DictDataConvert.INSTANCE.convert(reqVO); | |
| 194 | 193 | dictDataMapper.updateById(updateObj); |
| 195 | 194 | |
| 196 | 195 | // 发送刷新消息 |
| ... | ... | @@ -226,7 +225,7 @@ public class DictDataServiceImpl implements DictDataService { |
| 226 | 225 | |
| 227 | 226 | @VisibleForTesting |
| 228 | 227 | public void checkDictDataValueUnique(Long id, String dictType, String value) { |
| 229 | - SysDictDataDO dictData = dictDataMapper.selectByDictTypeAndValue(dictType, value); | |
| 228 | + DictDataDO dictData = dictDataMapper.selectByDictTypeAndValue(dictType, value); | |
| 230 | 229 | if (dictData == null) { |
| 231 | 230 | return; |
| 232 | 231 | } |
| ... | ... | @@ -244,7 +243,7 @@ public class DictDataServiceImpl implements DictDataService { |
| 244 | 243 | if (id == null) { |
| 245 | 244 | return; |
| 246 | 245 | } |
| 247 | - SysDictDataDO dictData = dictDataMapper.selectById(id); | |
| 246 | + DictDataDO dictData = dictDataMapper.selectById(id); | |
| 248 | 247 | if (dictData == null) { |
| 249 | 248 | throw exception(DICT_DATA_NOT_EXISTS); |
| 250 | 249 | } |
| ... | ... | @@ -266,10 +265,10 @@ public class DictDataServiceImpl implements DictDataService { |
| 266 | 265 | if (CollUtil.isEmpty(values)) { |
| 267 | 266 | return; |
| 268 | 267 | } |
| 269 | - ImmutableMap<String, SysDictDataDO> dictDataMap = valueDictDataCache.row(dictType); | |
| 268 | + ImmutableMap<String, DictDataDO> dictDataMap = valueDictDataCache.row(dictType); | |
| 270 | 269 | // 校验 |
| 271 | 270 | values.forEach(value -> { |
| 272 | - SysDictDataDO dictData = dictDataMap.get(value); | |
| 271 | + DictDataDO dictData = dictDataMap.get(value); | |
| 273 | 272 | if (dictData == null) { |
| 274 | 273 | throw exception(DICT_DATA_NOT_EXISTS); |
| 275 | 274 | } | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictTypeServiceImpl.java
| ... | ... | @@ -7,7 +7,7 @@ import cn.iocoder.yudao.module.system.controller.admin.dict.vo.type.DictTypePage |
| 7 | 7 | import cn.iocoder.yudao.module.system.controller.admin.dict.vo.type.DictTypeUpdateReqVO; |
| 8 | 8 | import cn.iocoder.yudao.module.system.convert.dict.DictTypeConvert; |
| 9 | 9 | import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictTypeDO; |
| 10 | -import cn.iocoder.yudao.module.system.dal.mysql.dict.SysDictTypeMapper; | |
| 10 | +import cn.iocoder.yudao.module.system.dal.mysql.dict.DictTypeMapper; | |
| 11 | 11 | import com.google.common.annotations.VisibleForTesting; |
| 12 | 12 | import org.springframework.stereotype.Service; |
| 13 | 13 | |
| ... | ... | @@ -29,7 +29,7 @@ public class DictTypeServiceImpl implements DictTypeService { |
| 29 | 29 | private DictDataService dictDataService; |
| 30 | 30 | |
| 31 | 31 | @Resource |
| 32 | - private SysDictTypeMapper dictTypeMapper; | |
| 32 | + private DictTypeMapper dictTypeMapper; | |
| 33 | 33 | |
| 34 | 34 | @Override |
| 35 | 35 | public PageResult<DictTypeDO> getDictTypePage(DictTypePageReqVO reqVO) { | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/errorcode/ErrorCodeServiceImpl.java
| ... | ... | @@ -10,7 +10,7 @@ import cn.iocoder.yudao.module.system.framework.errorcode.core.dto.ErrorCodeResp |
| 10 | 10 | import cn.iocoder.yudao.module.system.convert.errorcode.ErrorCodeConvert; |
| 11 | 11 | import cn.iocoder.yudao.module.system.controller.admin.errorcode.vo.ErrorCodeExportReqVO; |
| 12 | 12 | import cn.iocoder.yudao.module.system.controller.admin.errorcode.vo.ErrorCodePageReqVO; |
| 13 | -import cn.iocoder.yudao.module.system.dal.mysql.errorcode.SysErrorCodeMapper; | |
| 13 | +import cn.iocoder.yudao.module.system.dal.mysql.errorcode.ErrorCodeMapper; | |
| 14 | 14 | import cn.iocoder.yudao.module.system.enums.errorcode.ErrorCodeTypeEnum; |
| 15 | 15 | import com.google.common.annotations.VisibleForTesting; |
| 16 | 16 | import lombok.extern.slf4j.Slf4j; |
| ... | ... | @@ -39,7 +39,7 @@ import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils. |
| 39 | 39 | public class ErrorCodeServiceImpl implements ErrorCodeService { |
| 40 | 40 | |
| 41 | 41 | @Resource |
| 42 | - private SysErrorCodeMapper errorCodeMapper; | |
| 42 | + private ErrorCodeMapper errorCodeMapper; | |
| 43 | 43 | |
| 44 | 44 | @Override |
| 45 | 45 | public Long createErrorCode(ErrorCodeCreateReqVO createReqVO) { | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/logger/LoginLogService.java
| ... | ... | @@ -2,7 +2,7 @@ package cn.iocoder.yudao.module.system.service.logger; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.module.system.controller.admin.logger.vo.loginlog.LoginLogExportReqVO; |
| 4 | 4 | import cn.iocoder.yudao.module.system.controller.admin.logger.vo.loginlog.LoginLogPageReqVO; |
| 5 | -import cn.iocoder.yudao.module.system.dal.dataobject.logger.SysLoginLogDO; | |
| 5 | +import cn.iocoder.yudao.module.system.dal.dataobject.logger.LoginLogDO; | |
| 6 | 6 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 7 | 7 | import cn.iocoder.yudao.module.system.api.logger.dto.LoginLogCreateReqDTO; |
| 8 | 8 | |
| ... | ... | @@ -20,7 +20,7 @@ public interface LoginLogService { |
| 20 | 20 | * @param reqVO 分页条件 |
| 21 | 21 | * @return 登录日志分页 |
| 22 | 22 | */ |
| 23 | - PageResult<SysLoginLogDO> getLoginLogPage(LoginLogPageReqVO reqVO); | |
| 23 | + PageResult<LoginLogDO> getLoginLogPage(LoginLogPageReqVO reqVO); | |
| 24 | 24 | |
| 25 | 25 | /** |
| 26 | 26 | * 获得登录日志列表 |
| ... | ... | @@ -28,7 +28,7 @@ public interface LoginLogService { |
| 28 | 28 | * @param reqVO 列表条件 |
| 29 | 29 | * @return 登录日志列表 |
| 30 | 30 | */ |
| 31 | - List<SysLoginLogDO> getLoginLogList(LoginLogExportReqVO reqVO); | |
| 31 | + List<LoginLogDO> getLoginLogList(LoginLogExportReqVO reqVO); | |
| 32 | 32 | |
| 33 | 33 | /** |
| 34 | 34 | * 创建登录日志 | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/logger/LoginLogServiceImpl.java
| 1 | 1 | package cn.iocoder.yudao.module.system.service.logger; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 4 | +import cn.iocoder.yudao.module.system.api.logger.dto.LoginLogCreateReqDTO; | |
| 4 | 5 | import cn.iocoder.yudao.module.system.controller.admin.logger.vo.loginlog.LoginLogExportReqVO; |
| 5 | 6 | import cn.iocoder.yudao.module.system.controller.admin.logger.vo.loginlog.LoginLogPageReqVO; |
| 6 | -import cn.iocoder.yudao.module.system.convert.logger.SysLoginLogCoreConvert; | |
| 7 | -import cn.iocoder.yudao.module.system.dal.dataobject.logger.SysLoginLogDO; | |
| 7 | +import cn.iocoder.yudao.module.system.convert.logger.LoginLogConvert; | |
| 8 | +import cn.iocoder.yudao.module.system.dal.dataobject.logger.LoginLogDO; | |
| 8 | 9 | import cn.iocoder.yudao.module.system.dal.mysql.logger.LoginLogMapper; |
| 9 | -import cn.iocoder.yudao.module.system.api.logger.dto.LoginLogCreateReqDTO; | |
| 10 | 10 | import org.springframework.stereotype.Service; |
| 11 | 11 | |
| 12 | 12 | import javax.annotation.Resource; |
| ... | ... | @@ -22,18 +22,18 @@ public class LoginLogServiceImpl implements LoginLogService { |
| 22 | 22 | private LoginLogMapper loginLogMapper; |
| 23 | 23 | |
| 24 | 24 | @Override |
| 25 | - public PageResult<SysLoginLogDO> getLoginLogPage(LoginLogPageReqVO reqVO) { | |
| 25 | + public PageResult<LoginLogDO> getLoginLogPage(LoginLogPageReqVO reqVO) { | |
| 26 | 26 | return loginLogMapper.selectPage(reqVO); |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | @Override |
| 30 | - public List<SysLoginLogDO> getLoginLogList(LoginLogExportReqVO reqVO) { | |
| 30 | + public List<LoginLogDO> getLoginLogList(LoginLogExportReqVO reqVO) { | |
| 31 | 31 | return loginLogMapper.selectList(reqVO); |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | @Override |
| 35 | 35 | public void createLoginLog(LoginLogCreateReqDTO reqDTO) { |
| 36 | - SysLoginLogDO loginLog = SysLoginLogCoreConvert.INSTANCE.convert(reqDTO); | |
| 36 | + LoginLogDO loginLog = LoginLogConvert.INSTANCE.convert(reqDTO); | |
| 37 | 37 | loginLogMapper.insert(loginLog); |
| 38 | 38 | } |
| 39 | 39 | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/notice/NoticeServiceImpl.java
| ... | ... | @@ -6,7 +6,7 @@ import cn.iocoder.yudao.module.system.controller.admin.notice.vo.NoticeCreateReq |
| 6 | 6 | import cn.iocoder.yudao.module.system.controller.admin.notice.vo.NoticePageReqVO; |
| 7 | 7 | import cn.iocoder.yudao.module.system.controller.admin.notice.vo.NoticeUpdateReqVO; |
| 8 | 8 | import cn.iocoder.yudao.module.system.convert.notice.NoticeConvert; |
| 9 | -import cn.iocoder.yudao.module.system.dal.mysql.notice.SysNoticeMapper; | |
| 9 | +import cn.iocoder.yudao.module.system.dal.mysql.notice.NoticeMapper; | |
| 10 | 10 | import cn.iocoder.yudao.module.system.dal.dataobject.notice.NoticeDO; |
| 11 | 11 | import com.google.common.annotations.VisibleForTesting; |
| 12 | 12 | import org.springframework.stereotype.Service; |
| ... | ... | @@ -24,7 +24,7 @@ import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.NOTICE_NOT |
| 24 | 24 | public class NoticeServiceImpl implements NoticeService { |
| 25 | 25 | |
| 26 | 26 | @Resource |
| 27 | - private SysNoticeMapper noticeMapper; | |
| 27 | + private NoticeMapper noticeMapper; | |
| 28 | 28 | |
| 29 | 29 | @Override |
| 30 | 30 | public Long createNotice(NoticeCreateReqVO reqVO) { | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/permission/MenuServiceImpl.java
| ... | ... | @@ -56,7 +56,7 @@ public class MenuServiceImpl implements MenuService { |
| 56 | 56 | /** |
| 57 | 57 | * 权限与菜单缓存 |
| 58 | 58 | * key:权限 {@link MenuDO#getPermission()} |
| 59 | - * value:SysMenuDO 数组,因为一个权限可能对应多个 SysMenuDO 对象 | |
| 59 | + * value:MenuDO 数组,因为一个权限可能对应多个 MenuDO 对象 | |
| 60 | 60 | * |
| 61 | 61 | * 这里声明 volatile 修饰的原因是,每次刷新时,直接修改指向 |
| 62 | 62 | */ | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/permission/PermissionServiceImpl.java
| ... | ... | @@ -3,7 +3,7 @@ package cn.iocoder.yudao.module.system.service.permission; |
| 3 | 3 | import cn.hutool.core.collection.CollUtil; |
| 4 | 4 | import cn.hutool.core.collection.CollectionUtil; |
| 5 | 5 | import cn.hutool.core.util.ArrayUtil; |
| 6 | -import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysDeptDO; | |
| 6 | +import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO; | |
| 7 | 7 | import cn.iocoder.yudao.module.system.dal.dataobject.permission.MenuDO; |
| 8 | 8 | import cn.iocoder.yudao.module.system.dal.dataobject.permission.RoleDO; |
| 9 | 9 | import cn.iocoder.yudao.module.system.dal.dataobject.permission.RoleMenuDO; |
| ... | ... | @@ -383,8 +383,8 @@ public class PermissionServiceImpl implements PermissionService { |
| 383 | 383 | } |
| 384 | 384 | // 情况四,DEPT_DEPT_AND_CHILD |
| 385 | 385 | if (Objects.equals(role.getDataScope(), DataScopeEnum.DEPT_AND_CHILD.getScope())) { |
| 386 | - List<SysDeptDO> depts = deptService.getDeptsByParentIdFromCache(loginUser.getDeptId(), true); | |
| 387 | - CollUtil.addAll(result.getDeptIds(), CollectionUtils.convertList(depts, SysDeptDO::getId)); | |
| 386 | + List<DeptDO> depts = deptService.getDeptsByParentIdFromCache(loginUser.getDeptId(), true); | |
| 387 | + CollUtil.addAll(result.getDeptIds(), CollectionUtils.convertList(depts, DeptDO::getId)); | |
| 388 | 388 | continue; |
| 389 | 389 | } |
| 390 | 390 | // 情况五,SELF | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsChannelService.java
| 1 | 1 | package cn.iocoder.yudao.module.system.service.sms; |
| 2 | 2 | |
| 3 | -import cn.iocoder.yudao.module.system.dal.dataobject.sms.SysSmsChannelDO; | |
| 3 | +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsChannelDO; | |
| 4 | 4 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 5 | 5 | import cn.iocoder.yudao.module.system.controller.admin.sms.vo.channel.SmsChannelCreateReqVO; |
| 6 | 6 | import cn.iocoder.yudao.module.system.controller.admin.sms.vo.channel.SmsChannelPageReqVO; |
| ... | ... | @@ -51,7 +51,7 @@ public interface SmsChannelService { |
| 51 | 51 | * @param id 编号 |
| 52 | 52 | * @return 短信渠道 |
| 53 | 53 | */ |
| 54 | - SysSmsChannelDO getSmsChannel(Long id); | |
| 54 | + SmsChannelDO getSmsChannel(Long id); | |
| 55 | 55 | |
| 56 | 56 | /** |
| 57 | 57 | * 获得短信渠道列表 |
| ... | ... | @@ -59,14 +59,14 @@ public interface SmsChannelService { |
| 59 | 59 | * @param ids 编号 |
| 60 | 60 | * @return 短信渠道列表 |
| 61 | 61 | */ |
| 62 | - List<SysSmsChannelDO> getSmsChannelList(Collection<Long> ids); | |
| 62 | + List<SmsChannelDO> getSmsChannelList(Collection<Long> ids); | |
| 63 | 63 | |
| 64 | 64 | /** |
| 65 | 65 | * 获得所有短信渠道列表 |
| 66 | 66 | * |
| 67 | 67 | * @return 短信渠道列表 |
| 68 | 68 | */ |
| 69 | - List<SysSmsChannelDO> getSmsChannelList(); | |
| 69 | + List<SmsChannelDO> getSmsChannelList(); | |
| 70 | 70 | |
| 71 | 71 | /** |
| 72 | 72 | * 获得短信渠道分页 |
| ... | ... | @@ -74,6 +74,6 @@ public interface SmsChannelService { |
| 74 | 74 | * @param pageReqVO 分页查询 |
| 75 | 75 | * @return 短信渠道分页 |
| 76 | 76 | */ |
| 77 | - PageResult<SysSmsChannelDO> getSmsChannelPage(SmsChannelPageReqVO pageReqVO); | |
| 77 | + PageResult<SmsChannelDO> getSmsChannelPage(SmsChannelPageReqVO pageReqVO); | |
| 78 | 78 | |
| 79 | 79 | } | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsChannelServiceImpl.java
| ... | ... | @@ -5,9 +5,9 @@ import cn.iocoder.yudao.module.system.controller.admin.sms.vo.channel.SmsChannel |
| 5 | 5 | import cn.iocoder.yudao.module.system.controller.admin.sms.vo.channel.SmsChannelPageReqVO; |
| 6 | 6 | import cn.iocoder.yudao.module.system.controller.admin.sms.vo.channel.SmsChannelUpdateReqVO; |
| 7 | 7 | import cn.iocoder.yudao.module.system.convert.sms.SmsChannelConvert; |
| 8 | +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsChannelDO; | |
| 8 | 9 | import cn.iocoder.yudao.module.system.dal.mysql.sms.SmsChannelMapper; |
| 9 | 10 | import cn.iocoder.yudao.module.system.mq.producer.sms.SmsProducer; |
| 10 | -import cn.iocoder.yudao.module.system.dal.dataobject.sms.SysSmsChannelDO; | |
| 11 | 11 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 12 | 12 | import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; |
| 13 | 13 | import cn.iocoder.yudao.framework.sms.core.client.SmsClientFactory; |
| ... | ... | @@ -64,7 +64,7 @@ public class SmsChannelServiceImpl implements SmsChannelService { |
| 64 | 64 | @PostConstruct |
| 65 | 65 | public void initSmsClients() { |
| 66 | 66 | // 获取短信渠道,如果有更新 |
| 67 | - List<SysSmsChannelDO> smsChannels = this.loadSmsChannelIfUpdate(maxUpdateTime); | |
| 67 | + List<SmsChannelDO> smsChannels = this.loadSmsChannelIfUpdate(maxUpdateTime); | |
| 68 | 68 | if (CollUtil.isEmpty(smsChannels)) { |
| 69 | 69 | return; |
| 70 | 70 | } |
| ... | ... | @@ -91,7 +91,7 @@ public class SmsChannelServiceImpl implements SmsChannelService { |
| 91 | 91 | * @param maxUpdateTime 当前短信渠道的最大更新时间 |
| 92 | 92 | * @return 短信渠道列表 |
| 93 | 93 | */ |
| 94 | - private List<SysSmsChannelDO> loadSmsChannelIfUpdate(Date maxUpdateTime) { | |
| 94 | + private List<SmsChannelDO> loadSmsChannelIfUpdate(Date maxUpdateTime) { | |
| 95 | 95 | // 第一步,判断是否要更新。 |
| 96 | 96 | if (maxUpdateTime == null) { // 如果更新时间为空,说明 DB 一定有新数据 |
| 97 | 97 | log.info("[loadSmsChannelIfUpdate][首次加载全量短信渠道]"); |
| ... | ... | @@ -108,7 +108,7 @@ public class SmsChannelServiceImpl implements SmsChannelService { |
| 108 | 108 | @Override |
| 109 | 109 | public Long createSmsChannel(SmsChannelCreateReqVO createReqVO) { |
| 110 | 110 | // 插入 |
| 111 | - SysSmsChannelDO smsChannel = SmsChannelConvert.INSTANCE.convert(createReqVO); | |
| 111 | + SmsChannelDO smsChannel = SmsChannelConvert.INSTANCE.convert(createReqVO); | |
| 112 | 112 | smsChannelMapper.insert(smsChannel); |
| 113 | 113 | // 发送刷新消息 |
| 114 | 114 | smsProducer.sendSmsChannelRefreshMessage(); |
| ... | ... | @@ -121,7 +121,7 @@ public class SmsChannelServiceImpl implements SmsChannelService { |
| 121 | 121 | // 校验存在 |
| 122 | 122 | this.validateSmsChannelExists(updateReqVO.getId()); |
| 123 | 123 | // 更新 |
| 124 | - SysSmsChannelDO updateObj = SmsChannelConvert.INSTANCE.convert(updateReqVO); | |
| 124 | + SmsChannelDO updateObj = SmsChannelConvert.INSTANCE.convert(updateReqVO); | |
| 125 | 125 | smsChannelMapper.updateById(updateObj); |
| 126 | 126 | // 发送刷新消息 |
| 127 | 127 | smsProducer.sendSmsChannelRefreshMessage(); |
| ... | ... | @@ -148,22 +148,22 @@ public class SmsChannelServiceImpl implements SmsChannelService { |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | @Override |
| 151 | - public SysSmsChannelDO getSmsChannel(Long id) { | |
| 151 | + public SmsChannelDO getSmsChannel(Long id) { | |
| 152 | 152 | return smsChannelMapper.selectById(id); |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | @Override |
| 156 | - public List<SysSmsChannelDO> getSmsChannelList(Collection<Long> ids) { | |
| 156 | + public List<SmsChannelDO> getSmsChannelList(Collection<Long> ids) { | |
| 157 | 157 | return smsChannelMapper.selectBatchIds(ids); |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | @Override |
| 161 | - public List<SysSmsChannelDO> getSmsChannelList() { | |
| 161 | + public List<SmsChannelDO> getSmsChannelList() { | |
| 162 | 162 | return smsChannelMapper.selectList(); |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | @Override |
| 166 | - public PageResult<SysSmsChannelDO> getSmsChannelPage(SmsChannelPageReqVO pageReqVO) { | |
| 166 | + public PageResult<SmsChannelDO> getSmsChannelPage(SmsChannelPageReqVO pageReqVO) { | |
| 167 | 167 | return smsChannelMapper.selectPage(pageReqVO); |
| 168 | 168 | } |
| 169 | 169 | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsLogService.java
| ... | ... | @@ -2,9 +2,9 @@ package cn.iocoder.yudao.module.system.service.sms; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.module.system.controller.admin.sms.vo.log.SmsLogExportReqVO; |
| 4 | 4 | import cn.iocoder.yudao.module.system.controller.admin.sms.vo.log.SmsLogPageReqVO; |
| 5 | -import cn.iocoder.yudao.module.system.dal.dataobject.sms.SysSmsLogDO; | |
| 5 | +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsLogDO; | |
| 6 | 6 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 7 | -import cn.iocoder.yudao.module.system.dal.dataobject.sms.SysSmsTemplateDO; | |
| 7 | +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsTemplateDO; | |
| 8 | 8 | |
| 9 | 9 | import java.util.Date; |
| 10 | 10 | import java.util.List; |
| ... | ... | @@ -31,7 +31,7 @@ public interface SmsLogService { |
| 31 | 31 | * @return 发送日志编号 |
| 32 | 32 | */ |
| 33 | 33 | Long createSmsLog(String mobile, Long userId, Integer userType, Boolean isSend, |
| 34 | - SysSmsTemplateDO template, String templateContent, Map<String, Object> templateParams); | |
| 34 | + SmsTemplateDO template, String templateContent, Map<String, Object> templateParams); | |
| 35 | 35 | |
| 36 | 36 | /** |
| 37 | 37 | * 更新日志的发送结果 |
| ... | ... | @@ -64,7 +64,7 @@ public interface SmsLogService { |
| 64 | 64 | * @param pageReqVO 分页查询 |
| 65 | 65 | * @return 短信日志分页 |
| 66 | 66 | */ |
| 67 | - PageResult<SysSmsLogDO> getSmsLogPage(SmsLogPageReqVO pageReqVO); | |
| 67 | + PageResult<SmsLogDO> getSmsLogPage(SmsLogPageReqVO pageReqVO); | |
| 68 | 68 | |
| 69 | 69 | /** |
| 70 | 70 | * 获得短信日志列表, 用于 Excel 导出 |
| ... | ... | @@ -72,6 +72,6 @@ public interface SmsLogService { |
| 72 | 72 | * @param exportReqVO 查询条件 |
| 73 | 73 | * @return 短信日志列表 |
| 74 | 74 | */ |
| 75 | - List<SysSmsLogDO> getSmsLogList(SmsLogExportReqVO exportReqVO); | |
| 75 | + List<SmsLogDO> getSmsLogList(SmsLogExportReqVO exportReqVO); | |
| 76 | 76 | |
| 77 | 77 | } | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsLogServiceImpl.java
| ... | ... | @@ -3,12 +3,12 @@ package cn.iocoder.yudao.module.system.service.sms; |
| 3 | 3 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 4 | 4 | import cn.iocoder.yudao.module.system.controller.admin.sms.vo.log.SmsLogExportReqVO; |
| 5 | 5 | import cn.iocoder.yudao.module.system.controller.admin.sms.vo.log.SmsLogPageReqVO; |
| 6 | -import cn.iocoder.yudao.module.system.dal.dataobject.sms.SysSmsTemplateDO; | |
| 6 | +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsLogDO; | |
| 7 | +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsTemplateDO; | |
| 7 | 8 | import cn.iocoder.yudao.module.system.dal.mysql.sms.SmsLogMapper; |
| 8 | -import cn.iocoder.yudao.module.system.dal.dataobject.sms.SysSmsLogDO; | |
| 9 | 9 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 10 | -import cn.iocoder.yudao.module.system.enums.sms.SysSmsReceiveStatusEnum; | |
| 11 | -import cn.iocoder.yudao.module.system.enums.sms.SysSmsSendStatusEnum; | |
| 10 | +import cn.iocoder.yudao.module.system.enums.sms.SmsReceiveStatusEnum; | |
| 11 | +import cn.iocoder.yudao.module.system.enums.sms.SmsSendStatusEnum; | |
| 12 | 12 | import lombok.extern.slf4j.Slf4j; |
| 13 | 13 | import org.springframework.stereotype.Service; |
| 14 | 14 | |
| ... | ... | @@ -32,11 +32,11 @@ public class SmsLogServiceImpl implements SmsLogService { |
| 32 | 32 | |
| 33 | 33 | @Override |
| 34 | 34 | public Long createSmsLog(String mobile, Long userId, Integer userType, Boolean isSend, |
| 35 | - SysSmsTemplateDO template, String templateContent, Map<String, Object> templateParams) { | |
| 36 | - SysSmsLogDO.SysSmsLogDOBuilder logBuilder = SysSmsLogDO.builder(); | |
| 35 | + SmsTemplateDO template, String templateContent, Map<String, Object> templateParams) { | |
| 36 | + SmsLogDO.SmsLogDOBuilder logBuilder = SmsLogDO.builder(); | |
| 37 | 37 | // 根据是否要发送,设置状态 |
| 38 | - logBuilder.sendStatus(Objects.equals(isSend, true) ? SysSmsSendStatusEnum.INIT.getStatus() | |
| 39 | - : SysSmsSendStatusEnum.IGNORE.getStatus()); | |
| 38 | + logBuilder.sendStatus(Objects.equals(isSend, true) ? SmsSendStatusEnum.INIT.getStatus() | |
| 39 | + : SmsSendStatusEnum.IGNORE.getStatus()); | |
| 40 | 40 | // 设置手机相关字段 |
| 41 | 41 | logBuilder.mobile(mobile).userId(userId).userType(userType); |
| 42 | 42 | // 设置模板相关字段 |
| ... | ... | @@ -46,10 +46,10 @@ public class SmsLogServiceImpl implements SmsLogService { |
| 46 | 46 | // 设置渠道相关字段 |
| 47 | 47 | logBuilder.channelId(template.getChannelId()).channelCode(template.getChannelCode()); |
| 48 | 48 | // 设置接收相关字段 |
| 49 | - logBuilder.receiveStatus(SysSmsReceiveStatusEnum.INIT.getStatus()); | |
| 49 | + logBuilder.receiveStatus(SmsReceiveStatusEnum.INIT.getStatus()); | |
| 50 | 50 | |
| 51 | 51 | // 插入数据库 |
| 52 | - SysSmsLogDO logDO = logBuilder.build(); | |
| 52 | + SmsLogDO logDO = logBuilder.build(); | |
| 53 | 53 | smsLogMapper.insert(logDO); |
| 54 | 54 | return logDO.getId(); |
| 55 | 55 | } |
| ... | ... | @@ -58,9 +58,9 @@ public class SmsLogServiceImpl implements SmsLogService { |
| 58 | 58 | public void updateSmsSendResult(Long id, Integer sendCode, String sendMsg, |
| 59 | 59 | String apiSendCode, String apiSendMsg, |
| 60 | 60 | String apiRequestId, String apiSerialNo) { |
| 61 | - SysSmsSendStatusEnum sendStatus = CommonResult.isSuccess(sendCode) ? | |
| 62 | - SysSmsSendStatusEnum.SUCCESS : SysSmsSendStatusEnum.FAILURE; | |
| 63 | - smsLogMapper.updateById(SysSmsLogDO.builder().id(id).sendStatus(sendStatus.getStatus()) | |
| 61 | + SmsSendStatusEnum sendStatus = CommonResult.isSuccess(sendCode) ? | |
| 62 | + SmsSendStatusEnum.SUCCESS : SmsSendStatusEnum.FAILURE; | |
| 63 | + smsLogMapper.updateById(SmsLogDO.builder().id(id).sendStatus(sendStatus.getStatus()) | |
| 64 | 64 | .sendTime(new Date()).sendCode(sendCode).sendMsg(sendMsg) |
| 65 | 65 | .apiSendCode(apiSendCode).apiSendMsg(apiSendMsg) |
| 66 | 66 | .apiRequestId(apiRequestId).apiSerialNo(apiSerialNo).build()); |
| ... | ... | @@ -69,19 +69,19 @@ public class SmsLogServiceImpl implements SmsLogService { |
| 69 | 69 | @Override |
| 70 | 70 | public void updateSmsReceiveResult(Long id, Boolean success, Date receiveTime, |
| 71 | 71 | String apiReceiveCode, String apiReceiveMsg) { |
| 72 | - SysSmsReceiveStatusEnum receiveStatus = Objects.equals(success, true) ? | |
| 73 | - SysSmsReceiveStatusEnum.SUCCESS : SysSmsReceiveStatusEnum.FAILURE; | |
| 74 | - smsLogMapper.updateById(SysSmsLogDO.builder().id(id).receiveStatus(receiveStatus.getStatus()) | |
| 72 | + SmsReceiveStatusEnum receiveStatus = Objects.equals(success, true) ? | |
| 73 | + SmsReceiveStatusEnum.SUCCESS : SmsReceiveStatusEnum.FAILURE; | |
| 74 | + smsLogMapper.updateById(SmsLogDO.builder().id(id).receiveStatus(receiveStatus.getStatus()) | |
| 75 | 75 | .receiveTime(receiveTime).apiReceiveCode(apiReceiveCode).apiReceiveMsg(apiReceiveMsg).build()); |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | @Override |
| 79 | - public PageResult<SysSmsLogDO> getSmsLogPage(SmsLogPageReqVO pageReqVO) { | |
| 79 | + public PageResult<SmsLogDO> getSmsLogPage(SmsLogPageReqVO pageReqVO) { | |
| 80 | 80 | return smsLogMapper.selectPage(pageReqVO); |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | @Override |
| 84 | - public List<SysSmsLogDO> getSmsLogList(SmsLogExportReqVO exportReqVO) { | |
| 84 | + public List<SmsLogDO> getSmsLogList(SmsLogExportReqVO exportReqVO) { | |
| 85 | 85 | return smsLogMapper.selectList(exportReqVO); |
| 86 | 86 | } |
| 87 | 87 | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsSendServiceImpl.java
| ... | ... | @@ -12,7 +12,7 @@ import cn.iocoder.yudao.framework.sms.core.client.dto.SmsReceiveRespDTO; |
| 12 | 12 | import cn.iocoder.yudao.framework.sms.core.client.dto.SmsSendRespDTO; |
| 13 | 13 | import cn.iocoder.yudao.module.member.api.user.MemberUserApi; |
| 14 | 14 | import cn.iocoder.yudao.module.member.api.user.dto.UserRespDTO; |
| 15 | -import cn.iocoder.yudao.module.system.dal.dataobject.sms.SysSmsTemplateDO; | |
| 15 | +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsTemplateDO; | |
| 16 | 16 | import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; |
| 17 | 17 | import cn.iocoder.yudao.module.system.mq.message.sms.SmsSendMessage; |
| 18 | 18 | import cn.iocoder.yudao.module.system.mq.producer.sms.SmsProducer; |
| ... | ... | @@ -83,7 +83,7 @@ public class SmsSendServiceImpl implements SmsSendService { |
| 83 | 83 | public Long sendSingleSms(String mobile, Long userId, Integer userType, |
| 84 | 84 | String templateCode, Map<String, Object> templateParams) { |
| 85 | 85 | // 校验短信模板是否合法 |
| 86 | - SysSmsTemplateDO template = this.checkSmsTemplateValid(templateCode); | |
| 86 | + SmsTemplateDO template = this.checkSmsTemplateValid(templateCode); | |
| 87 | 87 | // 校验手机号码是否存在 |
| 88 | 88 | mobile = this.checkMobile(mobile); |
| 89 | 89 | // 构建有序的模板参数。为什么放在这个位置,是提前保证模板参数的正确性,而不是到了插入发送日志 |
| ... | ... | @@ -104,9 +104,9 @@ public class SmsSendServiceImpl implements SmsSendService { |
| 104 | 104 | |
| 105 | 105 | |
| 106 | 106 | @VisibleForTesting |
| 107 | - public SysSmsTemplateDO checkSmsTemplateValid(String templateCode) { | |
| 107 | + public SmsTemplateDO checkSmsTemplateValid(String templateCode) { | |
| 108 | 108 | // 获得短信模板。考虑到效率,从缓存中获取 |
| 109 | - SysSmsTemplateDO template = smsTemplateService.getSmsTemplateByCodeFromCache(templateCode); | |
| 109 | + SmsTemplateDO template = smsTemplateService.getSmsTemplateByCodeFromCache(templateCode); | |
| 110 | 110 | // 短信模板不存在 |
| 111 | 111 | if (template == null) { |
| 112 | 112 | throw exception(SMS_SEND_TEMPLATE_NOT_EXISTS); |
| ... | ... | @@ -124,7 +124,7 @@ public class SmsSendServiceImpl implements SmsSendService { |
| 124 | 124 | * @return 处理后的参数 |
| 125 | 125 | */ |
| 126 | 126 | @VisibleForTesting |
| 127 | - public List<KeyValue<String, Object>> buildTemplateParams(SysSmsTemplateDO template, Map<String, Object> templateParams) { | |
| 127 | + public List<KeyValue<String, Object>> buildTemplateParams(SmsTemplateDO template, Map<String, Object> templateParams) { | |
| 128 | 128 | return template.getParams().stream().map(key -> { |
| 129 | 129 | Object value = templateParams.get(key); |
| 130 | 130 | if (value == null) { | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsTemplateService.java
| ... | ... | @@ -4,7 +4,7 @@ import cn.iocoder.yudao.module.system.controller.admin.sms.vo.template.SmsTempla |
| 4 | 4 | import cn.iocoder.yudao.module.system.controller.admin.sms.vo.template.SmsTemplateExportReqVO; |
| 5 | 5 | import cn.iocoder.yudao.module.system.controller.admin.sms.vo.template.SmsTemplatePageReqVO; |
| 6 | 6 | import cn.iocoder.yudao.module.system.controller.admin.sms.vo.template.SmsTemplateUpdateReqVO; |
| 7 | -import cn.iocoder.yudao.module.system.dal.dataobject.sms.SysSmsTemplateDO; | |
| 7 | +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsTemplateDO; | |
| 8 | 8 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 9 | 9 | |
| 10 | 10 | import javax.validation.Valid; |
| ... | ... | @@ -31,7 +31,7 @@ public interface SmsTemplateService { |
| 31 | 31 | * @param code 模板编码 |
| 32 | 32 | * @return 短信模板 |
| 33 | 33 | */ |
| 34 | - SysSmsTemplateDO getSmsTemplateByCodeFromCache(String code); | |
| 34 | + SmsTemplateDO getSmsTemplateByCodeFromCache(String code); | |
| 35 | 35 | |
| 36 | 36 | /** |
| 37 | 37 | * 格式化短信内容 |
| ... | ... | @@ -48,7 +48,7 @@ public interface SmsTemplateService { |
| 48 | 48 | * @param code 模板编码 |
| 49 | 49 | * @return 短信模板 |
| 50 | 50 | */ |
| 51 | - SysSmsTemplateDO getSmsTemplateByCode(String code); | |
| 51 | + SmsTemplateDO getSmsTemplateByCode(String code); | |
| 52 | 52 | |
| 53 | 53 | /** |
| 54 | 54 | * 创建短信模板 |
| ... | ... | @@ -78,7 +78,7 @@ public interface SmsTemplateService { |
| 78 | 78 | * @param id 编号 |
| 79 | 79 | * @return 短信模板 |
| 80 | 80 | */ |
| 81 | - SysSmsTemplateDO getSmsTemplate(Long id); | |
| 81 | + SmsTemplateDO getSmsTemplate(Long id); | |
| 82 | 82 | |
| 83 | 83 | /** |
| 84 | 84 | * 获得短信模板列表 |
| ... | ... | @@ -86,7 +86,7 @@ public interface SmsTemplateService { |
| 86 | 86 | * @param ids 编号 |
| 87 | 87 | * @return 短信模板列表 |
| 88 | 88 | */ |
| 89 | - List<SysSmsTemplateDO> getSmsTemplateList(Collection<Long> ids); | |
| 89 | + List<SmsTemplateDO> getSmsTemplateList(Collection<Long> ids); | |
| 90 | 90 | |
| 91 | 91 | /** |
| 92 | 92 | * 获得短信模板分页 |
| ... | ... | @@ -94,7 +94,7 @@ public interface SmsTemplateService { |
| 94 | 94 | * @param pageReqVO 分页查询 |
| 95 | 95 | * @return 短信模板分页 |
| 96 | 96 | */ |
| 97 | - PageResult<SysSmsTemplateDO> getSmsTemplatePage(SmsTemplatePageReqVO pageReqVO); | |
| 97 | + PageResult<SmsTemplateDO> getSmsTemplatePage(SmsTemplatePageReqVO pageReqVO); | |
| 98 | 98 | |
| 99 | 99 | /** |
| 100 | 100 | * 获得短信模板列表, 用于 Excel 导出 |
| ... | ... | @@ -102,7 +102,7 @@ public interface SmsTemplateService { |
| 102 | 102 | * @param exportReqVO 查询条件 |
| 103 | 103 | * @return 短信模板分页 |
| 104 | 104 | */ |
| 105 | - List<SysSmsTemplateDO> getSmsTemplateList(SmsTemplateExportReqVO exportReqVO); | |
| 105 | + List<SmsTemplateDO> getSmsTemplateList(SmsTemplateExportReqVO exportReqVO); | |
| 106 | 106 | |
| 107 | 107 | /** |
| 108 | 108 | * 获得指定短信渠道下的短信模板数量 | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsTemplateServiceImpl.java
| ... | ... | @@ -9,10 +9,10 @@ import cn.iocoder.yudao.module.system.controller.admin.sms.vo.template.SmsTempla |
| 9 | 9 | import cn.iocoder.yudao.module.system.controller.admin.sms.vo.template.SmsTemplatePageReqVO; |
| 10 | 10 | import cn.iocoder.yudao.module.system.controller.admin.sms.vo.template.SmsTemplateUpdateReqVO; |
| 11 | 11 | import cn.iocoder.yudao.module.system.convert.sms.SmsTemplateConvert; |
| 12 | +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsTemplateDO; | |
| 12 | 13 | import cn.iocoder.yudao.module.system.dal.mysql.sms.SmsTemplateMapper; |
| 13 | 14 | import cn.iocoder.yudao.module.system.mq.producer.sms.SmsProducer; |
| 14 | -import cn.iocoder.yudao.module.system.dal.dataobject.sms.SysSmsChannelDO; | |
| 15 | -import cn.iocoder.yudao.module.system.dal.dataobject.sms.SysSmsTemplateDO; | |
| 15 | +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsChannelDO; | |
| 16 | 16 | import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; |
| 17 | 17 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 18 | 18 | import cn.iocoder.yudao.framework.sms.core.client.SmsClient; |
| ... | ... | @@ -69,11 +69,11 @@ public class SmsTemplateServiceImpl implements SmsTemplateService { |
| 69 | 69 | |
| 70 | 70 | /** |
| 71 | 71 | * 短信模板缓存 |
| 72 | - * key:短信模板编码 {@link SysSmsTemplateDO#getCode()} | |
| 72 | + * key:短信模板编码 {@link SmsTemplateDO#getCode()} | |
| 73 | 73 | * |
| 74 | 74 | * 这里声明 volatile 修饰的原因是,每次刷新时,直接修改指向 |
| 75 | 75 | */ |
| 76 | - private volatile Map<String, SysSmsTemplateDO> smsTemplateCache; | |
| 76 | + private volatile Map<String, SmsTemplateDO> smsTemplateCache; | |
| 77 | 77 | /** |
| 78 | 78 | * 缓存短信模板的最大更新时间,用于后续的增量轮询,判断是否有更新 |
| 79 | 79 | */ |
| ... | ... | @@ -83,13 +83,13 @@ public class SmsTemplateServiceImpl implements SmsTemplateService { |
| 83 | 83 | @PostConstruct |
| 84 | 84 | public void initLocalCache() { |
| 85 | 85 | // 获取短信模板列表,如果有更新 |
| 86 | - List<SysSmsTemplateDO> smsTemplateList = this.loadSmsTemplateIfUpdate(maxUpdateTime); | |
| 86 | + List<SmsTemplateDO> smsTemplateList = this.loadSmsTemplateIfUpdate(maxUpdateTime); | |
| 87 | 87 | if (CollUtil.isEmpty(smsTemplateList)) { |
| 88 | 88 | return; |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | // 写入缓存 |
| 92 | - ImmutableMap.Builder<String, SysSmsTemplateDO> builder = ImmutableMap.builder(); | |
| 92 | + ImmutableMap.Builder<String, SmsTemplateDO> builder = ImmutableMap.builder(); | |
| 93 | 93 | smsTemplateList.forEach(sysSmsTemplateDO -> builder.put(sysSmsTemplateDO.getCode(), sysSmsTemplateDO)); |
| 94 | 94 | smsTemplateCache = builder.build(); |
| 95 | 95 | assert smsTemplateList.size() > 0; // 断言,避免告警 |
| ... | ... | @@ -104,7 +104,7 @@ public class SmsTemplateServiceImpl implements SmsTemplateService { |
| 104 | 104 | * @param maxUpdateTime 当前短信模板的最大更新时间 |
| 105 | 105 | * @return 短信模板列表 |
| 106 | 106 | */ |
| 107 | - private List<SysSmsTemplateDO> loadSmsTemplateIfUpdate(Date maxUpdateTime) { | |
| 107 | + private List<SmsTemplateDO> loadSmsTemplateIfUpdate(Date maxUpdateTime) { | |
| 108 | 108 | // 第一步,判断是否要更新。 |
| 109 | 109 | if (maxUpdateTime == null) { // 如果更新时间为空,说明 DB 一定有新数据 |
| 110 | 110 | log.info("[loadSmsTemplateIfUpdate][首次加载全量短信模板]"); |
| ... | ... | @@ -124,7 +124,7 @@ public class SmsTemplateServiceImpl implements SmsTemplateService { |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | @Override |
| 127 | - public SysSmsTemplateDO getSmsTemplateByCodeFromCache(String code) { | |
| 127 | + public SmsTemplateDO getSmsTemplateByCodeFromCache(String code) { | |
| 128 | 128 | return smsTemplateCache.get(code); |
| 129 | 129 | } |
| 130 | 130 | |
| ... | ... | @@ -134,7 +134,7 @@ public class SmsTemplateServiceImpl implements SmsTemplateService { |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | @Override |
| 137 | - public SysSmsTemplateDO getSmsTemplateByCode(String code) { | |
| 137 | + public SmsTemplateDO getSmsTemplateByCode(String code) { | |
| 138 | 138 | return smsTemplateMapper.selectByCode(code); |
| 139 | 139 | } |
| 140 | 140 | |
| ... | ... | @@ -146,14 +146,14 @@ public class SmsTemplateServiceImpl implements SmsTemplateService { |
| 146 | 146 | @Override |
| 147 | 147 | public Long createSmsTemplate(SmsTemplateCreateReqVO createReqVO) { |
| 148 | 148 | // 校验短信渠道 |
| 149 | - SysSmsChannelDO channelDO = checkSmsChannel(createReqVO.getChannelId()); | |
| 149 | + SmsChannelDO channelDO = checkSmsChannel(createReqVO.getChannelId()); | |
| 150 | 150 | // 校验短信编码是否重复 |
| 151 | 151 | checkSmsTemplateCodeDuplicate(null, createReqVO.getCode()); |
| 152 | 152 | // 校验短信模板 |
| 153 | 153 | checkApiTemplate(createReqVO.getChannelId(), createReqVO.getApiTemplateId()); |
| 154 | 154 | |
| 155 | 155 | // 插入 |
| 156 | - SysSmsTemplateDO template = SmsTemplateConvert.INSTANCE.convert(createReqVO); | |
| 156 | + SmsTemplateDO template = SmsTemplateConvert.INSTANCE.convert(createReqVO); | |
| 157 | 157 | template.setParams(parseTemplateContentParams(template.getContent())); |
| 158 | 158 | template.setChannelCode(channelDO.getCode()); |
| 159 | 159 | smsTemplateMapper.insert(template); |
| ... | ... | @@ -168,14 +168,14 @@ public class SmsTemplateServiceImpl implements SmsTemplateService { |
| 168 | 168 | // 校验存在 |
| 169 | 169 | this.validateSmsTemplateExists(updateReqVO.getId()); |
| 170 | 170 | // 校验短信渠道 |
| 171 | - SysSmsChannelDO channelDO = checkSmsChannel(updateReqVO.getChannelId()); | |
| 171 | + SmsChannelDO channelDO = checkSmsChannel(updateReqVO.getChannelId()); | |
| 172 | 172 | // 校验短信编码是否重复 |
| 173 | 173 | checkSmsTemplateCodeDuplicate(updateReqVO.getId(), updateReqVO.getCode()); |
| 174 | 174 | // 校验短信模板 |
| 175 | 175 | checkApiTemplate(updateReqVO.getChannelId(), updateReqVO.getApiTemplateId()); |
| 176 | 176 | |
| 177 | 177 | // 更新 |
| 178 | - SysSmsTemplateDO updateObj = SmsTemplateConvert.INSTANCE.convert(updateReqVO); | |
| 178 | + SmsTemplateDO updateObj = SmsTemplateConvert.INSTANCE.convert(updateReqVO); | |
| 179 | 179 | updateObj.setParams(parseTemplateContentParams(updateObj.getContent())); |
| 180 | 180 | updateObj.setChannelCode(channelDO.getCode()); |
| 181 | 181 | smsTemplateMapper.updateById(updateObj); |
| ... | ... | @@ -200,22 +200,22 @@ public class SmsTemplateServiceImpl implements SmsTemplateService { |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | @Override |
| 203 | - public SysSmsTemplateDO getSmsTemplate(Long id) { | |
| 203 | + public SmsTemplateDO getSmsTemplate(Long id) { | |
| 204 | 204 | return smsTemplateMapper.selectById(id); |
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | @Override |
| 208 | - public List<SysSmsTemplateDO> getSmsTemplateList(Collection<Long> ids) { | |
| 208 | + public List<SmsTemplateDO> getSmsTemplateList(Collection<Long> ids) { | |
| 209 | 209 | return smsTemplateMapper.selectBatchIds(ids); |
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | @Override |
| 213 | - public PageResult<SysSmsTemplateDO> getSmsTemplatePage(SmsTemplatePageReqVO pageReqVO) { | |
| 213 | + public PageResult<SmsTemplateDO> getSmsTemplatePage(SmsTemplatePageReqVO pageReqVO) { | |
| 214 | 214 | return smsTemplateMapper.selectPage(pageReqVO); |
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | @Override |
| 218 | - public List<SysSmsTemplateDO> getSmsTemplateList(SmsTemplateExportReqVO exportReqVO) { | |
| 218 | + public List<SmsTemplateDO> getSmsTemplateList(SmsTemplateExportReqVO exportReqVO) { | |
| 219 | 219 | return smsTemplateMapper.selectList(exportReqVO); |
| 220 | 220 | } |
| 221 | 221 | |
| ... | ... | @@ -225,8 +225,8 @@ public class SmsTemplateServiceImpl implements SmsTemplateService { |
| 225 | 225 | } |
| 226 | 226 | |
| 227 | 227 | @VisibleForTesting |
| 228 | - public SysSmsChannelDO checkSmsChannel(Long channelId) { | |
| 229 | - SysSmsChannelDO channelDO = smsChannelService.getSmsChannel(channelId); | |
| 228 | + public SmsChannelDO checkSmsChannel(Long channelId) { | |
| 229 | + SmsChannelDO channelDO = smsChannelService.getSmsChannel(channelId); | |
| 230 | 230 | if (channelDO == null) { |
| 231 | 231 | throw exception(SMS_CHANNEL_NOT_EXISTS); |
| 232 | 232 | } |
| ... | ... | @@ -238,7 +238,7 @@ public class SmsTemplateServiceImpl implements SmsTemplateService { |
| 238 | 238 | |
| 239 | 239 | @VisibleForTesting |
| 240 | 240 | public void checkSmsTemplateCodeDuplicate(Long id, String code) { |
| 241 | - SysSmsTemplateDO template = smsTemplateMapper.selectByCode(code); | |
| 241 | + SmsTemplateDO template = smsTemplateMapper.selectByCode(code); | |
| 242 | 242 | if (template == null) { |
| 243 | 243 | return; |
| 244 | 244 | } | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/social/SocialUserService.java
| ... | ... | @@ -2,7 +2,7 @@ package cn.iocoder.yudao.module.system.service.social; |
| 2 | 2 | |
| 3 | 3 | import cn.hutool.core.util.StrUtil; |
| 4 | 4 | import cn.iocoder.yudao.framework.common.exception.ServiceException; |
| 5 | -import cn.iocoder.yudao.module.system.dal.dataobject.social.SysSocialUserDO; | |
| 5 | +import cn.iocoder.yudao.module.system.dal.dataobject.social.SocialUserDO; | |
| 6 | 6 | import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum; |
| 7 | 7 | import me.zhyd.oauth.model.AuthUser; |
| 8 | 8 | |
| ... | ... | @@ -56,7 +56,7 @@ public interface SocialUserService { |
| 56 | 56 | * @param userType 全局用户类型 |
| 57 | 57 | * @return 社交用户列表 |
| 58 | 58 | */ |
| 59 | - List<SysSocialUserDO> getAllSocialUserList(Integer type, String unionId, Integer userType); | |
| 59 | + List<SocialUserDO> getAllSocialUserList(Integer type, String unionId, Integer userType); | |
| 60 | 60 | |
| 61 | 61 | /** |
| 62 | 62 | * 获得指定用户的社交用户列表 |
| ... | ... | @@ -65,7 +65,7 @@ public interface SocialUserService { |
| 65 | 65 | * @param userType 用户类型 |
| 66 | 66 | * @return 社交用户列表 |
| 67 | 67 | */ |
| 68 | - List<SysSocialUserDO> getSocialUserList(Long userId, Integer userType); | |
| 68 | + List<SocialUserDO> getSocialUserList(Long userId, Integer userType); | |
| 69 | 69 | |
| 70 | 70 | /** |
| 71 | 71 | * 绑定社交用户 | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/social/SocialUserServiceImpl.java
| ... | ... | @@ -3,8 +3,8 @@ package cn.iocoder.yudao.module.system.service.social; |
| 3 | 3 | import cn.hutool.core.collection.CollUtil; |
| 4 | 4 | import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; |
| 5 | 5 | import cn.iocoder.yudao.framework.common.util.http.HttpUtils; |
| 6 | -import cn.iocoder.yudao.module.system.dal.dataobject.social.SysSocialUserDO; | |
| 7 | -import cn.iocoder.yudao.module.system.dal.mysql.social.SysSocialUserMapper; | |
| 6 | +import cn.iocoder.yudao.module.system.dal.dataobject.social.SocialUserDO; | |
| 7 | +import cn.iocoder.yudao.module.system.dal.mysql.social.SocialUserMapper; | |
| 8 | 8 | import cn.iocoder.yudao.module.system.dal.redis.social.SocialAuthUserRedisDAO; |
| 9 | 9 | import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum; |
| 10 | 10 | import com.google.common.annotations.VisibleForTesting; |
| ... | ... | @@ -45,7 +45,7 @@ public class SocialUserServiceImpl implements SocialUserService { |
| 45 | 45 | private SocialAuthUserRedisDAO authSocialUserRedisDAO; |
| 46 | 46 | |
| 47 | 47 | @Resource |
| 48 | - private SysSocialUserMapper socialUserMapper; | |
| 48 | + private SocialUserMapper socialUserMapper; | |
| 49 | 49 | |
| 50 | 50 | @Override |
| 51 | 51 | public String getAuthorizeUrl(Integer type, String redirectUri) { |
| ... | ... | @@ -73,22 +73,22 @@ public class SocialUserServiceImpl implements SocialUserService { |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | @Override |
| 76 | - public List<SysSocialUserDO> getAllSocialUserList(Integer type, String unionId, Integer userType) { | |
| 76 | + public List<SocialUserDO> getAllSocialUserList(Integer type, String unionId, Integer userType) { | |
| 77 | 77 | List<Integer> types = SocialTypeEnum.getRelationTypes(type); |
| 78 | 78 | return socialUserMapper.selectListByTypeAndUnionId(userType, types, unionId); |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | @Override |
| 82 | - public List<SysSocialUserDO> getSocialUserList(Long userId, Integer userType) { | |
| 82 | + public List<SocialUserDO> getSocialUserList(Long userId, Integer userType) { | |
| 83 | 83 | return socialUserMapper.selectListByUserId(userType, userId); |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | @Override |
| 87 | 87 | @Transactional(rollbackFor = Exception.class) |
| 88 | 88 | public void bindSocialUser(Long userId, Integer userType, Integer type, AuthUser authUser) { |
| 89 | - // 获得 unionId 对应的 SysSocialUserDO 列表 | |
| 89 | + // 获得 unionId 对应的 SocialUserDO 列表 | |
| 90 | 90 | String unionId = getAuthUserUnionId(authUser); |
| 91 | - List<SysSocialUserDO> socialUsers = this.getAllSocialUserList(type, unionId, userType); | |
| 91 | + List<SocialUserDO> socialUsers = this.getAllSocialUserList(type, unionId, userType); | |
| 92 | 92 | |
| 93 | 93 | // 逻辑一:如果 userId 之前绑定过该 type 的其它账号,需要进行解绑 |
| 94 | 94 | this.unbindOldSocialUser(userId, userType, type, unionId); |
| ... | ... | @@ -100,12 +100,12 @@ public class SocialUserServiceImpl implements SocialUserService { |
| 100 | 100 | if (Objects.equals(socialUser.getUserId(), userId)) { |
| 101 | 101 | return; |
| 102 | 102 | } |
| 103 | - socialUserMapper.updateById(new SysSocialUserDO().setId(socialUser.getId()).setUserId(userId)); | |
| 103 | + socialUserMapper.updateById(new SocialUserDO().setId(socialUser.getId()).setUserId(userId)); | |
| 104 | 104 | }); |
| 105 | 105 | |
| 106 | 106 | // 逻辑三:如果 authUser 不存在于 socialUsers 中,则进行新增;否则,进行更新 |
| 107 | - SysSocialUserDO socialUser = CollUtil.findOneByField(socialUsers, "openid", authUser.getUuid()); | |
| 108 | - SysSocialUserDO saveSocialUser = SysSocialUserDO.builder() // 新增和更新的通用属性 | |
| 107 | + SocialUserDO socialUser = CollUtil.findOneByField(socialUsers, "openid", authUser.getUuid()); | |
| 108 | + SocialUserDO saveSocialUser = SocialUserDO.builder() // 新增和更新的通用属性 | |
| 109 | 109 | .token(authUser.getToken().getAccessToken()).rawTokenInfo(toJsonString(authUser.getToken())) |
| 110 | 110 | .nickname(authUser.getNickname()).avatar(authUser.getAvatar()).rawUserInfo(toJsonString(authUser.getRawUserInfo())) |
| 111 | 111 | .build(); |
| ... | ... | @@ -121,8 +121,8 @@ public class SocialUserServiceImpl implements SocialUserService { |
| 121 | 121 | |
| 122 | 122 | @Override |
| 123 | 123 | public void unbindSocialUser(Long userId, Integer userType, Integer type, String unionId) { |
| 124 | - // 获得 unionId 对应的所有 SysSocialUserDO 社交用户 | |
| 125 | - List<SysSocialUserDO> socialUsers = this.getAllSocialUserList(type, unionId, userType); | |
| 124 | + // 获得 unionId 对应的所有 SocialUserDO 社交用户 | |
| 125 | + List<SocialUserDO> socialUsers = this.getAllSocialUserList(type, unionId, userType); | |
| 126 | 126 | if (CollUtil.isEmpty(socialUsers)) { |
| 127 | 127 | return; |
| 128 | 128 | } |
| ... | ... | @@ -134,20 +134,20 @@ public class SocialUserServiceImpl implements SocialUserService { |
| 134 | 134 | }); |
| 135 | 135 | |
| 136 | 136 | // 解绑 |
| 137 | - socialUserMapper.deleteBatchIds(CollectionUtils.convertSet(socialUsers, SysSocialUserDO::getId)); | |
| 137 | + socialUserMapper.deleteBatchIds(CollectionUtils.convertSet(socialUsers, SocialUserDO::getId)); | |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | @VisibleForTesting |
| 141 | 141 | public void unbindOldSocialUser(Long userId, Integer userType, Integer type, String newUnionId) { |
| 142 | 142 | List<Integer> types = SocialTypeEnum.getRelationTypes(type); |
| 143 | - List<SysSocialUserDO> oldSocialUsers = socialUserMapper.selectListByTypeAndUserId(userType, types, userId); | |
| 143 | + List<SocialUserDO> oldSocialUsers = socialUserMapper.selectListByTypeAndUserId(userType, types, userId); | |
| 144 | 144 | // 如果新老的 unionId 是一致的,说明无需解绑 |
| 145 | 145 | if (CollUtil.isEmpty(oldSocialUsers) || Objects.equals(newUnionId, oldSocialUsers.get(0).getUnionId())) { |
| 146 | 146 | return; |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | // 解绑 |
| 150 | - socialUserMapper.deleteBatchIds(CollectionUtils.convertSet(oldSocialUsers, SysSocialUserDO::getId)); | |
| 150 | + socialUserMapper.deleteBatchIds(CollectionUtils.convertSet(oldSocialUsers, SocialUserDO::getId)); | |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | /** | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/tenant/SysTenantCoreService.java deleted
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/tenant/TenantService.java
| 1 | 1 | package cn.iocoder.yudao.module.system.service.tenant; |
| 2 | 2 | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.framework.tenant.core.service.TenantFrameworkService; | |
| 3 | 5 | import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.TenantCreateReqVO; |
| 4 | 6 | import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.TenantExportReqVO; |
| 5 | 7 | import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.TenantPageReqVO; |
| 6 | 8 | import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.TenantUpdateReqVO; |
| 7 | -import cn.iocoder.yudao.module.system.dal.dataobject.tenant.SysTenantDO; | |
| 8 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 9 | +import cn.iocoder.yudao.module.system.dal.dataobject.tenant.TenantDO; | |
| 9 | 10 | |
| 10 | 11 | import javax.validation.Valid; |
| 11 | 12 | import java.util.Collection; |
| ... | ... | @@ -16,7 +17,7 @@ import java.util.List; |
| 16 | 17 | * |
| 17 | 18 | * @author 芋道源码 |
| 18 | 19 | */ |
| 19 | -public interface TenantService { | |
| 20 | +public interface TenantService extends TenantFrameworkService { | |
| 20 | 21 | |
| 21 | 22 | /** |
| 22 | 23 | * 创建租户 |
| ... | ... | @@ -46,7 +47,7 @@ public interface TenantService { |
| 46 | 47 | * @param id 编号 |
| 47 | 48 | * @return 租户 |
| 48 | 49 | */ |
| 49 | - SysTenantDO getTenant(Long id); | |
| 50 | + TenantDO getTenant(Long id); | |
| 50 | 51 | |
| 51 | 52 | /** |
| 52 | 53 | * 获得租户列表 |
| ... | ... | @@ -54,7 +55,7 @@ public interface TenantService { |
| 54 | 55 | * @param ids 编号 |
| 55 | 56 | * @return 租户列表 |
| 56 | 57 | */ |
| 57 | - List<SysTenantDO> getTenantList(Collection<Long> ids); | |
| 58 | + List<TenantDO> getTenantList(Collection<Long> ids); | |
| 58 | 59 | |
| 59 | 60 | /** |
| 60 | 61 | * 获得租户分页 |
| ... | ... | @@ -62,7 +63,7 @@ public interface TenantService { |
| 62 | 63 | * @param pageReqVO 分页查询 |
| 63 | 64 | * @return 租户分页 |
| 64 | 65 | */ |
| 65 | - PageResult<SysTenantDO> getTenantPage(TenantPageReqVO pageReqVO); | |
| 66 | + PageResult<TenantDO> getTenantPage(TenantPageReqVO pageReqVO); | |
| 66 | 67 | |
| 67 | 68 | /** |
| 68 | 69 | * 获得租户列表, 用于 Excel 导出 |
| ... | ... | @@ -70,7 +71,7 @@ public interface TenantService { |
| 70 | 71 | * @param exportReqVO 查询条件 |
| 71 | 72 | * @return 租户列表 |
| 72 | 73 | */ |
| 73 | - List<SysTenantDO> getTenantList(TenantExportReqVO exportReqVO); | |
| 74 | + List<TenantDO> getTenantList(TenantExportReqVO exportReqVO); | |
| 74 | 75 | |
| 75 | 76 | /** |
| 76 | 77 | * 获得名字对应的租户 |
| ... | ... | @@ -78,6 +79,6 @@ public interface TenantService { |
| 78 | 79 | * @param name 组户名 |
| 79 | 80 | * @return 租户 |
| 80 | 81 | */ |
| 81 | - SysTenantDO getTenantByName(String name); | |
| 82 | + TenantDO getTenantByName(String name); | |
| 82 | 83 | |
| 83 | 84 | } | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceImpl.java
| 1 | 1 | package cn.iocoder.yudao.module.system.service.tenant; |
| 2 | 2 | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; | |
| 3 | 5 | import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.TenantCreateReqVO; |
| 4 | 6 | import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.TenantExportReqVO; |
| 5 | 7 | import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.TenantPageReqVO; |
| 6 | 8 | import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.TenantUpdateReqVO; |
| 7 | 9 | import cn.iocoder.yudao.module.system.convert.tenant.TenantConvert; |
| 8 | -import cn.iocoder.yudao.module.system.dal.mysql.tenant.SysTenantMapper; | |
| 9 | -import cn.iocoder.yudao.module.system.dal.dataobject.tenant.SysTenantDO; | |
| 10 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 10 | +import cn.iocoder.yudao.module.system.dal.dataobject.tenant.TenantDO; | |
| 11 | +import cn.iocoder.yudao.module.system.dal.mysql.tenant.TenantMapper; | |
| 11 | 12 | import org.springframework.stereotype.Service; |
| 12 | 13 | import org.springframework.validation.annotation.Validated; |
| 13 | 14 | |
| ... | ... | @@ -15,8 +16,8 @@ import javax.annotation.Resource; |
| 15 | 16 | import java.util.Collection; |
| 16 | 17 | import java.util.List; |
| 17 | 18 | |
| 18 | -import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.TENANT_NOT_EXISTS; | |
| 19 | 19 | import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; |
| 20 | +import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.TENANT_NOT_EXISTS; | |
| 20 | 21 | |
| 21 | 22 | /** |
| 22 | 23 | * 租户 Service 实现类 |
| ... | ... | @@ -28,12 +29,18 @@ import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionU |
| 28 | 29 | public class TenantServiceImpl implements TenantService { |
| 29 | 30 | |
| 30 | 31 | @Resource |
| 31 | - private SysTenantMapper tenantMapper; | |
| 32 | + private TenantMapper tenantMapper; | |
| 33 | + | |
| 34 | + @Override | |
| 35 | + public List<Long> getTenantIds() { | |
| 36 | + List<TenantDO> tenants = tenantMapper.selectList(); | |
| 37 | + return CollectionUtils.convertList(tenants, TenantDO::getId); | |
| 38 | + } | |
| 32 | 39 | |
| 33 | 40 | @Override |
| 34 | 41 | public Long createTenant(TenantCreateReqVO createReqVO) { |
| 35 | 42 | // 插入 |
| 36 | - SysTenantDO tenant = TenantConvert.INSTANCE.convert(createReqVO); | |
| 43 | + TenantDO tenant = TenantConvert.INSTANCE.convert(createReqVO); | |
| 37 | 44 | tenantMapper.insert(tenant); |
| 38 | 45 | // 返回 |
| 39 | 46 | return tenant.getId(); |
| ... | ... | @@ -44,7 +51,7 @@ public class TenantServiceImpl implements TenantService { |
| 44 | 51 | // 校验存在 |
| 45 | 52 | this.validateTenantExists(updateReqVO.getId()); |
| 46 | 53 | // 更新 |
| 47 | - SysTenantDO updateObj = TenantConvert.INSTANCE.convert(updateReqVO); | |
| 54 | + TenantDO updateObj = TenantConvert.INSTANCE.convert(updateReqVO); | |
| 48 | 55 | tenantMapper.updateById(updateObj); |
| 49 | 56 | } |
| 50 | 57 | |
| ... | ... | @@ -63,27 +70,27 @@ public class TenantServiceImpl implements TenantService { |
| 63 | 70 | } |
| 64 | 71 | |
| 65 | 72 | @Override |
| 66 | - public SysTenantDO getTenant(Long id) { | |
| 73 | + public TenantDO getTenant(Long id) { | |
| 67 | 74 | return tenantMapper.selectById(id); |
| 68 | 75 | } |
| 69 | 76 | |
| 70 | 77 | @Override |
| 71 | - public List<SysTenantDO> getTenantList(Collection<Long> ids) { | |
| 78 | + public List<TenantDO> getTenantList(Collection<Long> ids) { | |
| 72 | 79 | return tenantMapper.selectBatchIds(ids); |
| 73 | 80 | } |
| 74 | 81 | |
| 75 | 82 | @Override |
| 76 | - public PageResult<SysTenantDO> getTenantPage(TenantPageReqVO pageReqVO) { | |
| 83 | + public PageResult<TenantDO> getTenantPage(TenantPageReqVO pageReqVO) { | |
| 77 | 84 | return tenantMapper.selectPage(pageReqVO); |
| 78 | 85 | } |
| 79 | 86 | |
| 80 | 87 | @Override |
| 81 | - public List<SysTenantDO> getTenantList(TenantExportReqVO exportReqVO) { | |
| 88 | + public List<TenantDO> getTenantList(TenantExportReqVO exportReqVO) { | |
| 82 | 89 | return tenantMapper.selectList(exportReqVO); |
| 83 | 90 | } |
| 84 | 91 | |
| 85 | 92 | @Override |
| 86 | - public SysTenantDO getTenantByName(String name) { | |
| 93 | + public TenantDO getTenantByName(String name) { | |
| 87 | 94 | return tenantMapper.selectByName(name); |
| 88 | 95 | } |
| 89 | 96 | ... | ... |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/tenant/impl/SysTenantCoreServiceImpl.java deleted
| 1 | -package cn.iocoder.yudao.module.system.service.tenant.impl; | |
| 2 | - | |
| 3 | -import cn.iocoder.yudao.module.system.dal.dataobject.tenant.SysTenantDO; | |
| 4 | -import cn.iocoder.yudao.module.system.dal.mysql.tenant.SysTenantCoreMapper; | |
| 5 | -import cn.iocoder.yudao.module.system.service.tenant.SysTenantCoreService; | |
| 6 | -import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; | |
| 7 | -import org.springframework.stereotype.Service; | |
| 8 | - | |
| 9 | -import javax.annotation.Resource; | |
| 10 | -import java.util.List; | |
| 11 | - | |
| 12 | -/** | |
| 13 | - * 租户 Service 实现类 | |
| 14 | - * | |
| 15 | - * @author 芋道源码 | |
| 16 | - */ | |
| 17 | -@Service | |
| 18 | -public class SysTenantCoreServiceImpl implements SysTenantCoreService { | |
| 19 | - | |
| 20 | - @Resource | |
| 21 | - private SysTenantCoreMapper tenantCoreMapper; | |
| 22 | - | |
| 23 | - @Override | |
| 24 | - public List<Long> getTenantIds() { | |
| 25 | - List<SysTenantDO> tenants = tenantCoreMapper.selectList(); | |
| 26 | - return CollectionUtils.convertList(tenants, SysTenantDO::getId); | |
| 27 | - } | |
| 28 | - | |
| 29 | -} |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImpl.java
| ... | ... | @@ -13,7 +13,7 @@ import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfi |
| 13 | 13 | import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfileUpdateReqVO; |
| 14 | 14 | import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.*; |
| 15 | 15 | import cn.iocoder.yudao.module.system.convert.user.UserConvert; |
| 16 | -import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysDeptDO; | |
| 16 | +import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO; | |
| 17 | 17 | import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; |
| 18 | 18 | import cn.iocoder.yudao.module.system.dal.mysql.user.AdminUserMapper; |
| 19 | 19 | import cn.iocoder.yudao.module.system.service.dept.DeptService; |
| ... | ... | @@ -241,7 +241,7 @@ public class AdminUserServiceImpl implements AdminUserService { |
| 241 | 241 | return Collections.emptySet(); |
| 242 | 242 | } |
| 243 | 243 | Set<Long> deptIds = CollectionUtils.convertSet(deptService.getDeptsByParentIdFromCache( |
| 244 | - deptId, true), SysDeptDO::getId); | |
| 244 | + deptId, true), DeptDO::getId); | |
| 245 | 245 | deptIds.add(deptId); // 包括自身 |
| 246 | 246 | return deptIds; |
| 247 | 247 | } | ... | ... |
yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/auth/UserSessionServiceImplTest.java
| ... | ... | @@ -5,12 +5,12 @@ import cn.iocoder.yudao.framework.security.config.SecurityProperties; |
| 5 | 5 | import cn.iocoder.yudao.framework.security.core.LoginUser; |
| 6 | 6 | import cn.iocoder.yudao.module.system.controller.admin.auth.vo.session.UserSessionPageReqVO; |
| 7 | 7 | import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; |
| 8 | -import cn.iocoder.yudao.module.system.dal.mysql.auth.SysUserSessionMapper; | |
| 8 | +import cn.iocoder.yudao.module.system.dal.mysql.auth.UserSessionMapper; | |
| 9 | 9 | import cn.iocoder.yudao.module.system.service.logger.LoginLogService; |
| 10 | 10 | import cn.iocoder.yudao.module.system.service.user.AdminUserService; |
| 11 | -import cn.iocoder.yudao.module.system.dal.dataobject.auth.SysUserSessionDO; | |
| 11 | +import cn.iocoder.yudao.module.system.dal.dataobject.auth.UserSessionDO; | |
| 12 | 12 | import cn.iocoder.yudao.module.system.dal.redis.auth.LoginUserRedisDAO; |
| 13 | -import cn.iocoder.yudao.module.system.enums.common.SysSexEnum; | |
| 13 | +import cn.iocoder.yudao.module.system.enums.common.SexEnum; | |
| 14 | 14 | import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; |
| 15 | 15 | import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; |
| 16 | 16 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| ... | ... | @@ -49,13 +49,13 @@ public class UserSessionServiceImplTest extends BaseDbAndRedisUnitTest { |
| 49 | 49 | private UserSessionServiceImpl userSessionService; |
| 50 | 50 | |
| 51 | 51 | @Resource |
| 52 | - private SysUserSessionMapper userSessionMapper; | |
| 52 | + private UserSessionMapper userSessionMapper; | |
| 53 | 53 | |
| 54 | 54 | @MockBean |
| 55 | 55 | private AdminUserService userService; |
| 56 | 56 | @MockBean |
| 57 | 57 | private LoginLogService loginLogService; |
| 58 | - @MockBean | |
| 58 | + @Resource | |
| 59 | 59 | private LoginUserRedisDAO loginUserRedisDAO; |
| 60 | 60 | |
| 61 | 61 | @MockBean |
| ... | ... | @@ -65,13 +65,13 @@ public class UserSessionServiceImplTest extends BaseDbAndRedisUnitTest { |
| 65 | 65 | public void testGetUserSessionPage_success() { |
| 66 | 66 | // mock 数据 |
| 67 | 67 | AdminUserDO dbUser = randomPojo(AdminUserDO.class, o -> { |
| 68 | - o.setSex(randomEle(SysSexEnum.values()).getSex()); | |
| 68 | + o.setSex(randomEle(SexEnum.values()).getSex()); | |
| 69 | 69 | o.setStatus(CommonStatusEnum.ENABLE.getStatus()); |
| 70 | 70 | }); |
| 71 | 71 | when(userService.getUsersByUsername(eq(dbUser.getUsername()))).thenReturn(singletonList(dbUser)); |
| 72 | 72 | // 插入可被查询到的数据 |
| 73 | 73 | String userIp = randomString(); |
| 74 | - SysUserSessionDO dbSession = randomPojo(SysUserSessionDO.class, o -> { | |
| 74 | + UserSessionDO dbSession = randomPojo(UserSessionDO.class, o -> { | |
| 75 | 75 | o.setUserId(dbUser.getId()); |
| 76 | 76 | o.setUserType(randomEle(UserTypeEnum.values()).getValue()); |
| 77 | 77 | o.setUserIp(userIp); |
| ... | ... | @@ -93,7 +93,7 @@ public class UserSessionServiceImplTest extends BaseDbAndRedisUnitTest { |
| 93 | 93 | reqVO.setUserIp(userIp); |
| 94 | 94 | |
| 95 | 95 | // 调用 |
| 96 | - PageResult<SysUserSessionDO> pageResult = userSessionService.getUserSessionPage(reqVO); | |
| 96 | + PageResult<UserSessionDO> pageResult = userSessionService.getUserSessionPage(reqVO); | |
| 97 | 97 | // 断言 |
| 98 | 98 | assertEquals(1, pageResult.getTotal()); |
| 99 | 99 | assertEquals(1, pageResult.getList().size()); |
| ... | ... | @@ -107,15 +107,15 @@ public class UserSessionServiceImplTest extends BaseDbAndRedisUnitTest { |
| 107 | 107 | int expectedTimeoutCount = 120, expectedTotal = 1; |
| 108 | 108 | |
| 109 | 109 | // 准备数据 |
| 110 | - List<SysUserSessionDO> prepareData = Stream | |
| 110 | + List<UserSessionDO> prepareData = Stream | |
| 111 | 111 | .iterate(0, i -> i) |
| 112 | 112 | .limit(expectedTimeoutCount) |
| 113 | - .map(i -> randomPojo(SysUserSessionDO.class, o -> { | |
| 113 | + .map(i -> randomPojo(UserSessionDO.class, o -> { | |
| 114 | 114 | o.setUserType(randomEle(UserTypeEnum.values()).getValue()); |
| 115 | 115 | o.setSessionTimeout(DateUtil.offsetSecond(new Date(), -1)); |
| 116 | 116 | })) |
| 117 | 117 | .collect(Collectors.toList()); |
| 118 | - SysUserSessionDO sessionDO = randomPojo(SysUserSessionDO.class, o -> { | |
| 118 | + UserSessionDO sessionDO = randomPojo(UserSessionDO.class, o -> { | |
| 119 | 119 | o.setUserType(randomEle(UserTypeEnum.values()).getValue()); |
| 120 | 120 | o.setSessionTimeout(DateUtil.offsetMinute(new Date(), 30)); |
| 121 | 121 | }); |
| ... | ... | @@ -126,7 +126,7 @@ public class UserSessionServiceImplTest extends BaseDbAndRedisUnitTest { |
| 126 | 126 | long actualTimeoutCount = userSessionService.clearSessionTimeout(); |
| 127 | 127 | // 校验 |
| 128 | 128 | assertEquals(expectedTimeoutCount, actualTimeoutCount); |
| 129 | - List<SysUserSessionDO> userSessionDOS = userSessionMapper.selectList(); | |
| 129 | + List<UserSessionDO> userSessionDOS = userSessionMapper.selectList(); | |
| 130 | 130 | assertEquals(expectedTotal, userSessionDOS.size()); |
| 131 | 131 | assertPojoEquals(sessionDO, userSessionDOS.get(0), "updateTime"); |
| 132 | 132 | } |
| ... | ... | @@ -145,8 +145,8 @@ public class UserSessionServiceImplTest extends BaseDbAndRedisUnitTest { |
| 145 | 145 | |
| 146 | 146 | // 调用 |
| 147 | 147 | String sessionId = userSessionService.createUserSession(loginUser, userIp, userAgent); |
| 148 | - // 校验 SysUserSessionDO 记录 | |
| 149 | - SysUserSessionDO userSessionDO = userSessionMapper.selectById(sessionId); | |
| 148 | + // 校验 UserSessionDO 记录 | |
| 149 | + UserSessionDO userSessionDO = userSessionMapper.selectById(sessionId); | |
| 150 | 150 | assertPojoEquals(loginUser, userSessionDO, "id", "updateTime"); |
| 151 | 151 | assertEquals(sessionId, userSessionDO.getId()); |
| 152 | 152 | assertEquals(userIp, userSessionDO.getUserIp()); |
| ... | ... | @@ -171,7 +171,7 @@ public class UserSessionServiceImplTest extends BaseDbAndRedisUnitTest { |
| 171 | 171 | // mock 数据 |
| 172 | 172 | loginUser.setUpdateTime(date); |
| 173 | 173 | loginUserRedisDAO.set(sessionId, loginUser); |
| 174 | - SysUserSessionDO userSession = SysUserSessionDO.builder().id(sessionId) | |
| 174 | + UserSessionDO userSession = UserSessionDO.builder().id(sessionId) | |
| 175 | 175 | .userId(loginUser.getId()).userType(loginUser.getUserType()) |
| 176 | 176 | .userIp(userIp).userAgent(userAgent).username(userName) |
| 177 | 177 | .sessionTimeout(addTime(Duration.ofMillis(timeLong))) |
| ... | ... | @@ -183,8 +183,8 @@ public class UserSessionServiceImplTest extends BaseDbAndRedisUnitTest { |
| 183 | 183 | // 校验 LoginUser 缓存 |
| 184 | 184 | LoginUser redisLoginUser = loginUserRedisDAO.get(sessionId); |
| 185 | 185 | assertNotEquals(redisLoginUser.getUpdateTime(), date); |
| 186 | - // 校验 SysUserSessionDO 记录 | |
| 187 | - SysUserSessionDO updateDO = userSessionMapper.selectById(sessionId); | |
| 186 | + // 校验 UserSessionDO 记录 | |
| 187 | + UserSessionDO updateDO = userSessionMapper.selectById(sessionId); | |
| 188 | 188 | assertEquals(updateDO.getUsername(), loginUser.getUsername()); |
| 189 | 189 | assertNotEquals(updateDO.getUpdateTime(), userSession.getUpdateTime()); |
| 190 | 190 | assertNotEquals(updateDO.getSessionTimeout(), addTime(Duration.ofMillis(timeLong))); |
| ... | ... | @@ -202,7 +202,7 @@ public class UserSessionServiceImplTest extends BaseDbAndRedisUnitTest { |
| 202 | 202 | when(securityProperties.getSessionTimeout()).thenReturn(Duration.ofDays(1)); |
| 203 | 203 | // mock 数据 |
| 204 | 204 | loginUserRedisDAO.set(sessionId, loginUser); |
| 205 | - SysUserSessionDO userSession = SysUserSessionDO.builder().id(sessionId) | |
| 205 | + UserSessionDO userSession = UserSessionDO.builder().id(sessionId) | |
| 206 | 206 | .userId(loginUser.getId()).userType(loginUser.getUserType()) |
| 207 | 207 | .userIp(userIp).userAgent(userAgent).username(loginUser.getUsername()) |
| 208 | 208 | .sessionTimeout(addTime(Duration.ofMillis(timeLong))) | ... | ... |
yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/dept/DeptServiceTest.java
| ... | ... | @@ -4,8 +4,8 @@ import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; |
| 4 | 4 | import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptCreateReqVO; |
| 5 | 5 | import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptListReqVO; |
| 6 | 6 | import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptUpdateReqVO; |
| 7 | -import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysDeptDO; | |
| 8 | -import cn.iocoder.yudao.module.system.dal.mysql.dept.SysDeptMapper; | |
| 7 | +import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO; | |
| 8 | +import cn.iocoder.yudao.module.system.dal.mysql.dept.DeptMapper; | |
| 9 | 9 | import cn.iocoder.yudao.module.system.enums.dept.DeptIdEnum; |
| 10 | 10 | import cn.iocoder.yudao.module.system.mq.producer.dept.DeptProducer; |
| 11 | 11 | import cn.iocoder.yudao.framework.common.util.collection.ArrayUtils; |
| ... | ... | @@ -43,7 +43,7 @@ public class DeptServiceTest extends BaseDbUnitTest { |
| 43 | 43 | @Resource |
| 44 | 44 | private DeptServiceImpl deptService; |
| 45 | 45 | @Resource |
| 46 | - private SysDeptMapper deptMapper; | |
| 46 | + private DeptMapper deptMapper; | |
| 47 | 47 | @MockBean |
| 48 | 48 | private DeptProducer deptProducer; |
| 49 | 49 | |
| ... | ... | @@ -51,20 +51,20 @@ public class DeptServiceTest extends BaseDbUnitTest { |
| 51 | 51 | @SuppressWarnings("unchecked") |
| 52 | 52 | void testInitLocalCache() { |
| 53 | 53 | // mock 数据 |
| 54 | - SysDeptDO deptDO1 = randomDeptDO(); | |
| 54 | + DeptDO deptDO1 = randomDeptDO(); | |
| 55 | 55 | deptMapper.insert(deptDO1); |
| 56 | - SysDeptDO deptDO2 = randomDeptDO(); | |
| 56 | + DeptDO deptDO2 = randomDeptDO(); | |
| 57 | 57 | deptMapper.insert(deptDO2); |
| 58 | 58 | |
| 59 | 59 | // 调用 |
| 60 | 60 | deptService.initLocalCache(); |
| 61 | 61 | // 断言 deptCache 缓存 |
| 62 | - Map<Long, SysDeptDO> deptCache = (Map<Long, SysDeptDO>) getFieldValue(deptService, "deptCache"); | |
| 62 | + Map<Long, DeptDO> deptCache = (Map<Long, DeptDO>) getFieldValue(deptService, "deptCache"); | |
| 63 | 63 | assertEquals(2, deptCache.size()); |
| 64 | 64 | assertPojoEquals(deptDO1, deptCache.get(deptDO1.getId())); |
| 65 | 65 | assertPojoEquals(deptDO2, deptCache.get(deptDO2.getId())); |
| 66 | 66 | // 断言 parentDeptCache 缓存 |
| 67 | - Multimap<Long, SysDeptDO> parentDeptCache = (Multimap<Long, SysDeptDO>) getFieldValue(deptService, "parentDeptCache"); | |
| 67 | + Multimap<Long, DeptDO> parentDeptCache = (Multimap<Long, DeptDO>) getFieldValue(deptService, "parentDeptCache"); | |
| 68 | 68 | assertEquals(2, parentDeptCache.size()); |
| 69 | 69 | assertPojoEquals(deptDO1, parentDeptCache.get(deptDO1.getParentId())); |
| 70 | 70 | assertPojoEquals(deptDO2, parentDeptCache.get(deptDO2.getParentId())); |
| ... | ... | @@ -76,7 +76,7 @@ public class DeptServiceTest extends BaseDbUnitTest { |
| 76 | 76 | @Test |
| 77 | 77 | void testListDepts() { |
| 78 | 78 | // mock 数据 |
| 79 | - SysDeptDO dept = randomPojo(SysDeptDO.class, o -> { // 等会查询到 | |
| 79 | + DeptDO dept = randomPojo(DeptDO.class, o -> { // 等会查询到 | |
| 80 | 80 | o.setName("开发部"); |
| 81 | 81 | o.setStatus(CommonStatusEnum.ENABLE.getStatus()); |
| 82 | 82 | }); |
| ... | ... | @@ -90,7 +90,7 @@ public class DeptServiceTest extends BaseDbUnitTest { |
| 90 | 90 | reqVO.setName("开"); |
| 91 | 91 | reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); |
| 92 | 92 | // 调用 |
| 93 | - List<SysDeptDO> sysDeptDOS = deptService.getSimpleDepts(reqVO); | |
| 93 | + List<DeptDO> sysDeptDOS = deptService.getSimpleDepts(reqVO); | |
| 94 | 94 | // 断言 |
| 95 | 95 | assertEquals(1, sysDeptDOS.size()); |
| 96 | 96 | assertPojoEquals(dept, sysDeptDOS.get(0)); |
| ... | ... | @@ -109,7 +109,7 @@ public class DeptServiceTest extends BaseDbUnitTest { |
| 109 | 109 | // 断言 |
| 110 | 110 | assertNotNull(deptId); |
| 111 | 111 | // 校验记录的属性是否正确 |
| 112 | - SysDeptDO deptDO = deptMapper.selectById(deptId); | |
| 112 | + DeptDO deptDO = deptMapper.selectById(deptId); | |
| 113 | 113 | assertPojoEquals(reqVO, deptDO); |
| 114 | 114 | // 校验调用 |
| 115 | 115 | verify(deptProducer, times(1)).sendDeptRefreshMessage(); |
| ... | ... | @@ -118,7 +118,7 @@ public class DeptServiceTest extends BaseDbUnitTest { |
| 118 | 118 | @Test |
| 119 | 119 | void testUpdateDept_success() { |
| 120 | 120 | // mock 数据 |
| 121 | - SysDeptDO dbDeptDO = randomPojo(SysDeptDO.class, o -> o.setStatus(randomCommonStatus())); | |
| 121 | + DeptDO dbDeptDO = randomPojo(DeptDO.class, o -> o.setStatus(randomCommonStatus())); | |
| 122 | 122 | deptMapper.insert(dbDeptDO);// @Sql: 先插入出一条存在的数据 |
| 123 | 123 | // 准备参数 |
| 124 | 124 | DeptUpdateReqVO reqVO = randomPojo(DeptUpdateReqVO.class, o -> { |
| ... | ... | @@ -130,14 +130,14 @@ public class DeptServiceTest extends BaseDbUnitTest { |
| 130 | 130 | // 调用 |
| 131 | 131 | deptService.updateDept(reqVO); |
| 132 | 132 | // 校验是否更新正确 |
| 133 | - SysDeptDO deptDO = deptMapper.selectById(reqVO.getId()); // 获取最新的 | |
| 133 | + DeptDO deptDO = deptMapper.selectById(reqVO.getId()); // 获取最新的 | |
| 134 | 134 | assertPojoEquals(reqVO, deptDO); |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | @Test |
| 138 | 138 | void testDeleteDept_success() { |
| 139 | 139 | // mock 数据 |
| 140 | - SysDeptDO dbDeptDO = randomPojo(SysDeptDO.class, o -> o.setStatus(randomCommonStatus())); | |
| 140 | + DeptDO dbDeptDO = randomPojo(DeptDO.class, o -> o.setStatus(randomCommonStatus())); | |
| 141 | 141 | deptMapper.insert(dbDeptDO);// @Sql: 先插入出一条存在的数据 |
| 142 | 142 | // 准备参数 |
| 143 | 143 | Long id = dbDeptDO.getId(); |
| ... | ... | @@ -150,12 +150,12 @@ public class DeptServiceTest extends BaseDbUnitTest { |
| 150 | 150 | @Test |
| 151 | 151 | void testCheckDept_nameDuplicateForUpdate() { |
| 152 | 152 | // mock 数据 |
| 153 | - SysDeptDO deptDO = randomDeptDO(); | |
| 153 | + DeptDO deptDO = randomDeptDO(); | |
| 154 | 154 | // 设置根节点部门 |
| 155 | 155 | deptDO.setParentId(DeptIdEnum.ROOT.getId()); |
| 156 | 156 | deptMapper.insert(deptDO); |
| 157 | 157 | // mock 数据 稍后模拟重复它的 name |
| 158 | - SysDeptDO nameDeptDO = randomDeptDO(); | |
| 158 | + DeptDO nameDeptDO = randomDeptDO(); | |
| 159 | 159 | // 设置根节点部门 |
| 160 | 160 | nameDeptDO.setParentId(DeptIdEnum.ROOT.getId()); |
| 161 | 161 | deptMapper.insert(nameDeptDO); |
| ... | ... | @@ -192,10 +192,10 @@ public class DeptServiceTest extends BaseDbUnitTest { |
| 192 | 192 | @Test |
| 193 | 193 | void testCheckDept_exitsChildrenForDelete() { |
| 194 | 194 | // mock 数据 |
| 195 | - SysDeptDO parentDept = randomPojo(SysDeptDO.class, o -> o.setStatus(randomCommonStatus())); | |
| 195 | + DeptDO parentDept = randomPojo(DeptDO.class, o -> o.setStatus(randomCommonStatus())); | |
| 196 | 196 | deptMapper.insert(parentDept);// @Sql: 先插入出一条存在的数据 |
| 197 | 197 | // 准备参数 |
| 198 | - SysDeptDO childrenDeptDO = randomPojo(SysDeptDO.class, o -> { | |
| 198 | + DeptDO childrenDeptDO = randomPojo(DeptDO.class, o -> { | |
| 199 | 199 | o.setParentId(parentDept.getId()); |
| 200 | 200 | o.setStatus(randomCommonStatus()); |
| 201 | 201 | }); |
| ... | ... | @@ -208,7 +208,7 @@ public class DeptServiceTest extends BaseDbUnitTest { |
| 208 | 208 | @Test |
| 209 | 209 | void testCheckDept_parentErrorForUpdate() { |
| 210 | 210 | // mock 数据 |
| 211 | - SysDeptDO dbDeptDO = randomPojo(SysDeptDO.class, o -> o.setStatus(randomCommonStatus())); | |
| 211 | + DeptDO dbDeptDO = randomPojo(DeptDO.class, o -> o.setStatus(randomCommonStatus())); | |
| 212 | 212 | deptMapper.insert(dbDeptDO); |
| 213 | 213 | // 准备参数 |
| 214 | 214 | DeptUpdateReqVO reqVO = randomPojo(DeptUpdateReqVO.class, |
| ... | ... | @@ -225,7 +225,7 @@ public class DeptServiceTest extends BaseDbUnitTest { |
| 225 | 225 | @Test |
| 226 | 226 | void testCheckDept_notEnableForCreate() { |
| 227 | 227 | // mock 数据 |
| 228 | - SysDeptDO deptDO = randomPojo(SysDeptDO.class, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus())); | |
| 228 | + DeptDO deptDO = randomPojo(DeptDO.class, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus())); | |
| 229 | 229 | deptMapper.insert(deptDO); |
| 230 | 230 | // 准备参数 |
| 231 | 231 | DeptCreateReqVO reqVO = randomPojo(DeptCreateReqVO.class, |
| ... | ... | @@ -240,9 +240,9 @@ public class DeptServiceTest extends BaseDbUnitTest { |
| 240 | 240 | @Test |
| 241 | 241 | void testCheckDept_parentIsChildForUpdate() { |
| 242 | 242 | // mock 数据 |
| 243 | - SysDeptDO parentDept = randomPojo(SysDeptDO.class, o -> o.setStatus(CommonStatusEnum.ENABLE.getStatus())); | |
| 243 | + DeptDO parentDept = randomPojo(DeptDO.class, o -> o.setStatus(CommonStatusEnum.ENABLE.getStatus())); | |
| 244 | 244 | deptMapper.insert(parentDept); |
| 245 | - SysDeptDO childDept = randomPojo(SysDeptDO.class, o -> { | |
| 245 | + DeptDO childDept = randomPojo(DeptDO.class, o -> { | |
| 246 | 246 | o.setStatus(CommonStatusEnum.ENABLE.getStatus()); |
| 247 | 247 | o.setParentId(parentDept.getId()); |
| 248 | 248 | }); |
| ... | ... | @@ -262,11 +262,11 @@ public class DeptServiceTest extends BaseDbUnitTest { |
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | @SafeVarargs |
| 265 | - private static SysDeptDO randomDeptDO(Consumer<SysDeptDO>... consumers) { | |
| 266 | - Consumer<SysDeptDO> consumer = (o) -> { | |
| 265 | + private static DeptDO randomDeptDO(Consumer<DeptDO>... consumers) { | |
| 266 | + Consumer<DeptDO> consumer = (o) -> { | |
| 267 | 267 | o.setStatus(randomEle(CommonStatusEnum.values()).getStatus()); // 保证 status 的范围 |
| 268 | 268 | }; |
| 269 | - return randomPojo(SysDeptDO.class, ArrayUtils.append(consumer, consumers)); | |
| 269 | + return randomPojo(DeptDO.class, ArrayUtils.append(consumer, consumers)); | |
| 270 | 270 | } |
| 271 | 271 | |
| 272 | 272 | } | ... | ... |
yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/dept/PostServiceTest.java
| 1 | 1 | package cn.iocoder.yudao.module.system.service.dept; |
| 2 | 2 | |
| 3 | -import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysPostDO; | |
| 3 | +import cn.iocoder.yudao.module.system.dal.dataobject.dept.PostDO; | |
| 4 | 4 | import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; |
| 5 | 5 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 6 | 6 | import cn.iocoder.yudao.framework.common.util.collection.ArrayUtils; |
| ... | ... | @@ -9,7 +9,7 @@ import cn.iocoder.yudao.module.system.controller.admin.dept.vo.post.PostCreateRe |
| 9 | 9 | import cn.iocoder.yudao.module.system.controller.admin.dept.vo.post.PostExportReqVO; |
| 10 | 10 | import cn.iocoder.yudao.module.system.controller.admin.dept.vo.post.PostPageReqVO; |
| 11 | 11 | import cn.iocoder.yudao.module.system.controller.admin.dept.vo.post.PostUpdateReqVO; |
| 12 | -import cn.iocoder.yudao.module.system.dal.mysql.dept.SysPostMapper; | |
| 12 | +import cn.iocoder.yudao.module.system.dal.mysql.dept.PostMapper; | |
| 13 | 13 | import cn.iocoder.yudao.module.system.test.BaseDbUnitTest; |
| 14 | 14 | import org.junit.jupiter.api.Test; |
| 15 | 15 | import org.springframework.context.annotation.Import; |
| ... | ... | @@ -32,12 +32,12 @@ public class PostServiceTest extends BaseDbUnitTest { |
| 32 | 32 | @Resource |
| 33 | 33 | private PostServiceImpl postService; |
| 34 | 34 | @Resource |
| 35 | - private SysPostMapper postMapper; | |
| 35 | + private PostMapper postMapper; | |
| 36 | 36 | |
| 37 | 37 | @Test |
| 38 | 38 | void testPagePosts() { |
| 39 | 39 | // mock 数据 |
| 40 | - SysPostDO postDO = randomPojo(SysPostDO.class, o -> { | |
| 40 | + PostDO postDO = randomPojo(PostDO.class, o -> { | |
| 41 | 41 | o.setName("码仔"); |
| 42 | 42 | o.setStatus(CommonStatusEnum.ENABLE.getStatus()); |
| 43 | 43 | }); |
| ... | ... | @@ -53,7 +53,7 @@ public class PostServiceTest extends BaseDbUnitTest { |
| 53 | 53 | reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); |
| 54 | 54 | |
| 55 | 55 | // 调用 |
| 56 | - PageResult<SysPostDO> pageResult = postService.getPostPage(reqVO); | |
| 56 | + PageResult<PostDO> pageResult = postService.getPostPage(reqVO); | |
| 57 | 57 | |
| 58 | 58 | // 断言 |
| 59 | 59 | assertEquals(1, pageResult.getTotal()); |
| ... | ... | @@ -64,7 +64,7 @@ public class PostServiceTest extends BaseDbUnitTest { |
| 64 | 64 | @Test |
| 65 | 65 | void testListPosts() { |
| 66 | 66 | // mock 数据 |
| 67 | - SysPostDO postDO = randomPojo(SysPostDO.class, o -> { | |
| 67 | + PostDO postDO = randomPojo(PostDO.class, o -> { | |
| 68 | 68 | o.setName("码仔"); |
| 69 | 69 | o.setStatus(CommonStatusEnum.ENABLE.getStatus()); |
| 70 | 70 | }); |
| ... | ... | @@ -79,7 +79,7 @@ public class PostServiceTest extends BaseDbUnitTest { |
| 79 | 79 | reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); |
| 80 | 80 | |
| 81 | 81 | // 调用 |
| 82 | - List<SysPostDO> list = postService.getPosts(reqVO); | |
| 82 | + List<PostDO> list = postService.getPosts(reqVO); | |
| 83 | 83 | // 断言 |
| 84 | 84 | assertEquals(1, list.size()); |
| 85 | 85 | assertPojoEquals(postDO, list.get(0)); |
| ... | ... | @@ -88,12 +88,12 @@ public class PostServiceTest extends BaseDbUnitTest { |
| 88 | 88 | @Test |
| 89 | 89 | void testGetPost() { |
| 90 | 90 | // mock 数据 |
| 91 | - SysPostDO dbPostDO = randomPostDO(); | |
| 91 | + PostDO dbPostDO = randomPostDO(); | |
| 92 | 92 | postMapper.insert(dbPostDO); |
| 93 | 93 | // 准备参数 |
| 94 | 94 | Long id = dbPostDO.getId(); |
| 95 | 95 | // 调用 |
| 96 | - SysPostDO post = postService.getPost(id); | |
| 96 | + PostDO post = postService.getPost(id); | |
| 97 | 97 | // 断言 |
| 98 | 98 | assertNotNull(post); |
| 99 | 99 | assertPojoEquals(dbPostDO, post); |
| ... | ... | @@ -109,14 +109,14 @@ public class PostServiceTest extends BaseDbUnitTest { |
| 109 | 109 | // 断言 |
| 110 | 110 | assertNotNull(postId); |
| 111 | 111 | // 校验记录的属性是否正确 |
| 112 | - SysPostDO post = postMapper.selectById(postId); | |
| 112 | + PostDO post = postMapper.selectById(postId); | |
| 113 | 113 | assertPojoEquals(reqVO, post); |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | @Test |
| 117 | 117 | void testUpdatePost_success() { |
| 118 | 118 | // mock 数据 |
| 119 | - SysPostDO postDO = randomPostDO(); | |
| 119 | + PostDO postDO = randomPostDO(); | |
| 120 | 120 | postMapper.insert(postDO);// @Sql: 先插入出一条存在的数据 |
| 121 | 121 | // 准备参数 |
| 122 | 122 | PostUpdateReqVO reqVO = randomPojo(PostUpdateReqVO.class, |
| ... | ... | @@ -128,14 +128,14 @@ public class PostServiceTest extends BaseDbUnitTest { |
| 128 | 128 | // 调用 |
| 129 | 129 | postService.updatePost(reqVO); |
| 130 | 130 | // 校验是否更新正确 |
| 131 | - SysPostDO post = postMapper.selectById(reqVO.getId());// 获取最新的 | |
| 131 | + PostDO post = postMapper.selectById(reqVO.getId());// 获取最新的 | |
| 132 | 132 | assertPojoEquals(reqVO, post); |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | @Test |
| 136 | 136 | void testDeletePost_success() { |
| 137 | 137 | // mock 数据 |
| 138 | - SysPostDO postDO = randomPostDO(); | |
| 138 | + PostDO postDO = randomPostDO(); | |
| 139 | 139 | postMapper.insert(postDO); |
| 140 | 140 | // 准备参数 |
| 141 | 141 | Long id = postDO.getId(); |
| ... | ... | @@ -155,7 +155,7 @@ public class PostServiceTest extends BaseDbUnitTest { |
| 155 | 155 | @Test |
| 156 | 156 | void testCheckPost_nameDuplicateForCreate() { |
| 157 | 157 | // mock 数据 |
| 158 | - SysPostDO postDO = randomPostDO(); | |
| 158 | + PostDO postDO = randomPostDO(); | |
| 159 | 159 | postMapper.insert(postDO);// @Sql: 先插入出一条存在的数据 |
| 160 | 160 | // 准备参数 |
| 161 | 161 | PostCreateReqVO reqVO = randomPojo(PostCreateReqVO.class, |
| ... | ... | @@ -167,10 +167,10 @@ public class PostServiceTest extends BaseDbUnitTest { |
| 167 | 167 | @Test |
| 168 | 168 | void testCheckPost_codeDuplicateForUpdate() { |
| 169 | 169 | // mock 数据 |
| 170 | - SysPostDO postDO = randomPostDO(); | |
| 170 | + PostDO postDO = randomPostDO(); | |
| 171 | 171 | postMapper.insert(postDO); |
| 172 | 172 | // mock 数据 稍后模拟重复它的 code |
| 173 | - SysPostDO codePostDO = randomPostDO(); | |
| 173 | + PostDO codePostDO = randomPostDO(); | |
| 174 | 174 | postMapper.insert(codePostDO); |
| 175 | 175 | // 准备参数 |
| 176 | 176 | PostUpdateReqVO reqVO = randomPojo(PostUpdateReqVO.class, |
| ... | ... | @@ -185,10 +185,10 @@ public class PostServiceTest extends BaseDbUnitTest { |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | @SafeVarargs |
| 188 | - private static SysPostDO randomPostDO(Consumer<SysPostDO>... consumers) { | |
| 189 | - Consumer<SysPostDO> consumer = (o) -> { | |
| 188 | + private static PostDO randomPostDO(Consumer<PostDO>... consumers) { | |
| 189 | + Consumer<PostDO> consumer = (o) -> { | |
| 190 | 190 | o.setStatus(randomEle(CommonStatusEnum.values()).getStatus()); // 保证 status 的范围 |
| 191 | 191 | }; |
| 192 | - return randomPojo(SysPostDO.class, ArrayUtils.append(consumer, consumers)); | |
| 192 | + return randomPojo(PostDO.class, ArrayUtils.append(consumer, consumers)); | |
| 193 | 193 | } |
| 194 | 194 | } | ... | ... |
yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/dict/DictDataServiceTest.java
| 1 | 1 | package cn.iocoder.yudao.module.system.service.dict; |
| 2 | 2 | |
| 3 | -import cn.iocoder.yudao.module.system.dal.dataobject.dict.SysDictDataDO; | |
| 3 | +import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictDataDO; | |
| 4 | 4 | import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; |
| 5 | 5 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 6 | 6 | import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataCreateReqVO; |
| ... | ... | @@ -8,7 +8,7 @@ import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataExpo |
| 8 | 8 | import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataPageReqVO; |
| 9 | 9 | import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataUpdateReqVO; |
| 10 | 10 | import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictTypeDO; |
| 11 | -import cn.iocoder.yudao.module.system.dal.mysql.dict.SysDictDataMapper; | |
| 11 | +import cn.iocoder.yudao.module.system.dal.mysql.dict.DictDataMapper; | |
| 12 | 12 | import cn.iocoder.yudao.module.system.mq.producer.dict.DictDataProducer; |
| 13 | 13 | import cn.iocoder.yudao.framework.common.util.collection.ArrayUtils; |
| 14 | 14 | import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; |
| ... | ... | @@ -39,7 +39,7 @@ public class DictDataServiceTest extends BaseDbUnitTest { |
| 39 | 39 | private DictDataServiceImpl dictDataService; |
| 40 | 40 | |
| 41 | 41 | @Resource |
| 42 | - private SysDictDataMapper dictDataMapper; | |
| 42 | + private DictDataMapper dictDataMapper; | |
| 43 | 43 | @MockBean |
| 44 | 44 | private DictTypeService dictTypeService; |
| 45 | 45 | @MockBean |
| ... | ... | @@ -52,22 +52,22 @@ public class DictDataServiceTest extends BaseDbUnitTest { |
| 52 | 52 | @SuppressWarnings("unchecked") |
| 53 | 53 | public void testInitLocalCache() { |
| 54 | 54 | // mock 数据 |
| 55 | - SysDictDataDO dictData01 = randomDictDataDO(); | |
| 55 | + DictDataDO dictData01 = randomDictDataDO(); | |
| 56 | 56 | dictDataMapper.insert(dictData01); |
| 57 | - SysDictDataDO dictData02 = randomDictDataDO(); | |
| 57 | + DictDataDO dictData02 = randomDictDataDO(); | |
| 58 | 58 | dictDataMapper.insert(dictData02); |
| 59 | 59 | |
| 60 | 60 | // 调用 |
| 61 | 61 | dictDataService.initLocalCache(); |
| 62 | 62 | // 断言 labelDictDataCache 缓存 |
| 63 | - ImmutableTable<String, String, SysDictDataDO> labelDictDataCache = | |
| 64 | - (ImmutableTable<String, String, SysDictDataDO>) getFieldValue(dictDataService, "labelDictDataCache"); | |
| 63 | + ImmutableTable<String, String, DictDataDO> labelDictDataCache = | |
| 64 | + (ImmutableTable<String, String, DictDataDO>) getFieldValue(dictDataService, "labelDictDataCache"); | |
| 65 | 65 | assertEquals(2, labelDictDataCache.size()); |
| 66 | 66 | assertPojoEquals(dictData01, labelDictDataCache.get(dictData01.getDictType(), dictData01.getLabel())); |
| 67 | 67 | assertPojoEquals(dictData02, labelDictDataCache.get(dictData02.getDictType(), dictData02.getLabel())); |
| 68 | 68 | // 断言 valueDictDataCache 缓存 |
| 69 | - ImmutableTable<String, String, SysDictDataDO> valueDictDataCache = | |
| 70 | - (ImmutableTable<String, String, SysDictDataDO>) getFieldValue(dictDataService, "valueDictDataCache"); | |
| 69 | + ImmutableTable<String, String, DictDataDO> valueDictDataCache = | |
| 70 | + (ImmutableTable<String, String, DictDataDO>) getFieldValue(dictDataService, "valueDictDataCache"); | |
| 71 | 71 | assertEquals(2, valueDictDataCache.size()); |
| 72 | 72 | assertPojoEquals(dictData01, valueDictDataCache.get(dictData01.getDictType(), dictData01.getValue())); |
| 73 | 73 | assertPojoEquals(dictData02, valueDictDataCache.get(dictData02.getDictType(), dictData02.getValue())); |
| ... | ... | @@ -79,7 +79,7 @@ public class DictDataServiceTest extends BaseDbUnitTest { |
| 79 | 79 | @Test |
| 80 | 80 | public void testGetDictDataPage() { |
| 81 | 81 | // mock 数据 |
| 82 | - SysDictDataDO dbDictData = randomPojo(SysDictDataDO.class, o -> { // 等会查询到 | |
| 82 | + DictDataDO dbDictData = randomPojo(DictDataDO.class, o -> { // 等会查询到 | |
| 83 | 83 | o.setLabel("芋艿"); |
| 84 | 84 | o.setDictType("yunai"); |
| 85 | 85 | o.setStatus(CommonStatusEnum.ENABLE.getStatus()); |
| ... | ... | @@ -98,7 +98,7 @@ public class DictDataServiceTest extends BaseDbUnitTest { |
| 98 | 98 | reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); |
| 99 | 99 | |
| 100 | 100 | // 调用 |
| 101 | - PageResult<SysDictDataDO> pageResult = dictDataService.getDictDataPage(reqVO); | |
| 101 | + PageResult<DictDataDO> pageResult = dictDataService.getDictDataPage(reqVO); | |
| 102 | 102 | // 断言 |
| 103 | 103 | assertEquals(1, pageResult.getTotal()); |
| 104 | 104 | assertEquals(1, pageResult.getList().size()); |
| ... | ... | @@ -108,7 +108,7 @@ public class DictDataServiceTest extends BaseDbUnitTest { |
| 108 | 108 | @Test |
| 109 | 109 | public void testGetDictDataList() { |
| 110 | 110 | // mock 数据 |
| 111 | - SysDictDataDO dbDictData = randomPojo(SysDictDataDO.class, o -> { // 等会查询到 | |
| 111 | + DictDataDO dbDictData = randomPojo(DictDataDO.class, o -> { // 等会查询到 | |
| 112 | 112 | o.setLabel("芋艿"); |
| 113 | 113 | o.setDictType("yunai"); |
| 114 | 114 | o.setStatus(CommonStatusEnum.ENABLE.getStatus()); |
| ... | ... | @@ -127,7 +127,7 @@ public class DictDataServiceTest extends BaseDbUnitTest { |
| 127 | 127 | reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); |
| 128 | 128 | |
| 129 | 129 | // 调用 |
| 130 | - List<SysDictDataDO> list = dictDataService.getDictDatas(reqVO); | |
| 130 | + List<DictDataDO> list = dictDataService.getDictDatas(reqVO); | |
| 131 | 131 | // 断言 |
| 132 | 132 | assertEquals(1, list.size()); |
| 133 | 133 | assertPojoEquals(dbDictData, list.get(0)); |
| ... | ... | @@ -146,7 +146,7 @@ public class DictDataServiceTest extends BaseDbUnitTest { |
| 146 | 146 | // 断言 |
| 147 | 147 | assertNotNull(dictDataId); |
| 148 | 148 | // 校验记录的属性是否正确 |
| 149 | - SysDictDataDO dictData = dictDataMapper.selectById(dictDataId); | |
| 149 | + DictDataDO dictData = dictDataMapper.selectById(dictDataId); | |
| 150 | 150 | assertPojoEquals(reqVO, dictData); |
| 151 | 151 | // 校验调用 |
| 152 | 152 | verify(dictDataProducer, times(1)).sendDictDataRefreshMessage(); |
| ... | ... | @@ -155,7 +155,7 @@ public class DictDataServiceTest extends BaseDbUnitTest { |
| 155 | 155 | @Test |
| 156 | 156 | public void testUpdateDictData_success() { |
| 157 | 157 | // mock 数据 |
| 158 | - SysDictDataDO dbDictData = randomDictDataDO(); | |
| 158 | + DictDataDO dbDictData = randomDictDataDO(); | |
| 159 | 159 | dictDataMapper.insert(dbDictData);// @Sql: 先插入出一条存在的数据 |
| 160 | 160 | // 准备参数 |
| 161 | 161 | DictDataUpdateReqVO reqVO = randomPojo(DictDataUpdateReqVO.class, o -> { |
| ... | ... | @@ -168,7 +168,7 @@ public class DictDataServiceTest extends BaseDbUnitTest { |
| 168 | 168 | // 调用 |
| 169 | 169 | dictDataService.updateDictData(reqVO); |
| 170 | 170 | // 校验是否更新正确 |
| 171 | - SysDictDataDO dictData = dictDataMapper.selectById(reqVO.getId()); // 获取最新的 | |
| 171 | + DictDataDO dictData = dictDataMapper.selectById(reqVO.getId()); // 获取最新的 | |
| 172 | 172 | assertPojoEquals(reqVO, dictData); |
| 173 | 173 | // 校验调用 |
| 174 | 174 | verify(dictDataProducer, times(1)).sendDictDataRefreshMessage(); |
| ... | ... | @@ -177,7 +177,7 @@ public class DictDataServiceTest extends BaseDbUnitTest { |
| 177 | 177 | @Test |
| 178 | 178 | public void testDeleteDictData_success() { |
| 179 | 179 | // mock 数据 |
| 180 | - SysDictDataDO dbDictData = randomDictDataDO(); | |
| 180 | + DictDataDO dbDictData = randomDictDataDO(); | |
| 181 | 181 | dictDataMapper.insert(dbDictData);// @Sql: 先插入出一条存在的数据 |
| 182 | 182 | // 准备参数 |
| 183 | 183 | Long id = dbDictData.getId(); |
| ... | ... | @@ -193,7 +193,7 @@ public class DictDataServiceTest extends BaseDbUnitTest { |
| 193 | 193 | @Test |
| 194 | 194 | public void testCheckDictDataExists_success() { |
| 195 | 195 | // mock 数据 |
| 196 | - SysDictDataDO dbDictData = randomDictDataDO(); | |
| 196 | + DictDataDO dbDictData = randomDictDataDO(); | |
| 197 | 197 | dictDataMapper.insert(dbDictData);// @Sql: 先插入出一条存在的数据 |
| 198 | 198 | |
| 199 | 199 | // 调用成功 |
| ... | ... | @@ -273,18 +273,18 @@ public class DictDataServiceTest extends BaseDbUnitTest { |
| 273 | 273 | // ========== 随机对象 ========== |
| 274 | 274 | |
| 275 | 275 | @SafeVarargs |
| 276 | - private static SysDictDataDO randomDictDataDO(Consumer<SysDictDataDO>... consumers) { | |
| 277 | - Consumer<SysDictDataDO> consumer = (o) -> { | |
| 276 | + private static DictDataDO randomDictDataDO(Consumer<DictDataDO>... consumers) { | |
| 277 | + Consumer<DictDataDO> consumer = (o) -> { | |
| 278 | 278 | o.setStatus(randomCommonStatus()); // 保证 status 的范围 |
| 279 | 279 | }; |
| 280 | - return randomPojo(SysDictDataDO.class, ArrayUtils.append(consumer, consumers)); | |
| 280 | + return randomPojo(DictDataDO.class, ArrayUtils.append(consumer, consumers)); | |
| 281 | 281 | } |
| 282 | 282 | |
| 283 | 283 | /** |
| 284 | 284 | * 生成一个有效的字典类型 |
| 285 | 285 | * |
| 286 | 286 | * @param type 字典类型 |
| 287 | - * @return SysDictTypeDO 对象 | |
| 287 | + * @return DictTypeDO 对象 | |
| 288 | 288 | */ |
| 289 | 289 | private static DictTypeDO randomDictTypeDO(String type) { |
| 290 | 290 | return randomPojo(DictTypeDO.class, o -> { | ... | ... |
yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/dict/DictTypeServiceTest.java
| ... | ... | @@ -7,7 +7,7 @@ import cn.iocoder.yudao.module.system.controller.admin.dict.vo.type.DictTypeUpda |
| 7 | 7 | import cn.iocoder.yudao.module.system.controller.admin.dict.vo.type.DictTypeExportReqVO; |
| 8 | 8 | import cn.iocoder.yudao.module.system.controller.admin.dict.vo.type.DictTypePageReqVO; |
| 9 | 9 | import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictTypeDO; |
| 10 | -import cn.iocoder.yudao.module.system.dal.mysql.dict.SysDictTypeMapper; | |
| 10 | +import cn.iocoder.yudao.module.system.dal.mysql.dict.DictTypeMapper; | |
| 11 | 11 | import cn.iocoder.yudao.framework.common.util.collection.ArrayUtils; |
| 12 | 12 | import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; |
| 13 | 13 | import cn.iocoder.yudao.module.system.test.BaseDbUnitTest; |
| ... | ... | @@ -36,7 +36,7 @@ public class DictTypeServiceTest extends BaseDbUnitTest { |
| 36 | 36 | private DictTypeServiceImpl dictTypeService; |
| 37 | 37 | |
| 38 | 38 | @Resource |
| 39 | - private SysDictTypeMapper dictTypeMapper; | |
| 39 | + private DictTypeMapper dictTypeMapper; | |
| 40 | 40 | @MockBean |
| 41 | 41 | private DictDataService dictDataService; |
| 42 | 42 | ... | ... |
yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/errorcode/ErrorCodeServiceTest.java
| ... | ... | @@ -7,7 +7,7 @@ import cn.iocoder.yudao.module.system.controller.admin.errorcode.vo.ErrorCodeCre |
| 7 | 7 | import cn.iocoder.yudao.module.system.controller.admin.errorcode.vo.ErrorCodeExportReqVO; |
| 8 | 8 | import cn.iocoder.yudao.module.system.controller.admin.errorcode.vo.ErrorCodePageReqVO; |
| 9 | 9 | import cn.iocoder.yudao.module.system.controller.admin.errorcode.vo.ErrorCodeUpdateReqVO; |
| 10 | -import cn.iocoder.yudao.module.system.dal.mysql.errorcode.SysErrorCodeMapper; | |
| 10 | +import cn.iocoder.yudao.module.system.dal.mysql.errorcode.ErrorCodeMapper; | |
| 11 | 11 | import cn.iocoder.yudao.module.system.enums.errorcode.ErrorCodeTypeEnum; |
| 12 | 12 | import cn.iocoder.yudao.framework.common.util.collection.ArrayUtils; |
| 13 | 13 | import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; |
| ... | ... | @@ -36,7 +36,7 @@ public class ErrorCodeServiceTest extends BaseDbUnitTest { |
| 36 | 36 | private ErrorCodeServiceImpl errorCodeService; |
| 37 | 37 | |
| 38 | 38 | @Resource |
| 39 | - private SysErrorCodeMapper errorCodeMapper; | |
| 39 | + private ErrorCodeMapper errorCodeMapper; | |
| 40 | 40 | |
| 41 | 41 | @Test |
| 42 | 42 | public void testCreateErrorCode_success() { |
| ... | ... | @@ -200,7 +200,7 @@ public class ErrorCodeServiceTest extends BaseDbUnitTest { |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | /** |
| 203 | - * 情况 2.1,错误码存在,但是是 SysErrorCodeTypeEnum.MANUAL_OPERATION 类型 | |
| 203 | + * 情况 2.1,错误码存在,但是是 ErrorCodeTypeEnum.MANUAL_OPERATION 类型 | |
| 204 | 204 | */ |
| 205 | 205 | @Test |
| 206 | 206 | public void testAutoGenerateErrorCodes_021() { | ... | ... |
yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/logger/LoginLogServiceImplTest.java
| 1 | 1 | package cn.iocoder.yudao.module.system.service.logger; |
| 2 | 2 | |
| 3 | 3 | import cn.hutool.core.util.RandomUtil; |
| 4 | -import cn.iocoder.yudao.module.system.dal.dataobject.logger.SysLoginLogDO; | |
| 4 | +import cn.iocoder.yudao.module.system.dal.dataobject.logger.LoginLogDO; | |
| 5 | 5 | import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; |
| 6 | 6 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 7 | 7 | import cn.iocoder.yudao.framework.common.util.monitor.TracerUtils; |
| ... | ... | @@ -38,7 +38,7 @@ public class LoginLogServiceImplTest extends BaseDbUnitTest { |
| 38 | 38 | public void testGetLoginLogPage() { |
| 39 | 39 | // 构造测试数据 |
| 40 | 40 | // 登录成功的 |
| 41 | - SysLoginLogDO loginLogDO = RandomUtils.randomPojo(SysLoginLogDO.class, logDO -> { | |
| 41 | + LoginLogDO loginLogDO = RandomUtils.randomPojo(LoginLogDO.class, logDO -> { | |
| 42 | 42 | logDO.setLogType(RandomUtil.randomEle(cn.iocoder.yudao.module.system.enums.logger.LoginLogTypeEnum.values()).getType()); |
| 43 | 43 | logDO.setTraceId(TracerUtils.getTraceId()); |
| 44 | 44 | logDO.setUserType(RandomUtil.randomEle(UserTypeEnum.values()).getValue()); |
| ... | ... | @@ -70,7 +70,7 @@ public class LoginLogServiceImplTest extends BaseDbUnitTest { |
| 70 | 70 | reqVO.setEndTime(buildTime(2021, 3, 7)); |
| 71 | 71 | |
| 72 | 72 | // 调用service方法 |
| 73 | - PageResult<SysLoginLogDO> pageResult = loginLogService.getLoginLogPage(reqVO); | |
| 73 | + PageResult<LoginLogDO> pageResult = loginLogService.getLoginLogPage(reqVO); | |
| 74 | 74 | |
| 75 | 75 | // 断言,只查到了一条符合条件的 |
| 76 | 76 | assertEquals(1, pageResult.getTotal()); |
| ... | ... | @@ -83,7 +83,7 @@ public class LoginLogServiceImplTest extends BaseDbUnitTest { |
| 83 | 83 | // 构造测试数据 |
| 84 | 84 | |
| 85 | 85 | // 登录成功的 |
| 86 | - SysLoginLogDO loginLogDO = RandomUtils.randomPojo(SysLoginLogDO.class, logDO -> { | |
| 86 | + LoginLogDO loginLogDO = RandomUtils.randomPojo(LoginLogDO.class, logDO -> { | |
| 87 | 87 | logDO.setLogType(RandomUtil.randomEle(cn.iocoder.yudao.module.system.enums.logger.LoginLogTypeEnum.values()).getType()); |
| 88 | 88 | logDO.setTraceId(TracerUtils.getTraceId()); |
| 89 | 89 | logDO.setUserType(RandomUtil.randomEle(UserTypeEnum.values()).getValue()); |
| ... | ... | @@ -116,7 +116,7 @@ public class LoginLogServiceImplTest extends BaseDbUnitTest { |
| 116 | 116 | |
| 117 | 117 | |
| 118 | 118 | // 调用service方法 |
| 119 | - List<SysLoginLogDO> loginLogList = loginLogService.getLoginLogList(reqVO); | |
| 119 | + List<LoginLogDO> loginLogList = loginLogService.getLoginLogList(reqVO); | |
| 120 | 120 | |
| 121 | 121 | // 断言 |
| 122 | 122 | assertEquals(1, loginLogList.size()); |
| ... | ... | @@ -136,7 +136,7 @@ public class LoginLogServiceImplTest extends BaseDbUnitTest { |
| 136 | 136 | // 调用 |
| 137 | 137 | loginLogService.createLoginLog(reqDTO); |
| 138 | 138 | // 断言,忽略基本字段 |
| 139 | - SysLoginLogDO sysLoginLogDO = loginLogMapper.selectOne(null); | |
| 139 | + LoginLogDO sysLoginLogDO = loginLogMapper.selectOne(null); | |
| 140 | 140 | assertPojoEquals(reqDTO, sysLoginLogDO); |
| 141 | 141 | } |
| 142 | 142 | ... | ... |
yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/logger/OperateLogServiceImplTest.java
| ... | ... | @@ -7,7 +7,7 @@ import cn.iocoder.yudao.module.system.dal.dataobject.logger.OperateLogDO; |
| 7 | 7 | import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; |
| 8 | 8 | import cn.iocoder.yudao.module.system.dal.mysql.logger.OperateLogMapper; |
| 9 | 9 | import cn.iocoder.yudao.module.system.service.user.AdminUserService; |
| 10 | -import cn.iocoder.yudao.module.system.enums.common.SysSexEnum; | |
| 10 | +import cn.iocoder.yudao.module.system.enums.common.SexEnum; | |
| 11 | 11 | import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; |
| 12 | 12 | import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants; |
| 13 | 13 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| ... | ... | @@ -68,7 +68,7 @@ public class OperateLogServiceImplTest extends BaseDbUnitTest { |
| 68 | 68 | // 先构造用户 |
| 69 | 69 | AdminUserDO user = RandomUtils.randomPojo(AdminUserDO.class, o -> { |
| 70 | 70 | o.setNickname("wangkai"); |
| 71 | - o.setSex(SysSexEnum.MALE.getSex()); | |
| 71 | + o.setSex(SexEnum.MALE.getSex()); | |
| 72 | 72 | o.setStatus(CommonStatusEnum.ENABLE.getStatus()); |
| 73 | 73 | }); |
| 74 | 74 | when(userService.getUsersByNickname("wangkai")).thenReturn(Collections.singletonList(user)); |
| ... | ... | @@ -119,7 +119,7 @@ public class OperateLogServiceImplTest extends BaseDbUnitTest { |
| 119 | 119 | // 先构造用户 |
| 120 | 120 | AdminUserDO user = RandomUtils.randomPojo(AdminUserDO.class, o -> { |
| 121 | 121 | o.setNickname("wangkai"); |
| 122 | - o.setSex(SysSexEnum.MALE.getSex()); | |
| 122 | + o.setSex(SexEnum.MALE.getSex()); | |
| 123 | 123 | o.setStatus(CommonStatusEnum.ENABLE.getStatus()); |
| 124 | 124 | }); |
| 125 | 125 | when(userService.getUsersByNickname("wangkai")).thenReturn(Collections.singletonList(user)); | ... | ... |
yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/notice/NoticeServiceImplTest.java
| ... | ... | @@ -6,7 +6,7 @@ import cn.iocoder.yudao.module.system.controller.admin.notice.vo.NoticeCreateReq |
| 6 | 6 | import cn.iocoder.yudao.module.system.controller.admin.notice.vo.NoticePageReqVO; |
| 7 | 7 | import cn.iocoder.yudao.module.system.controller.admin.notice.vo.NoticeUpdateReqVO; |
| 8 | 8 | import cn.iocoder.yudao.module.system.dal.dataobject.notice.NoticeDO; |
| 9 | -import cn.iocoder.yudao.module.system.dal.mysql.notice.SysNoticeMapper; | |
| 9 | +import cn.iocoder.yudao.module.system.dal.mysql.notice.NoticeMapper; | |
| 10 | 10 | import cn.iocoder.yudao.module.system.enums.notice.NoticeTypeEnum; |
| 11 | 11 | import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; |
| 12 | 12 | import cn.iocoder.yudao.module.system.test.BaseDbUnitTest; |
| ... | ... | @@ -32,7 +32,7 @@ class NoticeServiceImplTest extends BaseDbUnitTest { |
| 32 | 32 | private NoticeServiceImpl sysNoticeService; |
| 33 | 33 | |
| 34 | 34 | @Resource |
| 35 | - private SysNoticeMapper sysNoticeMapper; | |
| 35 | + private NoticeMapper sysNoticeMapper; | |
| 36 | 36 | |
| 37 | 37 | @Test |
| 38 | 38 | public void testPageNotices_success() { |
| ... | ... | @@ -66,7 +66,7 @@ class NoticeServiceImplTest extends BaseDbUnitTest { |
| 66 | 66 | @Test |
| 67 | 67 | public void testGetNotice_success() { |
| 68 | 68 | // 插入前置数据 |
| 69 | - NoticeDO dbNotice = randomSysNoticeDO(); | |
| 69 | + NoticeDO dbNotice = randomNoticeDO(); | |
| 70 | 70 | sysNoticeMapper.insert(dbNotice); |
| 71 | 71 | |
| 72 | 72 | // 查询 |
| ... | ... | @@ -80,7 +80,7 @@ class NoticeServiceImplTest extends BaseDbUnitTest { |
| 80 | 80 | @Test |
| 81 | 81 | public void testCreateNotice_success() { |
| 82 | 82 | // 准备参数 |
| 83 | - NoticeCreateReqVO reqVO = randomSysNoticeCreateReqVO(); | |
| 83 | + NoticeCreateReqVO reqVO = randomNoticeCreateReqVO(); | |
| 84 | 84 | |
| 85 | 85 | // 校验插入是否成功 |
| 86 | 86 | Long noticeId = sysNoticeService.createNotice(reqVO); |
| ... | ... | @@ -94,11 +94,11 @@ class NoticeServiceImplTest extends BaseDbUnitTest { |
| 94 | 94 | @Test |
| 95 | 95 | public void testUpdateNotice_success() { |
| 96 | 96 | // 插入前置数据 |
| 97 | - NoticeDO dbNoticeDO = randomSysNoticeDO(); | |
| 97 | + NoticeDO dbNoticeDO = randomNoticeDO(); | |
| 98 | 98 | sysNoticeMapper.insert(dbNoticeDO); |
| 99 | 99 | |
| 100 | 100 | // 准备更新参数 |
| 101 | - NoticeUpdateReqVO reqVO = randomSysNoticeUpdateReqVO(o -> o.setId(dbNoticeDO.getId())); | |
| 101 | + NoticeUpdateReqVO reqVO = randomNoticeUpdateReqVO(o -> o.setId(dbNoticeDO.getId())); | |
| 102 | 102 | |
| 103 | 103 | // 更新 |
| 104 | 104 | sysNoticeService.updateNotice(reqVO); |
| ... | ... | @@ -111,7 +111,7 @@ class NoticeServiceImplTest extends BaseDbUnitTest { |
| 111 | 111 | @Test |
| 112 | 112 | public void testDeleteNotice_success() { |
| 113 | 113 | // 插入前置数据 |
| 114 | - NoticeDO dbNotice = randomSysNoticeDO(); | |
| 114 | + NoticeDO dbNotice = randomNoticeDO(); | |
| 115 | 115 | sysNoticeMapper.insert(dbNotice); |
| 116 | 116 | |
| 117 | 117 | // 删除 |
| ... | ... | @@ -124,7 +124,7 @@ class NoticeServiceImplTest extends BaseDbUnitTest { |
| 124 | 124 | @Test |
| 125 | 125 | public void checkNoticeExists_success() { |
| 126 | 126 | // 插入前置数据 |
| 127 | - NoticeDO dbNotice = randomSysNoticeDO(); | |
| 127 | + NoticeDO dbNotice = randomNoticeDO(); | |
| 128 | 128 | sysNoticeMapper.insert(dbNotice); |
| 129 | 129 | |
| 130 | 130 | // 成功调用 |
| ... | ... | @@ -137,7 +137,7 @@ class NoticeServiceImplTest extends BaseDbUnitTest { |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | @SafeVarargs |
| 140 | - private static NoticeDO randomSysNoticeDO(Consumer<NoticeDO>... consumers) { | |
| 140 | + private static NoticeDO randomNoticeDO(Consumer<NoticeDO>... consumers) { | |
| 141 | 141 | NoticeDO notice = randomPojo(NoticeDO.class, consumers); |
| 142 | 142 | notice.setType(randomEle(NoticeTypeEnum.values()).getType()); |
| 143 | 143 | notice.setStatus(CommonStatusEnum.ENABLE.getStatus()); |
| ... | ... | @@ -145,14 +145,14 @@ class NoticeServiceImplTest extends BaseDbUnitTest { |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | @SafeVarargs |
| 148 | - private static NoticeUpdateReqVO randomSysNoticeUpdateReqVO(Consumer<NoticeUpdateReqVO>... consumers) { | |
| 148 | + private static NoticeUpdateReqVO randomNoticeUpdateReqVO(Consumer<NoticeUpdateReqVO>... consumers) { | |
| 149 | 149 | NoticeUpdateReqVO reqVO = randomPojo(NoticeUpdateReqVO.class, consumers); |
| 150 | 150 | reqVO.setType(randomEle(NoticeTypeEnum.values()).getType()); |
| 151 | 151 | reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); |
| 152 | 152 | return reqVO; |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | - private static NoticeCreateReqVO randomSysNoticeCreateReqVO() { | |
| 155 | + private static NoticeCreateReqVO randomNoticeCreateReqVO() { | |
| 156 | 156 | NoticeCreateReqVO reqVO = randomPojo(NoticeCreateReqVO.class); |
| 157 | 157 | reqVO.setType(randomEle(NoticeTypeEnum.values()).getType()); |
| 158 | 158 | reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); | ... | ... |
yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/permission/PermissionServiceTest.java
| 1 | 1 | package cn.iocoder.yudao.module.system.service.permission; |
| 2 | 2 | |
| 3 | 3 | import cn.hutool.core.collection.CollUtil; |
| 4 | -import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysDeptDO; | |
| 4 | +import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO; | |
| 5 | 5 | import cn.iocoder.yudao.module.system.dal.dataobject.permission.RoleDO; |
| 6 | 6 | import cn.iocoder.yudao.module.system.dal.dataobject.permission.RoleMenuDO; |
| 7 | 7 | import cn.iocoder.yudao.module.system.dal.dataobject.permission.UserRoleDO; |
| ... | ... | @@ -194,7 +194,7 @@ public class PermissionServiceTest extends BaseDbUnitTest { |
| 194 | 194 | RoleDO roleDO = randomPojo(RoleDO.class, o -> o.setDataScope(DataScopeEnum.DEPT_AND_CHILD.getScope())); |
| 195 | 195 | when(roleService.getRolesFromCache(same(loginUser.getRoleIds()))).thenReturn(singletonList(roleDO)); |
| 196 | 196 | // mock 方法(部门) |
| 197 | - SysDeptDO deptDO = randomPojo(SysDeptDO.class); | |
| 197 | + DeptDO deptDO = randomPojo(DeptDO.class); | |
| 198 | 198 | when(deptService.getDeptsByParentIdFromCache(eq(loginUser.getDeptId()), eq(true))) |
| 199 | 199 | .thenReturn(singletonList(deptDO)); |
| 200 | 200 | ... | ... |
yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsChannelServiceTest.java
| ... | ... | @@ -6,7 +6,7 @@ import cn.iocoder.yudao.module.system.controller.admin.sms.vo.channel.SmsChannel |
| 6 | 6 | import cn.iocoder.yudao.module.system.controller.admin.sms.vo.channel.SmsChannelUpdateReqVO; |
| 7 | 7 | import cn.iocoder.yudao.module.system.dal.mysql.sms.SmsChannelMapper; |
| 8 | 8 | import cn.iocoder.yudao.module.system.mq.producer.sms.SmsProducer; |
| 9 | -import cn.iocoder.yudao.module.system.dal.dataobject.sms.SysSmsChannelDO; | |
| 9 | +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsChannelDO; | |
| 10 | 10 | import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; |
| 11 | 11 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 12 | 12 | import cn.iocoder.yudao.framework.common.util.collection.ArrayUtils; |
| ... | ... | @@ -51,9 +51,9 @@ public class SmsChannelServiceTest extends BaseDbUnitTest { |
| 51 | 51 | @Test |
| 52 | 52 | public void testInitLocalCache_success() { |
| 53 | 53 | // mock 数据 |
| 54 | - SysSmsChannelDO smsChannelDO01 = randomSmsChannelDO(); | |
| 54 | + SmsChannelDO smsChannelDO01 = randomSmsChannelDO(); | |
| 55 | 55 | smsChannelMapper.insert(smsChannelDO01); |
| 56 | - SysSmsChannelDO smsChannelDO02 = randomSmsChannelDO(); | |
| 56 | + SmsChannelDO smsChannelDO02 = randomSmsChannelDO(); | |
| 57 | 57 | smsChannelMapper.insert(smsChannelDO02); |
| 58 | 58 | |
| 59 | 59 | // 调用 |
| ... | ... | @@ -78,7 +78,7 @@ public class SmsChannelServiceTest extends BaseDbUnitTest { |
| 78 | 78 | // 断言 |
| 79 | 79 | assertNotNull(smsChannelId); |
| 80 | 80 | // 校验记录的属性是否正确 |
| 81 | - SysSmsChannelDO smsChannel = smsChannelMapper.selectById(smsChannelId); | |
| 81 | + SmsChannelDO smsChannel = smsChannelMapper.selectById(smsChannelId); | |
| 82 | 82 | assertPojoEquals(reqVO, smsChannel); |
| 83 | 83 | // 校验调用 |
| 84 | 84 | verify(smsProducer, times(1)).sendSmsChannelRefreshMessage(); |
| ... | ... | @@ -87,7 +87,7 @@ public class SmsChannelServiceTest extends BaseDbUnitTest { |
| 87 | 87 | @Test |
| 88 | 88 | public void testUpdateSmsChannel_success() { |
| 89 | 89 | // mock 数据 |
| 90 | - SysSmsChannelDO dbSmsChannel = randomSmsChannelDO(); | |
| 90 | + SmsChannelDO dbSmsChannel = randomSmsChannelDO(); | |
| 91 | 91 | smsChannelMapper.insert(dbSmsChannel);// @Sql: 先插入出一条存在的数据 |
| 92 | 92 | // 准备参数 |
| 93 | 93 | SmsChannelUpdateReqVO reqVO = randomPojo(SmsChannelUpdateReqVO.class, o -> { |
| ... | ... | @@ -99,7 +99,7 @@ public class SmsChannelServiceTest extends BaseDbUnitTest { |
| 99 | 99 | // 调用 |
| 100 | 100 | smsChannelService.updateSmsChannel(reqVO); |
| 101 | 101 | // 校验是否更新正确 |
| 102 | - SysSmsChannelDO smsChannel = smsChannelMapper.selectById(reqVO.getId()); // 获取最新的 | |
| 102 | + SmsChannelDO smsChannel = smsChannelMapper.selectById(reqVO.getId()); // 获取最新的 | |
| 103 | 103 | assertPojoEquals(reqVO, smsChannel); |
| 104 | 104 | // 校验调用 |
| 105 | 105 | verify(smsProducer, times(1)).sendSmsChannelRefreshMessage(); |
| ... | ... | @@ -117,7 +117,7 @@ public class SmsChannelServiceTest extends BaseDbUnitTest { |
| 117 | 117 | @Test |
| 118 | 118 | public void testDeleteSmsChannel_success() { |
| 119 | 119 | // mock 数据 |
| 120 | - SysSmsChannelDO dbSmsChannel = randomSmsChannelDO(); | |
| 120 | + SmsChannelDO dbSmsChannel = randomSmsChannelDO(); | |
| 121 | 121 | smsChannelMapper.insert(dbSmsChannel);// @Sql: 先插入出一条存在的数据 |
| 122 | 122 | // 准备参数 |
| 123 | 123 | Long id = dbSmsChannel.getId(); |
| ... | ... | @@ -142,7 +142,7 @@ public class SmsChannelServiceTest extends BaseDbUnitTest { |
| 142 | 142 | @Test |
| 143 | 143 | public void testDeleteSmsChannel_hasChildren() { |
| 144 | 144 | // mock 数据 |
| 145 | - SysSmsChannelDO dbSmsChannel = randomSmsChannelDO(); | |
| 145 | + SmsChannelDO dbSmsChannel = randomSmsChannelDO(); | |
| 146 | 146 | smsChannelMapper.insert(dbSmsChannel);// @Sql: 先插入出一条存在的数据 |
| 147 | 147 | // 准备参数 |
| 148 | 148 | Long id = dbSmsChannel.getId(); |
| ... | ... | @@ -156,7 +156,7 @@ public class SmsChannelServiceTest extends BaseDbUnitTest { |
| 156 | 156 | @Test |
| 157 | 157 | public void testGetSmsChannelPage() { |
| 158 | 158 | // mock 数据 |
| 159 | - SysSmsChannelDO dbSmsChannel = randomPojo(SysSmsChannelDO.class, o -> { // 等会查询到 | |
| 159 | + SmsChannelDO dbSmsChannel = randomPojo(SmsChannelDO.class, o -> { // 等会查询到 | |
| 160 | 160 | o.setSignature("芋道源码"); |
| 161 | 161 | o.setStatus(CommonStatusEnum.ENABLE.getStatus()); |
| 162 | 162 | o.setCreateTime(buildTime(2020, 12, 12)); |
| ... | ... | @@ -176,7 +176,7 @@ public class SmsChannelServiceTest extends BaseDbUnitTest { |
| 176 | 176 | reqVO.setEndCreateTime(buildTime(2020, 12, 24)); |
| 177 | 177 | |
| 178 | 178 | // 调用 |
| 179 | - PageResult<SysSmsChannelDO> pageResult = smsChannelService.getSmsChannelPage(reqVO); | |
| 179 | + PageResult<SmsChannelDO> pageResult = smsChannelService.getSmsChannelPage(reqVO); | |
| 180 | 180 | // 断言 |
| 181 | 181 | assertEquals(1, pageResult.getTotal()); |
| 182 | 182 | assertEquals(1, pageResult.getList().size()); |
| ... | ... | @@ -186,11 +186,11 @@ public class SmsChannelServiceTest extends BaseDbUnitTest { |
| 186 | 186 | // ========== 随机对象 ========== |
| 187 | 187 | |
| 188 | 188 | @SafeVarargs |
| 189 | - private static SysSmsChannelDO randomSmsChannelDO(Consumer<SysSmsChannelDO>... consumers) { | |
| 190 | - Consumer<SysSmsChannelDO> consumer = (o) -> { | |
| 189 | + private static SmsChannelDO randomSmsChannelDO(Consumer<SmsChannelDO>... consumers) { | |
| 190 | + Consumer<SmsChannelDO> consumer = (o) -> { | |
| 191 | 191 | o.setStatus(randomEle(CommonStatusEnum.values()).getStatus()); // 保证 status 的范围 |
| 192 | 192 | }; |
| 193 | - return randomPojo(SysSmsChannelDO.class, ArrayUtils.append(consumer, consumers)); | |
| 193 | + return randomPojo(SmsChannelDO.class, ArrayUtils.append(consumer, consumers)); | |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | } | ... | ... |
yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsLogServiceTest.java
| ... | ... | @@ -4,12 +4,12 @@ import cn.hutool.core.map.MapUtil; |
| 4 | 4 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 5 | 5 | import cn.iocoder.yudao.module.system.controller.admin.sms.vo.log.SmsLogExportReqVO; |
| 6 | 6 | import cn.iocoder.yudao.module.system.controller.admin.sms.vo.log.SmsLogPageReqVO; |
| 7 | -import cn.iocoder.yudao.module.system.dal.dataobject.sms.SysSmsTemplateDO; | |
| 7 | +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsLogDO; | |
| 8 | +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsTemplateDO; | |
| 8 | 9 | import cn.iocoder.yudao.module.system.dal.mysql.sms.SmsLogMapper; |
| 9 | -import cn.iocoder.yudao.module.system.dal.dataobject.sms.SysSmsLogDO; | |
| 10 | -import cn.iocoder.yudao.module.system.enums.sms.SysSmsReceiveStatusEnum; | |
| 11 | -import cn.iocoder.yudao.module.system.enums.sms.SysSmsSendStatusEnum; | |
| 12 | -import cn.iocoder.yudao.module.system.enums.sms.SysSmsTemplateTypeEnum; | |
| 10 | +import cn.iocoder.yudao.module.system.enums.sms.SmsReceiveStatusEnum; | |
| 11 | +import cn.iocoder.yudao.module.system.enums.sms.SmsSendStatusEnum; | |
| 12 | +import cn.iocoder.yudao.module.system.enums.sms.SmsTemplateTypeEnum; | |
| 13 | 13 | import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; |
| 14 | 14 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 15 | 15 | import cn.iocoder.yudao.framework.common.util.collection.ArrayUtils; |
| ... | ... | @@ -44,13 +44,13 @@ public class SmsLogServiceTest extends BaseDbUnitTest { |
| 44 | 44 | @Test |
| 45 | 45 | public void testGetSmsLogPage() { |
| 46 | 46 | // mock 数据 |
| 47 | - SysSmsLogDO dbSmsLog = randomSmsLogDO(o -> { // 等会查询到 | |
| 47 | + SmsLogDO dbSmsLog = randomSmsLogDO(o -> { // 等会查询到 | |
| 48 | 48 | o.setChannelId(1L); |
| 49 | 49 | o.setTemplateId(10L); |
| 50 | 50 | o.setMobile("15601691300"); |
| 51 | - o.setSendStatus(SysSmsSendStatusEnum.INIT.getStatus()); | |
| 51 | + o.setSendStatus(SmsSendStatusEnum.INIT.getStatus()); | |
| 52 | 52 | o.setSendTime(buildTime(2020, 11, 11)); |
| 53 | - o.setReceiveStatus(SysSmsReceiveStatusEnum.INIT.getStatus()); | |
| 53 | + o.setReceiveStatus(SmsReceiveStatusEnum.INIT.getStatus()); | |
| 54 | 54 | o.setReceiveTime(buildTime(2021, 11, 11)); |
| 55 | 55 | }); |
| 56 | 56 | smsLogMapper.insert(dbSmsLog); |
| ... | ... | @@ -61,11 +61,11 @@ public class SmsLogServiceTest extends BaseDbUnitTest { |
| 61 | 61 | // 测试 mobile 不匹配 |
| 62 | 62 | smsLogMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsLog, o -> o.setMobile("18818260999"))); |
| 63 | 63 | // 测试 sendStatus 不匹配 |
| 64 | - smsLogMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsLog, o -> o.setSendStatus(SysSmsSendStatusEnum.IGNORE.getStatus()))); | |
| 64 | + smsLogMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsLog, o -> o.setSendStatus(SmsSendStatusEnum.IGNORE.getStatus()))); | |
| 65 | 65 | // 测试 sendTime 不匹配 |
| 66 | 66 | smsLogMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsLog, o -> o.setSendTime(buildTime(2020, 12, 12)))); |
| 67 | 67 | // 测试 receiveStatus 不匹配 |
| 68 | - smsLogMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsLog, o -> o.setReceiveStatus(SysSmsReceiveStatusEnum.SUCCESS.getStatus()))); | |
| 68 | + smsLogMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsLog, o -> o.setReceiveStatus(SmsReceiveStatusEnum.SUCCESS.getStatus()))); | |
| 69 | 69 | // 测试 receiveTime 不匹配 |
| 70 | 70 | smsLogMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsLog, o -> o.setReceiveTime(buildTime(2021, 12, 12)))); |
| 71 | 71 | // 准备参数 |
| ... | ... | @@ -73,15 +73,15 @@ public class SmsLogServiceTest extends BaseDbUnitTest { |
| 73 | 73 | reqVO.setChannelId(1L); |
| 74 | 74 | reqVO.setTemplateId(10L); |
| 75 | 75 | reqVO.setMobile("156"); |
| 76 | - reqVO.setSendStatus(SysSmsSendStatusEnum.INIT.getStatus()); | |
| 76 | + reqVO.setSendStatus(SmsSendStatusEnum.INIT.getStatus()); | |
| 77 | 77 | reqVO.setBeginSendTime(buildTime(2020, 11, 1)); |
| 78 | 78 | reqVO.setEndSendTime(buildTime(2020, 11, 30)); |
| 79 | - reqVO.setReceiveStatus(SysSmsReceiveStatusEnum.INIT.getStatus()); | |
| 79 | + reqVO.setReceiveStatus(SmsReceiveStatusEnum.INIT.getStatus()); | |
| 80 | 80 | reqVO.setBeginReceiveTime(buildTime(2021, 11, 1)); |
| 81 | 81 | reqVO.setEndReceiveTime(buildTime(2021, 11, 30)); |
| 82 | 82 | |
| 83 | 83 | // 调用 |
| 84 | - PageResult<SysSmsLogDO> pageResult = smsLogService.getSmsLogPage(reqVO); | |
| 84 | + PageResult<SmsLogDO> pageResult = smsLogService.getSmsLogPage(reqVO); | |
| 85 | 85 | // 断言 |
| 86 | 86 | assertEquals(1, pageResult.getTotal()); |
| 87 | 87 | assertEquals(1, pageResult.getList().size()); |
| ... | ... | @@ -91,13 +91,13 @@ public class SmsLogServiceTest extends BaseDbUnitTest { |
| 91 | 91 | @Test |
| 92 | 92 | public void testGetSmsLogList() { |
| 93 | 93 | // mock 数据 |
| 94 | - SysSmsLogDO dbSmsLog = randomSmsLogDO(o -> { // 等会查询到 | |
| 94 | + SmsLogDO dbSmsLog = randomSmsLogDO(o -> { // 等会查询到 | |
| 95 | 95 | o.setChannelId(1L); |
| 96 | 96 | o.setTemplateId(10L); |
| 97 | 97 | o.setMobile("15601691300"); |
| 98 | - o.setSendStatus(SysSmsSendStatusEnum.INIT.getStatus()); | |
| 98 | + o.setSendStatus(SmsSendStatusEnum.INIT.getStatus()); | |
| 99 | 99 | o.setSendTime(buildTime(2020, 11, 11)); |
| 100 | - o.setReceiveStatus(SysSmsReceiveStatusEnum.INIT.getStatus()); | |
| 100 | + o.setReceiveStatus(SmsReceiveStatusEnum.INIT.getStatus()); | |
| 101 | 101 | o.setReceiveTime(buildTime(2021, 11, 11)); |
| 102 | 102 | }); |
| 103 | 103 | smsLogMapper.insert(dbSmsLog); |
| ... | ... | @@ -108,11 +108,11 @@ public class SmsLogServiceTest extends BaseDbUnitTest { |
| 108 | 108 | // 测试 mobile 不匹配 |
| 109 | 109 | smsLogMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsLog, o -> o.setMobile("18818260999"))); |
| 110 | 110 | // 测试 sendStatus 不匹配 |
| 111 | - smsLogMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsLog, o -> o.setSendStatus(SysSmsSendStatusEnum.IGNORE.getStatus()))); | |
| 111 | + smsLogMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsLog, o -> o.setSendStatus(SmsSendStatusEnum.IGNORE.getStatus()))); | |
| 112 | 112 | // 测试 sendTime 不匹配 |
| 113 | 113 | smsLogMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsLog, o -> o.setSendTime(buildTime(2020, 12, 12)))); |
| 114 | 114 | // 测试 receiveStatus 不匹配 |
| 115 | - smsLogMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsLog, o -> o.setReceiveStatus(SysSmsReceiveStatusEnum.SUCCESS.getStatus()))); | |
| 115 | + smsLogMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsLog, o -> o.setReceiveStatus(SmsReceiveStatusEnum.SUCCESS.getStatus()))); | |
| 116 | 116 | // 测试 receiveTime 不匹配 |
| 117 | 117 | smsLogMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsLog, o -> o.setReceiveTime(buildTime(2021, 12, 12)))); |
| 118 | 118 | // 准备参数 |
| ... | ... | @@ -120,15 +120,15 @@ public class SmsLogServiceTest extends BaseDbUnitTest { |
| 120 | 120 | reqVO.setChannelId(1L); |
| 121 | 121 | reqVO.setTemplateId(10L); |
| 122 | 122 | reqVO.setMobile("156"); |
| 123 | - reqVO.setSendStatus(SysSmsSendStatusEnum.INIT.getStatus()); | |
| 123 | + reqVO.setSendStatus(SmsSendStatusEnum.INIT.getStatus()); | |
| 124 | 124 | reqVO.setBeginSendTime(buildTime(2020, 11, 1)); |
| 125 | 125 | reqVO.setEndSendTime(buildTime(2020, 11, 30)); |
| 126 | - reqVO.setReceiveStatus(SysSmsReceiveStatusEnum.INIT.getStatus()); | |
| 126 | + reqVO.setReceiveStatus(SmsReceiveStatusEnum.INIT.getStatus()); | |
| 127 | 127 | reqVO.setBeginReceiveTime(buildTime(2021, 11, 1)); |
| 128 | 128 | reqVO.setEndReceiveTime(buildTime(2021, 11, 30)); |
| 129 | 129 | |
| 130 | 130 | // 调用 |
| 131 | - List<SysSmsLogDO> list = smsLogService.getSmsLogList(reqVO); | |
| 131 | + List<SmsLogDO> list = smsLogService.getSmsLogList(reqVO); | |
| 132 | 132 | // 断言 |
| 133 | 133 | assertEquals(1, list.size()); |
| 134 | 134 | assertPojoEquals(dbSmsLog, list.get(0)); |
| ... | ... | @@ -141,8 +141,8 @@ public class SmsLogServiceTest extends BaseDbUnitTest { |
| 141 | 141 | Long userId = randomLongId(); |
| 142 | 142 | Integer userType = randomEle(UserTypeEnum.values()).getValue(); |
| 143 | 143 | Boolean isSend = randomBoolean(); |
| 144 | - SysSmsTemplateDO templateDO = randomPojo(SysSmsTemplateDO.class, | |
| 145 | - o -> o.setType(randomEle(SysSmsTemplateTypeEnum.values()).getType())); | |
| 144 | + SmsTemplateDO templateDO = randomPojo(SmsTemplateDO.class, | |
| 145 | + o -> o.setType(randomEle(SmsTemplateTypeEnum.values()).getType())); | |
| 146 | 146 | String templateContent = randomString(); |
| 147 | 147 | Map<String, Object> templateParams = randomTemplateParams(); |
| 148 | 148 | // mock 方法 |
| ... | ... | @@ -151,8 +151,8 @@ public class SmsLogServiceTest extends BaseDbUnitTest { |
| 151 | 151 | Long logId = smsLogService.createSmsLog(mobile, userId, userType, isSend, |
| 152 | 152 | templateDO, templateContent, templateParams); |
| 153 | 153 | // 断言 |
| 154 | - SysSmsLogDO logDO = smsLogMapper.selectById(logId); | |
| 155 | - assertEquals(isSend ? SysSmsSendStatusEnum.INIT.getStatus() : SysSmsSendStatusEnum.IGNORE.getStatus(), | |
| 154 | + SmsLogDO logDO = smsLogMapper.selectById(logId); | |
| 155 | + assertEquals(isSend ? SmsSendStatusEnum.INIT.getStatus() : SmsSendStatusEnum.IGNORE.getStatus(), | |
| 156 | 156 | logDO.getSendStatus()); |
| 157 | 157 | assertEquals(mobile, logDO.getMobile()); |
| 158 | 158 | assertEquals(userType, logDO.getUserType()); |
| ... | ... | @@ -164,14 +164,14 @@ public class SmsLogServiceTest extends BaseDbUnitTest { |
| 164 | 164 | assertEquals(templateDO.getChannelCode(), logDO.getChannelCode()); |
| 165 | 165 | assertEquals(templateContent, logDO.getTemplateContent()); |
| 166 | 166 | assertEquals(templateParams, logDO.getTemplateParams()); |
| 167 | - assertEquals(SysSmsReceiveStatusEnum.INIT.getStatus(), logDO.getReceiveStatus()); | |
| 167 | + assertEquals(SmsReceiveStatusEnum.INIT.getStatus(), logDO.getReceiveStatus()); | |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | @Test |
| 171 | 171 | public void testUpdateSmsSendResult() { |
| 172 | 172 | // mock 数据 |
| 173 | - SysSmsLogDO dbSmsLog = randomSmsLogDO( | |
| 174 | - o -> o.setSendStatus(SysSmsSendStatusEnum.IGNORE.getStatus())); | |
| 173 | + SmsLogDO dbSmsLog = randomSmsLogDO( | |
| 174 | + o -> o.setSendStatus(SmsSendStatusEnum.IGNORE.getStatus())); | |
| 175 | 175 | smsLogMapper.insert(dbSmsLog); |
| 176 | 176 | // 准备参数 |
| 177 | 177 | Long id = dbSmsLog.getId(); |
| ... | ... | @@ -187,8 +187,8 @@ public class SmsLogServiceTest extends BaseDbUnitTest { |
| 187 | 187 | apiSendCode, apiSendMsg, apiRequestId, apiSerialNo); |
| 188 | 188 | // 断言 |
| 189 | 189 | dbSmsLog = smsLogMapper.selectById(id); |
| 190 | - assertEquals(CommonResult.isSuccess(sendCode) ? SysSmsSendStatusEnum.SUCCESS.getStatus() | |
| 191 | - : SysSmsSendStatusEnum.FAILURE.getStatus(), dbSmsLog.getSendStatus()); | |
| 190 | + assertEquals(CommonResult.isSuccess(sendCode) ? SmsSendStatusEnum.SUCCESS.getStatus() | |
| 191 | + : SmsSendStatusEnum.FAILURE.getStatus(), dbSmsLog.getSendStatus()); | |
| 192 | 192 | assertNotNull(dbSmsLog.getSendTime()); |
| 193 | 193 | assertEquals(sendMsg, dbSmsLog.getSendMsg()); |
| 194 | 194 | assertEquals(apiSendCode, dbSmsLog.getApiSendCode()); |
| ... | ... | @@ -200,8 +200,8 @@ public class SmsLogServiceTest extends BaseDbUnitTest { |
| 200 | 200 | @Test |
| 201 | 201 | public void testUpdateSmsReceiveResult() { |
| 202 | 202 | // mock 数据 |
| 203 | - SysSmsLogDO dbSmsLog = randomSmsLogDO( | |
| 204 | - o -> o.setReceiveStatus(SysSmsReceiveStatusEnum.INIT.getStatus())); | |
| 203 | + SmsLogDO dbSmsLog = randomSmsLogDO( | |
| 204 | + o -> o.setReceiveStatus(SmsReceiveStatusEnum.INIT.getStatus())); | |
| 205 | 205 | smsLogMapper.insert(dbSmsLog); |
| 206 | 206 | // 准备参数 |
| 207 | 207 | Long id = dbSmsLog.getId(); |
| ... | ... | @@ -214,8 +214,8 @@ public class SmsLogServiceTest extends BaseDbUnitTest { |
| 214 | 214 | smsLogService.updateSmsReceiveResult(id, success, receiveTime, apiReceiveCode, apiReceiveMsg); |
| 215 | 215 | // 断言 |
| 216 | 216 | dbSmsLog = smsLogMapper.selectById(id); |
| 217 | - assertEquals(success ? SysSmsReceiveStatusEnum.SUCCESS.getStatus() | |
| 218 | - : SysSmsReceiveStatusEnum.FAILURE.getStatus(), dbSmsLog.getReceiveStatus()); | |
| 217 | + assertEquals(success ? SmsReceiveStatusEnum.SUCCESS.getStatus() | |
| 218 | + : SmsReceiveStatusEnum.FAILURE.getStatus(), dbSmsLog.getReceiveStatus()); | |
| 219 | 219 | assertEquals(receiveTime, dbSmsLog.getReceiveTime()); |
| 220 | 220 | assertEquals(apiReceiveCode, dbSmsLog.getApiReceiveCode()); |
| 221 | 221 | assertEquals(apiReceiveMsg, dbSmsLog.getApiReceiveMsg()); |
| ... | ... | @@ -224,15 +224,15 @@ public class SmsLogServiceTest extends BaseDbUnitTest { |
| 224 | 224 | // ========== 随机对象 ========== |
| 225 | 225 | |
| 226 | 226 | @SafeVarargs |
| 227 | - private static SysSmsLogDO randomSmsLogDO(Consumer<SysSmsLogDO>... consumers) { | |
| 228 | - Consumer<SysSmsLogDO> consumer = (o) -> { | |
| 227 | + private static SmsLogDO randomSmsLogDO(Consumer<SmsLogDO>... consumers) { | |
| 228 | + Consumer<SmsLogDO> consumer = (o) -> { | |
| 229 | 229 | o.setTemplateParams(randomTemplateParams()); |
| 230 | - o.setTemplateType(randomEle(SysSmsTemplateTypeEnum.values()).getType()); // 保证 templateType 的范围 | |
| 230 | + o.setTemplateType(randomEle(SmsTemplateTypeEnum.values()).getType()); // 保证 templateType 的范围 | |
| 231 | 231 | o.setUserType(randomEle(UserTypeEnum.values()).getValue()); // 保证 userType 的范围 |
| 232 | - o.setSendStatus(randomEle(SysSmsSendStatusEnum.values()).getStatus()); // 保证 sendStatus 的范围 | |
| 233 | - o.setReceiveStatus(randomEle(SysSmsReceiveStatusEnum.values()).getStatus()); // 保证 receiveStatus 的范围 | |
| 232 | + o.setSendStatus(randomEle(SmsSendStatusEnum.values()).getStatus()); // 保证 sendStatus 的范围 | |
| 233 | + o.setReceiveStatus(randomEle(SmsReceiveStatusEnum.values()).getStatus()); // 保证 receiveStatus 的范围 | |
| 234 | 234 | }; |
| 235 | - return randomPojo(SysSmsLogDO.class, ArrayUtils.append(consumer, consumers)); | |
| 235 | + return randomPojo(SmsLogDO.class, ArrayUtils.append(consumer, consumers)); | |
| 236 | 236 | } |
| 237 | 237 | |
| 238 | 238 | ... | ... |
yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/sms/SysSmsSendServiceTest.java renamed to yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsSendServiceTest.java
| 1 | 1 | package cn.iocoder.yudao.module.system.service.sms; |
| 2 | 2 | |
| 3 | 3 | import cn.hutool.core.map.MapUtil; |
| 4 | -import cn.iocoder.yudao.module.system.dal.dataobject.sms.SysSmsTemplateDO; | |
| 4 | +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsTemplateDO; | |
| 5 | 5 | import cn.iocoder.yudao.module.system.mq.message.sms.SmsSendMessage; |
| 6 | 6 | import cn.iocoder.yudao.module.system.mq.producer.sms.SmsProducer; |
| 7 | 7 | import cn.iocoder.yudao.framework.common.core.KeyValue; |
| ... | ... | @@ -30,7 +30,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; |
| 30 | 30 | import static org.mockito.ArgumentMatchers.eq; |
| 31 | 31 | import static org.mockito.Mockito.*; |
| 32 | 32 | |
| 33 | -public class SysSmsSendServiceTest extends BaseMockitoUnitTest { | |
| 33 | +public class SmsSendServiceTest extends BaseMockitoUnitTest { | |
| 34 | 34 | |
| 35 | 35 | @InjectMocks |
| 36 | 36 | private SmsSendServiceImpl smsService; |
| ... | ... | @@ -57,7 +57,7 @@ public class SysSmsSendServiceTest extends BaseMockitoUnitTest { |
| 57 | 57 | Map<String, Object> templateParams = MapUtil.<String, Object>builder().put("code", "1234") |
| 58 | 58 | .put("op", "login").build(); |
| 59 | 59 | // mock SmsTemplateService 的方法 |
| 60 | - SysSmsTemplateDO template = randomPojo(SysSmsTemplateDO.class, o -> { | |
| 60 | + SmsTemplateDO template = randomPojo(SmsTemplateDO.class, o -> { | |
| 61 | 61 | o.setStatus(CommonStatusEnum.ENABLE.getStatus()); |
| 62 | 62 | o.setContent("验证码为{code}, 操作为{op}"); |
| 63 | 63 | o.setParams(Lists.newArrayList("code", "op")); |
| ... | ... | @@ -94,7 +94,7 @@ public class SysSmsSendServiceTest extends BaseMockitoUnitTest { |
| 94 | 94 | Map<String, Object> templateParams = MapUtil.<String, Object>builder().put("code", "1234") |
| 95 | 95 | .put("op", "login").build(); |
| 96 | 96 | // mock SmsTemplateService 的方法 |
| 97 | - SysSmsTemplateDO template = randomPojo(SysSmsTemplateDO.class, o -> { | |
| 97 | + SmsTemplateDO template = randomPojo(SmsTemplateDO.class, o -> { | |
| 98 | 98 | o.setStatus(CommonStatusEnum.DISABLE.getStatus()); |
| 99 | 99 | o.setContent("验证码为{code}, 操作为{op}"); |
| 100 | 100 | o.setParams(Lists.newArrayList("code", "op")); |
| ... | ... | @@ -131,7 +131,7 @@ public class SysSmsSendServiceTest extends BaseMockitoUnitTest { |
| 131 | 131 | @Test |
| 132 | 132 | public void testBuildTemplateParams_paramMiss() { |
| 133 | 133 | // 准备参数 |
| 134 | - SysSmsTemplateDO template = randomPojo(SysSmsTemplateDO.class, | |
| 134 | + SmsTemplateDO template = randomPojo(SmsTemplateDO.class, | |
| 135 | 135 | o -> o.setParams(Lists.newArrayList("code"))); |
| 136 | 136 | Map<String, Object> templateParams = new HashMap<>(); |
| 137 | 137 | // mock 方法 | ... | ... |
yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsTemplateServiceTest.java
| ... | ... | @@ -4,11 +4,11 @@ import cn.iocoder.yudao.module.system.controller.admin.sms.vo.template.SmsTempla |
| 4 | 4 | import cn.iocoder.yudao.module.system.controller.admin.sms.vo.template.SmsTemplateExportReqVO; |
| 5 | 5 | import cn.iocoder.yudao.module.system.controller.admin.sms.vo.template.SmsTemplatePageReqVO; |
| 6 | 6 | import cn.iocoder.yudao.module.system.controller.admin.sms.vo.template.SmsTemplateUpdateReqVO; |
| 7 | +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsChannelDO; | |
| 8 | +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsTemplateDO; | |
| 7 | 9 | import cn.iocoder.yudao.module.system.dal.mysql.sms.SmsTemplateMapper; |
| 8 | 10 | import cn.iocoder.yudao.module.system.mq.producer.sms.SmsProducer; |
| 9 | -import cn.iocoder.yudao.module.system.dal.dataobject.sms.SysSmsChannelDO; | |
| 10 | -import cn.iocoder.yudao.module.system.dal.dataobject.sms.SysSmsTemplateDO; | |
| 11 | -import cn.iocoder.yudao.module.system.enums.sms.SysSmsTemplateTypeEnum; | |
| 11 | +import cn.iocoder.yudao.module.system.enums.sms.SmsTemplateTypeEnum; | |
| 12 | 12 | import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; |
| 13 | 13 | import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants; |
| 14 | 14 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| ... | ... | @@ -64,15 +64,15 @@ public class SmsTemplateServiceTest extends BaseDbUnitTest { |
| 64 | 64 | @SuppressWarnings("unchecked") |
| 65 | 65 | void testInitLocalCache() { |
| 66 | 66 | // mock 数据 |
| 67 | - SysSmsTemplateDO smsTemplate01 = randomSmsTemplateDO(); | |
| 67 | + SmsTemplateDO smsTemplate01 = randomSmsTemplateDO(); | |
| 68 | 68 | smsTemplateMapper.insert(smsTemplate01); |
| 69 | - SysSmsTemplateDO smsTemplate02 = randomSmsTemplateDO(); | |
| 69 | + SmsTemplateDO smsTemplate02 = randomSmsTemplateDO(); | |
| 70 | 70 | smsTemplateMapper.insert(smsTemplate02); |
| 71 | 71 | |
| 72 | 72 | // 调用 |
| 73 | 73 | smsTemplateService.initLocalCache(); |
| 74 | 74 | // 断言 deptCache 缓存 |
| 75 | - Map<String, SysSmsTemplateDO> smsTemplateCache = (Map<String, SysSmsTemplateDO>) getFieldValue(smsTemplateService, "smsTemplateCache"); | |
| 75 | + Map<String, SmsTemplateDO> smsTemplateCache = (Map<String, SmsTemplateDO>) getFieldValue(smsTemplateService, "smsTemplateCache"); | |
| 76 | 76 | assertEquals(2, smsTemplateCache.size()); |
| 77 | 77 | assertPojoEquals(smsTemplate01, smsTemplateCache.get(smsTemplate01.getCode())); |
| 78 | 78 | assertPojoEquals(smsTemplate02, smsTemplateCache.get(smsTemplate02.getCode())); |
| ... | ... | @@ -100,10 +100,10 @@ public class SmsTemplateServiceTest extends BaseDbUnitTest { |
| 100 | 100 | SmsTemplateCreateReqVO reqVO = randomPojo(SmsTemplateCreateReqVO.class, o -> { |
| 101 | 101 | o.setContent("正在进行登录操作{operation},您的验证码是{code}"); |
| 102 | 102 | o.setStatus(randomEle(CommonStatusEnum.values()).getStatus()); // 保证 status 的范围 |
| 103 | - o.setType(randomEle(SysSmsTemplateTypeEnum.values()).getType()); // 保证 type 的 范围 | |
| 103 | + o.setType(randomEle(SmsTemplateTypeEnum.values()).getType()); // 保证 type 的 范围 | |
| 104 | 104 | }); |
| 105 | 105 | // mock Channel 的方法 |
| 106 | - SysSmsChannelDO channelDO = randomPojo(SysSmsChannelDO.class, o -> { | |
| 106 | + SmsChannelDO channelDO = randomPojo(SmsChannelDO.class, o -> { | |
| 107 | 107 | o.setId(reqVO.getChannelId()); |
| 108 | 108 | o.setStatus(CommonStatusEnum.ENABLE.getStatus()); // 保证 status 开启,创建必须处于这个状态 |
| 109 | 109 | }); |
| ... | ... | @@ -118,7 +118,7 @@ public class SmsTemplateServiceTest extends BaseDbUnitTest { |
| 118 | 118 | // 断言 |
| 119 | 119 | assertNotNull(smsTemplateId); |
| 120 | 120 | // 校验记录的属性是否正确 |
| 121 | - SysSmsTemplateDO smsTemplate = smsTemplateMapper.selectById(smsTemplateId); | |
| 121 | + SmsTemplateDO smsTemplate = smsTemplateMapper.selectById(smsTemplateId); | |
| 122 | 122 | assertPojoEquals(reqVO, smsTemplate); |
| 123 | 123 | assertEquals(Lists.newArrayList("operation", "code"), smsTemplate.getParams()); |
| 124 | 124 | assertEquals(channelDO.getCode(), smsTemplate.getChannelCode()); |
| ... | ... | @@ -130,17 +130,17 @@ public class SmsTemplateServiceTest extends BaseDbUnitTest { |
| 130 | 130 | @SuppressWarnings("unchecked") |
| 131 | 131 | public void testUpdateSmsTemplate_success() { |
| 132 | 132 | // mock 数据 |
| 133 | - SysSmsTemplateDO dbSmsTemplate = randomSmsTemplateDO(); | |
| 133 | + SmsTemplateDO dbSmsTemplate = randomSmsTemplateDO(); | |
| 134 | 134 | smsTemplateMapper.insert(dbSmsTemplate);// @Sql: 先插入出一条存在的数据 |
| 135 | 135 | // 准备参数 |
| 136 | 136 | SmsTemplateUpdateReqVO reqVO = randomPojo(SmsTemplateUpdateReqVO.class, o -> { |
| 137 | 137 | o.setId(dbSmsTemplate.getId()); // 设置更新的 ID |
| 138 | 138 | o.setContent("正在进行登录操作{operation},您的验证码是{code}"); |
| 139 | 139 | o.setStatus(randomEle(CommonStatusEnum.values()).getStatus()); // 保证 status 的范围 |
| 140 | - o.setType(randomEle(SysSmsTemplateTypeEnum.values()).getType()); // 保证 type 的 范围 | |
| 140 | + o.setType(randomEle(SmsTemplateTypeEnum.values()).getType()); // 保证 type 的 范围 | |
| 141 | 141 | }); |
| 142 | 142 | // mock 方法 |
| 143 | - SysSmsChannelDO channelDO = randomPojo(SysSmsChannelDO.class, o -> { | |
| 143 | + SmsChannelDO channelDO = randomPojo(SmsChannelDO.class, o -> { | |
| 144 | 144 | o.setId(reqVO.getChannelId()); |
| 145 | 145 | o.setStatus(CommonStatusEnum.ENABLE.getStatus()); // 保证 status 开启,创建必须处于这个状态 |
| 146 | 146 | }); |
| ... | ... | @@ -153,7 +153,7 @@ public class SmsTemplateServiceTest extends BaseDbUnitTest { |
| 153 | 153 | // 调用 |
| 154 | 154 | smsTemplateService.updateSmsTemplate(reqVO); |
| 155 | 155 | // 校验是否更新正确 |
| 156 | - SysSmsTemplateDO smsTemplate = smsTemplateMapper.selectById(reqVO.getId()); // 获取最新的 | |
| 156 | + SmsTemplateDO smsTemplate = smsTemplateMapper.selectById(reqVO.getId()); // 获取最新的 | |
| 157 | 157 | assertPojoEquals(reqVO, smsTemplate); |
| 158 | 158 | assertEquals(Lists.newArrayList("operation", "code"), smsTemplate.getParams()); |
| 159 | 159 | assertEquals(channelDO.getCode(), smsTemplate.getChannelCode()); |
| ... | ... | @@ -173,7 +173,7 @@ public class SmsTemplateServiceTest extends BaseDbUnitTest { |
| 173 | 173 | @Test |
| 174 | 174 | public void testDeleteSmsTemplate_success() { |
| 175 | 175 | // mock 数据 |
| 176 | - SysSmsTemplateDO dbSmsTemplate = randomSmsTemplateDO(); | |
| 176 | + SmsTemplateDO dbSmsTemplate = randomSmsTemplateDO(); | |
| 177 | 177 | smsTemplateMapper.insert(dbSmsTemplate);// @Sql: 先插入出一条存在的数据 |
| 178 | 178 | // 准备参数 |
| 179 | 179 | Long id = dbSmsTemplate.getId(); |
| ... | ... | @@ -198,8 +198,8 @@ public class SmsTemplateServiceTest extends BaseDbUnitTest { |
| 198 | 198 | @Test |
| 199 | 199 | public void testGetSmsTemplatePage() { |
| 200 | 200 | // mock 数据 |
| 201 | - SysSmsTemplateDO dbSmsTemplate = randomPojo(SysSmsTemplateDO.class, o -> { // 等会查询到 | |
| 202 | - o.setType(SysSmsTemplateTypeEnum.PROMOTION.getType()); | |
| 201 | + SmsTemplateDO dbSmsTemplate = randomPojo(SmsTemplateDO.class, o -> { // 等会查询到 | |
| 202 | + o.setType(SmsTemplateTypeEnum.PROMOTION.getType()); | |
| 203 | 203 | o.setStatus(CommonStatusEnum.ENABLE.getStatus()); |
| 204 | 204 | o.setCode("yudaoyuanma"); |
| 205 | 205 | o.setContent("芋道源码"); |
| ... | ... | @@ -209,7 +209,7 @@ public class SmsTemplateServiceTest extends BaseDbUnitTest { |
| 209 | 209 | }); |
| 210 | 210 | smsTemplateMapper.insert(dbSmsTemplate); |
| 211 | 211 | // 测试 type 不匹配 |
| 212 | - smsTemplateMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsTemplate, o -> o.setType(SysSmsTemplateTypeEnum.VERIFICATION_CODE.getType()))); | |
| 212 | + smsTemplateMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsTemplate, o -> o.setType(SmsTemplateTypeEnum.VERIFICATION_CODE.getType()))); | |
| 213 | 213 | // 测试 status 不匹配 |
| 214 | 214 | smsTemplateMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsTemplate, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus()))); |
| 215 | 215 | // 测试 code 不匹配 |
| ... | ... | @@ -224,7 +224,7 @@ public class SmsTemplateServiceTest extends BaseDbUnitTest { |
| 224 | 224 | smsTemplateMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsTemplate, o -> o.setCreateTime(buildTime(2021, 12, 12)))); |
| 225 | 225 | // 准备参数 |
| 226 | 226 | SmsTemplatePageReqVO reqVO = new SmsTemplatePageReqVO(); |
| 227 | - reqVO.setType(SysSmsTemplateTypeEnum.PROMOTION.getType()); | |
| 227 | + reqVO.setType(SmsTemplateTypeEnum.PROMOTION.getType()); | |
| 228 | 228 | reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); |
| 229 | 229 | reqVO.setCode("yudao"); |
| 230 | 230 | reqVO.setContent("芋道"); |
| ... | ... | @@ -234,7 +234,7 @@ public class SmsTemplateServiceTest extends BaseDbUnitTest { |
| 234 | 234 | reqVO.setEndCreateTime(buildTime(2021, 12, 1)); |
| 235 | 235 | |
| 236 | 236 | // 调用 |
| 237 | - PageResult<SysSmsTemplateDO> pageResult = smsTemplateService.getSmsTemplatePage(reqVO); | |
| 237 | + PageResult<SmsTemplateDO> pageResult = smsTemplateService.getSmsTemplatePage(reqVO); | |
| 238 | 238 | // 断言 |
| 239 | 239 | assertEquals(1, pageResult.getTotal()); |
| 240 | 240 | assertEquals(1, pageResult.getList().size()); |
| ... | ... | @@ -244,8 +244,8 @@ public class SmsTemplateServiceTest extends BaseDbUnitTest { |
| 244 | 244 | @Test |
| 245 | 245 | public void testGetSmsTemplateList() { |
| 246 | 246 | // mock 数据 |
| 247 | - SysSmsTemplateDO dbSmsTemplate = randomPojo(SysSmsTemplateDO.class, o -> { // 等会查询到 | |
| 248 | - o.setType(SysSmsTemplateTypeEnum.PROMOTION.getType()); | |
| 247 | + SmsTemplateDO dbSmsTemplate = randomPojo(SmsTemplateDO.class, o -> { // 等会查询到 | |
| 248 | + o.setType(SmsTemplateTypeEnum.PROMOTION.getType()); | |
| 249 | 249 | o.setStatus(CommonStatusEnum.ENABLE.getStatus()); |
| 250 | 250 | o.setCode("yudaoyuanma"); |
| 251 | 251 | o.setContent("芋道源码"); |
| ... | ... | @@ -255,7 +255,7 @@ public class SmsTemplateServiceTest extends BaseDbUnitTest { |
| 255 | 255 | }); |
| 256 | 256 | smsTemplateMapper.insert(dbSmsTemplate); |
| 257 | 257 | // 测试 type 不匹配 |
| 258 | - smsTemplateMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsTemplate, o -> o.setType(SysSmsTemplateTypeEnum.VERIFICATION_CODE.getType()))); | |
| 258 | + smsTemplateMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsTemplate, o -> o.setType(SmsTemplateTypeEnum.VERIFICATION_CODE.getType()))); | |
| 259 | 259 | // 测试 status 不匹配 |
| 260 | 260 | smsTemplateMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsTemplate, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus()))); |
| 261 | 261 | // 测试 code 不匹配 |
| ... | ... | @@ -270,7 +270,7 @@ public class SmsTemplateServiceTest extends BaseDbUnitTest { |
| 270 | 270 | smsTemplateMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsTemplate, o -> o.setCreateTime(buildTime(2021, 12, 12)))); |
| 271 | 271 | // 准备参数 |
| 272 | 272 | SmsTemplateExportReqVO reqVO = new SmsTemplateExportReqVO(); |
| 273 | - reqVO.setType(SysSmsTemplateTypeEnum.PROMOTION.getType()); | |
| 273 | + reqVO.setType(SmsTemplateTypeEnum.PROMOTION.getType()); | |
| 274 | 274 | reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); |
| 275 | 275 | reqVO.setCode("yudao"); |
| 276 | 276 | reqVO.setContent("芋道"); |
| ... | ... | @@ -280,7 +280,7 @@ public class SmsTemplateServiceTest extends BaseDbUnitTest { |
| 280 | 280 | reqVO.setEndCreateTime(buildTime(2021, 12, 1)); |
| 281 | 281 | |
| 282 | 282 | // 调用 |
| 283 | - List<SysSmsTemplateDO> list = smsTemplateService.getSmsTemplateList(reqVO); | |
| 283 | + List<SmsTemplateDO> list = smsTemplateService.getSmsTemplateList(reqVO); | |
| 284 | 284 | // 断言 |
| 285 | 285 | assertEquals(1, list.size()); |
| 286 | 286 | assertPojoEquals(dbSmsTemplate, list.get(0)); |
| ... | ... | @@ -291,14 +291,14 @@ public class SmsTemplateServiceTest extends BaseDbUnitTest { |
| 291 | 291 | // 准备参数 |
| 292 | 292 | Long channelId = randomLongId(); |
| 293 | 293 | // mock 方法 |
| 294 | - SysSmsChannelDO channelDO = randomPojo(SysSmsChannelDO.class, o -> { | |
| 294 | + SmsChannelDO channelDO = randomPojo(SmsChannelDO.class, o -> { | |
| 295 | 295 | o.setId(channelId); |
| 296 | 296 | o.setStatus(CommonStatusEnum.ENABLE.getStatus()); // 保证 status 开启,创建必须处于这个状态 |
| 297 | 297 | }); |
| 298 | 298 | when(smsChannelService.getSmsChannel(eq(channelId))).thenReturn(channelDO); |
| 299 | 299 | |
| 300 | 300 | // 调用 |
| 301 | - SysSmsChannelDO returnChannelDO = smsTemplateService.checkSmsChannel(channelId); | |
| 301 | + SmsChannelDO returnChannelDO = smsTemplateService.checkSmsChannel(channelId); | |
| 302 | 302 | // 断言 |
| 303 | 303 | assertPojoEquals(returnChannelDO, channelDO); |
| 304 | 304 | } |
| ... | ... | @@ -318,7 +318,7 @@ public class SmsTemplateServiceTest extends BaseDbUnitTest { |
| 318 | 318 | // 准备参数 |
| 319 | 319 | Long channelId = randomLongId(); |
| 320 | 320 | // mock 方法 |
| 321 | - SysSmsChannelDO channelDO = randomPojo(SysSmsChannelDO.class, o -> { | |
| 321 | + SmsChannelDO channelDO = randomPojo(SmsChannelDO.class, o -> { | |
| 322 | 322 | o.setId(channelId); |
| 323 | 323 | o.setStatus(CommonStatusEnum.DISABLE.getStatus()); // 保证 status 禁用,触发失败 |
| 324 | 324 | }); |
| ... | ... | @@ -363,12 +363,12 @@ public class SmsTemplateServiceTest extends BaseDbUnitTest { |
| 363 | 363 | // ========== 随机对象 ========== |
| 364 | 364 | |
| 365 | 365 | @SafeVarargs |
| 366 | - private static SysSmsTemplateDO randomSmsTemplateDO(Consumer<SysSmsTemplateDO>... consumers) { | |
| 367 | - Consumer<SysSmsTemplateDO> consumer = (o) -> { | |
| 366 | + private static SmsTemplateDO randomSmsTemplateDO(Consumer<SmsTemplateDO>... consumers) { | |
| 367 | + Consumer<SmsTemplateDO> consumer = (o) -> { | |
| 368 | 368 | o.setStatus(randomEle(CommonStatusEnum.values()).getStatus()); // 保证 status 的范围 |
| 369 | - o.setType(randomEle(SysSmsTemplateTypeEnum.values()).getType()); // 保证 type 的 范围 | |
| 369 | + o.setType(randomEle(SmsTemplateTypeEnum.values()).getType()); // 保证 type 的 范围 | |
| 370 | 370 | }; |
| 371 | - return randomPojo(SysSmsTemplateDO.class, ArrayUtils.append(consumer, consumers)); | |
| 371 | + return randomPojo(SmsTemplateDO.class, ArrayUtils.append(consumer, consumers)); | |
| 372 | 372 | } |
| 373 | 373 | |
| 374 | 374 | } | ... | ... |
yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/social/SocialUserServiceTest.java
| 1 | 1 | package cn.iocoder.yudao.module.system.service.social; |
| 2 | 2 | |
| 3 | -import cn.iocoder.yudao.module.system.dal.dataobject.social.SysSocialUserDO; | |
| 4 | -import cn.iocoder.yudao.module.system.dal.mysql.social.SysSocialUserMapper; | |
| 3 | +import cn.iocoder.yudao.module.system.dal.dataobject.social.SocialUserDO; | |
| 4 | +import cn.iocoder.yudao.module.system.dal.mysql.social.SocialUserMapper; | |
| 5 | 5 | import cn.iocoder.yudao.module.system.dal.redis.social.SocialAuthUserRedisDAO; |
| 6 | 6 | import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum; |
| 7 | 7 | import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; |
| ... | ... | @@ -29,13 +29,13 @@ public class SocialUserServiceTest extends BaseDbAndRedisUnitTest { |
| 29 | 29 | private SocialUserServiceImpl socialService; |
| 30 | 30 | |
| 31 | 31 | @Resource |
| 32 | - private SysSocialUserMapper socialUserMapper; | |
| 32 | + private SocialUserMapper socialUserMapper; | |
| 33 | 33 | |
| 34 | 34 | @MockBean |
| 35 | 35 | private AuthRequestFactory authRequestFactory; |
| 36 | 36 | |
| 37 | 37 | /** |
| 38 | - * 情况一,创建 SysSocialUserDO 的情况 | |
| 38 | + * 情况一,创建 SocialUserDO 的情况 | |
| 39 | 39 | */ |
| 40 | 40 | @Test |
| 41 | 41 | public void testBindSocialUser_create() { |
| ... | ... | @@ -49,18 +49,18 @@ public class SocialUserServiceTest extends BaseDbAndRedisUnitTest { |
| 49 | 49 | // 调用 |
| 50 | 50 | socialService.bindSocialUser(userId, UserTypeEnum.ADMIN.getValue(), type, authUser); |
| 51 | 51 | // 断言 |
| 52 | - List<SysSocialUserDO> socialUsers = socialUserMapper.selectList("user_id", userId); | |
| 52 | + List<SocialUserDO> socialUsers = socialUserMapper.selectList("user_id", userId); | |
| 53 | 53 | assertEquals(1, socialUsers.size()); |
| 54 | 54 | assertBindSocialUser(socialUsers.get(0), authUser, userId, type); |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | /** |
| 58 | - * 情况二,更新 SysSocialUserDO 的情况 | |
| 58 | + * 情况二,更新 SocialUserDO 的情况 | |
| 59 | 59 | */ |
| 60 | 60 | @Test |
| 61 | 61 | public void testBindSocialUser_update() { |
| 62 | 62 | // mock 数据 |
| 63 | - SysSocialUserDO dbSocialUser = randomPojo(SysSocialUserDO.class, socialUserDO -> { | |
| 63 | + SocialUserDO dbSocialUser = randomPojo(SocialUserDO.class, socialUserDO -> { | |
| 64 | 64 | socialUserDO.setUserType(UserTypeEnum.ADMIN.getValue()); |
| 65 | 65 | socialUserDO.setType(randomEle(SocialTypeEnum.values()).getType()); |
| 66 | 66 | }); |
| ... | ... | @@ -74,7 +74,7 @@ public class SocialUserServiceTest extends BaseDbAndRedisUnitTest { |
| 74 | 74 | // 调用 |
| 75 | 75 | socialService.bindSocialUser(userId, UserTypeEnum.ADMIN.getValue(), type, authUser); |
| 76 | 76 | // 断言 |
| 77 | - List<SysSocialUserDO> socialUsers = socialUserMapper.selectList("user_id", userId); | |
| 77 | + List<SocialUserDO> socialUsers = socialUserMapper.selectList("user_id", userId); | |
| 78 | 78 | assertEquals(1, socialUsers.size()); |
| 79 | 79 | assertBindSocialUser(socialUsers.get(0), authUser, userId, type); |
| 80 | 80 | } |
| ... | ... | @@ -85,7 +85,7 @@ public class SocialUserServiceTest extends BaseDbAndRedisUnitTest { |
| 85 | 85 | @Test |
| 86 | 86 | public void testBindSocialUser_userId() { |
| 87 | 87 | // mock 数据 |
| 88 | - SysSocialUserDO dbSocialUser = randomPojo(SysSocialUserDO.class, socialUserDO -> { | |
| 88 | + SocialUserDO dbSocialUser = randomPojo(SocialUserDO.class, socialUserDO -> { | |
| 89 | 89 | socialUserDO.setUserType(UserTypeEnum.ADMIN.getValue()); |
| 90 | 90 | socialUserDO.setType(randomEle(SocialTypeEnum.values()).getType()); |
| 91 | 91 | }); |
| ... | ... | @@ -99,12 +99,12 @@ public class SocialUserServiceTest extends BaseDbAndRedisUnitTest { |
| 99 | 99 | // 调用 |
| 100 | 100 | socialService.bindSocialUser(userId, UserTypeEnum.ADMIN.getValue(), type, authUser); |
| 101 | 101 | // 断言 |
| 102 | - List<SysSocialUserDO> socialUsers = socialUserMapper.selectList("user_id", userId); | |
| 102 | + List<SocialUserDO> socialUsers = socialUserMapper.selectList("user_id", userId); | |
| 103 | 103 | assertEquals(1, socialUsers.size()); |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | - private void assertBindSocialUser(SysSocialUserDO socialUser, AuthUser authUser, Long userId, | |
| 107 | - Integer type) { | |
| 106 | + private void assertBindSocialUser(SocialUserDO socialUser, AuthUser authUser, Long userId, | |
| 107 | + Integer type) { | |
| 108 | 108 | assertEquals(authUser.getToken().getAccessToken(), socialUser.getToken()); |
| 109 | 109 | assertEquals(toJsonString(authUser.getToken()), socialUser.getRawTokenInfo()); |
| 110 | 110 | assertEquals(authUser.getNickname(), socialUser.getNickname()); |
| ... | ... | @@ -123,7 +123,7 @@ public class SocialUserServiceTest extends BaseDbAndRedisUnitTest { |
| 123 | 123 | @Test |
| 124 | 124 | public void testUnbindOldSocialUser_no() { |
| 125 | 125 | // mock 数据 |
| 126 | - SysSocialUserDO oldSocialUser = randomPojo(SysSocialUserDO.class, socialUserDO -> { | |
| 126 | + SocialUserDO oldSocialUser = randomPojo(SocialUserDO.class, socialUserDO -> { | |
| 127 | 127 | socialUserDO.setUserType(UserTypeEnum.ADMIN.getValue()); |
| 128 | 128 | socialUserDO.setType(randomEle(SocialTypeEnum.values()).getType()); |
| 129 | 129 | }); |
| ... | ... | @@ -146,7 +146,7 @@ public class SocialUserServiceTest extends BaseDbAndRedisUnitTest { |
| 146 | 146 | @Test |
| 147 | 147 | public void testUnbindOldSocialUser_yes() { |
| 148 | 148 | // mock 数据 |
| 149 | - SysSocialUserDO oldSocialUser = randomPojo(SysSocialUserDO.class, socialUserDO -> { | |
| 149 | + SocialUserDO oldSocialUser = randomPojo(SocialUserDO.class, socialUserDO -> { | |
| 150 | 150 | socialUserDO.setUserType(UserTypeEnum.ADMIN.getValue()); |
| 151 | 151 | socialUserDO.setType(randomEle(SocialTypeEnum.values()).getType()); |
| 152 | 152 | }); | ... | ... |
yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceTest.java
| ... | ... | @@ -4,8 +4,8 @@ import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.TenantCreateReq |
| 4 | 4 | import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.TenantExportReqVO; |
| 5 | 5 | import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.TenantPageReqVO; |
| 6 | 6 | import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.TenantUpdateReqVO; |
| 7 | -import cn.iocoder.yudao.module.system.dal.mysql.tenant.SysTenantMapper; | |
| 8 | -import cn.iocoder.yudao.module.system.dal.dataobject.tenant.SysTenantDO; | |
| 7 | +import cn.iocoder.yudao.module.system.dal.dataobject.tenant.TenantDO; | |
| 8 | +import cn.iocoder.yudao.module.system.dal.mysql.tenant.TenantMapper; | |
| 9 | 9 | import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; |
| 10 | 10 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 11 | 11 | import cn.iocoder.yudao.module.system.test.BaseDbUnitTest; |
| ... | ... | @@ -30,7 +30,7 @@ public class TenantServiceTest extends BaseDbUnitTest { |
| 30 | 30 | private TenantServiceImpl tenantService; |
| 31 | 31 | |
| 32 | 32 | @Resource |
| 33 | - private SysTenantMapper tenantMapper; | |
| 33 | + private TenantMapper tenantMapper; | |
| 34 | 34 | |
| 35 | 35 | @Test |
| 36 | 36 | public void testCreateTenant_success() { |
| ... | ... | @@ -42,14 +42,14 @@ public class TenantServiceTest extends BaseDbUnitTest { |
| 42 | 42 | // 断言 |
| 43 | 43 | assertNotNull(tenantId); |
| 44 | 44 | // 校验记录的属性是否正确 |
| 45 | - SysTenantDO tenant = tenantMapper.selectById(tenantId); | |
| 45 | + TenantDO tenant = tenantMapper.selectById(tenantId); | |
| 46 | 46 | assertPojoEquals(reqVO, tenant); |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | @Test |
| 50 | 50 | public void testUpdateTenant_success() { |
| 51 | 51 | // mock 数据 |
| 52 | - SysTenantDO dbTenant = randomPojo(SysTenantDO.class, o -> o.setStatus(randomCommonStatus())); | |
| 52 | + TenantDO dbTenant = randomPojo(TenantDO.class, o -> o.setStatus(randomCommonStatus())); | |
| 53 | 53 | tenantMapper.insert(dbTenant);// @Sql: 先插入出一条存在的数据 |
| 54 | 54 | // 准备参数 |
| 55 | 55 | TenantUpdateReqVO reqVO = randomPojo(TenantUpdateReqVO.class, o -> { |
| ... | ... | @@ -60,7 +60,7 @@ public class TenantServiceTest extends BaseDbUnitTest { |
| 60 | 60 | // 调用 |
| 61 | 61 | tenantService.updateTenant(reqVO); |
| 62 | 62 | // 校验是否更新正确 |
| 63 | - SysTenantDO tenant = tenantMapper.selectById(reqVO.getId()); // 获取最新的 | |
| 63 | + TenantDO tenant = tenantMapper.selectById(reqVO.getId()); // 获取最新的 | |
| 64 | 64 | assertPojoEquals(reqVO, tenant); |
| 65 | 65 | } |
| 66 | 66 | |
| ... | ... | @@ -76,7 +76,7 @@ public class TenantServiceTest extends BaseDbUnitTest { |
| 76 | 76 | @Test |
| 77 | 77 | public void testDeleteTenant_success() { |
| 78 | 78 | // mock 数据 |
| 79 | - SysTenantDO dbTenant = randomPojo(SysTenantDO.class, | |
| 79 | + TenantDO dbTenant = randomPojo(TenantDO.class, | |
| 80 | 80 | o -> o.setStatus(randomCommonStatus())); |
| 81 | 81 | tenantMapper.insert(dbTenant);// @Sql: 先插入出一条存在的数据 |
| 82 | 82 | // 准备参数 |
| ... | ... | @@ -100,7 +100,7 @@ public class TenantServiceTest extends BaseDbUnitTest { |
| 100 | 100 | @Test |
| 101 | 101 | public void testGetTenantPage() { |
| 102 | 102 | // mock 数据 |
| 103 | - SysTenantDO dbTenant = randomPojo(SysTenantDO.class, o -> { // 等会查询到 | |
| 103 | + TenantDO dbTenant = randomPojo(TenantDO.class, o -> { // 等会查询到 | |
| 104 | 104 | o.setName("芋道源码"); |
| 105 | 105 | o.setContactName("芋艿"); |
| 106 | 106 | o.setContactMobile("15601691300"); |
| ... | ... | @@ -128,7 +128,7 @@ public class TenantServiceTest extends BaseDbUnitTest { |
| 128 | 128 | reqVO.setEndCreateTime(buildTime(2020, 12, 24)); |
| 129 | 129 | |
| 130 | 130 | // 调用 |
| 131 | - PageResult<SysTenantDO> pageResult = tenantService.getTenantPage(reqVO); | |
| 131 | + PageResult<TenantDO> pageResult = tenantService.getTenantPage(reqVO); | |
| 132 | 132 | // 断言 |
| 133 | 133 | assertEquals(1, pageResult.getTotal()); |
| 134 | 134 | assertEquals(1, pageResult.getList().size()); |
| ... | ... | @@ -138,7 +138,7 @@ public class TenantServiceTest extends BaseDbUnitTest { |
| 138 | 138 | @Test |
| 139 | 139 | public void testGetTenantList() { |
| 140 | 140 | // mock 数据 |
| 141 | - SysTenantDO dbTenant = randomPojo(SysTenantDO.class, o -> { // 等会查询到 | |
| 141 | + TenantDO dbTenant = randomPojo(TenantDO.class, o -> { // 等会查询到 | |
| 142 | 142 | o.setName("芋道源码"); |
| 143 | 143 | o.setContactName("芋艿"); |
| 144 | 144 | o.setContactMobile("15601691300"); |
| ... | ... | @@ -166,7 +166,7 @@ public class TenantServiceTest extends BaseDbUnitTest { |
| 166 | 166 | reqVO.setEndCreateTime(buildTime(2020, 12, 24)); |
| 167 | 167 | |
| 168 | 168 | // 调用 |
| 169 | - List<SysTenantDO> list = tenantService.getTenantList(reqVO); | |
| 169 | + List<TenantDO> list = tenantService.getTenantList(reqVO); | |
| 170 | 170 | // 断言 |
| 171 | 171 | assertEquals(1, list.size()); |
| 172 | 172 | assertPojoEquals(dbTenant, list.get(0)); | ... | ... |
yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/user/UserServiceImplTest.java
| ... | ... | @@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.system.service.user; |
| 3 | 3 | import cn.hutool.core.util.RandomUtil; |
| 4 | 4 | import cn.iocoder.yudao.coreservice.modules.infra.service.file.InfFileCoreService; |
| 5 | 5 | import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; |
| 6 | +import cn.iocoder.yudao.framework.common.exception.ServiceException; | |
| 6 | 7 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 7 | 8 | import cn.iocoder.yudao.framework.common.util.collection.ArrayUtils; |
| 8 | 9 | import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; |
| ... | ... | @@ -10,11 +11,11 @@ import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; |
| 10 | 11 | import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfileUpdatePasswordReqVO; |
| 11 | 12 | import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfileUpdateReqVO; |
| 12 | 13 | import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.*; |
| 13 | -import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysDeptDO; | |
| 14 | -import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysPostDO; | |
| 14 | +import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO; | |
| 15 | +import cn.iocoder.yudao.module.system.dal.dataobject.dept.PostDO; | |
| 15 | 16 | import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; |
| 16 | 17 | import cn.iocoder.yudao.module.system.dal.mysql.user.AdminUserMapper; |
| 17 | -import cn.iocoder.yudao.module.system.enums.common.SysSexEnum; | |
| 18 | +import cn.iocoder.yudao.module.system.enums.common.SexEnum; | |
| 18 | 19 | import cn.iocoder.yudao.module.system.service.dept.DeptService; |
| 19 | 20 | import cn.iocoder.yudao.module.system.service.dept.PostService; |
| 20 | 21 | import cn.iocoder.yudao.module.system.service.permission.PermissionService; |
| ... | ... | @@ -68,18 +69,18 @@ public class UserServiceImplTest extends BaseDbUnitTest { |
| 68 | 69 | public void testCreatUser_success() { |
| 69 | 70 | // 准备参数 |
| 70 | 71 | UserCreateReqVO reqVO = randomPojo(UserCreateReqVO.class, o -> { |
| 71 | - o.setSex(RandomUtil.randomEle(SysSexEnum.values()).getSex()); | |
| 72 | + o.setSex(RandomUtil.randomEle(SexEnum.values()).getSex()); | |
| 72 | 73 | o.setMobile(randomString()); |
| 73 | 74 | }); |
| 74 | 75 | // mock deptService 的方法 |
| 75 | - SysDeptDO dept = randomPojo(SysDeptDO.class, o -> { | |
| 76 | + DeptDO dept = randomPojo(DeptDO.class, o -> { | |
| 76 | 77 | o.setId(reqVO.getDeptId()); |
| 77 | 78 | o.setStatus(CommonStatusEnum.ENABLE.getStatus()); |
| 78 | 79 | }); |
| 79 | 80 | when(deptService.getDept(eq(dept.getId()))).thenReturn(dept); |
| 80 | 81 | // mock postService 的方法 |
| 81 | - List<SysPostDO> posts = CollectionUtils.convertList(reqVO.getPostIds(), postId -> | |
| 82 | - randomPojo(SysPostDO.class, o -> { | |
| 82 | + List<PostDO> posts = CollectionUtils.convertList(reqVO.getPostIds(), postId -> | |
| 83 | + randomPojo(PostDO.class, o -> { | |
| 83 | 84 | o.setId(postId); |
| 84 | 85 | o.setStatus(CommonStatusEnum.ENABLE.getStatus()); |
| 85 | 86 | })); |
| ... | ... | @@ -99,23 +100,23 @@ public class UserServiceImplTest extends BaseDbUnitTest { |
| 99 | 100 | @Test |
| 100 | 101 | public void testUpdateUser_success() { |
| 101 | 102 | // mock 数据 |
| 102 | - AdminUserDO dbUser = randomSysUserDO(); | |
| 103 | + AdminUserDO dbUser = randomAdminUserDO(); | |
| 103 | 104 | userMapper.insert(dbUser); |
| 104 | 105 | // 准备参数 |
| 105 | 106 | UserUpdateReqVO reqVO = randomPojo(UserUpdateReqVO.class, o -> { |
| 106 | 107 | o.setId(dbUser.getId()); |
| 107 | - o.setSex(RandomUtil.randomEle(SysSexEnum.values()).getSex()); | |
| 108 | + o.setSex(RandomUtil.randomEle(SexEnum.values()).getSex()); | |
| 108 | 109 | o.setMobile(randomString()); |
| 109 | 110 | }); |
| 110 | 111 | // mock deptService 的方法 |
| 111 | - SysDeptDO dept = randomPojo(SysDeptDO.class, o -> { | |
| 112 | + DeptDO dept = randomPojo(DeptDO.class, o -> { | |
| 112 | 113 | o.setId(reqVO.getDeptId()); |
| 113 | 114 | o.setStatus(CommonStatusEnum.ENABLE.getStatus()); |
| 114 | 115 | }); |
| 115 | 116 | when(deptService.getDept(eq(dept.getId()))).thenReturn(dept); |
| 116 | 117 | // mock postService 的方法 |
| 117 | - List<SysPostDO> posts = CollectionUtils.convertList(reqVO.getPostIds(), postId -> | |
| 118 | - randomPojo(SysPostDO.class, o -> { | |
| 118 | + List<PostDO> posts = CollectionUtils.convertList(reqVO.getPostIds(), postId -> | |
| 119 | + randomPojo(PostDO.class, o -> { | |
| 119 | 120 | o.setId(postId); |
| 120 | 121 | o.setStatus(CommonStatusEnum.ENABLE.getStatus()); |
| 121 | 122 | })); |
| ... | ... | @@ -131,13 +132,13 @@ public class UserServiceImplTest extends BaseDbUnitTest { |
| 131 | 132 | @Test |
| 132 | 133 | public void testUpdateUserProfile_success() { |
| 133 | 134 | // mock 数据 |
| 134 | - AdminUserDO dbUser = randomSysUserDO(); | |
| 135 | + AdminUserDO dbUser = randomAdminUserDO(); | |
| 135 | 136 | userMapper.insert(dbUser); |
| 136 | 137 | // 准备参数 |
| 137 | 138 | Long userId = dbUser.getId(); |
| 138 | 139 | UserProfileUpdateReqVO reqVO = randomPojo(UserProfileUpdateReqVO.class, o -> { |
| 139 | 140 | o.setMobile(randomString()); |
| 140 | - o.setSex(RandomUtil.randomEle(SysSexEnum.values()).getSex()); | |
| 141 | + o.setSex(RandomUtil.randomEle(SexEnum.values()).getSex()); | |
| 141 | 142 | }); |
| 142 | 143 | |
| 143 | 144 | // 调用 |
| ... | ... | @@ -150,7 +151,7 @@ public class UserServiceImplTest extends BaseDbUnitTest { |
| 150 | 151 | @Test |
| 151 | 152 | public void testUpdateUserPassword_success() { |
| 152 | 153 | // mock 数据 |
| 153 | - AdminUserDO dbUser = randomSysUserDO(o -> o.setPassword("encode:yudao")); | |
| 154 | + AdminUserDO dbUser = randomAdminUserDO(o -> o.setPassword("encode:yudao")); | |
| 154 | 155 | userMapper.insert(dbUser); |
| 155 | 156 | // 准备参数 |
| 156 | 157 | Long userId = dbUser.getId(); |
| ... | ... | @@ -173,7 +174,7 @@ public class UserServiceImplTest extends BaseDbUnitTest { |
| 173 | 174 | @Test |
| 174 | 175 | public void testUpdateUserAvatar_success() { |
| 175 | 176 | // mock 数据 |
| 176 | - AdminUserDO dbUser = randomSysUserDO(); | |
| 177 | + AdminUserDO dbUser = randomAdminUserDO(); | |
| 177 | 178 | userMapper.insert(dbUser); |
| 178 | 179 | // 准备参数 |
| 179 | 180 | Long userId = dbUser.getId(); |
| ... | ... | @@ -193,7 +194,7 @@ public class UserServiceImplTest extends BaseDbUnitTest { |
| 193 | 194 | @Test |
| 194 | 195 | public void testUpdateUserPassword02_success() { |
| 195 | 196 | // mock 数据 |
| 196 | - AdminUserDO dbUser = randomSysUserDO(); | |
| 197 | + AdminUserDO dbUser = randomAdminUserDO(); | |
| 197 | 198 | userMapper.insert(dbUser); |
| 198 | 199 | // 准备参数 |
| 199 | 200 | Long userId = dbUser.getId(); |
| ... | ... | @@ -212,7 +213,7 @@ public class UserServiceImplTest extends BaseDbUnitTest { |
| 212 | 213 | @Test |
| 213 | 214 | public void testUpdateUserStatus() { |
| 214 | 215 | // mock 数据 |
| 215 | - AdminUserDO dbUser = randomSysUserDO(); | |
| 216 | + AdminUserDO dbUser = randomAdminUserDO(); | |
| 216 | 217 | userMapper.insert(dbUser); |
| 217 | 218 | // 准备参数 |
| 218 | 219 | Long userId = dbUser.getId(); |
| ... | ... | @@ -228,7 +229,7 @@ public class UserServiceImplTest extends BaseDbUnitTest { |
| 228 | 229 | @Test |
| 229 | 230 | public void testDeleteUser_success(){ |
| 230 | 231 | // mock 数据 |
| 231 | - AdminUserDO dbUser = randomSysUserDO(); | |
| 232 | + AdminUserDO dbUser = randomAdminUserDO(); | |
| 232 | 233 | userMapper.insert(dbUser); |
| 233 | 234 | // 准备参数 |
| 234 | 235 | Long userId = dbUser.getId(); |
| ... | ... | @@ -254,7 +255,7 @@ public class UserServiceImplTest extends BaseDbUnitTest { |
| 254 | 255 | reqVO.setEndTime(buildTime(2020, 12, 24)); |
| 255 | 256 | reqVO.setDeptId(1L); // 其中,1L 是 2L 的父部门 |
| 256 | 257 | // mock 方法 |
| 257 | - List<SysDeptDO> deptList = newArrayList(randomPojo(SysDeptDO.class, o -> o.setId(2L))); | |
| 258 | + List<DeptDO> deptList = newArrayList(randomPojo(DeptDO.class, o -> o.setId(2L))); | |
| 258 | 259 | when(deptService.getDeptsByParentIdFromCache(eq(reqVO.getDeptId()), eq(true))).thenReturn(deptList); |
| 259 | 260 | |
| 260 | 261 | // 调用 |
| ... | ... | @@ -278,7 +279,7 @@ public class UserServiceImplTest extends BaseDbUnitTest { |
| 278 | 279 | reqVO.setEndTime(buildTime(2020, 12, 24)); |
| 279 | 280 | reqVO.setDeptId(1L); // 其中,1L 是 2L 的父部门 |
| 280 | 281 | // mock 方法 |
| 281 | - List<SysDeptDO> deptList = newArrayList(randomPojo(SysDeptDO.class, o -> o.setId(2L))); | |
| 282 | + List<DeptDO> deptList = newArrayList(randomPojo(DeptDO.class, o -> o.setId(2L))); | |
| 282 | 283 | when(deptService.getDeptsByParentIdFromCache(eq(reqVO.getDeptId()), eq(true))).thenReturn(deptList); |
| 283 | 284 | |
| 284 | 285 | // 调用 |
| ... | ... | @@ -293,7 +294,7 @@ public class UserServiceImplTest extends BaseDbUnitTest { |
| 293 | 294 | */ |
| 294 | 295 | private AdminUserDO initGetUserPageData() { |
| 295 | 296 | // mock 数据 |
| 296 | - AdminUserDO dbUser = randomSysUserDO(o -> { // 等会查询到 | |
| 297 | + AdminUserDO dbUser = randomAdminUserDO(o -> { // 等会查询到 | |
| 297 | 298 | o.setUsername("yudaoyuanma"); |
| 298 | 299 | o.setMobile("15601691300"); |
| 299 | 300 | o.setStatus(CommonStatusEnum.ENABLE.getStatus()); |
| ... | ... | @@ -320,8 +321,10 @@ public class UserServiceImplTest extends BaseDbUnitTest { |
| 320 | 321 | @Test |
| 321 | 322 | public void testImportUsers_01() { |
| 322 | 323 | // 准备参数 |
| 323 | - UserImportExcelVO importUser = randomPojo(UserImportExcelVO.class); | |
| 324 | - // mock 方法 | |
| 324 | + UserImportExcelVO importUser = randomPojo(UserImportExcelVO.class, o -> { | |
| 325 | + }); | |
| 326 | + // mock 方法,模拟失败 | |
| 327 | + doThrow(new ServiceException(DEPT_NOT_FOUND)).when(deptService).validDepts(any()); | |
| 325 | 328 | |
| 326 | 329 | // 调用 |
| 327 | 330 | UserImportRespVO respVO = userService.importUsers(newArrayList(importUser), true); |
| ... | ... | @@ -340,10 +343,10 @@ public class UserServiceImplTest extends BaseDbUnitTest { |
| 340 | 343 | // 准备参数 |
| 341 | 344 | UserImportExcelVO importUser = randomPojo(UserImportExcelVO.class, o -> { |
| 342 | 345 | o.setStatus(randomEle(CommonStatusEnum.values()).getStatus()); // 保证 status 的范围 |
| 343 | - o.setSex(randomEle(SysSexEnum.values()).getSex()); // 保证 sex 的范围 | |
| 346 | + o.setSex(randomEle(SexEnum.values()).getSex()); // 保证 sex 的范围 | |
| 344 | 347 | }); |
| 345 | 348 | // mock deptService 的方法 |
| 346 | - SysDeptDO dept = randomPojo(SysDeptDO.class, o -> { | |
| 349 | + DeptDO dept = randomPojo(DeptDO.class, o -> { | |
| 347 | 350 | o.setId(importUser.getDeptId()); |
| 348 | 351 | o.setStatus(CommonStatusEnum.ENABLE.getStatus()); |
| 349 | 352 | }); |
| ... | ... | @@ -368,16 +371,16 @@ public class UserServiceImplTest extends BaseDbUnitTest { |
| 368 | 371 | @Test |
| 369 | 372 | public void testImportUsers_03() { |
| 370 | 373 | // mock 数据 |
| 371 | - AdminUserDO dbUser = randomSysUserDO(); | |
| 374 | + AdminUserDO dbUser = randomAdminUserDO(); | |
| 372 | 375 | userMapper.insert(dbUser); |
| 373 | 376 | // 准备参数 |
| 374 | 377 | UserImportExcelVO importUser = randomPojo(UserImportExcelVO.class, o -> { |
| 375 | 378 | o.setStatus(randomEle(CommonStatusEnum.values()).getStatus()); // 保证 status 的范围 |
| 376 | - o.setSex(randomEle(SysSexEnum.values()).getSex()); // 保证 sex 的范围 | |
| 379 | + o.setSex(randomEle(SexEnum.values()).getSex()); // 保证 sex 的范围 | |
| 377 | 380 | o.setUsername(dbUser.getUsername()); |
| 378 | 381 | }); |
| 379 | 382 | // mock deptService 的方法 |
| 380 | - SysDeptDO dept = randomPojo(SysDeptDO.class, o -> { | |
| 383 | + DeptDO dept = randomPojo(DeptDO.class, o -> { | |
| 381 | 384 | o.setId(importUser.getDeptId()); |
| 382 | 385 | o.setStatus(CommonStatusEnum.ENABLE.getStatus()); |
| 383 | 386 | }); |
| ... | ... | @@ -398,16 +401,16 @@ public class UserServiceImplTest extends BaseDbUnitTest { |
| 398 | 401 | @Test |
| 399 | 402 | public void testImportUsers_04() { |
| 400 | 403 | // mock 数据 |
| 401 | - AdminUserDO dbUser = randomSysUserDO(); | |
| 404 | + AdminUserDO dbUser = randomAdminUserDO(); | |
| 402 | 405 | userMapper.insert(dbUser); |
| 403 | 406 | // 准备参数 |
| 404 | 407 | UserImportExcelVO importUser = randomPojo(UserImportExcelVO.class, o -> { |
| 405 | 408 | o.setStatus(randomEle(CommonStatusEnum.values()).getStatus()); // 保证 status 的范围 |
| 406 | - o.setSex(randomEle(SysSexEnum.values()).getSex()); // 保证 sex 的范围 | |
| 409 | + o.setSex(randomEle(SexEnum.values()).getSex()); // 保证 sex 的范围 | |
| 407 | 410 | o.setUsername(dbUser.getUsername()); |
| 408 | 411 | }); |
| 409 | 412 | // mock deptService 的方法 |
| 410 | - SysDeptDO dept = randomPojo(SysDeptDO.class, o -> { | |
| 413 | + DeptDO dept = randomPojo(DeptDO.class, o -> { | |
| 411 | 414 | o.setId(importUser.getDeptId()); |
| 412 | 415 | o.setStatus(CommonStatusEnum.ENABLE.getStatus()); |
| 413 | 416 | }); |
| ... | ... | @@ -433,7 +436,7 @@ public class UserServiceImplTest extends BaseDbUnitTest { |
| 433 | 436 | // 准备参数 |
| 434 | 437 | String username = randomString(); |
| 435 | 438 | // mock 数据 |
| 436 | - userMapper.insert(randomSysUserDO(o -> o.setUsername(username))); | |
| 439 | + userMapper.insert(randomAdminUserDO(o -> o.setUsername(username))); | |
| 437 | 440 | |
| 438 | 441 | // 调用,校验异常 |
| 439 | 442 | assertServiceException(() -> userService.checkUsernameUnique(null, username), |
| ... | ... | @@ -446,7 +449,7 @@ public class UserServiceImplTest extends BaseDbUnitTest { |
| 446 | 449 | Long id = randomLongId(); |
| 447 | 450 | String username = randomString(); |
| 448 | 451 | // mock 数据 |
| 449 | - userMapper.insert(randomSysUserDO(o -> o.setUsername(username))); | |
| 452 | + userMapper.insert(randomAdminUserDO(o -> o.setUsername(username))); | |
| 450 | 453 | |
| 451 | 454 | // 调用,校验异常 |
| 452 | 455 | assertServiceException(() -> userService.checkUsernameUnique(id, username), |
| ... | ... | @@ -458,7 +461,7 @@ public class UserServiceImplTest extends BaseDbUnitTest { |
| 458 | 461 | // 准备参数 |
| 459 | 462 | String email = randomString(); |
| 460 | 463 | // mock 数据 |
| 461 | - userMapper.insert(randomSysUserDO(o -> o.setEmail(email))); | |
| 464 | + userMapper.insert(randomAdminUserDO(o -> o.setEmail(email))); | |
| 462 | 465 | |
| 463 | 466 | // 调用,校验异常 |
| 464 | 467 | assertServiceException(() -> userService.checkEmailUnique(null, email), |
| ... | ... | @@ -471,7 +474,7 @@ public class UserServiceImplTest extends BaseDbUnitTest { |
| 471 | 474 | Long id = randomLongId(); |
| 472 | 475 | String email = randomString(); |
| 473 | 476 | // mock 数据 |
| 474 | - userMapper.insert(randomSysUserDO(o -> o.setEmail(email))); | |
| 477 | + userMapper.insert(randomAdminUserDO(o -> o.setEmail(email))); | |
| 475 | 478 | |
| 476 | 479 | // 调用,校验异常 |
| 477 | 480 | assertServiceException(() -> userService.checkEmailUnique(id, email), |
| ... | ... | @@ -483,7 +486,7 @@ public class UserServiceImplTest extends BaseDbUnitTest { |
| 483 | 486 | // 准备参数 |
| 484 | 487 | String mobile = randomString(); |
| 485 | 488 | // mock 数据 |
| 486 | - userMapper.insert(randomSysUserDO(o -> o.setMobile(mobile))); | |
| 489 | + userMapper.insert(randomAdminUserDO(o -> o.setMobile(mobile))); | |
| 487 | 490 | |
| 488 | 491 | // 调用,校验异常 |
| 489 | 492 | assertServiceException(() -> userService.checkMobileUnique(null, mobile), |
| ... | ... | @@ -496,7 +499,7 @@ public class UserServiceImplTest extends BaseDbUnitTest { |
| 496 | 499 | Long id = randomLongId(); |
| 497 | 500 | String mobile = randomString(); |
| 498 | 501 | // mock 数据 |
| 499 | - userMapper.insert(randomSysUserDO(o -> o.setMobile(mobile))); | |
| 502 | + userMapper.insert(randomAdminUserDO(o -> o.setMobile(mobile))); | |
| 500 | 503 | |
| 501 | 504 | // 调用,校验异常 |
| 502 | 505 | assertServiceException(() -> userService.checkMobileUnique(id, mobile), |
| ... | ... | @@ -512,7 +515,7 @@ public class UserServiceImplTest extends BaseDbUnitTest { |
| 512 | 515 | @Test |
| 513 | 516 | public void testCheckOldPassword_passwordFailed() { |
| 514 | 517 | // mock 数据 |
| 515 | - AdminUserDO user = randomSysUserDO(); | |
| 518 | + AdminUserDO user = randomAdminUserDO(); | |
| 516 | 519 | userMapper.insert(user); |
| 517 | 520 | // 准备参数 |
| 518 | 521 | Long id = user.getId(); |
| ... | ... | @@ -530,13 +533,13 @@ public class UserServiceImplTest extends BaseDbUnitTest { |
| 530 | 533 | // // 准备参数 |
| 531 | 534 | // Collection<Long> postIds = asSet(10L, 20L); |
| 532 | 535 | // // mock 方法 |
| 533 | -// SysUserDO user1 = randomSysUserDO(o -> o.setPostIds(asSet(10L, 30L))); | |
| 536 | +// AdminUserDO user1 = randomAdminUserDO(o -> o.setPostIds(asSet(10L, 30L))); | |
| 534 | 537 | // userMapper.insert(user1); |
| 535 | -// SysUserDO user2 = randomSysUserDO(o -> o.setPostIds(singleton(100L))); | |
| 538 | +// AdminUserDO user2 = randomAdminUserDO(o -> o.setPostIds(singleton(100L))); | |
| 536 | 539 | // userMapper.insert(user2); |
| 537 | 540 | // |
| 538 | 541 | // // 调用 |
| 539 | -// List<SysUserDO> result = userService.getUsersByPostIds(postIds); | |
| 542 | +// List<AdminUserDO> result = userService.getUsersByPostIds(postIds); | |
| 540 | 543 | // // 断言 |
| 541 | 544 | // assertEquals(1, result.size()); |
| 542 | 545 | // assertEquals(user1, result.get(0)); |
| ... | ... | @@ -545,10 +548,10 @@ public class UserServiceImplTest extends BaseDbUnitTest { |
| 545 | 548 | // ========== 随机对象 ========== |
| 546 | 549 | |
| 547 | 550 | @SafeVarargs |
| 548 | - private static AdminUserDO randomSysUserDO(Consumer<AdminUserDO>... consumers) { | |
| 551 | + private static AdminUserDO randomAdminUserDO(Consumer<AdminUserDO>... consumers) { | |
| 549 | 552 | Consumer<AdminUserDO> consumer = (o) -> { |
| 550 | 553 | o.setStatus(randomEle(CommonStatusEnum.values()).getStatus()); // 保证 status 的范围 |
| 551 | - o.setSex(randomEle(SysSexEnum.values()).getSex()); // 保证 sex 的范围 | |
| 554 | + o.setSex(randomEle(SexEnum.values()).getSex()); // 保证 sex 的范围 | |
| 552 | 555 | }; |
| 553 | 556 | return randomPojo(AdminUserDO.class, ArrayUtils.append(consumer, consumers)); |
| 554 | 557 | } | ... | ... |
yudao-module-system/yudao-module-system-impl/src/test/resources/application-unit-test.yaml
0 → 100644
| 1 | +spring: | |
| 2 | + main: | |
| 3 | + lazy-initialization: true # 开启懒加载,加快速度 | |
| 4 | + banner-mode: off # 单元测试,禁用 Banner | |
| 5 | + | |
| 6 | +--- #################### 数据库相关配置 #################### | |
| 7 | + | |
| 8 | +spring: | |
| 9 | + # 数据源配置项 | |
| 10 | + datasource: | |
| 11 | + name: ruoyi-vue-pro | |
| 12 | + url: jdbc:h2:mem:testdb;MODE=MYSQL;DATABASE_TO_UPPER=false; # MODE 使用 MySQL 模式;DATABASE_TO_UPPER 配置表和字段使用小写 | |
| 13 | + driver-class-name: org.h2.Driver | |
| 14 | + username: sa | |
| 15 | + password: | |
| 16 | + schema: classpath:sql/create_tables.sql # MySQL 转 H2 的语句,使用 https://www.jooq.org/translate/ 工具 | |
| 17 | + druid: | |
| 18 | + async-init: true # 单元测试,异步初始化 Druid 连接池,提升启动速度 | |
| 19 | + initial-size: 1 # 单元测试,配置为 1,提升启动速度 | |
| 20 | + | |
| 21 | + # Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优 | |
| 22 | + redis: | |
| 23 | + host: 127.0.0.1 # 地址 | |
| 24 | + port: 16379 # 端口(单元测试,使用 16379 端口) | |
| 25 | + database: 0 # 数据库索引 | |
| 26 | + | |
| 27 | +mybatis: | |
| 28 | + lazy-initialization: true # 单元测试,设置 MyBatis Mapper 延迟加载,加速每个单元测试 | |
| 29 | + | |
| 30 | +--- #################### 定时任务相关配置 #################### | |
| 31 | + | |
| 32 | +--- #################### 配置中心相关配置 #################### | |
| 33 | + | |
| 34 | +--- #################### 服务保障相关配置 #################### | |
| 35 | + | |
| 36 | +# Lock4j 配置项(单元测试,禁用 Lock4j) | |
| 37 | + | |
| 38 | +# Resilience4j 配置项 | |
| 39 | + | |
| 40 | +--- #################### 监控相关配置 #################### | |
| 41 | + | |
| 42 | +--- #################### 芋道相关配置 #################### | |
| 43 | + | |
| 44 | +# 芋道配置项,设置当前项目所有自定义的配置 | |
| 45 | +yudao: | |
| 46 | + info: | |
| 47 | + base-package: cn.iocoder.yudao.module.member.dal.mysql | |
| 48 | + member-package: cn.iocoder.yudao.module.member # TODO 芋艿:要清理掉 | |
| 49 | + system-package: cn.iocoder.yudao.module.system # TODO 芋艿:要清理掉 | |
| 50 | + core-service: | |
| 51 | + base-package: cn.iocoder.yudao.module.member.dal.mysql # TODO 芋艿:要清理掉 | |
| 52 | + captcha: | |
| 53 | + timeout: 5m | |
| 54 | + width: 160 | |
| 55 | + height: 60 | ... | ... |
yudao-module-system/yudao-module-system-impl/src/test/resources/logback-spring.xml
0 → 100644
yudao-module-system/yudao-module-system-impl/src/test/resources/sql/clean.sql
0 → 100644
| 1 | +DELETE FROM "system_dept"; | |
| 2 | +DELETE FROM "system_dict_data"; | |
| 3 | +DELETE FROM "system_role"; | |
| 4 | +DELETE FROM "system_role_menu"; | |
| 5 | +DELETE FROM "system_menu"; | |
| 6 | +DELETE FROM "system_user_role"; | |
| 7 | +DELETE FROM "system_dict_type"; | |
| 8 | +DELETE FROM "system_user_session"; | |
| 9 | +DELETE FROM "system_post"; | |
| 10 | +DELETE FROM "system_login_log"; | |
| 11 | +DELETE FROM "system_operate_log"; | |
| 12 | +DELETE FROM "system_user"; | |
| 13 | +DELETE FROM "system_sms_channel"; | |
| 14 | +DELETE FROM "system_sms_template"; | |
| 15 | +DELETE FROM "system_sms_log"; | |
| 16 | +DELETE FROM "system_error_code"; | |
| 17 | +DELETE FROM "system_social_user"; | |
| 18 | +DELETE FROM "system_tenant"; | ... | ... |
yudao-module-system/yudao-module-system-impl/src/test/resources/sql/create_tables.sql
0 → 100644
| 1 | +-- sys 开头的 DB | |
| 2 | + | |
| 3 | +CREATE TABLE IF NOT EXISTS "system_dept" ( | |
| 4 | + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, | |
| 5 | + "name" varchar(30) NOT NULL DEFAULT '', | |
| 6 | + "parent_id" bigint NOT NULL DEFAULT '0', | |
| 7 | + "sort" int NOT NULL DEFAULT '0', | |
| 8 | + "leader_user_id" bigint DEFAULT NULL, | |
| 9 | + "phone" varchar(11) DEFAULT NULL, | |
| 10 | + "email" varchar(50) DEFAULT NULL, | |
| 11 | + "status" tinyint NOT NULL, | |
| 12 | + "creator" varchar(64) DEFAULT '', | |
| 13 | + "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 14 | + "updater" varchar(64) DEFAULT '', | |
| 15 | + "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 16 | + "deleted" bit NOT NULL DEFAULT FALSE, | |
| 17 | + "tenant_id" bigint not null default '0', | |
| 18 | + PRIMARY KEY ("id") | |
| 19 | +) COMMENT '部门表'; | |
| 20 | + | |
| 21 | +CREATE TABLE IF NOT EXISTS "system_dict_data" ( | |
| 22 | + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, | |
| 23 | + "sort" int NOT NULL DEFAULT '0', | |
| 24 | + "label" varchar(100) NOT NULL DEFAULT '', | |
| 25 | + "value" varchar(100) NOT NULL DEFAULT '', | |
| 26 | + "dict_type" varchar(100) NOT NULL DEFAULT '', | |
| 27 | + "status" tinyint NOT NULL DEFAULT '0', | |
| 28 | + "remark" varchar(500) DEFAULT NULL, | |
| 29 | + "creator" varchar(64) DEFAULT '', | |
| 30 | + "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 31 | + "updater" varchar(64) DEFAULT '', | |
| 32 | + "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 33 | + "deleted" bit NOT NULL DEFAULT FALSE, | |
| 34 | + PRIMARY KEY ("id") | |
| 35 | +) COMMENT '字典数据表'; | |
| 36 | + | |
| 37 | +CREATE TABLE IF NOT EXISTS "system_role" ( | |
| 38 | + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, | |
| 39 | + "name" varchar(30) NOT NULL, | |
| 40 | + "code" varchar(100) NOT NULL, | |
| 41 | + "sort" int NOT NULL, | |
| 42 | + "data_scope" tinyint NOT NULL DEFAULT '1', | |
| 43 | + "data_scope_dept_ids" varchar(500) NOT NULL DEFAULT '', | |
| 44 | + "status" tinyint NOT NULL, | |
| 45 | + "type" tinyint NOT NULL, | |
| 46 | + "remark" varchar(500) DEFAULT NULL, | |
| 47 | + "creator" varchar(64) DEFAULT '', | |
| 48 | + "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 49 | + "updater" varchar(64) DEFAULT '', | |
| 50 | + "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 51 | + "deleted" bit NOT NULL DEFAULT FALSE, | |
| 52 | + PRIMARY KEY ("id") | |
| 53 | +) COMMENT '角色信息表'; | |
| 54 | + | |
| 55 | +CREATE TABLE IF NOT EXISTS "system_role_menu" ( | |
| 56 | + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, | |
| 57 | + "role_id" bigint NOT NULL, | |
| 58 | + "menu_id" bigint NOT NULL, | |
| 59 | + "creator" varchar(64) DEFAULT '', | |
| 60 | + "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 61 | + "updater" varchar(64) DEFAULT '', | |
| 62 | + "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 63 | + "deleted" bit NOT NULL DEFAULT FALSE, | |
| 64 | + PRIMARY KEY ("id") | |
| 65 | +) COMMENT '角色和菜单关联表'; | |
| 66 | + | |
| 67 | +CREATE TABLE IF NOT EXISTS "system_menu" ( | |
| 68 | + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, | |
| 69 | + "name" varchar(50) NOT NULL, | |
| 70 | + "permission" varchar(100) NOT NULL DEFAULT '', | |
| 71 | + "menu_type" tinyint NOT NULL, | |
| 72 | + "sort" int NOT NULL DEFAULT '0', | |
| 73 | + "parent_id" bigint NOT NULL DEFAULT '0', | |
| 74 | + "path" varchar(200) DEFAULT '', | |
| 75 | + "icon" varchar(100) DEFAULT '#', | |
| 76 | + "component" varchar(255) DEFAULT NULL, | |
| 77 | + "status" tinyint NOT NULL DEFAULT '0', | |
| 78 | + "creator" varchar(64) DEFAULT '', | |
| 79 | + "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 80 | + "updater" varchar(64) DEFAULT '', | |
| 81 | + "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 82 | + "deleted" bit NOT NULL DEFAULT FALSE, | |
| 83 | + PRIMARY KEY ("id") | |
| 84 | +) COMMENT '菜单权限表'; | |
| 85 | + | |
| 86 | +CREATE TABLE IF NOT EXISTS "system_user_role" ( | |
| 87 | + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, | |
| 88 | + "user_id" bigint NOT NULL, | |
| 89 | + "role_id" bigint NOT NULL, | |
| 90 | + "creator" varchar(64) DEFAULT '', | |
| 91 | + "create_time" timestamp DEFAULT NULL, | |
| 92 | + "updater" varchar(64) DEFAULT '', | |
| 93 | + "update_time" timestamp DEFAULT NULL, | |
| 94 | + "deleted" bit DEFAULT FALSE, | |
| 95 | + PRIMARY KEY ("id") | |
| 96 | +) COMMENT '用户和角色关联表'; | |
| 97 | + | |
| 98 | +CREATE TABLE IF NOT EXISTS "system_dict_type" ( | |
| 99 | + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, | |
| 100 | + "name" varchar(100) NOT NULL DEFAULT '', | |
| 101 | + "type" varchar(100) NOT NULL DEFAULT '', | |
| 102 | + "status" tinyint NOT NULL DEFAULT '0', | |
| 103 | + "remark" varchar(500) DEFAULT NULL, | |
| 104 | + "creator" varchar(64) DEFAULT '', | |
| 105 | + "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 106 | + "updater" varchar(64) DEFAULT '', | |
| 107 | + "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 108 | + "deleted" bit NOT NULL DEFAULT FALSE, | |
| 109 | + PRIMARY KEY ("id") | |
| 110 | +) COMMENT '字典类型表'; | |
| 111 | + | |
| 112 | +CREATE TABLE IF NOT EXISTS `system_user_session` ( | |
| 113 | + `id` varchar(32) NOT NULL, | |
| 114 | + `user_id` bigint DEFAULT NULL, | |
| 115 | + "user_type" tinyint NOT NULL, | |
| 116 | + `username` varchar(50) NOT NULL DEFAULT '', | |
| 117 | + `user_ip` varchar(50) DEFAULT NULL, | |
| 118 | + `user_agent` varchar(512) DEFAULT NULL, | |
| 119 | + `session_timeout` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 120 | + "creator" varchar(64) DEFAULT '', | |
| 121 | + "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 122 | + `updater` varchar(64) DEFAULT '' , | |
| 123 | + "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 124 | + "deleted" bit NOT NULL DEFAULT FALSE, | |
| 125 | + "tenant_id" bigint not null default '0', | |
| 126 | + PRIMARY KEY (`id`) | |
| 127 | +) COMMENT '用户在线 Session'; | |
| 128 | + | |
| 129 | +CREATE TABLE IF NOT EXISTS "system_post" ( | |
| 130 | + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, | |
| 131 | + "code" varchar(64) NOT NULL, | |
| 132 | + "name" varchar(50) NOT NULL, | |
| 133 | + "sort" integer NOT NULL, | |
| 134 | + "status" tinyint NOT NULL, | |
| 135 | + "remark" varchar(500) DEFAULT NULL, | |
| 136 | + "creator" varchar(64) DEFAULT '', | |
| 137 | + "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 138 | + "updater" varchar(64) DEFAULT '', | |
| 139 | + "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 140 | + "deleted" bit NOT NULL DEFAULT FALSE, | |
| 141 | + "tenant_id" bigint not null default '0', | |
| 142 | + PRIMARY KEY ("id") | |
| 143 | +) COMMENT '岗位信息表'; | |
| 144 | + | |
| 145 | +CREATE TABLE IF NOT EXISTS "system_notice" ( | |
| 146 | + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, | |
| 147 | + "title" varchar(50) NOT NULL COMMENT '公告标题', | |
| 148 | + "content" text NOT NULL COMMENT '公告内容', | |
| 149 | + "notice_type" tinyint NOT NULL COMMENT '公告类型(1通知 2公告)', | |
| 150 | + "status" tinyint NOT NULL DEFAULT '0' COMMENT '公告状态(0正常 1关闭)', | |
| 151 | + "creator" varchar(64) DEFAULT '' COMMENT '创建者', | |
| 152 | + "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', | |
| 153 | + "updater" varchar(64) DEFAULT '' COMMENT '更新者', | |
| 154 | + "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', | |
| 155 | + "deleted" bit NOT NULL DEFAULT 0 COMMENT '是否删除', | |
| 156 | + "tenant_id" bigint not null default '0', | |
| 157 | + PRIMARY KEY("id") | |
| 158 | +) COMMENT '通知公告表'; | |
| 159 | + | |
| 160 | +CREATE TABLE IF NOT EXISTS `system_login_log` ( | |
| 161 | + `id` bigint(20) NOT NULL GENERATED BY DEFAULT AS IDENTITY, | |
| 162 | + `log_type` bigint(4) NOT NULL, | |
| 163 | + "user_id" bigint not null default '0', | |
| 164 | + "user_type" tinyint NOT NULL, | |
| 165 | + `trace_id` varchar(64) NOT NULL DEFAULT '', | |
| 166 | + `username` varchar(50) NOT NULL DEFAULT '', | |
| 167 | + `result` tinyint(4) NOT NULL, | |
| 168 | + `user_ip` varchar(50) NOT NULL, | |
| 169 | + `user_agent` varchar(512) NOT NULL, | |
| 170 | + `creator` varchar(64) DEFAULT '', | |
| 171 | + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 172 | + `updater` varchar(64) DEFAULT '', | |
| 173 | + `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | |
| 174 | + `deleted` bit(1) NOT NULL DEFAULT '0', | |
| 175 | + PRIMARY KEY (`id`) | |
| 176 | +) COMMENT ='系统访问记录'; | |
| 177 | + | |
| 178 | +CREATE TABLE IF NOT EXISTS `system_operate_log` ( | |
| 179 | + `id` bigint(20) NOT NULL GENERATED BY DEFAULT AS IDENTITY, | |
| 180 | + `trace_id` varchar(64) NOT NULL DEFAULT '', | |
| 181 | + `user_id` bigint(20) NOT NULL, | |
| 182 | + `module` varchar(50) NOT NULL, | |
| 183 | + `name` varchar(50) NOT NULL, | |
| 184 | + `operate_type` bigint(4) NOT NULL DEFAULT '0', | |
| 185 | + `content` varchar(2000) NOT NULL DEFAULT '', | |
| 186 | + `exts` varchar(512) NOT NULL DEFAULT '', | |
| 187 | + `request_method` varchar(16) DEFAULT '', | |
| 188 | + `request_url` varchar(255) DEFAULT '', | |
| 189 | + `user_ip` varchar(50) DEFAULT NULL, | |
| 190 | + `user_agent` varchar(200) DEFAULT NULL, | |
| 191 | + `java_method` varchar(512) NOT NULL DEFAULT '', | |
| 192 | + `java_method_args` varchar(8000) DEFAULT '', | |
| 193 | + `start_time` datetime NOT NULL, | |
| 194 | + `duration` int(11) NOT NULL, | |
| 195 | + `result_code` int(11) NOT NULL DEFAULT '0', | |
| 196 | + `result_msg` varchar(512) DEFAULT '', | |
| 197 | + `result_data` varchar(4000) DEFAULT '', | |
| 198 | + `creator` varchar(64) DEFAULT '', | |
| 199 | + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 200 | + `updater` varchar(64) DEFAULT '', | |
| 201 | + `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | |
| 202 | + `deleted` bit(1) NOT NULL DEFAULT '0', | |
| 203 | + "tenant_id" bigint not null default '0', | |
| 204 | + PRIMARY KEY (`id`) | |
| 205 | +) COMMENT ='操作日志记录'; | |
| 206 | + | |
| 207 | +CREATE TABLE IF NOT EXISTS "system_user" ( | |
| 208 | + "id" bigint not null GENERATED BY DEFAULT AS IDENTITY, | |
| 209 | + "username" varchar(30) not null, | |
| 210 | + "password" varchar(100) not null default '', | |
| 211 | + "nickname" varchar(30) not null, | |
| 212 | + "remark" varchar(500) default null, | |
| 213 | + "dept_id" bigint default null, | |
| 214 | + "post_ids" varchar(255) default null, | |
| 215 | + "email" varchar(50) default '', | |
| 216 | + "mobile" varchar(11) default '', | |
| 217 | + "sex" tinyint default '0', | |
| 218 | + "avatar" varchar(100) default '', | |
| 219 | + "status" tinyint not null default '0', | |
| 220 | + "login_ip" varchar(50) default '', | |
| 221 | + "login_date" timestamp default null, | |
| 222 | + "creator" varchar(64) default '', | |
| 223 | + "create_time" timestamp not null default current_timestamp, | |
| 224 | + "updater" varchar(64) default '', | |
| 225 | + "update_time" timestamp not null default current_timestamp, | |
| 226 | + "deleted" bit not null default false, | |
| 227 | + "tenant_id" bigint not null default '0', | |
| 228 | + primary key ("id") | |
| 229 | +) comment '用户信息表'; | |
| 230 | + | |
| 231 | +CREATE TABLE IF NOT EXISTS "inf_api_access_log" ( | |
| 232 | + "id" bigint not null GENERATED BY DEFAULT AS IDENTITY, | |
| 233 | + "trace_id" varchar(64) not null default '', | |
| 234 | + "user_id" bigint not null default '0', | |
| 235 | + "user_type" tinyint not null default '0', | |
| 236 | + "application_name" varchar(50) not null, | |
| 237 | + "request_method" varchar(16) not null default '', | |
| 238 | + "request_url" varchar(255) not null default '', | |
| 239 | + "request_params" varchar(8000) not null default '', | |
| 240 | + "user_ip" varchar(50) not null, | |
| 241 | + "user_agent" varchar(512) not null, | |
| 242 | + "begin_time" timestamp not null, | |
| 243 | + "end_time" timestamp not null, | |
| 244 | + "duration" integer not null, | |
| 245 | + "result_code" integer not null default '0', | |
| 246 | + "result_msg" varchar(512) default '', | |
| 247 | + "creator" varchar(64) default '', | |
| 248 | + "create_time" timestamp not null default current_timestamp, | |
| 249 | + "updater" varchar(64) default '', | |
| 250 | + "update_time" timestamp not null default current_timestamp, | |
| 251 | + "deleted" bit not null default false, | |
| 252 | + "tenant_id" bigint not null default '0', | |
| 253 | + primary key ("id") | |
| 254 | +) COMMENT 'API 访问日志表'; | |
| 255 | + | |
| 256 | +CREATE TABLE IF NOT EXISTS "inf_api_error_log" ( | |
| 257 | + "id" bigint not null GENERATED BY DEFAULT AS IDENTITY, | |
| 258 | + "trace_id" varchar(64) not null, | |
| 259 | + "user_id" bigint not null default '0', | |
| 260 | + "user_type" tinyint not null default '0', | |
| 261 | + "application_name" varchar(50) not null, | |
| 262 | + "request_method" varchar(16) not null, | |
| 263 | + "request_url" varchar(255) not null, | |
| 264 | + "request_params" varchar(8000) not null, | |
| 265 | + "user_ip" varchar(50) not null, | |
| 266 | + "user_agent" varchar(512) not null, | |
| 267 | + "exception_time" timestamp not null, | |
| 268 | + "exception_name" varchar(128) not null default '', | |
| 269 | + "exception_message" clob not null, | |
| 270 | + "exception_root_cause_message" clob not null, | |
| 271 | + "exception_stack_trace" clob not null, | |
| 272 | + "exception_class_name" varchar(512) not null, | |
| 273 | + "exception_file_name" varchar(512) not null, | |
| 274 | + "exception_method_name" varchar(512) not null, | |
| 275 | + "exception_line_number" integer not null, | |
| 276 | + "process_status" tinyint not null, | |
| 277 | + "process_time" timestamp default null, | |
| 278 | + "process_user_id" bigint default '0', | |
| 279 | + "creator" varchar(64) default '', | |
| 280 | + "create_time" timestamp not null default current_timestamp, | |
| 281 | + "updater" varchar(64) default '', | |
| 282 | + "update_time" timestamp not null default current_timestamp, | |
| 283 | + "deleted" bit not null default false, | |
| 284 | + "tenant_id" bigint not null default '0', | |
| 285 | + primary key ("id") | |
| 286 | +) COMMENT '系统异常日志'; | |
| 287 | + | |
| 288 | +CREATE TABLE IF NOT EXISTS "system_sms_channel" ( | |
| 289 | + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, | |
| 290 | + "signature" varchar(10) NOT NULL, | |
| 291 | + "code" varchar(63) NOT NULL, | |
| 292 | + "status" tinyint NOT NULL, | |
| 293 | + "remark" varchar(255) DEFAULT NULL, | |
| 294 | + "api_key" varchar(63) NOT NULL, | |
| 295 | + "api_secret" varchar(63) DEFAULT NULL, | |
| 296 | + "callback_url" varchar(255) DEFAULT NULL, | |
| 297 | + "creator" varchar(64) DEFAULT '', | |
| 298 | + "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 299 | + "updater" varchar(64) DEFAULT '', | |
| 300 | + "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 301 | + "deleted" bit NOT NULL DEFAULT FALSE, | |
| 302 | + PRIMARY KEY ("id") | |
| 303 | +) COMMENT '短信渠道'; | |
| 304 | + | |
| 305 | +CREATE TABLE IF NOT EXISTS "system_sms_template" ( | |
| 306 | + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, | |
| 307 | + "type" tinyint NOT NULL, | |
| 308 | + "status" tinyint NOT NULL, | |
| 309 | + "code" varchar(63) NOT NULL, | |
| 310 | + "name" varchar(63) NOT NULL, | |
| 311 | + "content" varchar(255) NOT NULL, | |
| 312 | + "params" varchar(255) NOT NULL, | |
| 313 | + "remark" varchar(255) DEFAULT NULL, | |
| 314 | + "api_template_id" varchar(63) NOT NULL, | |
| 315 | + "channel_id" bigint NOT NULL, | |
| 316 | + "channel_code" varchar(63) NOT NULL, | |
| 317 | + "creator" varchar(64) DEFAULT '', | |
| 318 | + "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 319 | + "updater" varchar(64) DEFAULT '', | |
| 320 | + "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 321 | + "deleted" bit NOT NULL DEFAULT FALSE, | |
| 322 | + PRIMARY KEY ("id") | |
| 323 | +) COMMENT '短信模板'; | |
| 324 | + | |
| 325 | +CREATE TABLE IF NOT EXISTS "system_sms_log" ( | |
| 326 | + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, | |
| 327 | + "channel_id" bigint NOT NULL, | |
| 328 | + "channel_code" varchar(63) NOT NULL, | |
| 329 | + "template_id" bigint NOT NULL, | |
| 330 | + "template_code" varchar(63) NOT NULL, | |
| 331 | + "template_type" tinyint NOT NULL, | |
| 332 | + "template_content" varchar(255) NOT NULL, | |
| 333 | + "template_params" varchar(255) NOT NULL, | |
| 334 | + "api_template_id" varchar(63) NOT NULL, | |
| 335 | + "mobile" varchar(11) NOT NULL, | |
| 336 | + "user_id" bigint DEFAULT '0', | |
| 337 | + "user_type" tinyint DEFAULT '0', | |
| 338 | + "send_status" tinyint NOT NULL DEFAULT '0', | |
| 339 | + "send_time" timestamp DEFAULT NULL, | |
| 340 | + "send_code" int DEFAULT NULL, | |
| 341 | + "send_msg" varchar(255) DEFAULT NULL, | |
| 342 | + "api_send_code" varchar(63) DEFAULT NULL, | |
| 343 | + "api_send_msg" varchar(255) DEFAULT NULL, | |
| 344 | + "api_request_id" varchar(255) DEFAULT NULL, | |
| 345 | + "api_serial_no" varchar(255) DEFAULT NULL, | |
| 346 | + "receive_status" tinyint NOT NULL DEFAULT '0', | |
| 347 | + "receive_time" timestamp DEFAULT NULL, | |
| 348 | + "api_receive_code" varchar(63) DEFAULT NULL, | |
| 349 | + "api_receive_msg" varchar(255) DEFAULT NULL, | |
| 350 | + "creator" varchar(64) DEFAULT '', | |
| 351 | + "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 352 | + "updater" varchar(64) DEFAULT '', | |
| 353 | + "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 354 | + "deleted" bit NOT NULL DEFAULT FALSE, | |
| 355 | + PRIMARY KEY ("id") | |
| 356 | +) COMMENT '短信日志'; | |
| 357 | + | |
| 358 | +CREATE TABLE IF NOT EXISTS "system_error_code" ( | |
| 359 | + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, | |
| 360 | + "type" tinyint NOT NULL DEFAULT '0', | |
| 361 | + "application_name" varchar(50) NOT NULL, | |
| 362 | + "code" int NOT NULL DEFAULT '0', | |
| 363 | + "message" varchar(512) NOT NULL DEFAULT '', | |
| 364 | + "memo" varchar(512) DEFAULT '', | |
| 365 | + "creator" varchar(64) DEFAULT '', | |
| 366 | + "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 367 | + "updater" varchar(64) DEFAULT '', | |
| 368 | + "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 369 | + "deleted" bit NOT NULL DEFAULT FALSE, | |
| 370 | + PRIMARY KEY ("id") | |
| 371 | +) COMMENT '错误码表'; | |
| 372 | + | |
| 373 | +CREATE TABLE IF NOT EXISTS "system_social_user" ( | |
| 374 | + "id" number NOT NULL GENERATED BY DEFAULT AS IDENTITY, | |
| 375 | + "user_id" bigint NOT NULL, | |
| 376 | + "user_type" tinyint NOT NULL DEFAULT '0', | |
| 377 | + "type" tinyint NOT NULL, | |
| 378 | + "openid" varchar(32) NOT NULL, | |
| 379 | + "token" varchar(256) DEFAULT NULL, | |
| 380 | + "union_id" varchar(32) NOT NULL, | |
| 381 | + "raw_token_info" varchar(1024) NOT NULL, | |
| 382 | + "nickname" varchar(32) NOT NULL, | |
| 383 | + "avatar" varchar(255) DEFAULT NULL, | |
| 384 | + "raw_user_info" varchar(1024) NOT NULL, | |
| 385 | + "creator" varchar(64) DEFAULT '', | |
| 386 | + "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 387 | + "updater" varchar(64) DEFAULT '', | |
| 388 | + "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 389 | + "deleted" bit NOT NULL DEFAULT FALSE, | |
| 390 | + PRIMARY KEY ("id") | |
| 391 | +) COMMENT '社交用户'; | |
| 392 | + | |
| 393 | +CREATE TABLE IF NOT EXISTS "system_tenant" ( | |
| 394 | + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, | |
| 395 | + "name" varchar(63) NOT NULL, | |
| 396 | + "contact_name" varchar(255) NOT NULL, | |
| 397 | + "contact_mobile" varchar(255), | |
| 398 | + "status" tinyint NOT NULL, | |
| 399 | + "creator" varchar(64) DEFAULT '', | |
| 400 | + "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 401 | + "updater" varchar(64) DEFAULT '', | |
| 402 | + "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 403 | + "deleted" bit NOT NULL DEFAULT FALSE, | |
| 404 | + PRIMARY KEY ("id") | |
| 405 | +) COMMENT '租户'; | ... | ... |