李昊 4 年之前
父節點
當前提交
3f7f9cebb0

+ 1 - 1
gx_api/GxPress/Model/GxPress.Entity/tede2/Media/MediaLable.cs

@@ -26,6 +26,6 @@ namespace GxPress.Entity.tede2.Media
         /// </summary>
         /// <value></value>
         [DataColumn]
-        public string LableIdName { get; set; }
+        public string LableName { get; set; }
     }
 }

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

@@ -47,12 +47,17 @@ namespace GxPress.Repository.Implement.Media
             //获取媒体
             var media = await _repository.GetAsync(id);
             result = _mapper.Map<MediaResult>(media);
+            result.ImageUrls = StringUtils.AddDomain(result.ImageUrls);
             result.CategoryId = StringUtils.StringCollectionToStringList(media.CategoryId).ToList();
             result.CategoryName = StringUtils.StringCollectionToStringList(media.CategoryName).ToList();
             result.FullCategoryId = StringUtils.StringCollectionToStringList(media.FullCategoryId).ToList();
             //获取媒体库资源
             var mediaLibrarys = await mediaLibraryRepository.GetAllAsync(Q.Where(nameof(Entity.tede2.Media.MediaLibrary.MediaId), id));
             result.MediaLibraryResults = mediaLibrarys.ToList().Select(n => _mapper.Map<MediaLibraryResult>(n)).ToList();
+            foreach (var item in result.MediaLibraryResults)
+            {
+                item.FileUrl = StringUtils.AddDomain(item.FileUrl);
+            }
             //获取媒体标签
             var mediaLables = await mediaLableRepository.GetAllAsync(Q.Where(nameof(Entity.tede2.Media.MediaLable.MediaId), id));
             result.MediaLableResults = mediaLables.Select(n => _mapper.Map<MediaLableResult>(n)).ToList();
@@ -92,6 +97,7 @@ namespace GxPress.Repository.Implement.Media
         public async Task<bool> InsertAsync(MediaResult result)
         {
             var model = _mapper.Map<Entity.tede2.Media.Media>(result);
+            model.ImageUrls = StringUtils.RemoveDomain(result.ImageUrls);
             try
             {
                 using (var transactionScope = new TransactionScope())
@@ -120,6 +126,7 @@ namespace GxPress.Repository.Implement.Media
                         {
                             var mediaLibrary = _mapper.Map<Entity.tede2.Media.MediaLibrary>(item);
                             mediaLibrary.MediaId = id;
+                            mediaLibrary.FileUrl = StringUtils.RemoveDomain(item.FileUrl);
                             await mediaLibraryRepository.InsertAsync(mediaLibrary);
                         }
                     }