白名单反显,防区转string
This commit is contained in:
parent
73302d48c7
commit
235989fb45
|
|
@ -30,7 +30,7 @@ namespace LY.App.Controllers
|
||||||
/// <param name="key"></param>
|
/// <param name="key"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpGet("list")]
|
[HttpGet("list")]
|
||||||
public async Task<IActionResult> List(int pageNum, int pageSize, string key)
|
public async Task<IActionResult> List(int pageNum = 1, int pageSize = 10, string key = null)
|
||||||
{
|
{
|
||||||
var result = await _whitListService.GetList(pageNum, pageSize, key);
|
var result = await _whitListService.GetList(pageNum, pageSize, key);
|
||||||
return Ok(result);
|
return Ok(result);
|
||||||
|
|
|
||||||
|
|
@ -20,9 +20,11 @@ namespace LY.App.Model
|
||||||
public DateTime? startTime { get; set; }
|
public DateTime? startTime { get; set; }
|
||||||
[SugarColumn(IsNullable = true)]
|
[SugarColumn(IsNullable = true)]
|
||||||
public DateTime? endTime { get; set; }
|
public DateTime? endTime { get; set; }
|
||||||
[JsonConverter(typeof(ValueToStringConverter))]
|
|
||||||
[SugarColumn(ColumnName = "position_id", ColumnDescription = "阵地id", IsJson = true)]
|
[SugarColumn(ColumnName = "position_id", ColumnDescription = "阵地id", IsJson = true)]
|
||||||
public List<long> positionId { get; set; }
|
public List<long> positionId { get; set; }
|
||||||
|
[SugarColumn(IsIgnore = true)]
|
||||||
|
public List<string> positionIds { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 所属单位
|
/// 所属单位
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ namespace LY.App.Service
|
||||||
public WhitListService(SqlSugarClient sqlSugarClient, RedisService redisService)
|
public WhitListService(SqlSugarClient sqlSugarClient, RedisService redisService)
|
||||||
{
|
{
|
||||||
_db = sqlSugarClient;
|
_db = sqlSugarClient;
|
||||||
_redisService=redisService;
|
_redisService = redisService;
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 新增白名单
|
/// 新增白名单
|
||||||
|
|
@ -69,7 +69,7 @@ namespace LY.App.Service
|
||||||
/// <param name="pageSize"></param>
|
/// <param name="pageSize"></param>
|
||||||
/// <param name="key"></param>
|
/// <param name="key"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<ApiResult> GetList(int pageNum, int pageSize, string key)
|
public async Task<ApiResult> GetList(int pageNum = 1, int pageSize = 10, string key = null)
|
||||||
{
|
{
|
||||||
var result = new ApiResult();
|
var result = new ApiResult();
|
||||||
RefAsync<int> total = 0;
|
RefAsync<int> total = 0;
|
||||||
|
|
@ -78,6 +78,10 @@ namespace LY.App.Service
|
||||||
.WhereIF(!string.IsNullOrEmpty(key), s => s.sn.Contains(key))
|
.WhereIF(!string.IsNullOrEmpty(key), s => s.sn.Contains(key))
|
||||||
.OrderByDescending(s => s.Id)
|
.OrderByDescending(s => s.Id)
|
||||||
.ToPageListAsync(pageNum, pageSize, total);
|
.ToPageListAsync(pageNum, pageSize, total);
|
||||||
|
items.ForEach(x =>
|
||||||
|
{
|
||||||
|
x.positionIds = x.positionId.Select(s => s.ToString()).ToList();
|
||||||
|
});
|
||||||
return new ApiResult()
|
return new ApiResult()
|
||||||
{
|
{
|
||||||
data = new
|
data = new
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue