|
@@ -994,6 +994,23 @@ namespace Hotline.Api.Controllers
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
#region 知识收藏
|
|
#region 知识收藏
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 知识收藏列表
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="dto"></param>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ [Permission(EPermission.KnowledgeCollectList)]
|
|
|
|
+ [HttpGet("knowledge_collect/list")]
|
|
|
|
+ public async Task<List<KnowledgeCollectDto>> List([FromQuery] KnowledgeCollectListDto dto)
|
|
|
|
+ {
|
|
|
|
+ var comments = await _knowledgeCollectRepository.Queryable()
|
|
|
|
+ .Includes(x=>x.Knowledge)
|
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.Keyword),x=>x.Knowledge.Title.Contains(dto.Keyword!)||( x.Knowledge.Summary != null && x.Knowledge.Summary.Contains(dto.Keyword!)))
|
|
|
|
+ .OrderByDescending(x => x.CreationTime)
|
|
|
|
+ .ToListAsync();
|
|
|
|
+ return new List<KnowledgeCollectDto>(_mapper.Map<IReadOnlyList<KnowledgeCollectDto>>(comments));
|
|
|
|
+ }
|
|
|
|
+
|
|
/// <summary>
|
|
/// <summary>
|
|
/// 新增知识收藏
|
|
/// 新增知识收藏
|
|
/// </summary>
|
|
/// </summary>
|