feat: 数据库迁移

This commit is contained in:
橙子
2023-10-07 17:51:05 +08:00
parent ca5697fb9c
commit c271f3005a
68 changed files with 222 additions and 18 deletions

View File

@@ -0,0 +1,13 @@
using Yi.Framework.Infrastructure.Ddd.Services.Abstract;
using Yi.Furion.Core.App.Dtos.Trends;
namespace Yi.Furion.Application.App.Services
{
/// <summary>
/// Trends服务抽象
/// </summary>
public interface ITrendsService : ICrudAppService<TrendsGetOutputDto, TrendsGetListOutputDto, long, TrendsGetListInput, TrendsCreateInput, TrendsUpdateInputVo>
{
}
}

View File

@@ -0,0 +1,34 @@
using SqlSugar;
using Yi.Framework.Infrastructure.Ddd.Dtos;
using Yi.Framework.Infrastructure.Ddd.Services;
using Yi.Furion.Application.App.Services;
using Yi.Furion.Core.App.Dtos.Trends;
using Yi.Furion.Core.App.Entities;
namespace Yi.Furion.Application.App.Services.Impl
{
/// <summary>
/// Trends服务实现
/// </summary>
[ApiDescriptionSettings("App")]
public class TrendsService : CrudAppService<TrendsEntity, TrendsGetOutputDto, TrendsGetListOutputDto, long, TrendsGetListInput, TrendsCreateInput, TrendsUpdateInputVo>,
ITrendsService, IDynamicApiController, ITransient
{
/// <summary>
/// 多查
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public override async Task<PagedResultDto<TrendsGetListOutputDto>> GetListAsync(TrendsGetListInput input)
{
var entity = await MapToEntityAsync(input);
RefAsync<int> total = 0;
var entities = await _DbQueryable
.WhereIF(input.StartTime is not null && input.EndTime is not null, x => x.CreationTime >= input.StartTime && x.CreationTime <= input.EndTime)
.ToPageListAsync(input.PageNum, input.PageSize, total);
return new PagedResultDto<TrendsGetListOutputDto>(total, await MapToGetListOutputDtosAsync(entities));
}
}
}