更新仓储层上下文对象与接口命名规范

This commit is contained in:
chenchun
2022-04-12 18:09:13 +08:00
parent e7a27cc474
commit 796bba1abe
9 changed files with 57 additions and 7 deletions

View File

@@ -6,11 +6,11 @@
<members>
<member name="T:Yi.Framework.ApiMicroservice.Controllers.BaseCrudController`1">
<summary>
6666
Json To Sql 类比模式,通用模型
</summary>
<typeparam name="T"></typeparam>
</member>
<member name="M:Yi.Framework.ApiMicroservice.Controllers.BaseCrudController`1.Get(System.Int64)">
<member name="M:Yi.Framework.ApiMicroservice.Controllers.BaseCrudController`1.GetById(System.Int64)">
<summary>
主键查询
</summary>
@@ -23,7 +23,7 @@
</summary>
<returns></returns>
</member>
<member name="M:Yi.Framework.ApiMicroservice.Controllers.BaseCrudController`1.Page(Yi.Framework.Model.Query.QueryPageCondition)">
<member name="M:Yi.Framework.ApiMicroservice.Controllers.BaseCrudController`1.PageList(Yi.Framework.Model.Query.QueryPageCondition)">
<summary>
条件分页查询
</summary>
@@ -51,6 +51,12 @@
<param name="ids"></param>
<returns></returns>
</member>
<member name="M:Yi.Framework.ApiMicroservice.Controllers.TestController.DbTest">
<summary>
仓储上下文对象测试
</summary>
<returns></returns>
</member>
<member name="M:Yi.Framework.ApiMicroservice.Controllers.TestController.LocalTest">
<summary>
国际化测试

View File

@@ -11,7 +11,7 @@ using Yi.Framework.WebCore.AttributeExtend;
namespace Yi.Framework.ApiMicroservice.Controllers
{
/// <summary>
/// 6666
/// Json To Sql 类比模式,通用模型
/// </summary>
/// <typeparam name="T"></typeparam>
[ApiController]
@@ -35,7 +35,7 @@ namespace Yi.Framework.ApiMicroservice.Controllers
/// <returns></returns>
[Permission($"{nameof(T)}:get:one")]
[HttpGet]
public async Task<Result> Get(long id)
public async Task<Result> GetById(long id)
{
return Result.Success().SetData(await _repository.GetByIdAsync(id));
}
@@ -58,7 +58,7 @@ namespace Yi.Framework.ApiMicroservice.Controllers
/// <returns></returns>
[Permission($"{nameof(T)}:get:page")]
[HttpPost]
public async Task<Result> Page(QueryPageCondition queryCondition)
public async Task<Result> PageList(QueryPageCondition queryCondition)
{
return Result.Success().SetData(await _repository.CommonPageAsync(queryCondition));
}

View File

@@ -22,10 +22,24 @@ namespace Yi.Framework.ApiMicroservice.Controllers
public class TestController : ControllerBase
{
private IStringLocalizer<LocalLanguage> _local;
private IUserService _iUserService;
public TestController(ILogger<UserEntity> logger, IUserService iUserService, IStringLocalizer<LocalLanguage> local)
{
_local = local;
_iUserService = iUserService;
}
/// <summary>
/// 仓储上下文对象测试
/// </summary>
/// <returns></returns>
[HttpGet]
/// 特点:仓储代理上下文对象,用起来就是爽
public async Task<Result> DbTest()
{
return Result.Success().SetData(await _iUserService.DbTest());
}
/// <summary>
/// 国际化测试
/// </summary>

View File

@@ -19,8 +19,10 @@ namespace Yi.Framework.ApiMicroservice.Controllers
[Route("api/[controller]/[action]")]
public class UserController : BaseCrudController<UserEntity>
{
private IUserService _iUserService;
public UserController(ILogger<UserEntity> logger, IUserService iUserService) : base(logger, iUserService)
{
_iUserService = iUserService;
}
}
}