feat: 添加abp的后台管理
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
using SqlSugar;
|
||||
using Volo.Abp.Application.Dtos;
|
||||
using Volo.Abp.Domain.Repositories;
|
||||
using Yi.Framework.Bbs.Application.Contracts.Dtos.Plate;
|
||||
using Yi.Framework.Bbs.Application.Contracts.IServices;
|
||||
using Yi.Framework.Bbs.Domain.Entities;
|
||||
using Yi.Framework.Ddd.Application;
|
||||
using Yi.Framework.Rbac.Application.Contracts.Dtos.Config;
|
||||
using Yi.Framework.SqlSugarCore.Abstractions;
|
||||
|
||||
namespace Yi.Framework.Bbs.Application.Services
|
||||
{
|
||||
@@ -12,8 +16,21 @@ namespace Yi.Framework.Bbs.Application.Services
|
||||
public class PlateService : YiCrudAppService<PlateEntity, PlateGetOutputDto, PlateGetListOutputDto, Guid, PlateGetListInputVo, PlateCreateInputVo, PlateUpdateInputVo>,
|
||||
IPlateService
|
||||
{
|
||||
public PlateService(IRepository<PlateEntity, Guid> repository) : base(repository)
|
||||
private ISqlSugarRepository<PlateEntity, Guid> _repository;
|
||||
public PlateService(ISqlSugarRepository<PlateEntity, Guid> repository) : base(repository)
|
||||
{
|
||||
_repository= repository;
|
||||
}
|
||||
|
||||
public override async Task<PagedResultDto<PlateGetListOutputDto>> GetListAsync(PlateGetListInputVo input)
|
||||
{
|
||||
RefAsync<int> total = 0;
|
||||
|
||||
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)
|
||||
.ToPageListAsync(input.SkipCount, input.MaxResultCount, total);
|
||||
return new PagedResultDto<PlateGetListOutputDto>(total, await MapToGetListOutputDtosAsync(entities));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user