Compare commits
2 Commits
fbec9b215b
...
5876b2c0ee
| Author | SHA1 | Date |
|---|---|---|
|
|
5876b2c0ee | |
|
|
9e50edb281 |
|
|
@ -670,6 +670,7 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers
|
|||
new("ClientId", info.ClientId),
|
||||
new("UserId", info.UserId),
|
||||
new("UserName", info.UserName),
|
||||
new("DeviceSn", info.DeviceSn),
|
||||
new("ConnectTime", info.ConnectTime.ToString("O")),
|
||||
new("IsLock", info.IsLock ? "true" : "false")
|
||||
});
|
||||
|
|
@ -723,13 +724,13 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers
|
|||
[AllowAnonymous]
|
||||
public async Task<List<MqttClientResp>> GetLockedDeviceClients()
|
||||
{
|
||||
var userIds = await _cache.SetMembersAsync("locked_devices");
|
||||
var deviceSns = await _cache.SetMembersAsync("locked_devices");
|
||||
|
||||
var result = new List<MqttClientResp>();
|
||||
|
||||
foreach (var userId in userIds)
|
||||
foreach (var deviceSn in deviceSns)
|
||||
{
|
||||
var entries = await _cache.HashGetAllAsync($"client:{userId}");
|
||||
var entries = await _cache.HashGetAllAsync($"client:{deviceSn}");
|
||||
if (entries.Length > 0)
|
||||
result.Add(ParseClient(entries));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue