refactor: 移除用户表和配置表的冗余逻辑

This commit is contained in:
Ray.Hao
2026-02-27 09:54:03 +08:00
parent f32996d9c2
commit 739311381c
2 changed files with 2 additions and 8 deletions

View File

@@ -364,8 +364,7 @@ CREATE TABLE `sys_user` (
`update_time` datetime COMMENT '更新时间', `update_time` datetime COMMENT '更新时间',
`update_by` bigint COMMENT '修改人ID', `update_by` bigint COMMENT '修改人ID',
`is_deleted` tinyint(1) DEFAULT 0 COMMENT '逻辑删除标识(0-未删除 1-已删除)', `is_deleted` tinyint(1) DEFAULT 0 COMMENT '逻辑删除标识(0-未删除 1-已删除)',
PRIMARY KEY (`id`) USING BTREE, PRIMARY KEY (`id`) USING BTREE
UNIQUE KEY `uk_username` (`username`)
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COMMENT = '系统用户表'; ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COMMENT = '系统用户表';
-- ---------------------------- -- ----------------------------

View File

@@ -80,7 +80,6 @@ public class ConfigServiceImpl extends ServiceImpl<ConfigMapper, Config> impleme
"配置键已存在"); "配置键已存在");
Config config = configConverter.toEntity(configForm); Config config = configConverter.toEntity(configForm);
config.setCreateBy(SecurityUtils.getUserId()); config.setCreateBy(SecurityUtils.getUserId());
config.setIsDeleted(0);
return this.save(config); return this.save(config);
} }
@@ -122,11 +121,7 @@ public class ConfigServiceImpl extends ServiceImpl<ConfigMapper, Config> impleme
@Override @Override
public boolean delete(Long id) { public boolean delete(Long id) {
if (id != null) { if (id != null) {
return super.update(new LambdaUpdateWrapper<Config>() return super.removeById(id);
.eq(Config::getId,id)
.set(Config::getIsDeleted, 1)
.set(Config::getUpdateBy, SecurityUtils.getUserId())
);
} }
return false; return false;
} }