Example #1
0
 /// <summary>
 /// 配置动作方法名称
 /// </summary>
 /// <param name="action">动作方法模型</param>
 /// <param name="apiDescriptionSettings">接口描述配置</param>
 /// <param name="controllerApiDescriptionSettings"></param>
 private void ConfigureActionName(ActionModel action, ApiDescriptionSettingsAttribute apiDescriptionSettings, ApiDescriptionSettingsAttribute controllerApiDescriptionSettings)
 {
     action.ActionName = ConfigureControllerAndActionName(apiDescriptionSettings, action.ActionName, _dynamicApiControllerSettings.AbandonActionAffixes, (tempName) =>
     {
         // 处理动作方法名称谓词
         if (!CheckIsKeepVerb(apiDescriptionSettings, controllerApiDescriptionSettings))
         {
             var words   = Penetrates.SplitCamelCase(tempName);
             var verbKey = words.First().ToLower();
             // 处理类似 getlist,getall 多个单词
             if (words.Length > 1 && Penetrates.VerbToHttpMethods.ContainsKey((words[0] + words[1]).ToLower()))
             {
                 tempName = tempName[(words[0] + words[1]).Length..];
             }
 /// <summary>
 /// 扫描控制器
 /// </summary>
 /// <param name="typeInfo">类型</param>
 /// <returns>bool</returns>
 protected override bool IsController(TypeInfo typeInfo)
 {
     return(Penetrates.IsController(typeInfo));
 }