Bladeren bron

Merge branch 'dev' of http://git.12345lm.cn/Fengwo/hotline into dev

Dun.Jason 6 maanden geleden
bovenliggende
commit
960750eac5

+ 6 - 6
src/Hotline.Api/Controllers/KnowledgeController.cs

@@ -515,10 +515,10 @@ namespace Hotline.Api.Controllers
         {
             return new List<KeyValuePair<int, string>>
             {
-                new KeyValuePair<int, string>(1, "已上架"),
-                new KeyValuePair<int, string>(2, "已下架"),
-                new KeyValuePair<int, string>(3, "审核中"),
-                new KeyValuePair<int, string>(4, "审核不通过")
+                new KeyValuePair<int, string>(3, "已上架"),
+                new KeyValuePair<int, string>(4, "已下架"),
+                new KeyValuePair<int, string>(1, "审核中"),
+                new KeyValuePair<int, string>(5, "审核不通过")
             };
         }
 
@@ -1342,10 +1342,10 @@ namespace Hotline.Api.Controllers
             if (await _knowledgeCollectGroupRepository
                 .Queryable()
                 .Where(m => m.Name == dto.Name && m.CreatorId == _sessionContext.UserId)
-                .AnyAsync() == true) throw new UserFriendlyException("分组名重复, 请重新输入!");
+                .AnyAsync() == true) throw UserFriendlyException.SameMessage("分组名重复, 请重新输入!");
 
             var key = await _knowledgeCollectGroupRepository.AddAsync(entity);
-            if (key.IsNullOrEmpty()) throw new UserFriendlyException("添加失败, 请重试");
+            if (key.IsNullOrEmpty()) throw UserFriendlyException.SameMessage("添加失败, 请重试");
             var outDto = dto.Adapt<KnowledgeCollectGroupOutDto>();
             outDto.Id = key;
             return outDto;

+ 1 - 1
src/Hotline.Application.Contracts/Validators/Knowledge/KnowledageCollectGroupValidator.cs

@@ -15,7 +15,7 @@ namespace Hotline.Application.Contracts.Validators.Knowledge
     {
         public KnowledgeCollectAddDtoValidator()
         {
-            RuleFor(d => d.KnowledgeCollectGroupId).NotEmpty();
+            //RuleFor(d => d.KnowledgeCollectGroupId).NotEmpty();
         }
     }
 }

+ 0 - 1
src/Hotline.Share/Dtos/Knowledge/KnowledgeCollectDto.cs

@@ -57,7 +57,6 @@ namespace Hotline.Share.Dtos.Knowledge
 		/// <summary>
 		/// 分组Id
 		/// </summary>
-		[Required]
 		public string KnowledgeCollectGroupId { get; set; }
 	}