登陆之后返回防区
This commit is contained in:
parent
41df54cebc
commit
c8600c6bd7
|
|
@ -1,4 +1,5 @@
|
|||
using LY.App.Model;
|
||||
using GraphQL;
|
||||
using LY.App.Model;
|
||||
using LY.App.Service;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
|
@ -27,6 +28,17 @@ namespace LY.App.Controllers
|
|||
return Ok(positions);
|
||||
}
|
||||
/// <summary>
|
||||
/// 登陆 后获取当前防区
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("Details")]
|
||||
public async Task<IActionResult> detail(IEnumerable<long> ids)
|
||||
{
|
||||
var positions = await _positionService.Detail(ids);
|
||||
return Ok(positions);
|
||||
}
|
||||
/// <summary>
|
||||
/// 删除
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
|
|
|
|||
|
|
@ -109,11 +109,27 @@ namespace LY.App.Service
|
|||
var entity = await _db.Queryable<PositionInfo>().FirstAsync(a => a.Id == id && a.IsDeleted != true);
|
||||
if (entity != null)
|
||||
{
|
||||
entity.SetRegionJson();
|
||||
return new ApiResult() { data = entity };
|
||||
}
|
||||
return new ApiResult(false, "未找到要获取的对象");
|
||||
}
|
||||
/// <summary>
|
||||
/// Details
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<ApiResult> Detail(IEnumerable<long> ids)
|
||||
{
|
||||
var entity = await _db.Queryable<PositionInfo>()
|
||||
.Where(a => ids.Contains(a.Id) && a.IsDeleted != true).ToListAsync();
|
||||
entity.ForEach(a =>
|
||||
{
|
||||
a.SetRegionJson();
|
||||
});
|
||||
return new ApiResult() { data = entity };
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取列表
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
|
|
|
|||
Loading…
Reference in New Issue