登陆之后返回防区
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 LY.App.Service;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
@ -23,7 +24,18 @@ namespace LY.App.Controllers
|
||||||
[HttpGet("list")]
|
[HttpGet("list")]
|
||||||
public async Task<IActionResult> Get([FromQuery] PositionQueryInput input)
|
public async Task<IActionResult> Get([FromQuery] PositionQueryInput input)
|
||||||
{
|
{
|
||||||
var positions =await _positionService.GetList(input);
|
var positions = await _positionService.GetList(input);
|
||||||
|
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);
|
return Ok(positions);
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
|
|
@ -109,11 +109,27 @@ namespace LY.App.Service
|
||||||
var entity = await _db.Queryable<PositionInfo>().FirstAsync(a => a.Id == id && a.IsDeleted != true);
|
var entity = await _db.Queryable<PositionInfo>().FirstAsync(a => a.Id == id && a.IsDeleted != true);
|
||||||
if (entity != null)
|
if (entity != null)
|
||||||
{
|
{
|
||||||
|
entity.SetRegionJson();
|
||||||
return new ApiResult() { data = entity };
|
return new ApiResult() { data = entity };
|
||||||
}
|
}
|
||||||
return new ApiResult(false, "未找到要获取的对象");
|
return new ApiResult(false, "未找到要获取的对象");
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <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>
|
/// </summary>
|
||||||
/// <param name="input"></param>
|
/// <param name="input"></param>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue