liaoxujun@qq.com
2024-03-04 c8f9d5977cc950592f0ccfea01237eccde506350
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/***********************************************************************
 *            Project: CoreCms.Net                                     *
 *                Web: https://CoreCms.Net                             *
 *        ProjectName: 百分兵法管理系统                               *
 *             Author:                                        *
 *              Email:                               *
 *         CreateTime: 2020-03-15 20:42:29
 *        Description: 暂无
 ***********************************************************************/
 
 
using Microsoft.AspNetCore.Mvc.ApplicationModels;
 
namespace CoreCms.Net.Web.Admin.Infrastructure
{
    public class ApiExplorerIgnores : IActionModelConvention
    {
        /// <summary>
        /// 自带的Controller与swagger3.0冲突,在此排除扫描
        /// </summary>
        /// <param name="action"></param>
        public void Apply(ActionModel action)
        {
            //冲突的Ocelot.Raft.RaftController
            if (action.Controller.ControllerName == ("WxOfficialOAuth") || action.Controller.ControllerName == ("WxOpenOAuth"))
                action.ApiExplorer.IsVisible = false;
            //Ocelot.Cache.OutputCacheController
            if (action.Controller.ControllerName == ("AliPay"))
                action.ApiExplorer.IsVisible = false;
 
            if (action.Controller.ControllerName == ("WeChatPay"))
                action.ApiExplorer.IsVisible = false;
        }
    }
}