upd: 编码规范

This commit is contained in:
2025-04-09 19:22:36 +08:00
parent 4a966fc535
commit 01b2e7f040
2 changed files with 3 additions and 3 deletions
@@ -7,7 +7,7 @@ import java.util.Set;
@Mapper
public interface RoleDeptMapper {
void insertBatchWithRoleId(@Param("roleId") Long roleId, @Param("depts") Set<Dept> depts);
void insertBatchWithRoleId(@Param("depts") Set<Dept> depts, @Param("roleId") Long roleId);
void deleteByRoleId(@Param("roleId") Long roleId);
void deleteByRoleIds(@Param("roleIds") Set<Long> roleIds);
}
@@ -88,7 +88,7 @@ public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements Ro
save(BeanUtil.copyProperties(resources, Role.class));
// 判断是否有部门数据,若有,则需创建关联
if (CollectionUtil.isNotEmpty(resources.getDepts())) {
roleDeptMapper.insertBatchWithRoleId(resources.getId(), resources.getDepts());
roleDeptMapper.insertBatchWithRoleId(resources.getDepts(), resources.getId());
}
}
@@ -111,7 +111,7 @@ public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements Ro
roleDeptMapper.deleteByRoleId(resources.getId());
// 判断是否有部门数据,若有,则需更新关联
if (CollectionUtil.isNotEmpty(resources.getDepts())) {
roleDeptMapper.insertBatchWithRoleId(resources.getId(), resources.getDepts());
roleDeptMapper.insertBatchWithRoleId(resources.getDepts(), resources.getId());
}
// 更新相关缓存
delCaches(role.getId(), null);