修改机场数据
parent
0ec8f35cd1
commit
f023c77f6c
|
|
@ -1,4 +1,5 @@
|
|||
using DocumentFormat.OpenXml.Wordprocessing;
|
||||
using DocumentFormat.OpenXml.Math;
|
||||
using DocumentFormat.OpenXml.Wordprocessing;
|
||||
using Infrastructure;
|
||||
using OpenAuth.App.BaseApp.Base;
|
||||
using OpenAuth.App.Interface;
|
||||
|
|
@ -24,20 +25,20 @@ namespace OpenAuth.App.ServiceApp
|
|||
/// <param name="pageSize"></param>
|
||||
/// <param name="key"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<Response<PageInfo<List<LasaDronePort>>>> GetPageList(int pageIndex, int pageSize, string key)
|
||||
public async Task<Response<PageInfo<List<LasaDronePort>>>> GetPageList(int page, int limit, string key)
|
||||
{
|
||||
int totalCount = 0;
|
||||
PageModel pageModel = new PageModel()
|
||||
|
||||
RefAsync<int> totalCount = 0;
|
||||
using (var db = UnitWork.CreateContext())
|
||||
{
|
||||
PageIndex = pageIndex,
|
||||
PageSize = pageSize,
|
||||
TotalCount = totalCount
|
||||
};
|
||||
var list = await Repository.GetPageListAsync(it => it.Name.Contains(key), pageModel, it => it.UpdateTime, OrderByType.Desc);
|
||||
return new Response<PageInfo<List<LasaDronePort>>>
|
||||
{
|
||||
Result = new PageInfo<List<LasaDronePort>> { Items = list, Total = totalCount }
|
||||
};
|
||||
var list = await db.LasaDronePort.AsQueryable().Includes(a => a.UavList)
|
||||
.WhereIF(!string.IsNullOrEmpty(key), a => a.Name.Contains(key))
|
||||
.ToPageListAsync(page, limit, totalCount);
|
||||
return new Response<PageInfo<List<LasaDronePort>>>
|
||||
{
|
||||
Result = new PageInfo<List<LasaDronePort>> { Items = list, Total = totalCount }
|
||||
};
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取无人机列表
|
||||
|
|
|
|||
|
|
@ -2,9 +2,10 @@
|
|||
|
||||
namespace OpenAuth.Repository.Domain
|
||||
{
|
||||
[SugarTable("lasa_droneport")]
|
||||
[SugarTable("lasa_droneport")]
|
||||
public class LasaDronePort
|
||||
{
|
||||
[SugarColumn(IsPrimaryKey = true)]
|
||||
public string Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string TypeId { get; set; }
|
||||
|
|
@ -15,6 +16,8 @@ namespace OpenAuth.Repository.Domain
|
|||
public long OrgId { get; set; }
|
||||
public string Sn { get; set; }
|
||||
public string DevicePicUrl { get; set; }
|
||||
public string Did { get; set; }
|
||||
public string Did { get; set; }
|
||||
[Navigate(NavigateType.OneToMany, nameof(LasaUav.PId))]
|
||||
public List<LasaUav> UavList { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ namespace OpenAuth.Repository.Domain
|
|||
[SugarTable("lasa_uav")]
|
||||
public class LasaUav
|
||||
{
|
||||
[SugarColumn(IsPrimaryKey = true)]
|
||||
public string Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string TypeId { get; set; }
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers
|
|||
/// <param name="key"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
[AllowAnonymous]
|
||||
public async Task<Response<PageInfo<List<LasaDronePort>>>> GetDataList(int page, int limit, string key)
|
||||
{
|
||||
var result = new Response<PageInfo<List<LasaDronePort>>>();
|
||||
|
|
@ -65,6 +66,7 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers
|
|||
/// <param name="key"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
[AllowAnonymous]
|
||||
public async Task<Response<PageInfo<List<LasaUav>>>> GetUavPageList(int page, int limit, string key)
|
||||
{
|
||||
var result = new Response<PageInfo<List<LasaUav>>>();
|
||||
|
|
|
|||
Loading…
Reference in New Issue