chore: add documentation comments and stylecop rules
This commit is contained in:
@@ -16,6 +16,7 @@ public sealed class UpdateRoleCommandHandler(
|
||||
{
|
||||
public async Task<RoleDto?> Handle(UpdateRoleCommand request, CancellationToken cancellationToken)
|
||||
{
|
||||
// 1. 获取租户上下文并查询角色
|
||||
var tenantId = tenantProvider.GetCurrentTenantId();
|
||||
var role = await roleRepository.FindByIdAsync(request.RoleId, tenantId, cancellationToken);
|
||||
if (role == null)
|
||||
@@ -23,12 +24,15 @@ public sealed class UpdateRoleCommandHandler(
|
||||
return null;
|
||||
}
|
||||
|
||||
// 2. 更新字段
|
||||
role.Name = request.Name;
|
||||
role.Description = request.Description;
|
||||
|
||||
// 3. 持久化
|
||||
await roleRepository.UpdateAsync(role, cancellationToken);
|
||||
await roleRepository.SaveChangesAsync(cancellationToken);
|
||||
|
||||
// 4. 返回 DTO
|
||||
return new RoleDto
|
||||
{
|
||||
Id = role.Id,
|
||||
|
||||
Reference in New Issue
Block a user