feat:完成权限相关、全局配置、优化细节

This commit is contained in:
橙子
2023-03-26 16:22:49 +08:00
parent b6f4cbfb4f
commit e5460ae3cc
55 changed files with 386 additions and 51 deletions

View File

@@ -48,9 +48,18 @@ namespace Yi.BBS.Application.Contracts.Forum.Dtos.Discuss
public string? PrivateCode { get; set; }
public DateTime CreationTime { get; set; }
public List<long> PermissionUserIds { get; set; }
public UserGetListOutputDto User { get; set; }
public void SetBan()
{
this.Title = DiscussConst.;
this.Introduction = "";
this.Cover = null;
//被禁止
this.IsBan = true;
}
}
@@ -69,20 +78,19 @@ namespace Yi.BBS.Application.Contracts.Forum.Dtos.Discuss
//当前主题是仅自己可见,同时不是当前登录用户
if (dto.User.Id != userId)
{
dto.Title = DiscussConst.;
dto.Introduction= "";
dto.Cover = null;
//被禁止
dto.IsBan = true;
dto.SetBan();
}
break;
case DiscussPermissionTypeEnum.User:
//当前主题为部分可见,同时不是当前登录用户 也 不在可见用户列表中
if (dto.User.Id != userId && !dto.PermissionUserIds.Contains(userId))
{
dto.SetBan();
}
break;
default:
break;
}
});
}

View File

@@ -37,6 +37,8 @@ namespace Yi.BBS.Application.Contracts.Forum.Dtos
public string? PrivateCode { get; set; }
public DateTime CreationTime { get; set; }
public DiscussPermissionTypeEnum PermissionType { get; set; }
public List<long> PermissionUserIds { get; set; }
public UserGetListOutputDto User { get; set; }
}
}

View File

@@ -17,6 +17,7 @@ namespace Yi.BBS.Application.Contracts.Forum.Dtos.Discuss
public string Content { get; set; }
public string? Color { get; set; }
public List<long> PermissionUserIds { get; set; }
public DiscussPermissionTypeEnum PermissionType { get; set; }