浏览代码

Merge branch 'test' of http://110.188.24.182:10023/Fengwo/hotline into test

xf 2 周之前
父节点
当前提交
b02a2b1f7b

+ 0 - 8
src/Hotline.Api/Properties/launchSettings.json

@@ -19,14 +19,6 @@
             "environmentVariables": {
                 "ASPNETCORE_ENVIRONMENT": "Test"
             }
-        },
-        "IIS Express": {
-            "commandName": "IISExpress",
-            "launchBrowser": true,
-            "launchUrl": "swagger",
-            "environmentVariables": {
-                "ASPNETCORE_ENVIRONMENT": "Development"
-            }
         }
     }
 }

+ 7 - 0
src/Hotline.Application/Snapshot/IndustryApplication.cs

@@ -99,6 +99,13 @@ public class IndustryApplication : IIndustryApplication, IScopeDependency
         var files = await _fileRepository.GetByKeyAsync(id, token);
         var outDto = industry.Adapt<IndustryDetailOutDto>();
         outDto.Files = files.Adapt<IList<IndustryFileDto>>();
+        if (outDto.Files.NotNullOrEmpty())
+            outDto.Files.ToList().ForEach(m =>
+                    {
+                    m.AdditionId = m.Key;
+                    m.Additions = m.Key;
+                    m.FileName = m.Name;
+                    });
         return outDto;
     }
 

+ 9 - 0
test/Hotline.Tests/Application/IndustryApplicationTest.cs

@@ -18,6 +18,7 @@ using Hotline.ThirdAccountDomainServices;
 using Hotline.Repository.SqlSugar.Extensions;
 using Hotline.Snapshot.IRepository;
 using Hotline.Application.Snapshot.Contracts;
+using Hotline.Application.Snapshot;
 
 namespace Hotline.Tests.Application;
 public class IndustryApplicationTest : TestBase
@@ -41,6 +42,14 @@ public class IndustryApplicationTest : TestBase
         items.ShouldNotBeNull();
     }
 
+    [Fact]
+    public async Task GetIndustryDetail_Test()
+    {
+        var industry = await _industryApplication.GetIndustres(new IndustryListInDto("电气焊", null)).FirstAsync();
+        var detail = await _industryApplication.GetIndustryDetailAsync(industry.Id, CancellationToken.None);
+        detail.Name.ShouldNotBeNull();
+    }
+
     [Fact]
     public async Task UpdateIndustry_Test()
     {