frontend
This commit is contained in:
@ -86,6 +86,7 @@ namespace Yuna.Website.Server.Services.DeviceService
|
||||
|
||||
if(propValue.TryGetDouble(out var value))
|
||||
{
|
||||
value = Math.Round(value, 2);
|
||||
result.Add(prop.Id, value.ToString());
|
||||
continue;
|
||||
}
|
||||
@ -123,5 +124,11 @@ namespace Yuna.Website.Server.Services.DeviceService
|
||||
var result = await _deviceRepository.GetList();
|
||||
return result ?? [];
|
||||
}
|
||||
|
||||
public async Task<IReadOnlyList<Device>> GetList(long userId)
|
||||
{
|
||||
var result = await _deviceRepository.GetList(userId);
|
||||
return result ?? [];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ namespace Yuna.Website.Server.Services.DeviceService
|
||||
{
|
||||
public Task<Device?> GetById(long id);
|
||||
public Task<IReadOnlyList<Device>> GetList();
|
||||
public Task<IReadOnlyList<Device>> GetList(long userId);
|
||||
public Task<Device?> Create(Device device);
|
||||
//public Task<User?> Update(User user);
|
||||
public Task<Device?> Delete(long id);
|
||||
|
@ -19,6 +19,7 @@ namespace Yuna.Website.Server.Services.TokenService
|
||||
{
|
||||
new(ClaimTypes.Name, user.UserName),
|
||||
new(ClaimTypes.NameIdentifier, user.Id.ToString()),
|
||||
new(ClaimTypes.Role, user.IsAdmin.ToString())
|
||||
};
|
||||
|
||||
return new ClaimsIdentity(claims, "Cookies");
|
||||
|
Reference in New Issue
Block a user