feat: 完成板块的排序功能

This commit is contained in:
橙子
2023-12-18 23:17:09 +08:00
parent c49e89605c
commit e84a9ae114
5 changed files with 1578 additions and 0 deletions

View File

@@ -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; }
}
}

View File

@@ -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; }
}
}

View File

@@ -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));
}

View File

@@ -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; }
}
}