feat: 完成板块的排序功能
This commit is contained in:
@@ -10,5 +10,7 @@ namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Plate
|
||||
public string? Introduction { get; set; }
|
||||
|
||||
public string Code { get; set; }
|
||||
|
||||
public int OrderNum { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,5 +7,7 @@ namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Plate
|
||||
public string? Introduction { get; set; }
|
||||
|
||||
public string? Code { get; set; }
|
||||
|
||||
public int OrderNum { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ namespace Yi.Framework.Bbs.Application.Services
|
||||
var entities = await _repository._DbQueryable.WhereIF(!string.IsNullOrEmpty(input.Name), x => x.Name.Contains(input.Name!))
|
||||
.WhereIF(!string.IsNullOrEmpty(input.Code), x => x.Name.Contains(input.Code!))
|
||||
.WhereIF(input.StartTime is not null && input.EndTime is not null, x => x.CreationTime >= input.StartTime && x.CreationTime <= input.EndTime)
|
||||
.OrderByDescending(x=>x.OrderNum)
|
||||
.ToPageListAsync(input.SkipCount, input.MaxResultCount, total);
|
||||
return new PagedResultDto<PlateGetListOutputDto>(total, await MapToGetListOutputDtosAsync(entities));
|
||||
}
|
||||
|
||||
@@ -27,5 +27,7 @@ namespace Yi.Framework.Bbs.Domain.Entities
|
||||
public Guid? LastModifierId { get; set; }
|
||||
|
||||
public DateTime? LastModificationTime { get; set; }
|
||||
|
||||
public int OrderNum { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user