feat: 添加swagger文档,优化枚举操作

This commit is contained in:
橙子
2023-12-30 16:10:30 +08:00
parent a4570b7b2f
commit d51e682110
8 changed files with 79 additions and 19 deletions

View File

@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;
using Mapster;
using Microsoft.AspNetCore.Authorization;
@@ -143,7 +144,7 @@ namespace Yi.Framework.Bbs.Application.Services
/// 导入文章
/// </summary>
/// <returns></returns>
public async Task PostImportAsync(ArticleImprotDto input, [FromForm] IFormFileCollection file)
public async Task PostImportAsync([FromQuery] ArticleImprotDto input, [FromForm][Required] IFormFileCollection file)
{
var fileObjs = new List<FileObject>();
if (file.Count > 0)
@@ -172,7 +173,7 @@ namespace Yi.Framework.Bbs.Application.Services
throw new UserFriendlyException("未选择文件");
}
//使用简单工厂根据传入的类型进行判断
await _forumManager.PostImportAsync(input.DiscussId, fileObjs, input.ImportType);
await _forumManager.PostImportAsync(input.DiscussId, input.ArticleParentId, fileObjs, input.ImportType);
}