parent
5d95cc9da2
commit
184a9d08c1
|
|
@ -0,0 +1,41 @@
|
||||||
|
using Infrastructure;
|
||||||
|
using OpenAuth.App.BaseApp.Base;
|
||||||
|
using OpenAuth.App.Interface;
|
||||||
|
using OpenAuth.App.Request;
|
||||||
|
using OpenAuth.Repository;
|
||||||
|
using OpenAuth.Repository.Domain;
|
||||||
|
using SqlSugar;
|
||||||
|
|
||||||
|
namespace OpenAuth.App.ServiceApp.AI;
|
||||||
|
|
||||||
|
public class AiAchievementServiceApp : SqlSugarBaseApp<LasaAiAchievement, SugarDbContext>
|
||||||
|
{
|
||||||
|
public AiAchievementServiceApp(ISugarUnitOfWork<SugarDbContext> unitWork,
|
||||||
|
ISimpleClient<LasaAiAchievement> repository, IAuth auth) : base(unitWork, repository, auth)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<Response<PageInfo<List<LasaAiAchievement>>>> GetAiAchievementList(PageReq req)
|
||||||
|
{
|
||||||
|
RefAsync<int> total = 0;
|
||||||
|
var page = await Repository.AsQueryable()
|
||||||
|
.WhereIF(!string.IsNullOrEmpty(req.key), x => x.Title.Contains(req.key))
|
||||||
|
.ToPageListAsync(req.page, req.limit, total);
|
||||||
|
return new Response<PageInfo<List<LasaAiAchievement>>>()
|
||||||
|
{
|
||||||
|
Result = new PageInfo<List<LasaAiAchievement>>()
|
||||||
|
{
|
||||||
|
Items = page,
|
||||||
|
Total = total.Value
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<Response<LasaAiAchievement>> GetAiAchievement(string id)
|
||||||
|
{
|
||||||
|
return new Response<LasaAiAchievement>()
|
||||||
|
{
|
||||||
|
Result = await Repository.GetByIdAsync(id)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -6,7 +6,7 @@ using OpenAuth.Repository;
|
||||||
using OpenAuth.Repository.Domain;
|
using OpenAuth.Repository.Domain;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
|
||||||
namespace OpenAuth.App.ServiceApp;
|
namespace OpenAuth.App.ServiceApp.Algo;
|
||||||
|
|
||||||
public class AlgoInstanceServiceApp : SqlSugarBaseApp<LasaAlgoInstance, SugarDbContext>
|
public class AlgoInstanceServiceApp : SqlSugarBaseApp<LasaAlgoInstance, SugarDbContext>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -650,15 +650,6 @@ namespace OpenAuth.App.ServiceApp.DroneDocking
|
||||||
{
|
{
|
||||||
ResData Response = new ResData();
|
ResData Response = new ResData();
|
||||||
string data = "{\r\n\"code\": 200,\r\n\"data\": {\r\n\"mode_code\":0,\r\n\"longitude\":122.45,\r\n\"latitude\":30.45,\r\n\"height\":80,\r\n\"elevation\":50,\r\n\"gimbal_pitch\":-45,\r\n\"gimbal_yaw\":23,\r\n\"battery_capacity_percent\":35,\r\n\"gps_state\":2,\r\n},\r\n\"message\": \"获取无人机机场状态成功!\",\r\n\"traceid\": \"xxx\"\r\n}";
|
string data = "{\r\n\"code\": 200,\r\n\"data\": {\r\n\"mode_code\":0,\r\n\"longitude\":122.45,\r\n\"latitude\":30.45,\r\n\"height\":80,\r\n\"elevation\":50,\r\n\"gimbal_pitch\":-45,\r\n\"gimbal_yaw\":23,\r\n\"battery_capacity_percent\":35,\r\n\"gps_state\":2,\r\n},\r\n\"message\": \"获取无人机机场状态成功!\",\r\n\"traceid\": \"xxx\"\r\n}";
|
||||||
//todo deviceid
|
|
||||||
var topicRequest1 = $"thing/product/" + deviceid + "/osd";
|
|
||||||
await _mqttClientManager.SubscribeAsync(topicRequest1, async (args) =>
|
|
||||||
{
|
|
||||||
var payload1 = args.ApplicationMessage.Payload;
|
|
||||||
var message = Encoding.UTF8.GetString(payload1);
|
|
||||||
Console.WriteLine($"收到主题 [{args.ApplicationMessage.Topic}] 的消息: {message}");
|
|
||||||
await Task.CompletedTask;
|
|
||||||
});
|
|
||||||
if (true)
|
if (true)
|
||||||
{
|
{
|
||||||
string x_lc_secret = _helper.getxseret();
|
string x_lc_secret = _helper.getxseret();
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
using SqlSugar;
|
||||||
|
|
||||||
|
namespace OpenAuth.Repository.Domain;
|
||||||
|
|
||||||
|
public class LasaAiAchievement
|
||||||
|
{
|
||||||
|
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
|
||||||
|
public string Id { get; set; }
|
||||||
|
|
||||||
|
[SugarColumn(ColumnName = "Title")]
|
||||||
|
public string Title { get; set; }
|
||||||
|
|
||||||
|
[SugarColumn(ColumnName = "ConfidenceLevel")]
|
||||||
|
public float? ConfidenceLevel { get; set; }
|
||||||
|
|
||||||
|
[SugarColumn(ColumnName = "Lng")]
|
||||||
|
public float? Lng { get; set; }
|
||||||
|
|
||||||
|
[SugarColumn(ColumnName = "Lat")]
|
||||||
|
public float? Lat { get; set; }
|
||||||
|
|
||||||
|
[SugarColumn(ColumnName = "Address")]
|
||||||
|
public string Address { get; set; }
|
||||||
|
|
||||||
|
[SugarColumn(ColumnName = "CreateTime")]
|
||||||
|
public DateTime? CreateTime { get; set; }
|
||||||
|
|
||||||
|
[SugarColumn(ColumnName = "PayloadModel")]
|
||||||
|
public string PayloadModel { get; set; }
|
||||||
|
|
||||||
|
[SugarColumn(ColumnName = "AiModel")]
|
||||||
|
public string AiModel { get; set; }
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
using SqlSugar;
|
||||||
|
|
||||||
|
namespace OpenAuth.Repository.Domain;
|
||||||
|
|
||||||
|
public class LasaAiAchievementDetail
|
||||||
|
{
|
||||||
|
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
|
||||||
|
public string Id { get; set; }
|
||||||
|
|
||||||
|
[SugarColumn(ColumnName = "Image")]
|
||||||
|
public string Image { get; set; }
|
||||||
|
|
||||||
|
[SugarColumn(ColumnName = "AiAchievementId")]
|
||||||
|
public string AiAchievementId { get; set; }
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,44 @@
|
||||||
|
using Infrastructure;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using OpenAuth.App.Request;
|
||||||
|
using OpenAuth.App.ServiceApp.AI;
|
||||||
|
using OpenAuth.Repository.Domain;
|
||||||
|
|
||||||
|
namespace OpenAuth.WebApi.Controllers.ServiceControllers;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// AI成果控制器
|
||||||
|
/// </summary>
|
||||||
|
[Route("api/[controller]/[action]")]
|
||||||
|
[ApiController]
|
||||||
|
public class AiAchievementController : ControllerBase
|
||||||
|
{
|
||||||
|
private readonly AiAchievementServiceApp _app;
|
||||||
|
|
||||||
|
public AiAchievementController(AiAchievementServiceApp app)
|
||||||
|
{
|
||||||
|
_app = app;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// AI成果列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="req"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet]
|
||||||
|
public async Task<Response<PageInfo<List<LasaAiAchievement>>>> GetAiAchievementList([FromQuery] PageReq req)
|
||||||
|
{
|
||||||
|
return await _app.GetAiAchievementList(req);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// AI成果详情
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet]
|
||||||
|
public async Task<Response<LasaAiAchievement>> GetAiAchievement(string id)
|
||||||
|
{
|
||||||
|
return await _app.GetAiAchievement(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
using Infrastructure;
|
using Infrastructure;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using OpenAuth.App.ServiceApp;
|
using OpenAuth.App.ServiceApp;
|
||||||
|
using OpenAuth.App.ServiceApp.Algo;
|
||||||
using OpenAuth.App.ServiceApp.Algo.Request;
|
using OpenAuth.App.ServiceApp.Algo.Request;
|
||||||
using OpenAuth.Repository.Domain;
|
using OpenAuth.Repository.Domain;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue