10/20更新
This commit is contained in:
@@ -51,7 +51,7 @@ namespace Yi.Framework.ApiMicroservice.Controllers
|
||||
{
|
||||
//如果标题为空,默认为内容的前20个字符
|
||||
entity.Title = string.IsNullOrEmpty(entity.Title) ?
|
||||
(entity.Content.Length > 20 ? entity.Content.Substring(0, 20) : entity.Content) :
|
||||
(entity.Content?.Length > 20 ? entity.Content.Substring(0, 20) : entity.Content) :
|
||||
entity.Title;
|
||||
entity.UserId = HttpContext.GetUserIdInfo();
|
||||
return base.Add(entity);
|
||||
|
||||
@@ -17,12 +17,22 @@ namespace Yi.Framework.ApiMicroservice.Controllers
|
||||
{
|
||||
[ApiController]
|
||||
[Route("api/[controller]/[action]")]
|
||||
public class SkuController : BaseCrudController<SkuEntity>
|
||||
public class SkuController : BaseSimpleCrudController<SkuEntity>
|
||||
{
|
||||
private ISkuService _iSkuService;
|
||||
public SkuController(ILogger<SkuEntity> logger, ISkuService iSkuService) : base(logger, iSkuService)
|
||||
{
|
||||
_iSkuService = iSkuService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 动态条件分页查询
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<Result> PageList([FromQuery] SkuEntity eneity, [FromQuery] PageParModel page)
|
||||
{
|
||||
return Result.Success().SetData(await _iSkuService.SelctPageList(eneity, page));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,12 +17,22 @@ namespace Yi.Framework.ApiMicroservice.Controllers
|
||||
{
|
||||
[ApiController]
|
||||
[Route("api/[controller]/[action]")]
|
||||
public class SpuController : BaseCrudController<SpuEntity>
|
||||
public class SpuController : BaseSimpleCrudController<SpuEntity>
|
||||
{
|
||||
private ISpuService _iSpuService;
|
||||
public SpuController(ILogger<SpuEntity> logger, ISpuService iSpuService) : base(logger, iSpuService)
|
||||
{
|
||||
_iSpuService = iSpuService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 动态条件分页查询
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<Result> PageList([FromQuery] SpuEntity eneity, [FromQuery] PageParModel page)
|
||||
{
|
||||
return Result.Success().SetData(await _iSpuService.SelctPageList(eneity, page));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user