text: (window.webpackJsonp=window.webpackJsonp||[]).push([[6],{142:function(e,n,t){"use strict";t.d(n,"a",(function(){return m})),t.d(n,"b",(function(){return u}));var a=t(0),i=t.n(a);function r(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function b(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function c(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?b(Object(t),!0).forEach((function(n){r(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):b(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function l(e,n){if(null==e)return{};var t,a,i=function(e,n){if(null==e)return{};var t,a,i={},r=Object.keys(e);for(a=0;a<r.length;a++)t=r[a],n.indexOf(t)>=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a<r.length;a++)t=r[a],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var p=i.a.createContext({}),o=function(e){var n=i.a.useContext(p),t=n;return e&&(t="function"==typeof e?e(n):c(c({},n),e)),t},m=function(e){var n=o(e.components);return i.a.createElement(p.Provider,{value:n},e.children)},s={inlineCode:"code",wrapper:function(e){var n=e.children;return i.a.createElement(i.a.Fragment,{},n)}},d=i.a.forwardRef((function(e,n){var t=e.components,a=e.mdxType,r=e.originalType,b=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),m=o(t),d=a,u=m["".concat(b,".").concat(d)]||m[d]||s[d]||r;return t?i.a.createElement(u,c(c({ref:n},p),{},{components:t})):i.a.createElement(u,c({ref:n},p))}));function u(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var r=t.length,b=new Array(r);b[0]=d;var c={};for(var l in n)hasOwnProperty.call(n,l)&&(c[l]=n[l]);c.originalType=e,c.mdxType="string"==typeof e?e:a,b[1]=c;for(var p=2;p<r;p++)b[p]=t[p];return i.a.createElement.apply(null,b)}return i.a.createElement.apply(null,t)}d.displayName="MDXCreateElement"},143:function(e,n,t){"use strict";var a=t(0),i=t(19);n.a=function(){var e=Object(a.useContext)(i.a);if(null===e)throw new Error("Docusaurus context not provided");return e}},144:function(e,n,t){"use strict";t.d(n,"b",(function(){return r})),t.d(n,"a",(function(){return b}));var a=t(143),i=t(145);function r(){var e=Object(a.a)().siteConfig,n=(e=void 0===e?{}:e).baseUrl,t=void 0===n?"/":n,r=e.url;return{withBaseUrl:function(e,n){return function(e,n,t,a){var r=void 0===a?{}:a,b=r.forcePrependBaseUrl,c=void 0!==b&&b,l=r.absolute,p=void 0!==l&&l;if(!t)return t;if(t.startsWith("#"))return t;if(Object(i.b)(t))return t;if(c)return n+t;var o=t.startsWith(n)?t:n+t.replace(/^\//,"");return p?e+o:o}(r,t,e,n)}}}function b(e,n){return void 0===n&&(n={}),(0,r().withBaseUrl)(e,n)}},145:function(e,n,t){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function i(e){return void 0!==e&&!a(e)}t.d(n,"b",(function(){return a})),t.d(n,"a",(function(){return i}))},146:function(e,n,t){"use strict";function a(e){var n,t,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e))for(n=0;n<e.length;n++)e[n]&&(t=a(e[n]))&&(i&&(i+=" "),i+=t);else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}n.a=function(){for(var e,n,t=0,i="";t<arguments.length;)(e=arguments[t++])&&(n=a(e))&&(i&&(i+=" "),i+=n);return i}},147:function(e,n,t){"use strict";var a=t(0),i=Object(a.createContext)(void 0);n.a=i},148:function(e,n,t){"use strict";var a=t(0),i=t(147);n.a=function(){var e=Object(a.useContext)(i.a);if(null==e)throw new Error("`useUserPreferencesContext` is used outside of `Layout` Component.");return e}},149:function(e,n,t){"use strict";var a=t(0),i=t.n(a),r=t(148),b=t(146),c=t(47),l=t.n(c),p=37,o=39;n.a=function(e){var n=e.block,t=e.children,c=e.defaultValue,m=e.values,s=e.groupId,d=Object(r.a)(),u=d.tabGroupChoices,O=d.setTabGroupChoices,j=Object(a.useState)(c),N=j[0],g=j[1],C=Object(a.useState)(!1),v=C[0],A=C[1];if(null!=s){var h=u[s];null!=h&&h!==N&&m.some((function(e){return e.value===h}))&&g(h)}var f=function(e){g(e),null!=s&&O(s,e)},y=[],w=function(e){e.metaKey||e.altKey||e.ctrlKey||A(!0)},F=function(){A(!1)};return Object(a.useEffect)((function(){window.addEventListener("keydown",w),window.addEventListener("mousedown",F)}),[]),i.a.createElement("div",null,i.a.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:Object(b.a)("tabs",{"tabs--block":n})},m.map((function(e){var n=e.value,t=e.label;return i.a.createElement("li",{role:"tab",tabIndex:0,"aria-selected":N===n,className:Object(b.a)("tabs__item",l.a.tabItem,{"tabs__item--active":N===n}),style:v?{}:{outline:"none"},key:n,ref:function(e){return y.push(e)},onKeyDown:function(e){!function(e,n,t){switch(t.keyCode){case o:!function(e,n){var t=e.indexOf(n)+1;e[t]?e[t].focus():e[0].focus()}(e,n);break;case p:!function(e,n){var t=e.indexOf(n)-1;e[t]?e[t].focus():e[e.length-1].focus()}(e,n)}}(y,e.target,e),w(e)},onFocus:function(){return f(n)},onClick:function(){f(n),A(!1)},onPointerDown:function(){return A(!1)}},t)}))),i.a.createElement("div",{role:"tabpanel",className:"margin-vert--md"},a.Children.toArray(t).filter((function(e){return e.props.value===N}))[0]))}},150:function(e,n,t){"use strict";var a=t(0),i=t.n(a);n.a=function(e){return i.a.createElement("div",null,e.children)}},57:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return p})),t.d(n,"metadata",(function(){return o})),t.d(n,"rightToc",(function(){return m})),t.d(n,"default",(function(){return d}));var a=t(2),i=t(6),r=(t(0),t(142)),b=t(144),c=t(149),l=t(150),p={id:"dynamic-api-controller",title:"5. \u52a8\u6001 WebAPI",sidebar_label:"5. \u52a8\u6001 WebAPI"},o={unversionedId:"dynamic-api-controller",id:"dynamic-api-controller",isDocsHomePage:!1,title:"5. \u52a8\u6001 WebAPI",description:"5.1 \u4ec0\u4e48\u662f\u63a7\u5236\u5668",source:"@site/docs\\dynamic-api-controller.mdx",slug:"/dynamic-api-controller",permalink:"/docs/dynamic-api-controller",editUrl:"https://gitee.com/monksoul/Fur/tree/main/handbook/docs/dynamic-api-controller.mdx",version:"current",sidebar_label:"5. \u52a8\u6001 WebAPI",sidebar:"docs",previous:{title:"4.2 \u9009\u9879",permalink:"/docs/options"},next:{title:"6. \u89c4\u8303\u5316\u63a5\u53e3\u6587\u6863",permalink:"/docs/specification-document"}},m=[{value:"5.1 \u4ec0\u4e48\u662f\u63a7\u5236\u5668",id:"51-\u4ec0\u4e48\u662f\u63a7\u5236\u5668",children:[]},{value:"5.2 <code>Mvc \u63a7\u5236\u5668</code> \u7ea6\u5b9a\u548c\u7f3a\u70b9",id:"52-mvc-\u63a7\u5236\u5668-\u7ea6\u5b9a\u548c\u7f3a\u70b9",children:[{value:"5.2.1 <code>WebAPI</code> \u7ea6\u5b9a",id:"521-webapi-\u7ea6\u5b9a",children:[]},{value:"5.2.2 <code>.NET Core WebAPI</code> \u7f3a\u70b9",id:"522-net-core-webapi-\u7f3a\u70b9",children:[]}]},{value:"5.3 \u52a8\u6001 <code>WebAPI</code> \u63a7\u5236\u5668",id:"53-\u52a8\u6001-webapi-\u63a7\u5236\u5668",children:[]},{value:"5.4 \u6ce8\u518c\u52a8\u6001 <code>WebAPI</code> \u670d\u52a1",id:"54-\u6ce8\u518c\u52a8\u6001-webapi-\u670d\u52a1",children:[]},{value:"5.5 \u7b2c\u4e00\u4e2a\u4f8b\u5b50",id:"55-\u7b2c\u4e00\u4e2a\u4f8b\u5b50",children:[]},{value:"5.6 \u52a8\u6001 <code>WebAPI</code> \u539f\u7406\u89e3\u6790",id:"56-\u52a8\u6001-webapi-\u539f\u7406\u89e3\u6790",children:[{value:"5.6.1 \u63a7\u5236\u5668\u7279\u6027\u63d0\u4f9b\u5668",id:"561-\u63a7\u5236\u5668\u7279\u6027\u63d0\u4f9b\u5668",children:[]},{value:"5.6.2 \u5e94\u7528\u6a21\u578b\u8f6c\u6362\u5668",id:"562-\u5e94\u7528\u6a21\u578b\u8f6c\u6362\u5668",children:[]}]},{value:"5.7 \u52a8\u6001 <code>WebAPI</code> \u914d\u7f6e\u7ea6\u5b9a",id:"57-\u52a8\u6001-webapi-\u914d\u7f6e\u7ea6\u5b9a",children:[{value:"5.7.1 \u63a7\u5236\u5668\u9ed8\u8ba4\u7ea6\u5b9a",id:"571-\u63a7\u5236\u5668\u9ed8\u8ba4\u7ea6\u5b9a",children:[]},{value:"5.7.2 \u52a8\u4f5c\u65b9\u6cd5\u9ed8\u8ba4\u7ea6\u5b9a",id:"572-\u52a8\u4f5c\u65b9\u6cd5\u9ed8\u8ba4\u7ea6\u5b9a",children:[]},{value:"5.7.3 \u8bf7\u6c42\u8c13\u8bcd\u9ed8\u8ba4\u7ea6\u5b9a",id:"573-\u8bf7\u6c42\u8c13\u8bcd\u9ed8\u8ba4\u7ea6\u5b9a",children:[]},{value:"5.7.4 \u8def\u7531\u5730\u5740\u9ed8\u8ba4\u7ea6\u5b9a",id:"574-\u8def\u7531\u5730\u5740\u9ed8\u8ba4\u7ea6\u5b9a",children:[]},{value:"5.7.5 \u5176\u4ed6\u7ea6\u5b9a",id:"575-\u5176\u4ed6\u7ea6\u5b9a",children:[]}]},{value:"5.8 \u66f4\u591a\u4f8b\u5b50",id:"58-\u66f4\u591a\u4f8b\u5b50",children:[{value:"5.8.1 \u591a\u79cd\u8bf7\u6c42\u8c13\u8bcd\u65b9\u6cd5",id:"581-\u591a\u79cd\u8bf7\u6c42\u8c13\u8bcd\u65b9\u6cd5",children:[]},{value:"5.8.2 \u591a\u4e2a\u81ea\u5b9a\u4e49\u52a8\u4f5c\u65b9\u6cd5",id:"582-\u591a\u4e2a\u81ea\u5b9a\u4e49\u52a8\u4f5c\u65b9\u6cd5",children:[]},{value:"5.8.3 \u5e26\u53c2\u6570\u52a8\u4f5c\u65b9\u6cd5",id:"583-\u5e26\u53c2\u6570\u52a8\u4f5c\u65b9\u6cd5",children:[]},{value:"5.8.5 <code>GET/HEAD</code> \u7c7b\u7c7b\u578b\u53c2\u6570",id:"585-gethead-\u7c7b\u7c7b\u578b\u53c2\u6570",children:[]},{value:"5.8.6 \u81ea\u5b9a\u4e49\u53c2\u6570\u4f4d\u7f6e",id:"586-\u81ea\u5b9a\u4e49\u53c2\u6570\u4f4d\u7f6e",children:[]},{value:"5.8.7 \u81ea\u5b9a\u4e49\u8bf7\u6c42\u8c13\u8bcd",id:"587-\u81ea\u5b9a\u4e49\u8bf7\u6c42\u8c13\u8bcd",children:[]},{value:"5.8.8 \u652f\u6301\u591a\u4e2a\u8c13\u8bcd",id:"588-\u652f\u6301\u591a\u4e2a\u8c13\u8bcd",children:[]},{value:"5.8.9 \u652f\u6301\u81ea\u5b9a\u4e49\u8def\u7531",id:"589-\u652f\u6301\u81ea\u5b9a\u4e49\u8def\u7531",children:[]},{value:"5.8.10 \u591a\u8def\u7531\u968f\u610f\u7ec4\u5408",id:"5810-\u591a\u8def\u7531\u968f\u610f\u7ec4\u5408",children:[]},{value:"5.8.11 \u652f\u6301\u7248\u672c\u63a7\u5236",id:"5811-\u652f\u6301\u7248\u672c\u63a7\u5236",children:[]},{value:"5.8.12 \u4e0d\u516c\u5f00\u63a7\u5236\u5668\u6216\u52a8\u4f5c\u65b9\u6cd5",id:"5812-\u4e0d\u516c\u5f00\u63a7\u5236\u5668\u6216\u52a8\u4f5c\u65b9\u6cd5",children:[]}]},{value:"5.9 <code>[ApiDescriptionSettings]</code>",id:"59-apidescriptionsettings",children:[{value:"5.9.1 \u5185\u7f6e\u914d\u7f6e",id:"591-\u5185\u7f6e\u914d\u7f6e",children:[]},{value:"5.9.2 <code>Name</code> \u914d\u7f6e",id:"592-name-\u914d\u7f6e",children:[]},{value:"5.9.3 <code>KeepName</code> \u914d\u7f6e",id:"593-keepname-\u914d\u7f6e",children:[]},{value:"5.9.4 <code>SplitCamelCase</code> \u914d\u7f6e",id:"594-splitcamelcase-\u914d\u7f6e",children:[]},{value:"5.9.5 <code>KeepVerb</code> \u914d\u7f6e",id:"595-keepverb-\u914d\u7f6e",children:[]},{value:"5.9.6 <code>Enabled</code> \u914d\u7f6e",id:"596-enabled-\u914d\u7f6e",children:[]},{value:"5.9.7 <code>Module</code> \u914d\u7f6e",id:"597-module-\u914d\u7f6e",children:[]},{value:"5.9.8 <code>Version</code> \u914d\u7f6e",id:"598-version-\u914d\u7f6e",children:[]},{value:"5.9.9 <code>Groups</code> \u914d\u7f6e",id:"599-groups-\u914d\u7f6e",children:[]},{value:"5.9.10 <code>Tag</code> \u914d\u7f6e",id:"5910-tag-\u914d\u7f6e",children:[]}]},{value:"5.10 <code>DynamicApiControllerSettings</code> \u914d\u7f6e",id:"510-dynamicapicontrollersettings-\u914d\u7f6e",children:[{value:"5.10.1 \u652f\u6301 <code>Mvc \u63a7\u5236\u5668</code> \u52a8\u6001\u914d\u7f6e",id:"5101-\u652f\u6301-mvc-\u63a7\u5236\u5668-\u52a8\u6001\u914d\u7f6e",children:[]}]},{value:"5.11 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"511-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],s={rightToc:m};function d(e){var n=e.components,t=Object(i.a)(e,["components"]);return Object(r.b)("wrapper",Object(a.a)({},s,t,{components:n,mdxType:"MDXLayout"}),Object(r.b)("h2",{id:"51-\u4ec0\u4e48\u662f\u63a7\u5236\u5668"},"5.1 \u4ec0\u4e48\u662f\u63a7\u5236\u5668"),Object(r.b)("p",null,"\u7b80\u5355\u6765\u8bf4\uff0c\u63a7\u5236\u5668\u662f\u4e00\u4e2a\u627f\u4e0a\u542f\u4e0b\u7684\u4f5c\u7528\uff0c\u6839\u636e\u7528\u6237\u8f93\u5165\uff0c\u6267\u884c\u54cd\u5e94\u884c\u4e3a\uff08\u52a8\u4f5c\u65b9\u6cd5\uff09\uff0c\u540c\u65f6\u5728\u884c\u4e3a\u4e2d\u8c03\u7528\u6a21\u578b\u7684\u4e1a\u52a1\u903b\u8f91\uff0c\u8fd4\u56de\u7ed9\u7528\u6237\u7ed3\u679c\uff08\u89c6\u56fe\uff09\u3002"),Object(r.b)("img",{src:Object(b.a)("img/kzq.png")}),Object(r.b)("p",null),Object(r.b)("p",null,"\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"ASP.NET Core")," \u4e2d\uff0c\u63a7\u5236\u5668\u6709\u4e24\u79cd\u8868\u73b0\u5f62\u5f0f\uff1a"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"Mvc"),"\uff08\u5e26\u89c6\u56fe\uff09"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"WebAPI"),"\uff08RESTful API\uff09")),Object(r.b)(c.a,{defaultValue:"mvc",values:[{label:"Mvc \u63a7\u5236\u5668",value:"mvc"},{label:"WebAPI \u63a7\u5236\u5668",value:"webapi"}],mdxType:"Tabs"},Object(r.b)(l.a,{value:"mvc",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,5,7}","{1,5,7}":!0}),"using Microsoft.AspNetCore.Mvc;\n\nnamespace Fur.Web.Entry.Controllers\n{\n    public class MvcController : Controller\n    {\n        public IActionResult Index()\n        {\n            return View();\n        }\n    }\n}\n"))),Object(r.b)(l.a,{value:"webapi",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,5,6,8,9}","{1,5,6,8,9}":!0}),'using Microsoft.AspNetCore.Mvc;\n\nnamespace Fur.Web.Entry.Controllers\n{\n    [Route("api/[controller]")]\n    public class WebApiController : ControllerBase\n    {\n        [HttpGet]\n        public IActionResult Get()\n        {\n            return Content(nameof(Fur));\n        }\n    }\n}\n')))),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Mvc")," \u63a7\u5236\u5668\u548c ",Object(r.b)("inlineCode",{parentName:"p"},"WebAPI")," \u63a7\u5236\u5668\u6700\u5927\u7684\u533a\u522b\u662f ",Object(r.b)("inlineCode",{parentName:"p"},"WebAPI")," \u63a7\u5236\u5668\u4e0d\u5e26 ",Object(r.b)("strong",{parentName:"p"},"\u89c6\u56fe")," \u548c\u901a\u8fc7 ",Object(r.b)("strong",{parentName:"p"},"\u8bf7\u6c42\u8c13\u8bcd\u548c\u8def\u7531\u5730\u5740\u54cd\u5e94\u884c\u4e3a"),"\u3002"),Object(r.b)("h2",{id:"52-mvc-\u63a7\u5236\u5668-\u7ea6\u5b9a\u548c\u7f3a\u70b9"},"5.2 ",Object(r.b)("inlineCode",{parentName:"h2"},"Mvc \u63a7\u5236\u5668")," \u7ea6\u5b9a\u548c\u7f3a\u70b9"),Object(r.b)("p",null,"\u5728\u5b66\u4e60\u52a8\u6001 ",Object(r.b)("inlineCode",{parentName:"p"},"WebAPI")," \u63a7\u5236\u5668\u4e4b\u524d\uff0c\u9996\u5148\u4e86\u89e3 ",Object(r.b)("inlineCode",{parentName:"p"},"ASP.NET Core")," \u4e2d ",Object(r.b)("inlineCode",{parentName:"p"},"WebAPI")," \u7684\u4e00\u4e9b\u7ea6\u5b9a\u548c\u6ce8\u610f\u4e8b\u9879\u3002"),Object(r.b)("h3",{id:"521-webapi-\u7ea6\u5b9a"},"5.2.1 ",Object(r.b)("inlineCode",{parentName:"h3"},"WebAPI")," \u7ea6\u5b9a"),Object(r.b)("p",null,"\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"ASP.NET Core")," \u5e94\u7528\u4e2d\uff0c\u4e00\u4e2a ",Object(r.b)("inlineCode",{parentName:"p"},"WebAPI")," \u63a7\u5236\u5668\u9700\u9075\u5faa\u4ee5\u4e0b\u7ea6\u5b9a\uff1a"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"\u63a7\u5236\u5668\u7c7b",Object(r.b)("strong",{parentName:"li"},"\u5fc5\u987b\u7ee7\u627f ",Object(r.b)("inlineCode",{parentName:"strong"},"ControllerBase")," \u6216\u95f4\u63a5\u7ee7\u627f")),Object(r.b)("li",{parentName:"ul"},"\u52a8\u4f5c\u65b9\u6cd5",Object(r.b)("strong",{parentName:"li"},"\u5fc5\u987b\u8d34\u6709 ",Object(r.b)("inlineCode",{parentName:"strong"},"[HttpMethod]")," \u7279\u6027\uff0c\u5982\uff1a",Object(r.b)("inlineCode",{parentName:"strong"},"[HttpGet]"))),Object(r.b)("li",{parentName:"ul"},"\u63a7\u5236\u5668\u6216\u52a8\u4f5c\u65b9\u6cd5",Object(r.b)("strong",{parentName:"li"},"\u81f3\u5c11\u6709\u4e00\u4e2a\u914d\u7f6e ",Object(r.b)("inlineCode",{parentName:"strong"},"[Route]")," \u7279\u6027")),Object(r.b)("li",{parentName:"ul"},"\u751f\u6210 ",Object(r.b)("inlineCode",{parentName:"li"},"WebAPI")," \u8def\u7531\u5730\u5740\u65f6\u4f1a\u81ea\u52a8\u53bb\u6389\u63a7\u5236\u5668\u540d\u79f0 ",Object(r.b)("inlineCode",{parentName:"li"},"Controller")," \u540e\u7f00\uff0c\u540c\u65f6\u4e5f\u4f1a\u53bb\u6389\u52a8\u4f5c\u65b9\u6cd5\u5339\u914d\u7684 ",Object(r.b)("inlineCode",{parentName:"li"},"HttpVerb")," \u8c13\u8bcd\uff0c\u5982 ",Object(r.b)("inlineCode",{parentName:"li"},"GET\uff0cPOST\uff0cDELETE\uff0cPUT")," \u7b49"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("strong",{parentName:"li"},"\u4e0d\u652f\u6301\u8fd4\u56de\u975e ",Object(r.b)("inlineCode",{parentName:"strong"},"IEnumerable<T>")," \u6cdb\u578b\u5bf9\u8c61")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("strong",{parentName:"li"},"\u4e0d\u652f\u6301\u7c7b\u7c7b\u578b\u53c2\u6570\u5728 ",Object(r.b)("inlineCode",{parentName:"strong"},"GET\uff0cHEAD")," \u8bf7\u6c42\u4e0b\u751f\u6210 ",Object(r.b)("inlineCode",{parentName:"strong"},"Query")," \u53c2\u6570"))),Object(r.b)("p",null,"\u9664\u4e86\u4e0a\u8ff0\u7ea6\u5b9a\u5916\uff0c",Object(r.b)("inlineCode",{parentName:"p"},"WebAPI")," \u8def\u7531\u5730\u5740",Object(r.b)("strong",{parentName:"p"},"\u57fa\u672c\u9760\u624b\u5de5\u5b8c\u6210"),"\uff0c\u4e0d\u5229\u4e8e\u4e66\u5199\uff0c\u4e0d\u5229\u4e8e\u7ef4\u62a4\uff0c\u518d\u8005\uff0c\u5728\u79fb\u52a8\u5e94\u7528\u5bf9\u63a5\u4e2d\u96be\u4ee5\u8fdb\u884c\u591a\u7248\u672c\u63a7\u5236\u3002"),Object(r.b)("h3",{id:"522-net-core-webapi-\u7f3a\u70b9"},"5.2.2 ",Object(r.b)("inlineCode",{parentName:"h3"},".NET Core WebAPI")," \u7f3a\u70b9"),Object(r.b)("p",null,"\u901a\u8fc7\u4e0a\u4e00\u7ae0\u8282\u53ef\u4ee5\u770b\u51fa\uff0c",Object(r.b)("inlineCode",{parentName:"p"},"ASP.NET Core")," \u5e94\u7528\u5b9e\u73b0 ",Object(r.b)("inlineCode",{parentName:"p"},"WebAPI")," \u9700\u8981\u9075\u5faa\u79cd\u79cd\u7ea6\u5b9a\uff0c\u800c\u4e14\u5bb9\u6613\u51fa\u9519\u3002"),Object(r.b)("p",null,"\u9664\u4e86\u8fd9\u4e9b\u7ea6\u5b9a\uff0c",Object(r.b)("inlineCode",{parentName:"p"},".NET Core WebAPI")," \u6709\u4ee5\u4e0b\u7f3a\u70b9\uff1a"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"\u8def\u7531\u5730\u5740\u57fa\u672c\u9760\u624b\u5de5\u5b8c\u6210"),Object(r.b)("li",{parentName:"ul"},"\u5728\u73b0\u5728\u79fb\u52a8\u4e3a\u738b\u7684\u65f6\u4ee3\uff0c\u4e0d\u5229\u4e8e\u8fdb\u884c\u591a\u7248\u672c\u63a7\u5236"),Object(r.b)("li",{parentName:"ul"},"\u5bf9\u63a5 ",Object(r.b)("inlineCode",{parentName:"li"},"Swagger")," \u6587\u6863\u5206\u7ec4\u6bd4\u8f83\u590d\u6742"),Object(r.b)("li",{parentName:"ul"},"\u5b9e\u73b0 ",Object(r.b)("inlineCode",{parentName:"li"},"Policy")," \u7b56\u7565\u6388\u6743\u4e5f\u6bd4\u8f83\u590d\u6742"),Object(r.b)("li",{parentName:"ul"},"\u4e0d\u652f\u6301\u63a7\u5236\u5668\u70ed\u62d4\u63d2\u63d2\u4ef6\u5316"),Object(r.b)("li",{parentName:"ul"},"\u96be\u4ee5\u5b9e\u73b0\u590d\u6742\u81ea\u5b9a\u4e49\u7684 ",Object(r.b)("inlineCode",{parentName:"li"},"RESTful API")," \u98ce\u683c")),Object(r.b)("h2",{id:"53-\u52a8\u6001-webapi-\u63a7\u5236\u5668"},"5.3 \u52a8\u6001 ",Object(r.b)("inlineCode",{parentName:"h2"},"WebAPI")," \u63a7\u5236\u5668"),Object(r.b)("p",null,"\u9488\u5bf9\u4ee5\u4e0a ",Object(r.b)("inlineCode",{parentName:"p"},"ASP.NET Core")," \u63d0\u4f9b\u7684 ",Object(r.b)("inlineCode",{parentName:"p"},"WebAPI")," \u5fc5\u987b\u9075\u5faa\u7684\u7ea6\u5b9a\u548c\u4e0d\u53ef\u907f\u514d\u7684\u7f3a\u70b9\uff0c",Object(r.b)("inlineCode",{parentName:"p"},"Fur")," \u6846\u67b6\u521b\u9020\u51fa\u4e00\u79cd\u66f4\u52a0\u7075\u6d3b\u521b\u5efa ",Object(r.b)("inlineCode",{parentName:"p"},"WebAPI")," \u63a7\u5236\u5668\u7684\u65b9\u5f0f\u3002"),Object(r.b)("p",null,"\u8fd9\u4e2a\u65b9\u5f0f\u5728\u7ee7\u627f\u4e86 ",Object(r.b)("inlineCode",{parentName:"p"},"ASP.NET Core WebAPI")," \u6240\u6709\u4f18\u70b9\uff0c\u540c\u65f6\u8fdb\u884c\u4e86\u5927\u91cf\u62d3\u5c55\u548c\u4f18\u5316\u3002\u4f18\u5316\u540e\u7684 ",Object(r.b)("inlineCode",{parentName:"p"},"WebAPI")," \u5177\u6709\u4ee5\u4e0b\u4f18\u70b9\uff1a"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"\u5177\u5907\u539f\u6709\u7684 ",Object(r.b)("inlineCode",{parentName:"li"},"ControllerBase")," \u6240\u6709\u529f\u80fd"),Object(r.b)("li",{parentName:"ul"},"\u652f\u6301",Object(r.b)("strong",{parentName:"li"},"\u4efb\u610f\u516c\u5f00 \u975e\u9759\u6001 \u975e\u62bd\u8c61 \u975e\u6cdb\u578b\u7c7b"),"\u8f6c\u63a7\u5236\u5668"),Object(r.b)("li",{parentName:"ul"},"\u63d0\u4f9b\u66f4\u52a0\u7075\u6d3b\u65b9\u4fbf\u7684 ",Object(r.b)("inlineCode",{parentName:"li"},"IDynamicApiController")," \u7a7a\u63a5\u53e3\u6216 ",Object(r.b)("inlineCode",{parentName:"li"},"[DynamicApiController]")," \u7279\u6027\u66ff\u4ee3 ",Object(r.b)("inlineCode",{parentName:"li"},"ControllerBase")," \u62bd\u8c61\u7c7b"),Object(r.b)("li",{parentName:"ul"},"\u65e0\u9700\u624b\u52a8\u914d\u7f6e ",Object(r.b)("inlineCode",{parentName:"li"},"[HttpMethod]")," \u7279\u6027\uff0c\u540c\u65f6\u652f\u6301\u4e00\u4e2a\u52a8\u4f5c\u65b9\u6cd5\u591a\u4e2a ",Object(r.b)("inlineCode",{parentName:"li"},"HttpVerb")),Object(r.b)("li",{parentName:"ul"},"\u65e0\u9700\u624b\u52a8\u914d\u7f6e ",Object(r.b)("inlineCode",{parentName:"li"},"[Route]")," \u7279\u6027\uff0c\u652f\u6301\u66f4\u52a0\u7075\u6d3b\u7684\u914d\u7f6e\u53ca\u81ea\u52a8\u8def\u7531\u751f\u6210"),Object(r.b)("li",{parentName:"ul"},"\u652f\u6301\u8fd4\u56de\u6cdb\u578b\u63a5\u53e3\uff0c\u6cdb\u578b\u7c7b"),Object(r.b)("li",{parentName:"ul"},"\u548c ",Object(r.b)("inlineCode",{parentName:"li"},"Swagger")," \u6df1\u5ea6\u7ed3\u5408\uff0c\u63d0\u4f9b\u6781\u5176\u65b9\u4fbf\u7684\u521b\u5efa ",Object(r.b)("inlineCode",{parentName:"li"},"Swagger")," \u5206\u7ec4\u914d\u7f6e"),Object(r.b)("li",{parentName:"ul"},"\u652f\u6301 ",Object(r.b)("inlineCode",{parentName:"li"},"Basic Auth\uff0cJwt\uff0cApiKey")," \u7b49\u591a\u79cd\u6743\u9650\u7075\u6d3b\u914d\u7f6e"),Object(r.b)("li",{parentName:"ul"},"\u652f\u6301\u63a7\u5236\u5668\u3001\u52a8\u4f5c\u65b9\u6cd5",Object(r.b)("strong",{parentName:"li"},"\u7248\u672c\u63a7\u5236"),"\u529f\u80fd"),Object(r.b)("li",{parentName:"ul"},"\u652f\u6301 ",Object(r.b)("inlineCode",{parentName:"li"},"GET\u3001HEAD")," \u8bf7\u6c42\u81ea\u52a8\u8f6c\u6362 ",Object(r.b)("inlineCode",{parentName:"li"},"\u7c7b\u7c7b\u578b\u53c2\u6570")),Object(r.b)("li",{parentName:"ul"},"\u652f\u6301\u751f\u6210 ",Object(r.b)("inlineCode",{parentName:"li"},"OAS3")," \u63a5\u53e3\u89c4\u8303")),Object(r.b)("h2",{id:"54-\u6ce8\u518c\u52a8\u6001-webapi-\u670d\u52a1"},"5.4 \u6ce8\u518c\u52a8\u6001 ",Object(r.b)("inlineCode",{parentName:"h2"},"WebAPI")," \u670d\u52a1"),Object(r.b)("div",{className:"admonition admonition-important alert alert--info"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u5907\u6ce8")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},Object(r.b)("inlineCode",{parentName:"p"},".AddDynamicApiControllers()")," \u9ed8\u8ba4\u5df2\u7ecf\u96c6\u6210\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"AddInject()")," \u4e2d\u4e86\uff0c\u65e0\u9700\u518d\u6b21\u6ce8\u518c\u3002\u4e5f\u5c31\u662f\u4e0b\u5217\u4ee3\u7801\u53ef\u4e0d\u914d\u7f6e\u3002"))),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:'{11} title="Fur.Web.Core\\FurWebCoreStartup.cs"',"{11}":!0,title:'"Fur.Web.Core\\FurWebCoreStartup.cs"'}),"using Microsoft.Extensions.DependencyInjection;\n\nnamespace Fur.Web.Core\n{\n    [AppStartup(800)]\n    public sealed class FurWebCoreStartup : AppStartup\n    {\n        public void ConfigureServices(IServiceCollection services)\n        {\n            services.AddControllers()\n                    .AddDynamicApiControllers();\n        }\n    }\n}\n")),Object(r.b)("div",{className:"admonition admonition-caution alert alert--warning"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})))),"\u7279\u522b\u6ce8\u610f")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},Object(r.b)("inlineCode",{parentName:"p"},".AddDynamicApiControllers()")," \u5fc5\u987b\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"services.AddControllers()")," \u4e4b\u540e\u6ce8\u518c\u3002"))),Object(r.b)("h2",{id:"55-\u7b2c\u4e00\u4e2a\u4f8b\u5b50"},"5.5 \u7b2c\u4e00\u4e2a\u4f8b\u5b50"),Object(r.b)("p",null,"\u521b\u5efa\u4e00\u4e2a ",Object(r.b)("inlineCode",{parentName:"p"},"FurAppService")," \u7c7b\u7ee7\u627f ",Object(r.b)("inlineCode",{parentName:"p"},"IDynamicApiController")," \u63a5\u53e3 \u6216 \u8d34 ",Object(r.b)("inlineCode",{parentName:"p"},"[DynamicApiController]")," \u7279\u6027\uff0c\u5e76\u5728\u8fd9\u4e2a\u7c7b\u4e2d\u7f16\u5199\u4e00\u4e2a ",Object(r.b)("inlineCode",{parentName:"p"},"Get")," \u65b9\u6cd5\u3002"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("strong",{parentName:"li"},Object(r.b)("inlineCode",{parentName:"strong"},"IDynamicApiController")," \u65b9\u5f0f"))),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,5,7}","{1,5,7}":!0}),'using Fur.DynamicApiController;\n\nnamespace Fur.Application\n{\n    public class FurAppService : IDynamicApiController\n    {\n        public string Get()\n        {\n            return $"Hello {nameof(Fur)}";\n        }\n    }\n}\n')),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("strong",{parentName:"li"},Object(r.b)("inlineCode",{parentName:"strong"},"[DynamicApiController]")," \u65b9\u5f0f"))),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,5,8}","{1,5,8}":!0}),'using Fur.DynamicApiController;\n\nnamespace Fur.Application\n{\n    [DynamicApiController]\n    public class FurAppService\n    {\n        public string Get()\n        {\n            return $"Hello {nameof(Fur)}";\n        }\n    }\n}\n')),Object(r.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff0c\u4e00\u4e2a ",Object(r.b)("inlineCode",{parentName:"p"},"WebAPI")," \u63a5\u53e3\u5c31\u8fd9\u4e48\u751f\u6210\u4e86\u3002"),Object(r.b)("img",{src:Object(b.a)("img/dyglz.gif")}),Object(r.b)("h2",{id:"56-\u52a8\u6001-webapi-\u539f\u7406\u89e3\u6790"},"5.6 \u52a8\u6001 ",Object(r.b)("inlineCode",{parentName:"h2"},"WebAPI")," \u539f\u7406\u89e3\u6790"),Object(r.b)("h3",{id:"561-\u63a7\u5236\u5668\u7279\u6027\u63d0\u4f9b\u5668"},"5.6.1 \u63a7\u5236\u5668\u7279\u6027\u63d0\u4f9b\u5668"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Fur")," \u6846\u67b6\u4f1a\u5728\u5e94\u7528\u542f\u52a8\u65f6\u6ce8\u518c ",Object(r.b)("inlineCode",{parentName:"p"},"DynamicApiControllerFeatureProvider")," \u63a7\u5236\u5668\u7279\u6027\u63d0\u4f9b\u5668\uff0c\u8be5\u63d0\u4f9b\u5668\u7ee7\u627f\u81ea ",Object(r.b)("inlineCode",{parentName:"p"},"ControllerFeatureProvider")," \u7c7b\u3002"),Object(r.b)("p",null,"\u63a5\u7740\u91cd\u5199 ",Object(r.b)("inlineCode",{parentName:"p"},"bool IsController(TypeInfo typeInfo)")," \u65b9\u6cd5\uff0c\u7528\u6765\u6807\u8bc6\u63a7\u5236\u5668\u7c7b\u578b\u3002\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"Fur")," \u6846\u67b6\u4e2d\uff0c",Object(r.b)("strong",{parentName:"p"},"\u7ee7\u627f\u81ea ",Object(r.b)("inlineCode",{parentName:"strong"},"ControllerBase")," \u7c7b\u6216 ",Object(r.b)("inlineCode",{parentName:"strong"},"IDynamicApiController")," \u63a5\u53e3\u6216 ",Object(r.b)("inlineCode",{parentName:"strong"},"[DynamicApiController]")," \u7279\u6027\u90fd\u4f1a\u88ab\u6807\u8bb0\u4e3a\u63a7\u5236\u5668\u7c7b\u578b\u3002")),Object(r.b)("h3",{id:"562-\u5e94\u7528\u6a21\u578b\u8f6c\u6362\u5668"},"5.6.2 \u5e94\u7528\u6a21\u578b\u8f6c\u6362\u5668"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Fur")," \u6846\u67b6\u540c\u65f6\u5728\u5e94\u7528\u542f\u52a8\u65f6\u6ce8\u518c ",Object(r.b)("inlineCode",{parentName:"p"},"DynamicApiControllerApplicationModelConvention")," \u5e94\u7528\u6a21\u578b\u8f6c\u6362\u5668\uff0c\u8be5\u8f6c\u6362\u5668\u7ee7\u627f\u81ea ",Object(r.b)("inlineCode",{parentName:"p"},"IApplicationModelConvention")," \u63a5\u53e3\u3002"),Object(r.b)("p",null,"\u63a5\u7740\u5b9e\u73b0 ",Object(r.b)("inlineCode",{parentName:"p"},"void Apply(ApplicationModel application)")," \u63a5\u53e3\u65b9\u6cd5\u3002\u5728\u8be5\u65b9\u6cd5\u4e2d\u914d\u7f6e\u63a7\u5236\u5668\u540d\u79f0\u3001\u8def\u7531\u3001\u5bfc\u51fa\u53ef\u89c1\u6027\u53ca\u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0\u3001\u8def\u7531\u3001\u5bfc\u51fa\u53ef\u89c1\u6027\u7b49\u3002"),Object(r.b)("p",null,"\u5b9e\u9645\u4e0a\u8be5\u65b9\u6cd5\u505a\u7684\u5c31\u662f\u6309\u7167 ",Object(r.b)("strong",{parentName:"p"},Object(r.b)("a",Object(a.a)({parentName:"strong"},{href:"#521-webapi-%E7%BA%A6%E5%AE%9A"}),"WebAPI \u7ea6\u5b9a"))," \u63d0\u524d\u5e2e\u6211\u4eec\u914d\u7f6e\u597d\u8def\u7531\u3001\u8bf7\u6c42\u8c13\u8bcd\u7b49\u4fe1\u606f\u3002\u907f\u514d\u4e86\u624b\u52a8\u914d\u7f6e\u7684\u540c\u65f6\u8fd8\u589e\u52a0\u4e86\u8bb8\u591a\u65b0\u7279\u6027\uff0c\u5982",Object(r.b)("strong",{parentName:"p"},"\u7248\u672c\u63a7\u5236\u3002")),Object(r.b)("h2",{id:"57-\u52a8\u6001-webapi-\u914d\u7f6e\u7ea6\u5b9a"},"5.7 \u52a8\u6001 ",Object(r.b)("inlineCode",{parentName:"h2"},"WebAPI")," \u914d\u7f6e\u7ea6\u5b9a"),Object(r.b)("h3",{id:"571-\u63a7\u5236\u5668\u9ed8\u8ba4\u7ea6\u5b9a"},"5.7.1 \u63a7\u5236\u5668\u9ed8\u8ba4\u7ea6\u5b9a"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"\u751f\u6210\u63a7\u5236\u5668\u540d\u79f0\u9ed8\u8ba4\u53bb\u9664\u4ee5 ",Object(r.b)("inlineCode",{parentName:"li"},"AppServices\uff0cAppService\uff0cApiController\uff0cController\uff0cServices\uff0cService")," \u4f5c\u4e3a\u524d\u540e\u7f00\u7684\u5b57\u7b26\u4e32\u3002\u89c1\u7b2c\u4e00\u4e2a\u4f8b\u5b50\u4e2d\u7684 ",Object(r.b)("inlineCode",{parentName:"li"},"FurAppService -> Fur")," ",Object(r.b)("strong",{parentName:"li"},"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e")),Object(r.b)("li",{parentName:"ul"},"\u63a7\u5236\u5668\u540d\u79f0\u5e26 ",Object(r.b)("inlineCode",{parentName:"li"},"V[0-9_]")," \u7ed3\u5c3e\u7684\uff0c\u4f1a\u81ea\u52a8\u751f\u6210\u63a7\u5236\u5668\u7248\u672c\u53f7\uff0c\u5982 ",Object(r.b)("inlineCode",{parentName:"li"},"FurAppServiceV2 -> Fur@2"),"\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"FurAppServiceV1_1_0 -> Fur@1.1.0"),"\u3002",Object(r.b)("strong",{parentName:"li"},"\u652f\u6301\u7248\u672c\u5206\u9694\u7b26\u914d\u7f6e")),Object(r.b)("li",{parentName:"ul"},"\u63a7\u5236\u540d\u79f0\u4ee5 ",Object(r.b)("inlineCode",{parentName:"li"},"\u9a86\u9a7c\u547d\u540d\uff08CamelCase\uff09")," \u4f1a\u81ea\u52a8\u5207\u5272\u6210\u591a\u4e2a\u5355\u8bcd ",Object(r.b)("inlineCode",{parentName:"li"},"-")," \u8fde\u63a5\u3002",Object(r.b)("strong",{parentName:"li"},"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e"))),Object(r.b)("h3",{id:"572-\u52a8\u4f5c\u65b9\u6cd5\u9ed8\u8ba4\u7ea6\u5b9a"},"5.7.2 \u52a8\u4f5c\u65b9\u6cd5\u9ed8\u8ba4\u7ea6\u5b9a"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"\u751f\u6210\u7684\u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0\u9ed8\u8ba4\u53bb\u9664\u4ee5 ",Object(r.b)("inlineCode",{parentName:"li"},"Post/Add/Create/Insert/Submit\uff0cGetAll/GetList/Get/Find/Fetch/Query/Search\uff0cPut/Update\uff0cDelete/Remove/Clear\uff0cPatch")," \u5f00\u5934\u7684\u5b57\u7b26\u4e32\u3002",Object(r.b)("strong",{parentName:"li"},"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e")),Object(r.b)("li",{parentName:"ul"},"\u751f\u6210\u7684\u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0\u9ed8\u8ba4\u53bb\u9664\u4ee5 ",Object(r.b)("inlineCode",{parentName:"li"},"Async")," \u4f5c\u4e3a\u524d\u540e\u7f00\u7684\u5b57\u7b26\u4e32\u3002",Object(r.b)("strong",{parentName:"li"},"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e")),Object(r.b)("li",{parentName:"ul"},"\u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0\u5e26 ",Object(r.b)("inlineCode",{parentName:"li"},"V[0-9_]")," \u7ed3\u5c3e\u7684\uff0c\u4f1a\u81ea\u52a8\u751f\u6210\u52a8\u4f5c\u65b9\u6cd5\u7248\u672c\u53f7\uff0c\u5982 ",Object(r.b)("inlineCode",{parentName:"li"},"ChangePasswordV2 -> ChangePassword@2"),"\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"ChangePasswordV1_1_0 -> ChangePassword@1.1.0"),"\u3002",Object(r.b)("strong",{parentName:"li"},"\u652f\u6301\u7248\u672c\u5206\u9694\u7b26\u914d\u7f6e")),Object(r.b)("li",{parentName:"ul"},"\u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0\u4ee5 ",Object(r.b)("inlineCode",{parentName:"li"},"\u9a86\u9a7c\u547d\u540d\uff08CamelCase\uff09")," \u4f1a\u81ea\u52a8\u5207\u5272\u6210\u591a\u4e2a\u5355\u8bcd ",Object(r.b)("inlineCode",{parentName:"li"},"-")," \u8fde\u63a5\u3002",Object(r.b)("strong",{parentName:"li"},"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e")),Object(r.b)("li",{parentName:"ul"},"\u52a8\u4f5c\u65b9\u6cd5\u53c2\u6570\u5c06\u81ea\u52a8\u8f6c\u4e3a\u5c0f\u5199\u3002",Object(r.b)("strong",{parentName:"li"},"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e"))),Object(r.b)("h3",{id:"573-\u8bf7\u6c42\u8c13\u8bcd\u9ed8\u8ba4\u7ea6\u5b9a"},"5.7.3 \u8bf7\u6c42\u8c13\u8bcd\u9ed8\u8ba4\u7ea6\u5b9a"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"\u52a8\u4f5c\u65b9\u6cd5\u540d",Object(r.b)("ul",{parentName:"li"},Object(r.b)("li",{parentName:"ul"},"\u4ee5 ",Object(r.b)("inlineCode",{parentName:"li"},"Post/Add/Create/Insert/Submit")," \u5f00\u5934\uff0c\u5219\u6dfb\u52a0 ",Object(r.b)("inlineCode",{parentName:"li"},"[HttpPost]")," \u7279\u6027\u3002"),Object(r.b)("li",{parentName:"ul"},"\u4ee5 ",Object(r.b)("inlineCode",{parentName:"li"},"GetAll/GetList/Get/Find/Fetch/Query")," \u5f00\u5934\uff0c\u5219\u6dfb\u52a0 ",Object(r.b)("inlineCode",{parentName:"li"},"[HttpGet]")," \u7279\u6027\u3002"),Object(r.b)("li",{parentName:"ul"},"\u4ee5 ",Object(r.b)("inlineCode",{parentName:"li"},"Put/Update")," \u5f00\u5934\uff0c\u5219\u6dfb\u52a0 ",Object(r.b)("inlineCode",{parentName:"li"},"[HttpPut]")," \u7279\u6027\u3002"),Object(r.b)("li",{parentName:"ul"},"\u4ee5 ",Object(r.b)("inlineCode",{parentName:"li"},"Delete/Remove/Clear")," \u5f00\u5934\uff0c\u5219\u6dfb\u52a0 ",Object(r.b)("inlineCode",{parentName:"li"},"[HttpDelete]")," \u7279\u6027\u3002"),Object(r.b)("li",{parentName:"ul"},"\u4ee5 ",Object(r.b)("inlineCode",{parentName:"li"},"Patch")," \u5f00\u5934\uff0c\u5219\u6dfb\u52a0 ",Object(r.b)("inlineCode",{parentName:"li"},"[HttpPatch]")," \u7279\u6027"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("strong",{parentName:"li"},"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e")))),Object(r.b)("li",{parentName:"ul"},"\u5982\u679c\u4e0d\u5728\u4e0a\u9762\u7ea6\u5b9a\u4e2d\uff0c\u5219\u9ed8\u8ba4\u6dfb\u52a0 ",Object(r.b)("inlineCode",{parentName:"li"},"[HttpPost]")," \u7279\u6027\u3002",Object(r.b)("strong",{parentName:"li"},"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e"))),Object(r.b)("h3",{id:"574-\u8def\u7531\u5730\u5740\u9ed8\u8ba4\u7ea6\u5b9a"},"5.7.4 \u8def\u7531\u5730\u5740\u9ed8\u8ba4\u7ea6\u5b9a"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"\u9ed8\u8ba4\u4ee5 ",Object(r.b)("inlineCode",{parentName:"li"},"api")," \u5f00\u5934\u3002",Object(r.b)("strong",{parentName:"li"},"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e")),Object(r.b)("li",{parentName:"ul"},"\u9ed8\u8ba4\u8f6c\u6362\u4e3a\u5c0f\u5199\u8def\u7531\u5730\u5740\u3002",Object(r.b)("strong",{parentName:"li"},"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e")),Object(r.b)("li",{parentName:"ul"},"\u751f\u6210\u63a7\u5236\u5668\u8def\u7531\u6a21\u677f\u683c\u5f0f\u4e3a\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"api/\u524d\u7f6e\u53c2\u6570\u5217\u8868/\u6a21\u5757\u540d\u6216\u9ed8\u8ba4\u533a\u57df\u540d/[controller@\u7248\u672c\u53f7]/\u540e\u7f6e\u53c2\u6570\u5217\u8868")),Object(r.b)("li",{parentName:"ul"},"\u751f\u6210\u52a8\u4f5c\u65b9\u6cd5\u8def\u7531\u6a21\u677f\u683c\u5f0f\u4e3a\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"\u524d\u7f6e\u53c2\u6570\u5217\u8868/\u6a21\u5757\u540d/[action@\u7248\u672c\u53f7]/\u540e\u7f6e\u53c2\u6570\u5217\u8868"))),Object(r.b)("h3",{id:"575-\u5176\u4ed6\u7ea6\u5b9a"},"5.7.5 \u5176\u4ed6\u7ea6\u5b9a"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"\u9ed8\u8ba4\u4e0d\u5904\u7406 ",Object(r.b)("inlineCode",{parentName:"li"},"ControllerBase")," \u63a7\u5236\u5668\u7c7b\u578b\u3002",Object(r.b)("strong",{parentName:"li"},"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e")),Object(r.b)("li",{parentName:"ul"},"\u9ed8\u8ba4\u4e0d\u5904\u7406 ",Object(r.b)("inlineCode",{parentName:"li"},"GET\uff0cHEAD")," \u8bf7\u6c42\u7684\u5f15\u7528\u7c7b\u578b\u53c2\u6570\u3002",Object(r.b)("strong",{parentName:"li"},"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e"))),Object(r.b)("h2",{id:"58-\u66f4\u591a\u4f8b\u5b50"},"5.8 \u66f4\u591a\u4f8b\u5b50"),Object(r.b)("h3",{id:"581-\u591a\u79cd\u8bf7\u6c42\u8c13\u8bcd\u65b9\u6cd5"},"5.8.1 \u591a\u79cd\u8bf7\u6c42\u8c13\u8bcd\u65b9\u6cd5"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{7,12,17,22,27}","{7,12,17,22,27}":!0}),'using Fur.DynamicApiController;\n\nnamespace Fur.Application\n{\n    public class FurAppService : IDynamicApiController\n    {\n        public string Get()\n        {\n            return $"GET \u8bf7\u6c42";\n        }\n\n        public string Post()\n        {\n            return $"POST \u8bf7\u6c42";\n        }\n\n        public string Delete()\n        {\n            return $"DELETE \u8bf7\u6c42";\n        }\n\n        public string Put()\n        {\n            return $"PUT \u8bf7\u6c42";\n        }\n\n        public string Patch()\n        {\n            return $"PATCH \u8bf7\u6c42";\n        }\n    }\n}\n')),Object(r.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(r.b)("img",{src:Object(b.a)("img/dgqqwc.png")}),Object(r.b)("h3",{id:"582-\u591a\u4e2a\u81ea\u5b9a\u4e49\u52a8\u4f5c\u65b9\u6cd5"},"5.8.2 \u591a\u4e2a\u81ea\u5b9a\u4e49\u52a8\u4f5c\u65b9\u6cd5"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{7,12,17}","{7,12,17}":!0}),'using Fur.DynamicApiController;\n\nnamespace Fur.Application\n{\n    public class FurAppService : IDynamicApiController\n    {\n        public string GetVersion()\n        {\n            return $"v1.0.0";\n        }\n\n        public string ChangeProfile()\n        {\n            return "\u4fee\u6539\u6210\u529f";\n        }\n\n        public string DeleteUser()\n        {\n            return "\u5220\u9664\u6210\u529f";\n        }\n    }\n}\n')),Object(r.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(r.b)("img",{src:Object(b.a)("img/dzmc.png")}),Object(r.b)("h3",{id:"583-\u5e26\u53c2\u6570\u52a8\u4f5c\u65b9\u6cd5"},"5.8.3 \u5e26\u53c2\u6570\u52a8\u4f5c\u65b9\u6cd5"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{7,12,17}","{7,12,17}":!0}),'using Fur.DynamicApiController;\n\nnamespace Fur.Application\n{\n    public class FurAppService : IDynamicApiController\n    {\n        public string GetUser(int id)\n        {\n            return $"{id}";\n        }\n\n        public string GetUser(int id, string name)\n        {\n            return $"{id} {name}";\n        }\n\n        public TestDto Add(TestDto testDto)\n        {\n            return testDto;\n        }\n    }\n}\n')),Object(r.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(r.b)("img",{src:Object(b.a)("img/dcsff.gif")}),Object(r.b)("h3",{id:"585-gethead-\u7c7b\u7c7b\u578b\u53c2\u6570"},"5.8.5 ",Object(r.b)("inlineCode",{parentName:"h3"},"GET/HEAD")," \u7c7b\u7c7b\u578b\u53c2\u6570"),Object(r.b)("p",null,"\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c",Object(r.b)("inlineCode",{parentName:"p"},"ASP.NET Core")," \u4f1a\u5c06 ",Object(r.b)("inlineCode",{parentName:"p"},"GET/HEAD")," \u8bf7\u6c42\u4e2d\u7684 ",Object(r.b)("inlineCode",{parentName:"p"},"\u7c7b\u7c7b\u578b\u53c2\u6570")," \u8bbe\u7f6e\u4e3a ",Object(r.b)("inlineCode",{parentName:"p"},"[FromBody]")," \u7ed1\u5b9a\uff0c\u5982\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{7}","{7}":!0}),"using Fur.DynamicApiController;\n\nnamespace Fur.Application\n{\n    public class FurAppService : IDynamicApiController\n    {\n        public TestDto GetTest(TestDto testDto)\n        {\n            return testDto;\n        }\n    }\n}\n")),Object(r.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(r.b)("img",{src:Object(b.a)("img/getyycs.png")}),Object(r.b)("p",null,"\u4f46\u662f\uff0c",Object(r.b)("inlineCode",{parentName:"p"},"GET\u3001HEAD")," \u8bf7\u6c42\u4e0d\u652f\u6301 ",Object(r.b)("inlineCode",{parentName:"p"},"From Body")," \u7ed1\u5b9a\u3002\u6240\u4ee5\u6211\u4eec\u9700\u8981\u8f6c\u6362\u4e3a ",Object(r.b)("inlineCode",{parentName:"p"},"Query")," \u67e5\u8be2\u53c2\u6570\u3002"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Fur")," \u6846\u67b6\u652f\u6301\u4ee5\u4e0b\u4e24\u79cd\u65b9\u5f0f\u914d\u7f6e\uff1a"),Object(r.b)(c.a,{defaultValue:"fromquery",values:[{label:"[FromQuery] \u7279\u6027",value:"fromquery"},{label:"\u914d\u7f6e DynamicApiControllerSettings",value:"DynamicApiControllerSettings"}],mdxType:"Tabs"},Object(r.b)(l.a,{value:"fromquery",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2,8}","{2,8}":!0}),"using Fur.DynamicApiController;\nusing Microsoft.AspNetCore.Mvc;\n\nnamespace Fur.Application\n{\n    public class FurAppService : IDynamicApiController\n    {\n        public TestDto GetTest([FromQuery] TestDto testDto)\n        {\n            return testDto;\n        }\n    }\n}\n"))),Object(r.b)(l.a,{value:"DynamicApiControllerSettings",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json",metastring:'{2-4} title="Fur.Web.Entry/appsettings.json"',"{2-4}":!0,title:'"Fur.Web.Entry/appsettings.json"'}),'{\n  "DynamicApiControllerSettings": {\n    "ModelToQuery": true\n  }\n}\n')))),Object(r.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(r.b)("img",{src:Object(b.a)("img/modeltoquery.png")}),Object(r.b)("h3",{id:"586-\u81ea\u5b9a\u4e49\u53c2\u6570\u4f4d\u7f6e"},"5.8.6 \u81ea\u5b9a\u4e49\u53c2\u6570\u4f4d\u7f6e"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Fur")," \u6846\u67b6\u63d0\u4f9b\u4e86\u975e\u5e38\u65b9\u4fbf\u7684\u81ea\u5b9a\u4e49\u53c2\u6570\u4f4d\u7f6e\u7684\u7279\u6027 ",Object(r.b)("inlineCode",{parentName:"p"},"[ApiSeat]"),"\uff0c\u901a\u8fc7 ",Object(r.b)("inlineCode",{parentName:"p"},"[ApiSeat]")," \u53ef\u914d\u7f6e\u53c2\u6570\u4f4d\u7f6e\uff0c\u652f\u6301\u4ee5\u4e0b\u56db\u79cd\u4f4d\u7f6e\uff1a"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"ApiSeats.ControllerStart"),"\uff1a\u63a7\u5236\u5668\u4e4b\u524d"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"ApiSeats.ControllerEnd"),"\uff1a\u63a7\u5236\u5668\u4e4b\u540e"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"ApiSeats.ActionStart"),"\uff1a\u52a8\u4f5c\u65b9\u6cd5\u4e4b\u524d"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"ApiSeats.ActionEnd"),"\uff1a\u52a8\u4f5c\u65b9\u6cd5\u4e4b\u540e\u3002",Object(r.b)("strong",{parentName:"li"},"\u9ed8\u8ba4\u503c"))),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{8-9,15-20}","{8-9,15-20}":!0}),'using Fur.DynamicApiController;\nusing System;\n\nnamespace Fur.Application\n{\n    public class FurAppService : IDynamicApiController\n    {\n        // \u53c2\u6570\u9ed8\u8ba4\u4e3a ApiSeats.ActionEnd\n        public string RouteSeat(int id, string name)\n        {\n            return "\u914d\u7f6e\u8def\u7531\u53c2\u6570\u4f4d\u7f6e";\n        }\n\n        public string RouteSeat(\n            [ApiSeat(ApiSeats.ControllerStart)] int id, // \u63a7\u5236\u5668\u540d\u79f0\u4e4b\u524d\n            [ApiSeat(ApiSeats.ControllerEnd)] string name, // \u63a7\u5236\u5668\u540d\u79f0\u4e4b\u540e\n            [ApiSeat(ApiSeats.ControllerEnd)] int age, // \u63a7\u5236\u5668\u540d\u79f0\u4e4b\u540e\n            [ApiSeat(ApiSeats.ActionStart)] decimal weight, // \u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0\u4e4b\u524d\n            [ApiSeat(ApiSeats.ActionStart)] float height, // \u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0\u4e4b\u524d\n            [ApiSeat(ApiSeats.ActionEnd)] DateTime birthday) // \u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0\u4e4b\u540e\uff08\u9ed8\u8ba4\u503c\uff09\n        {\n            return "\u914d\u7f6e\u8def\u7531\u53c2\u6570\u4f4d\u7f6e";\n        }\n    }\n}\n')),Object(r.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(r.b)("img",{src:Object(b.a)("img/cswz.png")}),Object(r.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u6e29\u99a8\u63d0\u793a")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u591a\u4e2a ",Object(r.b)("strong",{parentName:"p"},Object(r.b)("inlineCode",{parentName:"strong"},"\u540c\u4f4d\u7f6e"))," \u914d\u7f6e\u7684\u53c2\u6570\u5c06\u6309\u7167 ",Object(r.b)("strong",{parentName:"p"},Object(r.b)("inlineCode",{parentName:"strong"},"\u5b9a\u4e49\u53c2\u6570\u987a\u5e8f"))," \u8fdb\u884c\u6392\u5e8f\u3002"))),Object(r.b)("div",{className:"admonition admonition-caution alert alert--warning"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})))),"\u7279\u522b\u6ce8\u610f")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},Object(r.b)("inlineCode",{parentName:"p"},"[ApiSeat]")," \u53ea\u80fd\u5e94\u7528\u4e8e\u8d34\u4e86 ",Object(r.b)("inlineCode",{parentName:"p"},"[FromRoute]")," \u7279\u6027\u7684\u53c2\u6570\u6216 ",Object(r.b)("inlineCode",{parentName:"p"},"\u57fa\u5143\u7c7b\u578b\u3001\u503c\u7c7b\u578b\u3001\u53ef\u7a7a\u57fa\u5143\u7c7b\u578b\u548c\u53ef\u7a7a\u503c\u7c7b\u578b"),"\u3002"))),Object(r.b)("h3",{id:"587-\u81ea\u5b9a\u4e49\u8bf7\u6c42\u8c13\u8bcd"},"5.8.7 \u81ea\u5b9a\u4e49\u8bf7\u6c42\u8c13\u8bcd"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2,8}","{2,8}":!0}),'using Fur.DynamicApiController;\nusing Microsoft.AspNetCore.Mvc;\n\nnamespace Fur.Application\n{\n    public class FurAppService : IDynamicApiController\n    {\n        [HttpPost]\n        public string GetVersion()\n        {\n            return "1.0.0";\n        }\n    }\n}\n')),Object(r.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(r.b)("img",{src:Object(b.a)("img/zdywc.png")}),Object(r.b)("h3",{id:"588-\u652f\u6301\u591a\u4e2a\u8c13\u8bcd"},"5.8.8 \u652f\u6301\u591a\u4e2a\u8c13\u8bcd"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2,8}","{2,8}":!0}),'using Fur.DynamicApiController;\nusing Microsoft.AspNetCore.Mvc;\n\nnamespace Fur.Application\n{\n    public class FurAppService : IDynamicApiController\n    {\n        [HttpPost, HttpGet, AcceptVerbs("PUT", "DELETE")]\n        public string GetVersion()\n        {\n            return "1.0.0";\n        }\n    }\n}\n')),Object(r.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(r.b)("img",{src:Object(b.a)("img/dgwc.png")}),Object(r.b)("div",{className:"admonition admonition-caution alert alert--warning"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})))),"\u7279\u522b\u6ce8\u610f")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u5982\u679c\u52a8\u4f5c\u65b9\u6cd5\u4e2d\u542b\u6709 ",Object(r.b)("inlineCode",{parentName:"p"},"\u7c7b\u7c7b\u578b\u53c2\u6570"),"\uff0c\u4e14\u542b\u6709 ",Object(r.b)("inlineCode",{parentName:"p"},"POST/PUT/DELETE")," \u4efb\u610f\u8bf7\u6c42\u8c13\u8bcd\uff0c\u90a3\u4e48\u8be5\u53c2\u6570\u4f1a\u81ea\u52a8\u6dfb\u52a0 ",Object(r.b)("inlineCode",{parentName:"p"},"[FromBody]")," \u53c2\u6570\uff0c\u5373\u4f7f\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"GET/HEAD")," \u8bf7\u6c42\u4e2d\u4e0d\u652f\u6301\u3002"))),Object(r.b)("h3",{id:"589-\u652f\u6301\u81ea\u5b9a\u4e49\u8def\u7531"},"5.8.9 \u652f\u6301\u81ea\u5b9a\u4e49\u8def\u7531"),Object(r.b)("p",null,"\u652f\u6301\u63a7\u5236\u5668\u548c\u52a8\u4f5c\u65b9\u6cd5\u81ea\u5b9a\u4e49\u8def\u7531\uff1a"),Object(r.b)(c.a,{defaultValue:"kzqrl",values:[{label:"\u81ea\u5b9a\u4e49\u63a7\u5236\u5668\u8def\u7531",value:"kzqrl"},{label:"\u81ea\u5b9a\u4e49\u52a8\u4f5c\u65b9\u6cd5\u8def\u7531",value:"dzffrl"},{label:"\u540c\u65f6\u81ea\u5b9a\u4e49\u8def\u7531",value:"allrl"},{label:"\u8c13\u8bcd\u81ea\u5b9a\u4e49\u8def\u7531",value:"vcrl"}],mdxType:"Tabs"},Object(r.b)(l.a,{value:"kzqrl",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2,6}","{2,6}":!0}),'using Fur.DynamicApiController;\nusing Microsoft.AspNetCore.Mvc;\n\nnamespace Fur.Application\n{\n    [Route("customapi/mobile/[controller]")]\n    public class FurAppService : IDynamicApiController\n    {\n        public string GetVersion()\n        {\n            return "1.0.0";\n        }\n    }\n}\n')),Object(r.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(r.b)("img",{src:Object(b.a)("img/kzqrl.png")})),Object(r.b)(l.a,{value:"dzffrl",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2,8}","{2,8}":!0}),'using Fur.DynamicApiController;\nusing Microsoft.AspNetCore.Mvc;\n\nnamespace Fur.Application\n{\n    public class FurAppService : IDynamicApiController\n    {\n        [Route("customapi/[action]")]\n        public string GetVersion()\n        {\n            return "1.0.0";\n        }\n    }\n}\n')),Object(r.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(r.b)("img",{src:Object(b.a)("img/dzffrl.png")})),Object(r.b)(l.a,{value:"allrl",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2,6,9}","{2,6,9}":!0}),'using Fur.DynamicApiController;\nusing Microsoft.AspNetCore.Mvc;\n\nnamespace Fur.Application\n{\n    [Route("customapi/mobile/[controller]")]\n    public class FurAppService : IDynamicApiController\n    {\n        [Route("get/[action]")]\n        public string GetVersion()\n        {\n            return "1.0.0";\n        }\n    }\n}\n')),Object(r.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(r.b)("img",{src:Object(b.a)("img/allrl.png")})),Object(r.b)(l.a,{value:"vcrl",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{9}","{9}":!0}),'using Fur.DynamicApiController;\nusing Microsoft.AspNetCore.Mvc;\n\nnamespace Fur.Application\n{\n    [Route("api/[controller]")]\n    public class FurAppService : IDynamicApiController\n    {\n        [HttpGet("get/[action]")]\n        public string GetVersion()\n        {\n            return "1.0.0";\n        }\n    }\n}\n')),Object(r.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(r.b)("img",{src:Object(b.a)("img/wcrl.png")}))),Object(r.b)("div",{className:"admonition admonition-important alert alert--info"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u5c0f\u63d0\u793a")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u52a8\u6001\u65b9\u6cd5\u81ea\u5b9a\u4e49\u8def\u7531\u5982\u679c\u4ee5 ",Object(r.b)("strong",{parentName:"p"},Object(r.b)("inlineCode",{parentName:"strong"},"/"))," \u5f00\u5934\uff0c\u5219\u4e0d\u4f1a\u5408\u5e76\u63a7\u5236\u5668\u8def\u7531\u3002"))),Object(r.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u63a8\u8350\u914d\u7f6e")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u81ea\u5b9a\u4e49\u8def\u7531\u5982\u679c\u9700\u8981\u7528\u5230 ",Object(r.b)("strong",{parentName:"p"},"\u63a7\u5236\u5668/\u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0"),"\uff0c\u63a8\u8350\u4f7f\u7528 ",Object(r.b)("inlineCode",{parentName:"p"},"[controller]")," \u6216 ",Object(r.b)("inlineCode",{parentName:"p"},"[action]")," \u5360\u4f4d\u7b26\uff0c\u56e0\u4e3a\u8be5\u5360\u4f4d\u7b26\u5df2\u7ecf\u81ea\u52a8\u5904\u7406\u4e86 ",Object(r.b)("strong",{parentName:"p"},"\u524d\u540e\u7f00\u3001\u7248\u672c\u53f7\u3001\u6a21\u5757\u540d\u79f0"),"\u7b49\u3002"))),Object(r.b)("h3",{id:"5810-\u591a\u8def\u7531\u968f\u610f\u7ec4\u5408"},"5.8.10 \u591a\u8def\u7531\u968f\u610f\u7ec4\u5408"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Fur")," \u6846\u67b6\u63d0\u4f9b\u4e86\u975e\u5e38\u7075\u6d3b\u7684\u5404\u79cd\u8def\u7531\u7ec4\u5408\u65b9\u5f0f\uff0c\u652f\u6301\u4e00\u5bf9\u591a\uff0c\u591a\u5bf9\u591a\u8def\u7531\u7ec4\u5408\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{6-8,11-14}","{6-8,11-14}":!0}),'using Fur.DynamicApiController;\nusing Microsoft.AspNetCore.Mvc;\n\nnamespace Fur.Application\n{\n    [Route("api/[controller]")]\n    [Route("api/[controller]/second")]\n    [Route("api/[controller]/three")]\n    public class FurAppService : IDynamicApiController\n    {\n        [HttpGet]\n        [HttpGet("get/[action]")]\n        [HttpPost]\n        [HttpPost("post/cus-version")]\n        public string GetVersion()\n        {\n            return "1.0.0";\n        }\n    }\n}\n')),Object(r.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(r.b)("img",{src:Object(b.a)("img/dlrzh.gif")}),Object(r.b)("div",{className:"admonition admonition-caution alert alert--warning"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})))),"\u7279\u522b\u6ce8\u610f")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u52a8\u4f5c\u65b9\u6cd5\u4e0d\u80fd\u540c\u65f6\u8d34 ",Object(r.b)("inlineCode",{parentName:"p"},"[Route]")," \u548c ",Object(r.b)("inlineCode",{parentName:"p"},"[HttpMethod]")," \u7279\u6027\uff0c\u53ea\u80fd\u4e8c\u53d6\u4e00\u3002"))),Object(r.b)("h3",{id:"5811-\u652f\u6301\u7248\u672c\u63a7\u5236"},"5.8.11 \u652f\u6301\u7248\u672c\u63a7\u5236"),Object(r.b)(c.a,{defaultValue:"kzqbb",values:[{label:"\u63a7\u5236\u5668\u7248\u672c",value:"kzqbb"},{label:"\u52a8\u4f5c\u65b9\u6cd5\u7248\u672c",value:"dzffbb"}],mdxType:"Tabs"},Object(r.b)(l.a,{value:"kzqbb",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5,13,21}","{5,13,21}":!0}),"using Fur.DynamicApiController;\n\nnamespace Fur.Application\n{\n    public class FurAppServiceV1 : IDynamicApiController\n    {\n        public string Get()\n        {\n            return nameof(Fur);\n        }\n    }\n\n    public class FurAppServiceV1_2 : IDynamicApiController\n    {\n        public string Get()\n        {\n            return nameof(Fur);\n        }\n    }\n\n    public class FurAppServiceV1_2_1 : IDynamicApiController\n    {\n        public string Get()\n        {\n            return nameof(Fur);\n        }\n    }\n}\n")),Object(r.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(r.b)("img",{src:Object(b.a)("img/kzqbb.png")})),Object(r.b)(l.a,{value:"dzffbb",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{7,12,16}","{7,12,16}":!0}),"using Fur.DynamicApiController;\n\nnamespace Fur.Application\n{\n    public class FurAppService : IDynamicApiController\n    {\n        public string Get()\n        {\n            return nameof(Fur);\n        }\n\n        public string GetV1()\n        {\n            return nameof(Fur);\n        }\n        public string GetV2_1()\n        {\n            return nameof(Fur);\n        }\n    }\n}\n")),Object(r.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(r.b)("img",{src:Object(b.a)("img/dzffbb.png")}))),Object(r.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u7248\u672c\u751f\u6210\u539f\u7406")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},Object(r.b)("strong",{parentName:"p"},Object(r.b)("inlineCode",{parentName:"strong"},"V[0-9_]"))," \u7ed3\u5c3e\u7684\u547d\u540d\u81ea\u52a8\u89e3\u6790\u6210\u7248\u672c\u53f7\uff0c\u5982 ",Object(r.b)("strong",{parentName:"p"},Object(r.b)("inlineCode",{parentName:"strong"},"FurAppServiceV2 -> Fur@2")),"\u3002"))),Object(r.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u7248\u672c\u590d\u5199")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u9664\u4e86\u901a\u8fc7\u7279\u5b9a\u540e\u7f00\u65b9\u5f0f\u4ee5\u5916\uff0c\u7248\u672c\u8fd8\u76f4\u63a5\u901a\u8fc7 ",Object(r.b)("inlineCode",{parentName:"p"},"[ApiDescriptionSettings]")," \u8fdb\u884c\u590d\u5199\u3002\u5982\uff1a"),Object(r.b)("pre",{parentName:"div"},Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,2}","{1,2}":!0}),'[ApiDescriptionSettings(Version = "4.0")]\npublic string GetV1()\n{\n    return nameof(Fur);\n}\n')),Object(r.b)("p",{parentName:"div"},"\u8fd9\u65f6\uff0c\u751f\u6210\u7248\u672c\u5c06\u91c7\u7528 ",Object(r.b)("inlineCode",{parentName:"p"},"4.0")," \u66ff\u4ee3 ",Object(r.b)("inlineCode",{parentName:"p"},"1")))),Object(r.b)("h3",{id:"5812-\u4e0d\u516c\u5f00\u63a7\u5236\u5668\u6216\u52a8\u4f5c\u65b9\u6cd5"},"5.8.12 \u4e0d\u516c\u5f00\u63a7\u5236\u5668\u6216\u52a8\u4f5c\u65b9\u6cd5"),Object(r.b)("p",null,"\u6709\u4e9b\u65f6\u5019\uff0c\u6211\u4eec\u65e0\u9700\u5bfc\u51fa\u67d0\u4e2a\u52a8\u4f5c\u65b9\u6cd5\u6216\u63a7\u5236\u5668\uff0c\u53ea\u9700\u8981\u6dfb\u52a0 ",Object(r.b)("inlineCode",{parentName:"p"},"[ApiDescriptionSettings(false)]")," \u6216 ",Object(r.b)("inlineCode",{parentName:"p"},"[ApiExplorerSettings(IgnoreApi = true)]"),"\u5373\u53ef\u3002"),Object(r.b)("p",null,"\u53e6\u5916\u52a8\u4f5c\u65b9\u6cd5\u8fd8\u652f\u6301 ",Object(r.b)("inlineCode",{parentName:"p"},"[NonAction]")," \u6807\u8bb0\u3002"),Object(r.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u63a8\u8350\u4f7f\u7528")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u63a8\u8350\u63a7\u5236\u5668\u6216\u52a8\u4f5c\u65b9\u6cd5\u8bbe\u7f6e\u4e0d\u5bfc\u51fa\u4f7f\u7528 ",Object(r.b)("inlineCode",{parentName:"p"},"[ApiDescriptionSettings(false)]")," \u7279\u6027\u3002\u8be5\u7279\u6027\u9ed8\u8ba4\u7ee7\u627f\u81ea ",Object(r.b)("inlineCode",{parentName:"p"},"ApiExplorerSettingsAttribute")," \u7c7b\u3002"))),Object(r.b)("h2",{id:"59-apidescriptionsettings"},"5.9 ",Object(r.b)("inlineCode",{parentName:"h2"},"[ApiDescriptionSettings]")),Object(r.b)("p",null,"\u9664\u4e86\u4e0a\u8ff0 ",Object(r.b)("inlineCode",{parentName:"p"},"ASP.NET Core")," \u63d0\u4f9b\u7684\u914d\u7f6e\u5916\uff0c",Object(r.b)("inlineCode",{parentName:"p"},"Fur")," \u6846\u67b6\u8fd8\u63d0\u4f9b\u4e86\u975e\u5e38\u5f3a\u5927\u4e14\u7075\u6d3b\u7684 ",Object(r.b)("inlineCode",{parentName:"p"},"[ApiDescriptionSettings]")," \u7279\u6027\u3002"),Object(r.b)("h3",{id:"591-\u5185\u7f6e\u914d\u7f6e"},"5.9.1 \u5185\u7f6e\u914d\u7f6e"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"Name"),"\uff1a\u81ea\u5b9a\u4e49\u63a7\u5236\u5668/\u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"string"),"\uff0c\u9ed8\u8ba4 ",Object(r.b)("inlineCode",{parentName:"li"},"null")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"KeepName"),"\uff1a\u662f\u5426\u4fdd\u6301\u539f\u6709\u540d\u79f0\u4e0d\u5904\u7406\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"bool"),"\uff0c\u9ed8\u8ba4 ",Object(r.b)("inlineCode",{parentName:"li"},"false")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"SplitCamelCase"),"\uff1a\u5207\u5272\u9a86\u9a7c\u547d\u540d\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"bool"),"\uff0c\u9ed8\u8ba4 ",Object(r.b)("inlineCode",{parentName:"li"},"true")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"KeepVerb"),"\uff1a\u662f\u5426\u4fdd\u7559\u52a8\u4f5c\u65b9\u6cd5\u8bf7\u6c42\u8c13\u8bcd\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"bool"),"\uff0c\u9ed8\u8ba4 ",Object(r.b)("inlineCode",{parentName:"li"},"false")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"Enabled"),"\uff1a\u662f\u5426\u5bfc\u51fa\u63a5\u53e3\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"bool"),"\uff0c\u9ed8\u8ba4 ",Object(r.b)("inlineCode",{parentName:"li"},"true")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"Module"),"\uff1a\u6a21\u5757\u540d\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"string"),"\uff0c\u9ed8\u8ba4 ",Object(r.b)("inlineCode",{parentName:"li"},"null")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"Version"),"\uff1a\u7248\u672c\u53f7\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"string"),"\uff0c\u9ed8\u8ba4 ",Object(r.b)("inlineCode",{parentName:"li"},"null")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"Groups"),"\uff1a\u63a5\u53e3\u5206\u7ec4\uff0c\u53ef\u7ed3\u5408 ",Object(r.b)("inlineCode",{parentName:"li"},"Swagger")," \u4e00\u8d77\u4f7f\u7528\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"string[]"),"\uff0c\u9ed8\u8ba4 ",Object(r.b)("inlineCode",{parentName:"li"},"null")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"Tags"),"\uff1a\u63a5\u53e3\u6807\u7b7e\uff0c\u53ef\u7ed3\u5408 ",Object(r.b)("inlineCode",{parentName:"li"},"Swagger")," \u4e00\u8d77\u4f7f\u7528\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"string[]"),"\uff0c\u9ed8\u8ba4 ",Object(r.b)("inlineCode",{parentName:"li"},"null")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"AuthPolicies"),"\uff1a\u6388\u6743\u7b56\u7565\uff0c\u53ef\u7ed3\u5408 ",Object(r.b)("inlineCode",{parentName:"li"},"\u6388\u6743\uff0cJWT")," \u4e00\u8d77\u4f7f\u7528\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"string[]"),"\uff0c\u9ed8\u8ba4 ",Object(r.b)("inlineCode",{parentName:"li"},"null"))),Object(r.b)("h3",{id:"592-name-\u914d\u7f6e"},"5.9.2 ",Object(r.b)("inlineCode",{parentName:"h3"},"Name")," \u914d\u7f6e"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Name")," \u53c2\u6570\u53ef\u4ee5\u8986\u76d6\u52a8\u6001 ",Object(r.b)("inlineCode",{parentName:"p"},"WebAPI")," \u81ea\u52a8\u751f\u6210\u7684\u63a7\u5236\u5668\u6216\u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0\u3002\u5982\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5,8}","{5,8}":!0}),'using Fur.DynamicApiController;\n\nnamespace Fur.Application\n{\n    [ApiDescriptionSettings(Name = "MyFur")]\n    public class FurAppService : IDynamicApiController\n    {\n        [ApiDescriptionSettings(Name = "MyGet")]\n        public string Get()\n        {\n            return nameof(Fur);\n        }\n    }\n}\n')),Object(r.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(r.b)("img",{src:Object(b.a)("img/namepz.png")}),Object(r.b)("h3",{id:"593-keepname-\u914d\u7f6e"},"5.9.3 ",Object(r.b)("inlineCode",{parentName:"h3"},"KeepName")," \u914d\u7f6e"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"KeepName")," \u53c2\u6570\u53ef\u4ee5\u4fdd\u7559\u539f\u6709\u7684\u63a7\u5236\u5668\u6216\u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0\u3002\u5982\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5,8}","{5,8}":!0}),"using Fur.DynamicApiController;\n\nnamespace Fur.Application\n{\n    [ApiDescriptionSettings(KeepName = true)]\n    public class FurAppService : IDynamicApiController\n    {\n        [ApiDescriptionSettings(KeepName = true)]\n        public string Get()\n        {\n            return nameof(Fur);\n        }\n    }\n}\n")),Object(r.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(r.b)("img",{src:Object(b.a)("img/keepnamepz.png")}),Object(r.b)("h3",{id:"594-splitcamelcase-\u914d\u7f6e"},"5.9.4 ",Object(r.b)("inlineCode",{parentName:"h3"},"SplitCamelCase")," \u914d\u7f6e"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"SplitCamelCase")," \u53c2\u6570\u9ed8\u8ba4\u5c06\u9a86\u9a7c\u547d\u540d\u5207\u5272\u6210\u591a\u4e2a\u5355\u8bcd\u5e76\u901a\u8fc7\u6307\u5b9a ",Object(r.b)("inlineCode",{parentName:"p"},"\u5360\u4f4d\u7b26")," \u8fde\u63a5\u8d77\u6765\u3002\u9ed8\u8ba4 ",Object(r.b)("inlineCode",{parentName:"p"},"\u5360\u4f4d\u7b26")," \u4e3a ",Object(r.b)("inlineCode",{parentName:"p"},"-"),"\u3002\u9ed8\u8ba4\u4e3a ",Object(r.b)("inlineCode",{parentName:"p"},"true"),"\u3002\u5982\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5,8}","{5,8}":!0}),"using Fur.DynamicApiController;\n\nnamespace Fur.Application\n{\n    [ApiDescriptionSettings(SplitCamelCase = false)]\n    public class MyFurAppService : IDynamicApiController\n    {\n        [ApiDescriptionSettings(SplitCamelCase = true)]\n        public string ChangeUserName()\n        {\n            return nameof(Fur);\n        }\n    }\n}\n")),Object(r.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(r.b)("img",{src:Object(b.a)("img/splitnamepz.png")}),Object(r.b)("div",{className:"admonition admonition-important alert alert--info"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u6ce8\u610f")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},Object(r.b)("inlineCode",{parentName:"p"},"KeepName")," \u4f18\u5148\u7ea7\u9ad8\u4e8e ",Object(r.b)("inlineCode",{parentName:"p"},"SplitCamelCase"),"\uff0c\u4e5f\u5c31\u662f ",Object(r.b)("inlineCode",{parentName:"p"},"KeepName")," \u8bbe\u7f6e\u4e3a ",Object(r.b)("inlineCode",{parentName:"p"},"true"),"\uff0c\u5219\u4e0d\u4f1a\u5904\u7406 ",Object(r.b)("inlineCode",{parentName:"p"},"SplitCamelCase")," \u53c2\u6570\u3002"))),Object(r.b)("h3",{id:"595-keepverb-\u914d\u7f6e"},"5.9.5 ",Object(r.b)("inlineCode",{parentName:"h3"},"KeepVerb")," \u914d\u7f6e"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"KeepVerb")," \u53c2\u6570\u4f5c\u7528\u4e8e\u52a8\u4f5c\u65b9\u6cd5\uff0c\u6807\u8bc6\u662f\u5426\u4fdd\u7559\u52a8\u4f5c\u8c13\u8bcd\u3002\u5982\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{7}","{7}":!0}),"using Fur.DynamicApiController;\n\nnamespace Fur.Application\n{\n    public class FurAppService : IDynamicApiController\n    {\n        [ApiDescriptionSettings(KeepVerb = true)]\n        public string GetVersion()\n        {\n            return nameof(Fur);\n        }\n    }\n}\n")),Object(r.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(r.b)("img",{src:Object(b.a)("img/keepverbpz.png")}),Object(r.b)("h3",{id:"596-enabled-\u914d\u7f6e"},"5.9.6 ",Object(r.b)("inlineCode",{parentName:"h3"},"Enabled")," \u914d\u7f6e"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Enabled")," \u53c2\u6570\u914d\u7f6e\u63a5\u53e3\u662f\u5426\u5bfc\u51fa\u3002\u901a\u5e38\u7528\u4e8e\u52a8\u4f5c\u65b9\u6cd5\uff0c\u5982\u679c\u7528\u4e8e\u63a7\u5236\u5668\u5b9e\u9645\u4f5c\u7528\u4e0d\u5927\u3002"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{12}","{12}":!0}),"using Fur.DynamicApiController;\n\nnamespace Fur.Application\n{\n    public class FurAppService : IDynamicApiController\n    {\n        public string GetVersion()\n        {\n            return nameof(Fur);\n        }\n\n        [ApiDescriptionSettings(false)]\n        public string NoExport()\n        {\n            return nameof(Fur);\n        }\n    }\n}\n")),Object(r.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(r.b)("img",{src:Object(b.a)("img/enablepz.png")}),Object(r.b)("h3",{id:"597-module-\u914d\u7f6e"},"5.9.7 ",Object(r.b)("inlineCode",{parentName:"h3"},"Module")," \u914d\u7f6e"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Module")," \u53c2\u6570\u53ef\u4ee5\u914d\u7f6e\u8def\u7531\u5206\u79bb\uff0c\u7c7b\u4f3c\u4e8e ",Object(r.b)("inlineCode",{parentName:"p"},"Mvc \u533a\u57df")," \u7684\u4f5c\u7528\u3002"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5,8}","{5,8}":!0}),'using Fur.DynamicApiController;\n\nnamespace Fur.Application\n{\n    [ApiDescriptionSettings(Module = "mobile")]\n    public class FurAppService : IDynamicApiController\n    {\n        [ApiDescriptionSettings(Module = "user")]\n        public string GetVersion()\n        {\n            return nameof(Fur);\n        }\n    }\n}\n')),Object(r.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(r.b)("img",{src:Object(b.a)("img/modulepz.png")}),Object(r.b)("h3",{id:"598-version-\u914d\u7f6e"},"5.9.8 ",Object(r.b)("inlineCode",{parentName:"h3"},"Version")," \u914d\u7f6e"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Version")," \u53c2\u6570\u53ef\u4ee5\u914d\u7f6e\u63a5\u53e3\u7248\u672c\uff0c\u540c\u65f6\u53c8\u53ef\u4ee5\u590d\u5199\u7279\u6b8a\u7248\u672c\u547d\u540d\u914d\u7f6e\u3002\u9ed8\u8ba4\u7248\u672c\u53f7\u5206\u9694\u7b26\u4e3a ",Object(r.b)("inlineCode",{parentName:"p"},"@"),"\u3002\u5982\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5,9-10}","{5,9-10}":!0}),'using Fur.DynamicApiController;\n\nnamespace Fur.Application\n{\n    [ApiDescriptionSettings(Version = "1.0")]\n    public class FurAppService : IDynamicApiController\n    {\n        // V2.0.0 \u88ab\u590d\u5199\u6210 V2.1.1\n        [ApiDescriptionSettings(Version = "2.1.1")]\n        public string GetVersionV2_0_0()\n        {\n            return nameof(Fur);\n        }\n    }\n}\n')),Object(r.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(r.b)("img",{src:Object(b.a)("img/versionpz.png")}),Object(r.b)("h3",{id:"599-groups-\u914d\u7f6e"},"5.9.9 ",Object(r.b)("inlineCode",{parentName:"h3"},"Groups")," \u914d\u7f6e"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Groups")," \u914d\u7f6e\u4e3b\u8981\u7528\u4e8e\u914d\u7f6e ",Object(r.b)("inlineCode",{parentName:"p"},"Swagger")," \u5206\u7ec4\u4fe1\u606f\u3002"),Object(r.b)("p",null,"\u901a\u8fc7\u914d\u7f6e ",Object(r.b)("inlineCode",{parentName:"p"},"Groups")," \u53c2\u6570\u53ef\u4ee5\u5c06",Object(r.b)("inlineCode",{parentName:"p"},"\u63a7\u5236\u5668\u548c\u52a8\u4f5c\u65b9\u6cd5")," \u8fdb\u884c\u5f52\u7c7b\u548c\u591a\u4e2a\u5206\u7ec4\u76f4\u63a5\u5171\u4eab\u3002\u53ef\u901a\u8fc7 ",Object(r.b)("inlineCode",{parentName:"p"},"[ApiDescriptionSettings(params Groups)]")," \u6784\u9020\u51fd\u6570\u4f20\u5165\u6216\u6307\u5b9a ",Object(r.b)("inlineCode",{parentName:"p"},"Groups")," \u53c2\u6570\u914d\u7f6e\u63a5\u53e3\u662f\u5426\u5bfc\u51fa\u3002\u901a\u5e38\u7528\u4e8e\u52a8\u4f5c\u65b9\u6cd5\uff0c\u5982\u679c\u7528\u4e8e\u63a7\u5236\u5668\u5b9e\u9645\u4f5c\u7528\u4e0d\u5927\u3002"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5,13}","{5,13}":!0}),'using Fur.DynamicApiController;\n\nnamespace Fur.Application\n{\n    [ApiDescriptionSettings("Default", "Common")]\n    public class FurAppService : IDynamicApiController\n    {\n        public string Get()\n        {\n            return nameof(Fur);\n        }\n\n        [ApiDescriptionSettings("Custom")]\n        public int Get(int id)\n        {\n            return id;\n        }\n    }\n}\n')),Object(r.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(r.b)("img",{src:Object(b.a)("img/dfz.gif")}),Object(r.b)("h3",{id:"5910-tag-\u914d\u7f6e"},"5.9.10 ",Object(r.b)("inlineCode",{parentName:"h3"},"Tag")," \u914d\u7f6e"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Tag")," \u914d\u7f6e\u4e3b\u8981\u7528\u4e8e\u914d\u7f6e ",Object(r.b)("inlineCode",{parentName:"p"},"Swagger")," \u6807\u7b7e\u5206\u7ec4\u4fe1\u606f\u53ca\u5408\u5e76\u6807\u7b7e\u3002\u4e5f\u5c31\u662f ",Object(r.b)("inlineCode",{parentName:"p"},"\u7ec4\u4e2d\u7ec4"),":"),Object(r.b)(c.a,{defaultValue:"tag1",values:[{label:"\u6807\u7b7e\u547d\u540d",value:"tag1"},{label:"\u5408\u5e76\u6807\u7b7e",value:"tag2"}],mdxType:"Tabs"},Object(r.b)(l.a,{value:"tag1",mdxType:"TabItem"},Object(r.b)("h4",{id:"\u672a\u8d34\u6807\u7b7e\u4e4b\u524d"},"\u672a\u8d34\u6807\u7b7e\u4e4b\u524d"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"using Fur.DynamicApiController;\n\nnamespace Fur.Application\n{\n    public class FurAppService : IDynamicApiController\n    {\n        public string Get()\n        {\n            return nameof(Fur);\n        }\n\n        public int Get(int id)\n        {\n            return id;\n        }\n    }\n\n    public class TestAppService : IDynamicApiController\n    {\n        public string Get()\n        {\n            return nameof(Fur);\n        }\n\n        public int Get(int id)\n        {\n            return id;\n        }\n    }\n}\n")),Object(r.b)("h4",{id:"\u8d34\u6807\u7b7e\u4e4b\u540e"},"\u8d34\u6807\u7b7e\u4e4b\u540e"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5,19}","{5,19}":!0}),'using Fur.DynamicApiController;\n\nnamespace Fur.Application\n{\n    [ApiDescriptionSettings(Tag = "\u5206\u7ec4\u4e00")]\n    public class FurAppService : IDynamicApiController\n    {\n        public string Get()\n        {\n            return nameof(Fur);\n        }\n\n        public int Get(int id)\n        {\n            return id;\n        }\n    }\n\n    [ApiDescriptionSettings(Tag = "\u5206\u7ec4\u4e8c")]\n    public class TestAppService : IDynamicApiController\n    {\n        public string Get()\n        {\n            return nameof(Fur);\n        }\n\n        public int Get(int id)\n        {\n            return id;\n        }\n    }\n}\n')),Object(r.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(r.b)("img",{src:Object(b.a)("img/tag1.png")})),Object(r.b)(l.a,{value:"tag2",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5,19}","{5,19}":!0}),'using Fur.DynamicApiController;\n\nnamespace Fur.Application\n{\n    [ApiDescriptionSettings(Tag = "\u5408\u5e76\u6240\u6709\u6807\u7b7e")]\n    public class FurAppService : IDynamicApiController\n    {\n        public string Get()\n        {\n            return nameof(Fur);\n        }\n\n        public int Get(int id)\n        {\n            return id;\n        }\n    }\n\n    [ApiDescriptionSettings(Tag = "\u5408\u5e76\u6240\u6709\u6807\u7b7e")]\n    public class TestAppService : IDynamicApiController\n    {\n        public string Get()\n        {\n            return nameof(Fur);\n        }\n\n        public int Get(int id)\n        {\n            return id;\n        }\n    }\n}\n')),Object(r.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(r.b)("img",{src:Object(b.a)("img/tag2.png")}))),Object(r.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u5c0f\u77e5\u8bc6")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u5982\u679c ",Object(r.b)("inlineCode",{parentName:"p"},"Tag")," \u540d\u5b57\u4e00\u6837\uff0c\u5219\u4f1a\u81ea\u52a8\u5408\u5e76\uff0c\u5426\u5219\u53ea\u662f\u547d\u540d\u3002"))),Object(r.b)("h2",{id:"510-dynamicapicontrollersettings-\u914d\u7f6e"},"5.10 ",Object(r.b)("inlineCode",{parentName:"h2"},"DynamicApiControllerSettings")," \u914d\u7f6e"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Fur")," \u8fd8\u63d0\u4f9b\u52a8\u6001 ",Object(r.b)("inlineCode",{parentName:"p"},"WebAPI")," \u63a5\u53e3\u4e00\u4e9b\u5168\u5c40\u914d\u7f6e\u9009\u9879\uff0c\u5982\uff1a"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"DefaultRoutePrefix"),"\uff1a\u9ed8\u8ba4\u8def\u7531\u524d\u7f00\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"string"),"\uff0c\u9ed8\u8ba4 ",Object(r.b)("inlineCode",{parentName:"li"},"api")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"DefaultHttpMethod"),"\uff1a\u9ed8\u8ba4\u8bf7\u6c42\u8c13\u8bcd\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"string"),"\uff0c\u9ed8\u8ba4\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"POST")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"DefaultModule"),"\uff1a\u9ed8\u8ba4\u6a21\u5757\u540d\u79f0\uff08\u533a\u57df\uff09\uff0c\u53ef\u7528\u4f5c\u63a5\u53e3\u7248\u672c\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"string"),"\uff0c\u9ed8\u8ba4\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"v1")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"LowercaseRoute"),"\uff1a\u5c0f\u5199\u8def\u7531\u683c\u5f0f\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"bool"),"\uff0c\u9ed8\u8ba4\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"true")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"KeepVerb"),"\uff1a\u662f\u5426\u4fdd\u7559\u52a8\u4f5c\u8c13\u8bcd\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"bool"),"\uff0c\u9ed8\u8ba4\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"false")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"KeepName"),"\uff1a\u662f\u975e\u4fdd\u7559\u9ed8\u8ba4\u540d\u79f0\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"bool"),"\uff0c\u9ed8\u8ba4\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"fasle")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"CamelCaseSeparator"),"\uff1a\u9a86\u9a7c\u547d\u540d\u5206\u9694\u7b26\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"string"),"\uff0c\u9ed8\u8ba4\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"-")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"VersionSeparator"),"\uff1a\u7248\u672c\u5206\u9694\u7b26\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"string"),"\uff0c\u9ed8\u8ba4\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"@")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"ModelToQuery"),"\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"GET/HEAD")," \u8bf7\u6c42\u5c06 ",Object(r.b)("inlineCode",{parentName:"li"},"\u7c7b\u7c7b\u578b\u53c2\u6570\u8f6c\u67e5\u8be2\u53c2\u6570"),"\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"bool"),"\uff0c\u9ed8\u8ba4 ",Object(r.b)("inlineCode",{parentName:"li"},"false")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"SupportedMvcController"),"\uff1a\u662f\u5426\u652f\u6301 ",Object(r.b)("inlineCode",{parentName:"li"},"Mvc Controller")," \u52a8\u6001\u914d\u7f6e\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"bool"),"\uff0c\u9ed8\u8ba4 ",Object(r.b)("inlineCode",{parentName:"li"},"false")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"AbandonControllerAffixes"),"\uff1a\u9ed8\u8ba4\u53bb\u9664\u63a7\u5236\u5668\u540d\u79f0\u524d\u540e\u7f00\u5217\u8868\u540d\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"string[]"),"\uff0c\u9ed8\u8ba4\uff1a",Object(r.b)("ul",{parentName:"li"},Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"AppServices")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"AppService")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"ApiController")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"Controller")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"Services")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"Service")))),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"AbandonActionAffixes"),"\uff1a\u9ed8\u8ba4\u53bb\u9664\u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0\u524d\u540e\u7f00\u5217\u8868\u540d\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"string[]"),"\uff0c\u9ed8\u8ba4\uff1a",Object(r.b)("ul",{parentName:"li"},Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"Async"))))),Object(r.b)("h3",{id:"5101-\u652f\u6301-mvc-\u63a7\u5236\u5668-\u52a8\u6001\u914d\u7f6e"},"5.10.1 \u652f\u6301 ",Object(r.b)("inlineCode",{parentName:"h3"},"Mvc \u63a7\u5236\u5668")," \u52a8\u6001\u914d\u7f6e"),Object(r.b)("p",null,"\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c",Object(r.b)("inlineCode",{parentName:"p"},"Fur")," \u52a8\u6001 ",Object(r.b)("inlineCode",{parentName:"p"},"WebAPI")," \u63a5\u53e3\u4e0d\u5bf9 ",Object(r.b)("inlineCode",{parentName:"p"},"ControllerBase")," \u7c7b\u578b\u8fdb\u884c\u4efb\u4f55\u5904\u7406\u3002\u5f53\u7136\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u624b\u52a8\u542f\u7528 ",Object(r.b)("inlineCode",{parentName:"p"},"ControllerBase")," \u652f\u6301\u3002"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json",metastring:'{2-4} title="Fur.Web.Entry/appsettings.json"',"{2-4}":!0,title:'"Fur.Web.Entry/appsettings.json"'}),'{\n  "DynamicApiControllerSettings": {\n    "SupportedMvcController": true\n  }\n}\n')),Object(r.b)("p",null,"\u8bbe\u7f6e ",Object(r.b)("inlineCode",{parentName:"p"},"SupportedMvcController: true")," \u540e\uff0c",Object(r.b)("inlineCode",{parentName:"p"},"Mvc ControllerBase")," \u7c7b\u578b\u4e5f\u80fd\u548c\u52a8\u6001 ",Object(r.b)("inlineCode",{parentName:"p"},"WebAPI")," \u4e00\u6837\u7684\u7075\u6d3b\u4e86\u3002\u4ee3\u7801\u5982\u4e0b\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5}","{5}":!0}),"using Microsoft.AspNetCore.Mvc;\n\nnamespace Fur.Web.Entry.Controllers\n{\n    public class MvcController : ControllerBase\n    {\n        public string Get()\n        {\n            return nameof(Fur);\n        }\n    }\n}\n\n")),Object(r.b)("div",{className:"admonition admonition-warning alert alert--danger"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"})))),"\u6ce8\u610f\u4e8b\u9879")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u542f\u7528\u8be5\u914d\u7f6e\u540e\uff0c\u5982\u679c ",Object(r.b)("inlineCode",{parentName:"p"},"Mvc \u63a7\u5236\u5668")," \u6ca1\u6709\u4efb\u4f55 ",Object(r.b)("inlineCode",{parentName:"p"},"[Route]")," \u7279\u6027\uff0c\u4f46\u662f\u8d34\u4e86 ",Object(r.b)("inlineCode",{parentName:"p"},"[ApiController]")," \u7279\u6027\u5c06\u4f1a\u62a5\u9519\u3002\u539f\u56e0\u662f ",Object(r.b)("inlineCode",{parentName:"p"},"[ApiController]")," \u7279\u6027\u5185\u90e8\u505a\u4e86\u8def\u7531\u7279\u6027\u68c0\u6d4b\u3002\u6240\u4ee5\u5efa\u8bae\u4f7f\u7528 ",Object(r.b)("inlineCode",{parentName:"p"},"[ApiDataValidation]")," \u4ee3\u66ff\u3002"),Object(r.b)("p",{parentName:"div"},"\u67e5\u770b ",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"https://github.com/dotnet/aspnetcore/blob/c565386a3ed135560bc2e9017aa54a950b4e35dd/src/Mvc/Mvc.Core/src/ApplicationModels/ApiBehaviorApplicationModelProvider.cs#L90"}),"ASP.NET Core - ApiBehaviorApplicationModelProvider \u6e90\u7801")))),Object(r.b)("h2",{id:"511-\u53cd\u9988\u4e0e\u5efa\u8bae"},"5.11 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(r.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u7ed9 Fur \u63d0 ",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Fur/issues/new?issue"}),"Issue"),"\u3002"))))}d.isMDXComponent=!0}}]);