forked from ddrilling/AsbCloudServer
правки по ревью
This commit is contained in:
parent
5f0343cf48
commit
e52b6cf122
@ -62,6 +62,9 @@ namespace AsbCloudApp.Data.User
|
||||
|
||||
/// <summary>
|
||||
/// Id состояния пользователя
|
||||
/// 0 - не активен,
|
||||
/// 1 - активен,
|
||||
/// 2 - заблокирован
|
||||
/// </summary>
|
||||
public short IdState { get; set; }
|
||||
|
||||
|
@ -117,9 +117,13 @@ namespace AsbCloudWebApi
|
||||
var userService = services.BuildServiceProvider().GetRequiredService<IUserRepository>();
|
||||
var user = userService.GetOrDefault(idUser.Value);
|
||||
|
||||
if (user is null || user.IdState != User.ActiveStateId)
|
||||
if (user is null)
|
||||
{
|
||||
context.Fail("invaild user data");
|
||||
context.Fail("user is null");
|
||||
}
|
||||
else if (user.IdState != User.ActiveStateId)
|
||||
{
|
||||
context.Fail("user is not active");
|
||||
}
|
||||
|
||||
return Task.CompletedTask;
|
||||
|
Loading…
Reference in New Issue
Block a user