李昊 4 years ago
parent
commit
c41f64043b

+ 5 - 0
gx_api/GxPress/Model/GxPress.Result/App/Note/NoteDetailResult.cs

@@ -39,6 +39,11 @@ namespace GxPress.Result.App.Note
         public int UserId { get; set; }
 
         /// <summary>
+        /// 头像地址
+        /// </summary>
+        public string AvatarUrl { get; set; }
+
+        /// <summary>
         /// 阅读数量
         /// </summary>
 

+ 1 - 0
gx_api/GxPress/Repository/GxPress.Repository.Implement/Media/MediaRepository.cs

@@ -397,6 +397,7 @@ namespace GxPress.Repository.Implement.Media
             query.Where(nameof(Entity.tede2.Media.Media.IsDelete), false);
             query.OrderByDesc(nameof(Entity.tede2.Media.Media.IsTop));
             query.OrderByDesc(nameof(Entity.tede2.Media.Media.IsRecommend));
+            query.OrderByDesc(nameof(Entity.tede2.Media.Media.LastModifiedDate));
             query.ForPage(1, 10);
             return await _repository.GetAllAsync<NavigationMediaResult>(query);
         }

+ 1 - 2
gx_api/GxPress/Service/GxPress.Service.Implement/Note/NoteService.cs

@@ -441,11 +441,10 @@ namespace GxPress.Service.Implement.Note
             var result = _mapper.Map<NoteDetailResult>(note);
             var user = await _userRepository.GetAsync(result.UserId);
             result.Name = user.Name;
+            result.AvatarUrl = StringUtils.AddDomainMin(user.AvatarUrl);
             var list = JsonConvert.DeserializeObject<List<ContentJsonData>>(note.Content);
             foreach (var item in list)
-            {
                 item.File = StringUtils.AddDomain(item.File);
-            }
             if (userId == 0)
                 return result;
             //获取共享文件夹名称