添加redis获取机场数据
parent
5bb38d60e0
commit
f7317974f6
|
|
@ -1642,7 +1642,7 @@ namespace OpenAuth.App.ServiceApp
|
||||||
|
|
||||||
public async Task<string> TestPreventFlyTask(string taskId)
|
public async Task<string> TestPreventFlyTask(string taskId)
|
||||||
{
|
{
|
||||||
// 任务信息
|
// 任务信息
|
||||||
var task = await Repository.ChangeRepository<SugarRepositiry<LasaTask>>().GetByIdAsync(taskId);
|
var task = await Repository.ChangeRepository<SugarRepositiry<LasaTask>>().GetByIdAsync(taskId);
|
||||||
var dronePort = await Repository.ChangeRepository<SugarRepositiry<LasaDronePort>>()
|
var dronePort = await Repository.ChangeRepository<SugarRepositiry<LasaDronePort>>()
|
||||||
.GetByIdAsync(task.TaskDronePort);
|
.GetByIdAsync(task.TaskDronePort);
|
||||||
|
|
@ -2973,7 +2973,8 @@ WHERE
|
||||||
{
|
{
|
||||||
Result = new
|
Result = new
|
||||||
{
|
{
|
||||||
modeCode, droneInDock
|
modeCode,
|
||||||
|
droneInDock
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
@ -3004,5 +3005,25 @@ WHERE
|
||||||
}
|
}
|
||||||
).First();
|
).First();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#region redis获取数据
|
||||||
|
public async Task<Response<string>> GetDronePortInfoFromRedis(string key)
|
||||||
|
{
|
||||||
|
var info = _redisCacheContext.Get<string>(key);
|
||||||
|
if (!string.IsNullOrEmpty(info))
|
||||||
|
{
|
||||||
|
return new Response<string>
|
||||||
|
{
|
||||||
|
Result = info
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return new Response<string>
|
||||||
|
{
|
||||||
|
Message = "暂无数据",
|
||||||
|
Code = 500
|
||||||
|
};
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1011,5 +1011,19 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers
|
||||||
{
|
{
|
||||||
await _configSubscribe.HandleTopic(null, topic, message);
|
await _configSubscribe.HandleTopic(null, topic, message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#region 获取redis数据
|
||||||
|
/// <summary>
|
||||||
|
/// 根据key获取redis数据
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="key"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet]
|
||||||
|
[AllowAnonymous]
|
||||||
|
public async Task<Response<string>> GetDronePortInfoFromRedis(string key)
|
||||||
|
{
|
||||||
|
return await _app.GetDronePortInfoFromRedis(key);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -22,8 +22,8 @@
|
||||||
"UploadPath": "",
|
"UploadPath": "",
|
||||||
//附件上传的路径,如果为空则保存在站点根目录
|
//附件上传的路径,如果为空则保存在站点根目录
|
||||||
"RedisConf": {
|
"RedisConf": {
|
||||||
//"Conn": "192.168.10.163:6379,password=123456",
|
"Conn": "192.168.10.163:6379,password=123456",
|
||||||
"Conn": "127.0.0.1:6379,password=123456",
|
//"Conn": "127.0.0.1:6379,password=123456",
|
||||||
"Database": 7
|
"Database": 7
|
||||||
},
|
},
|
||||||
//redis配置
|
//redis配置
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue