Beispiel #1
0
 /// <summary>
 /// 配置动作方法名称
 /// </summary>
 /// <param name="action">动作方法模型</param>
 /// <param name="apiDescriptionSettings">接口配置描述</param>
 private void ConfigureActionName(ActionModel action, ApiDescriptionSettingsAttribute apiDescriptionSettings)
 {
     action.ActionName = ConfigureControllerAndActionName(apiDescriptionSettings, action.ActionName, _lazyControllerSettings.AbandonActionAffixes, (tempName) =>
     {
         // 处理动作方法名称谓词
         if (apiDescriptionSettings?.KeepVerb != true)
         {
             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..];
             }
Beispiel #2
0
 /// <summary>
 /// 扫描控制器
 /// </summary>
 /// <param name="typeInfo">类型</param>
 /// <returns></returns>
 protected override bool IsController(TypeInfo typeInfo)
 {
     return(Penetrates.IsController(typeInfo));
 }