爆肝,重构框架,你懂得
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.Interface.Base.Crud
|
||||
{
|
||||
public interface IApplicationService
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.Interface.Base.Crud
|
||||
{
|
||||
public interface ICreateAppService<TEntityDto>
|
||||
: ICreateAppService<TEntityDto, TEntityDto>
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
public interface ICreateAppService<TCreateResultOutputDto
|
||||
, in TCreateInputDto> : IApplicationService
|
||||
{
|
||||
Task<TCreateResultOutputDto> CreateAsync(TCreateInputDto dto);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.Interface.Base.Crud
|
||||
{
|
||||
public interface ICreateUpdateAppService<TEntityDto, in TKey>
|
||||
: ICreateUpdateAppService<TEntityDto, TKey, TEntityDto, TEntityDto>
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public interface ICreateUpdateAppService<TEntityDto, in TKey, in TCreateUpdateInput>
|
||||
: ICreateUpdateAppService<TEntityDto, TKey, TCreateUpdateInput, TCreateUpdateInput>
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public interface ICreateUpdateAppService<TGetOutputDto, in TKey, in TCreateUpdateInput, in TUpdateInput>
|
||||
: ICreateAppService<TGetOutputDto, TCreateUpdateInput>,
|
||||
IUpdateAppService<TGetOutputDto, TKey, TUpdateInput>
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.Interface.Base.Crud
|
||||
{
|
||||
public interface ICrudAppService<TEntityDto, in TKey>
|
||||
: ICrudAppService<TEntityDto, TKey, TEntityDto>
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public interface ICrudAppService<TEntityDto, in TKey, in TCreateInput>
|
||||
: ICrudAppService<TEntityDto, TKey, TCreateInput, TCreateInput>
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public interface ICrudAppService<TEntityDto, in TKey, in TCreateInput, in TUpdateInput>
|
||||
: ICrudAppService<TEntityDto, TEntityDto, TKey, TCreateInput, TUpdateInput>
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public interface ICrudAppService<TGetOutputDto, TGetListOutputDto, in TKey, in TCreateInput, in TUpdateInput>
|
||||
: IReadOnlyAppService<TGetOutputDto, TGetListOutputDto, TKey>,
|
||||
ICreateUpdateAppService<TGetOutputDto, TKey, TCreateInput, TUpdateInput>,
|
||||
IDeleteAppService<TKey>
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.Interface.Base.Crud
|
||||
{
|
||||
public interface IDeleteAppService<in TKey> : IApplicationService
|
||||
{
|
||||
Task DeleteAsync(IEnumerable<TKey> ids);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.Interface.Base.Crud
|
||||
{
|
||||
|
||||
public interface IReadOnlyAppService<TListDto, in TKey> : IReadOnlyAppService<TListDto, TListDto, TKey>
|
||||
{
|
||||
}
|
||||
|
||||
public interface IReadOnlyAppService<TDetail, TListDto, in TKey> : IApplicationService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据Id获取数据
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
Task<TDetail> GetByIdAsync(TKey id);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据url参数查询
|
||||
/// </summary>
|
||||
/// <param name="urlParams"></param>
|
||||
/// <returns></returns>
|
||||
//Task<PageData<TListDto>> GetByUrl(List<UrlParams> input = null);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.Interface.Base.Crud
|
||||
{
|
||||
public interface IUpdateAppService<TEntityDto, in TKey>
|
||||
: IUpdateAppService<TEntityDto, TKey, TEntityDto>
|
||||
{
|
||||
|
||||
}
|
||||
public interface IUpdateAppService<TUpdateResultOutputDto, in TKey, in TUpdateInputDto> : IApplicationService
|
||||
{
|
||||
Task<TUpdateResultOutputDto> UpdateAsync(TKey id, TUpdateInputDto dto);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Repository;
|
||||
|
||||
namespace Yi.Framework.Interface.Base
|
||||
{
|
||||
public interface IBaseService<T> where T : class, new()
|
||||
{
|
||||
public IRepository<T> _repository { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user