You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
153 KiB
JavaScript
1 line
153 KiB
JavaScript
"use strict";(self.webpackChunkfurion=self.webpackChunkfurion||[]).push([[8475],{1348:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>p,contentTitle:()=>a,default:()=>j,frontMatter:()=>d,metadata:()=>h,toc:()=>x});var i=r(5893),s=r(1151),l=r(510),c=r(4996),t=r(4866),o=r(5162);const d={id:"dynamic-api-controller",title:"5.1 \u52a8\u6001 WebAPI",sidebar_label:"5.1 \u52a8\u6001 WebAPI",description:"\u4e0d\u60f3\u624b\u52a8\u914d\u7f6e\u8def\u7531\u4e86\uff0c\u8bd5\u8bd5\u5b83"},a=void 0,h={id:"dynamic-api-controller",title:"5.1 \u52a8\u6001 WebAPI",description:"\u4e0d\u60f3\u624b\u52a8\u914d\u7f6e\u8def\u7531\u4e86\uff0c\u8bd5\u8bd5\u5b83",source:"@site/docs/dynamic-api-controller.mdx",sourceDirName:".",slug:"/dynamic-api-controller",permalink:"/docs/dynamic-api-controller",draft:!1,unlisted:!1,editUrl:"https://gitee.com/dotnetchina/Furion/tree/v4/handbook/docs/dynamic-api-controller.mdx",tags:[],version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1696900349,formattedLastUpdatedAt:"Oct 10, 2023",frontMatter:{id:"dynamic-api-controller",title:"5.1 \u52a8\u6001 WebAPI",sidebar_label:"5.1 \u52a8\u6001 WebAPI",description:"\u4e0d\u60f3\u624b\u52a8\u914d\u7f6e\u8def\u7531\u4e86\uff0c\u8bd5\u8bd5\u5b83"},sidebar:"docs",previous:{title:"5. Web \u5e94\u7528\u5f00\u53d1",permalink:"/docs/category/web"},next:{title:"5.2 HttpContext",permalink:"/docs/httpcontext"}},p={},x=[{value:"5.1.1 \u4ec0\u4e48\u662f\u63a7\u5236\u5668",id:"511-\u4ec0\u4e48\u662f\u63a7\u5236\u5668",level:2},{value:"5.1.2 <code>Mvc \u63a7\u5236\u5668</code> \u7ea6\u5b9a\u548c\u7f3a\u70b9",id:"512-mvc-\u63a7\u5236\u5668-\u7ea6\u5b9a\u548c\u7f3a\u70b9",level:2},{value:"5.1.2.1 <code>WebAPI</code> \u7ea6\u5b9a",id:"5121-webapi-\u7ea6\u5b9a",level:3},{value:"5.1.2.2 <code>.NET Core WebAPI</code> \u7f3a\u70b9",id:"5122-net-core-webapi-\u7f3a\u70b9",level:3},{value:"5.1.3 \u52a8\u6001 <code>WebAPI</code> \u63a7\u5236\u5668",id:"513-\u52a8\u6001-webapi-\u63a7\u5236\u5668",level:2},{value:"5.1.4 \u6ce8\u518c\u52a8\u6001 <code>WebAPI</code> \u670d\u52a1",id:"514-\u6ce8\u518c\u52a8\u6001-webapi-\u670d\u52a1",level:2},{value:"5.1.5 \u7b2c\u4e00\u4e2a\u4f8b\u5b50",id:"515-\u7b2c\u4e00\u4e2a\u4f8b\u5b50",level:2},{value:"5.1.6 \u52a8\u6001 <code>WebAPI</code> \u539f\u7406\u89e3\u6790",id:"516-\u52a8\u6001-webapi-\u539f\u7406\u89e3\u6790",level:2},{value:"5.1.6.1 \u63a7\u5236\u5668\u7279\u6027\u63d0\u4f9b\u5668",id:"5161-\u63a7\u5236\u5668\u7279\u6027\u63d0\u4f9b\u5668",level:3},{value:"5.1.6.2 \u5e94\u7528\u6a21\u578b\u8f6c\u6362\u5668",id:"5162-\u5e94\u7528\u6a21\u578b\u8f6c\u6362\u5668",level:3},{value:"5.1.7 \u52a8\u6001 <code>WebAPI</code> \u914d\u7f6e\u7ea6\u5b9a",id:"517-\u52a8\u6001-webapi-\u914d\u7f6e\u7ea6\u5b9a",level:2},{value:"5.1.7.1 \u63a7\u5236\u5668\u9ed8\u8ba4\u7ea6\u5b9a",id:"5171-\u63a7\u5236\u5668\u9ed8\u8ba4\u7ea6\u5b9a",level:3},{value:"5.1.7.2 \u52a8\u4f5c\u65b9\u6cd5\u9ed8\u8ba4\u7ea6\u5b9a",id:"5172-\u52a8\u4f5c\u65b9\u6cd5\u9ed8\u8ba4\u7ea6\u5b9a",level:3},{value:"5.1.7.3 \u8bf7\u6c42\u8c13\u8bcd\u9ed8\u8ba4\u7ea6\u5b9a",id:"5173-\u8bf7\u6c42\u8c13\u8bcd\u9ed8\u8ba4\u7ea6\u5b9a",level:3},{value:"5.1.7.4 \u8def\u7531\u5730\u5740\u9ed8\u8ba4\u7ea6\u5b9a",id:"5174-\u8def\u7531\u5730\u5740\u9ed8\u8ba4\u7ea6\u5b9a",level:3},{value:"5.1.7.5 \u5176\u4ed6\u7ea6\u5b9a",id:"5175-\u5176\u4ed6\u7ea6\u5b9a",level:3},{value:"5.1.8 \u66f4\u591a\u4f8b\u5b50",id:"518-\u66f4\u591a\u4f8b\u5b50",level:2},{value:"5.1.8.1 \u591a\u79cd\u8bf7\u6c42\u8c13\u8bcd\u65b9\u6cd5",id:"5181-\u591a\u79cd\u8bf7\u6c42\u8c13\u8bcd\u65b9\u6cd5",level:3},{value:"5.1.8.2 \u591a\u4e2a\u81ea\u5b9a\u4e49\u52a8\u4f5c\u65b9\u6cd5",id:"5182-\u591a\u4e2a\u81ea\u5b9a\u4e49\u52a8\u4f5c\u65b9\u6cd5",level:3},{value:"5.1.8.3 \u5e26\u53c2\u6570\u52a8\u4f5c\u65b9\u6cd5",id:"5183-\u5e26\u53c2\u6570\u52a8\u4f5c\u65b9\u6cd5",level:3},{value:"5.1.8.4 <code>GET/HEAD</code> \u7c7b\u7c7b\u578b\u53c2\u6570",id:"5184-gethead-\u7c7b\u7c7b\u578b\u53c2\u6570",level:3},{value:"5.1.8.5 \u81ea\u5b9a\u4e49\u53c2\u6570\u4f4d\u7f6e",id:"5185-\u81ea\u5b9a\u4e49\u53c2\u6570\u4f4d\u7f6e",level:3},{value:"5.1.8.6 \u81ea\u5b9a\u4e49\u8bf7\u6c42\u8c13\u8bcd",id:"5186-\u81ea\u5b9a\u4e49\u8bf7\u6c42\u8c13\u8bcd",level:3},{value:"5.1.8.7 \u652f\u6301\u591a\u4e2a\u8c13\u8bcd",id:"5187-\u652f\u6301\u591a\u4e2a\u8c13\u8bcd",level:3},{value:"5.1.8.8 \u652f\u6301\u81ea\u5b9a\u4e49\u8def\u7531",id:"5188-\u652f\u6301\u81ea\u5b9a\u4e49\u8def\u7531",level:3},{value:"5.1.8.9 \u591a\u8def\u7531\u968f\u610f\u7ec4\u5408",id:"5189-\u591a\u8def\u7531\u968f\u610f\u7ec4\u5408",level:3},{value:"5.1.8.10 \u652f\u6301\u7248\u672c\u63a7\u5236",id:"51810-\u652f\u6301\u7248\u672c\u63a7\u5236",level:3},{value:"5.1.8.11 \u4e0d\u516c\u5f00\u63a7\u5236\u5668\u6216\u52a8\u4f5c\u65b9\u6cd5",id:"51811-\u4e0d\u516c\u5f00\u63a7\u5236\u5668\u6216\u52a8\u4f5c\u65b9\u6cd5",level:3},{value:"5.1.8.12 \u4fdd\u6301\u63a7\u5236\u5668\u548c\u65b9\u6cd5\u547d\u540d",id:"51812-\u4fdd\u6301\u63a7\u5236\u5668\u548c\u65b9\u6cd5\u547d\u540d",level:3},{value:"5.1.8.13 \u65b9\u6cd5\u53c2\u6570 <code>[FromQuery]</code> \u5316/\u53c2\u6570\u975e\u5fc5\u586b/\u53c2\u6570\u53ef\u9009",id:"51813-\u65b9\u6cd5\u53c2\u6570-fromquery-\u5316\u53c2\u6570\u975e\u5fc5\u586b\u53c2\u6570\u53ef\u9009",level:3},{value:"5.1.8.14 \u53c2\u6570\u7ed1\u5b9a\u914d\u7f6e",id:"51814-\u53c2\u6570\u7ed1\u5b9a\u914d\u7f6e",level:3},{value:"5.1.8.15 \u81ea\u5b9a\u4e49\u6839\u636e\u65b9\u6cd5\u540d\u751f\u6210 <code>[HttpMethod]</code> \u89c4\u5219",id:"51815-\u81ea\u5b9a\u4e49\u6839\u636e\u65b9\u6cd5\u540d\u751f\u6210-httpmethod-\u89c4\u5219",level:3},{value:"5.1.8.16 \u8def\u7531\u53c2\u6570\u975e\u5fc5\u586b/\u9009\u586b",id:"51816-\u8def\u7531\u53c2\u6570\u975e\u5fc5\u586b\u9009\u586b",level:3},{value:"5.1.8.17 <code>[FormRoute]</code> \u8def\u7531\u7ea6\u675f",id:"51817-formroute-\u8def\u7531\u7ea6\u675f",level:3},{value:"5.1.8.18 <code>\u5c0f\u9a7c\u5cf0</code> \u8def\u7531\u8def\u5f84",id:"51818-\u5c0f\u9a7c\u5cf0-\u8def\u7531\u8def\u5f84",level:3},{value:"5.1.8.19 <code>application/xml</code> \u62a5\u6587\u53c2\u6570\u652f\u6301",id:"51819-applicationxml-\u62a5\u6587\u53c2\u6570\u652f\u6301",level:3},{value:"5.1.9 <code>[ApiDescriptionSettings]</code>",id:"519-apidescriptionsettings",level:2},{value:"5.1.9.1 \u5185\u7f6e\u914d\u7f6e",id:"5191-\u5185\u7f6e\u914d\u7f6e",level:3},{value:"5.1.9.2 <code>Name</code> \u914d\u7f6e",id:"5192-name-\u914d\u7f6e",level:3},{value:"5.1.9.3 <code>KeepName</code> \u914d\u7f6e",id:"5193-keepname-\u914d\u7f6e",level:3},{value:"5.1.9.4 <code>SplitCamelCase</code> \u914d\u7f6e",id:"5194-splitcamelcase-\u914d\u7f6e",level:3},{value:"5.1.9.5 <code>KeepVerb</code> \u914d\u7f6e",id:"5195-keepverb-\u914d\u7f6e",level:3},{value:"5.1.9.6 <code>Enabled</code> \u914d\u7f6e",id:"5196-enabled-\u914d\u7f6e",level:3},{value:"5.1.9.7 <code>Module</code> \u914d\u7f6e",id:"5197-module-\u914d\u7f6e",level:3},{value:"5.1.9.8 <code>Version</code> \u914d\u7f6e",id:"5198-version-\u914d\u7f6e",level:3},{value:"5.1.9.9 <code>Groups</code> \u914d\u7f6e",id:"5199-groups-\u914d\u7f6e",level:3},{value:"5.1.9.10 <code>Tag</code> \u914d\u7f6e",id:"51910-tag-\u914d\u7f6e",level:3},{value:"\u672a\u8d34\u6807\u7b7e\u4e4b\u524d",id:"\u672a\u8d34\u6807\u7b7e\u4e4b\u524d",level:4},{value:"\u8d34\u6807\u7b7e\u4e4b\u540e",id:"\u8d34\u6807\u7b7e\u4e4b\u540e",level:4},{value:"5.1.10 <code>DynamicApiControllerSettings</code> \u914d\u7f6e",id:"5110-dynamicapicontrollersettings-\u914d\u7f6e",level:2},{value:"5.1.10.1 \u652f\u6301 <code>Mvc \u63a7\u5236\u5668</code> \u52a8\u6001\u914d\u7f6e",id:"51101-\u652f\u6301-mvc-\u63a7\u5236\u5668-\u52a8\u6001\u914d\u7f6e",level:3},{value:"5.1.11 \u5173\u4e8e AOP \u62e6\u622a",id:"5111-\u5173\u4e8e-aop-\u62e6\u622a",level:2},{value:"5.1.12 \u8bbe\u7f6e <code>api</code> \u8d85\u65f6\u8bf7\u6c42\u65f6\u95f4",id:"5112-\u8bbe\u7f6e-api-\u8d85\u65f6\u8bf7\u6c42\u65f6\u95f4",level:2},{value:"5.1.13 \u83b7\u53d6\u8def\u7531/\u63a7\u5236\u5668/<code>Action</code> \u5217\u8868",id:"5113-\u83b7\u53d6\u8def\u7531\u63a7\u5236\u5668action-\u5217\u8868",level:2},{value:"5.1.14 \u63d2\u4ef6\u5316 <code>IDynamicApiRuntimeChangeProvider</code>",id:"5114-\u63d2\u4ef6\u5316-idynamicapiruntimechangeprovider",level:2},{value:"5.1.15 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"5115-\u53cd\u9988\u4e0e\u5efa\u8bae",level:2}];function u(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",h4:"h4",hr:"hr",li:"li",mdxAdmonitionTitle:"mdxAdmonitionTitle",ol:"ol",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,s.a)(),...e.components},{Details:r}=n;return r||function(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(r,{children:[(0,i.jsx)("summary",{children:"\ud83d\udcdd \u6a21\u5757\u66f4\u65b0\u65e5\u5fd7"}),(0,i.jsx)("div",{children:(0,i.jsxs)("div",{children:[(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"\u65b0\u7279\u6027"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\xa0",(0,i.jsx)(l.Z,{children:"\u65b0\u589e"})," \u52a8\u6001 ",(0,i.jsx)(n.code,{children:"WebAPI"})," \u652f\u6301 ",(0,i.jsx)(n.code,{children:"text/plain"})," \u683c\u5f0f\u7684 ",(0,i.jsx)(n.code,{children:"Body"})," \u53c2\u6570 ",(0,i.jsx)("sup",{children:"4.8.8.9"})," ",(0,i.jsx)("sup",{children:"\u23f1\ufe0f2023.05.04"})," ",(0,i.jsx)(n.a,{href:"https://gitee.com/dotnetchina/Furion/commit/b49fe5087cdf97b04b7c2c9d90231f1b9d5fc6ee",children:"b49fe50"})]}),"\n",(0,i.jsxs)(n.li,{children:["\xa0",(0,i.jsx)(l.Z,{children:"\u65b0\u589e"})," ",(0,i.jsxs)(n.strong,{children:["\u63d2\u4ef6\u5316 ",(0,i.jsx)(n.code,{children:"IDynamicApiRuntimeChangeProvider"})," \u63a5\u53e3\uff0c\u53ef\u5728\u8fd0\u884c\u65f6\u52a8\u6001\u6dfb\u52a0 ",(0,i.jsx)(n.code,{children:"WebAPI/Controller"})]})," ",(0,i.jsx)("sup",{children:"4.8.8.8"})," ",(0,i.jsx)("sup",{children:"\u23f1\ufe0f2023.05.04"})," ",(0,i.jsx)(n.a,{href:"https://gitee.com/dotnetchina/Furion/commit/322ea599ed58b1804e9f8ab85d7ed44882b3e5a8",children:"322ea59"})]}),"\n"]}),"\n"]}),"\n"]}),(0,i.jsxs)(r,{style:{marginLeft:50},children:[(0,i.jsx)("summary",{children:"\u67e5\u770b\u53d8\u5316"}),(0,i.jsxs)("div",{children:[(0,i.jsxs)(n.p,{children:["\u5728\u4e00\u4e9b\u7279\u5b9a\u7684\u9700\u6c42\u4e2d\uff0c\u6211\u4eec\u9700\u8981\u5728\u8fd0\u884c\u65f6",(0,i.jsxs)(n.strong,{children:["\u52a8\u6001\u7f16\u8bd1\u4ee3\u7801\uff0c\u5982\u52a8\u6001\u7f16\u5199 ",(0,i.jsx)(n.code,{children:"WebAPI"})]}),"\uff0c\u4e4b\u540e\u80fd\u591f\u5728\u4e0d\u91cd\u542f\u4e3b\u673a\u670d\u52a1\u7684\u60c5\u51b5\u4e0b\u5373\u53ef\u6709\u6548\u3002\u6bd4\u5982\u8fd9\u91cc\u52a8\u6001\u6dfb\u52a0 ",(0,i.jsx)(n.code,{children:"SomeClass"})," \u52a8\u6001 ",(0,i.jsx)(n.code,{children:"WebAPI"}),"\uff0c\u7136\u540e\u5728 ",(0,i.jsx)(n.code,{children:"Swagger/\u8def\u7531\u7cfb\u7edf"})," \u4e2d\u7acb\u5373\u6709\u6548\uff1a"]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {10,21-30,36-39}",children:'using Furion;\r\nusing Furion.DynamicApiController;\r\nusing Microsoft.AspNetCore.Mvc;\r\n\r\nnamespace YourProject.Application;\r\n\r\npublic class PluginApiServices : IDynamicApiController\r\n{\r\n private readonly IDynamicApiRuntimeChangeProvider _provider;\r\n public PluginApiServices(IDynamicApiRuntimeChangeProvider provider)\r\n {\r\n _provider = provider;\r\n }\r\n\r\n /// <summary>\r\n /// \u52a8\u6001\u6dfb\u52a0 WebAPI/Controller\r\n /// </summary>\r\n /// <param name="csharpCode"></param>\r\n /// <param name="assemblyName">\u53ef\u81ea\u884c\u6307\u5b9a\u7a0b\u5e8f\u96c6\u540d\u79f0</param>\r\n /// <returns></returns>\r\n public string Compile([FromBody] string csharpCode, [FromQuery] string assemblyName = default)\r\n {\r\n // \u7f16\u8bd1 C# \u4ee3\u7801\u5e76\u8fd4\u56de\u52a8\u6001\u7a0b\u5e8f\u96c6\r\n var dynamicAssembly = App.CompileCSharpClassCode(csharpCode, assemblyName);\r\n\r\n // \u5c06\u7a0b\u5e8f\u96c6\u6dfb\u52a0\u8fdb\u52a8\u6001 WebAPI \u5e94\u7528\u90e8\u4ef6\r\n _provider.AddAssembliesWithNotifyChanges(dynamicAssembly);\r\n\r\n // \u8fd4\u56de\u52a8\u6001\u7a0b\u5e8f\u96c6\u540d\u79f0\r\n return dynamicAssembly.GetName().Name;\r\n }\r\n\r\n /// <summary>\r\n /// \u79fb\u9664\u52a8\u6001\u7a0b\u5e8f\u96c6 WebAPI/Controller\r\n /// </summary>\r\n public void Remove(string assemblyName)\r\n {\r\n _provider.RemoveAssembliesWithNotifyChanges(assemblyName);\r\n }\r\n}\n'})}),(0,i.jsxs)(n.p,{children:["\u8fd9\u65f6\u53ea\u9700\u8981\u8bf7\u6c42 ",(0,i.jsx)(n.code,{children:"api/plugin-api/compile"})," \u63a5\u53e3\u540c\u65f6\u8bbe\u7f6e\u8bf7\u6c42 ",(0,i.jsx)(n.code,{children:"Content-Type"})," \u4e3a ",(0,i.jsx)(n.code,{children:"text/plain"}),"\uff0c\u63a5\u4e0b\u6765\u4f20\u5165 ",(0,i.jsx)(n.code,{children:"C# \u4ee3\u7801\u5b57\u7b26\u4e32"})," \u5373\u53ef\uff0c\u5982\uff1a"]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:'showLineNumbers title="\u52a8\u6001C#\u4ee3\u7801\u5b57\u7b26\u4e32"',children:"using Furion.DynamicApiController;\r\n\r\nnamespace YourProject.Application;\r\n\r\npublic class SomeClass : IDynamicApiController\r\n{\r\n public string GetName()\r\n {\r\n return nameof(Furion);\r\n }\r\n}\n"})}),(0,i.jsx)("img",{src:(0,c.Z)("img/dr1.png")}),(0,i.jsxs)(n.p,{children:["\u4e4b\u540e\u5237\u65b0\u6d4f\u89c8\u5668\u5373\u53ef\u770b\u5230\u6700\u65b0\u7684 ",(0,i.jsx)(n.code,{children:"API"}),"\uff1a"]}),(0,i.jsx)("img",{src:(0,c.Z)("img/dr2.png")}),(0,i.jsxs)(n.p,{children:["\u8fd8\u53ef\u4ee5\u5728\u8fd0\u884c\u65f6\u52a8\u6001\u5378\u8f7d\uff0c\u4f7f\u7528 ",(0,i.jsx)(n.code,{children:"DELETE"})," \u8bf7\u6c42 ",(0,i.jsx)(n.code,{children:"api/plugin-api"})," \u5373\u53ef\u3002"]})]})]}),(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\xa0",(0,i.jsx)(l.Z,{children:"\u65b0\u589e"})," ",(0,i.jsxs)(n.strong,{children:["\u52a8\u6001 ",(0,i.jsx)(n.code,{children:"WebAPI"})," \u81ea\u52a8\u68c0\u67e5\u8def\u7531\u662f\u5426\u5305\u542b\u91cd\u590d\u53c2\u6570\uff0c\u5982\u679c\u6709\u81ea\u52a8\u4fee\u6b63\u800c\u4e0d\u662f\u629b\u5f02\u5e38"]})," ",(0,i.jsx)("sup",{children:"4.8.6.5"})," ",(0,i.jsx)("sup",{children:"\u23f1\ufe0f2023.02.17"})," ",(0,i.jsx)(n.a,{href:"https://gitee.com/dotnetchina/Furion/commit/5f15ea1edd2e7793d86dd074ffbbecbebf7f683f",children:"5f15ea1"})]}),"\n"]}),"\n"]}),"\n"]}),(0,i.jsxs)(r,{style:{marginLeft:50},children:[(0,i.jsx)("summary",{children:"\u67e5\u770b\u53d8\u5316"}),(0,i.jsxs)("div",{children:[(0,i.jsxs)(n.p,{children:["\u5728 ",(0,i.jsx)(n.code,{children:"Furion 4.8.6.5"})," \u4e4b\u524d\uff0c\u4e0b\u5217\u4ee3\u7801",(0,i.jsx)(n.strong,{children:"\u4f1a\u629b\u51fa\u5f02\u5e38"}),"\uff1a",(0,i.jsx)(n.code,{children:"The route parameter name 'roleid' appears more than one time in the route template."})]}),(0,i.jsxs)(n.p,{children:[(0,i.jsxs)(n.strong,{children:["\u539f\u56e0\u662f\u751f\u6210\u7684\u8def\u7531\u5305\u542b\u4e86\u591a\u4e2a ",(0,i.jsx)(n.code,{children:"{roleId}"})]}),"\uff1a",(0,i.jsx)(n.code,{children:"/api/with-class/system/role/deptTree/{roleId}/{roleId}"}),"\u3002"]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {3}",children:'public class WithClass : IDynamicApiController\r\n{\r\n [HttpGet("system/role/deptTree/{roleId}")] // \u8fc7\u53bb\u7248\u672c\u629b\u5f02\u5e38\uff0cFurion 4.8.6.5+ \u6b63\u5e38~\r\n public string GetResult2(string roleId)\r\n {\r\n return nameof(Furion);\r\n }\r\n}\n'})}),(0,i.jsxs)(n.p,{children:["\u65b0\u7248\u672c ",(0,i.jsx)(n.code,{children:"Furion 4.8.6.5+"})," \u4fee\u6b63\u4e86\u8be5\u9519\u8bef\uff0c",(0,i.jsx)(n.strong,{children:"\u81ea\u52a8\u79fb\u9664\u540e\u9762\u91cd\u590d\u7684\u8def\u7531\u53c2\u6570\u4e14\u4e0d\u518d\u629b\u5f02\u5e38"}),"\uff0c\u4e5f\u5c31\u662f\u6700\u7ec8\u751f\u6210\u8def\u7531\u4e3a\uff1a",(0,i.jsx)(n.code,{children:"/api/with-class/system/role/deptTree/{roleId}"})]})]})]}),(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\xa0",(0,i.jsx)(l.Z,{children:"\u65b0\u589e"})," \u52a8\u6001 ",(0,i.jsx)(n.code,{children:"WebAPI"})," \u652f\u6301 ",(0,i.jsx)(n.code,{children:'[RouteConstraint(":*")]'})," \u8def\u7531\u7ea6\u675f ",(0,i.jsx)("sup",{children:"4.8.6.2"})," ",(0,i.jsx)("sup",{children:"\u23f1\ufe0f2023.02.10"})," ",(0,i.jsx)(n.a,{href:"https://gitee.com/dotnetchina/Furion/issues/I6E6JA",children:"#I6E6JA"})]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\xa0",(0,i.jsx)(l.Z,{children:"\u65b0\u589e"})," ",(0,i.jsxs)(n.strong,{children:["\u52a8\u6001 ",(0,i.jsx)(n.code,{children:"WebAPI"})," \u652f\u6301\u66f4\u52a0\u5f3a\u5927\u7684\u8def\u7531\u7ec4\u5408\u529f\u80fd"]})," ",(0,i.jsx)("sup",{children:"4.8.5.7"})," ",(0,i.jsx)("sup",{children:"\u23f1\ufe0f2023.02.03"})," ",(0,i.jsx)(n.a,{href:"https://gitee.com/dotnetchina/Furion/issues/I6CLPT",children:"#I6CLPT"})]}),"\n"]}),"\n"]}),"\n"]}),(0,i.jsxs)(r,{style:{marginLeft:50},children:[(0,i.jsx)("summary",{children:"\u67e5\u770b\u53d8\u5316"}),(0,i.jsxs)("div",{children:[(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {8,19,36}",children:'using Furion.DynamicApiController;\r\nusing Microsoft.AspNetCore.Mvc;\r\n\r\nnamespace WebApplication38;\r\n\r\n[Route("api/[controller]")]\r\n[Route("api2/[controller]")]\r\npublic class Test1Service : IDynamicApiController\r\n{\r\n [HttpGet("test")]\r\n [HttpPost]\r\n [AcceptVerbs("PUT", "PATCH")]\r\n public async Task GetTestName()\r\n {\r\n await Task.CompletedTask;\r\n }\r\n}\r\n\r\npublic class Test2Service : IDynamicApiController\r\n{\r\n [HttpGet("/root/test")]\r\n [HttpGet("test")]\r\n [HttpGet(Name = "other-test")]\r\n [HttpGet("template-test", Name = "other-test")]\r\n [HttpPost]\r\n [AcceptVerbs("PUT", "PATCH")]\r\n public async Task GetTestName()\r\n {\r\n await Task.CompletedTask;\r\n }\r\n}\r\n\r\n[Route("api/[controller]")]\r\n[Route("api2/[controller]/second")]\r\n[Route("api3/[controller]/three")]\r\npublic class Test3Service : IDynamicApiController\r\n{\r\n [HttpGet]\r\n [HttpGet("get/[action]")]\r\n [HttpPost]\r\n [HttpPost("post/cus-version")]\r\n public string GetVersion()\r\n {\r\n return "1.0.0";\r\n }\r\n}\n'})}),(0,i.jsx)("img",{src:(0,c.Z)("img/dy10.png")})]})]}),(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\xa0",(0,i.jsx)(l.Z,{children:"\u65b0\u589e"})," \u52a8\u6001 ",(0,i.jsx)(n.code,{children:"WebAPI"})," \u65b9\u6cd5\u652f\u6301\u901a\u8fc7 ",(0,i.jsx)(n.code,{children:"[ActionName(\u540d\u79f0)]"})," \u548c ",(0,i.jsx)(n.code,{children:"[HttpMethod(Name=\u540d\u79f0)]"})," \u6307\u5b9a\u8def\u7531\u540d\u79f0 ",(0,i.jsx)("sup",{children:"4.8.4.12"})," ",(0,i.jsx)("sup",{children:"\u23f1\ufe0f2023.01.10"})," ",(0,i.jsx)(n.a,{href:"https://gitee.com/dotnetchina/Furion/issues/I69AOJ",children:"#I69AOJ"})," ",(0,i.jsx)(n.a,{href:"https://gitee.com/dotnetchina/Furion/commit/f699540989e688f25597c509249e024ec014dc4e",children:"f699540"})]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"\u7a81\u7834\u6027\u53d8\u5316"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\xa0",(0,i.jsx)(l.Z,{children:"\u8c03\u6574"})," ",(0,i.jsxs)(n.strong,{children:["\u52a8\u6001 ",(0,i.jsx)(n.code,{children:"WebAPI"})," \u751f\u6210\u8def\u7531 ",(0,i.jsx)(n.code,{children:"[HttpMethod(template)]"})," \u89c4\u5219"]})," ",(0,i.jsx)("sup",{children:"4.8.5.7"})," ",(0,i.jsx)("sup",{children:"\u23f1\ufe0f2023.02.03"})," ",(0,i.jsx)(n.a,{href:"https://gitee.com/dotnetchina/Furion/issues/I6CLPT",children:"#I6CLPT"})]}),"\n"]}),"\n"]}),"\n"]}),(0,i.jsxs)(r,{style:{marginLeft:50},children:[(0,i.jsx)("summary",{children:"\u67e5\u770b\u53d8\u5316"}),(0,i.jsxs)("div",{children:[(0,i.jsxs)(n.p,{children:["\u5728\u8fc7\u53bb\uff0c",(0,i.jsx)(n.code,{children:"TestMethod"})," \u751f\u6210\u8def\u7531\u4e3a\uff1a",(0,i.jsx)(n.code,{children:"/mytest"})]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {1,4}",children:'// \u6ce8\u610f\u8fd9\u91cc\u6ca1\u6709 [Route] \u7279\u6027\r\npublic class ClassService: IDynamicApiController\r\n{\r\n [HttpPost("mytest")]\r\n public void TestMethod()\r\n {\r\n }\r\n}\n'})}),(0,i.jsxs)(n.p,{children:["\u65b0\u7248\u672c\uff1a",(0,i.jsx)(n.code,{children:"TestMethod"})," \u751f\u6210\u8def\u7531\u4e3a\uff1a",(0,i.jsx)(n.code,{children:"/api/class/mytest"}),"\uff0c",(0,i.jsx)(n.code,{children:"TestMethod2"})," \u751f\u6210\u8def\u7531\u4e3a\uff1a",(0,i.jsx)(n.code,{children:"/mytest"}),"\u3002"]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {1,4,9}",children:'// \u6ce8\u610f\u8fd9\u91cc\u6ca1\u6709 [Route] \u7279\u6027\r\npublic class ClassService: IDynamicApiController\r\n{\r\n [HttpPost("mytest")]\r\n public void TestMethod()\r\n {\r\n }\r\n\r\n [HttpPost("/mytest")]\r\n public void TestMethod2()\r\n {\r\n }\r\n}\n'})}),(0,i.jsxs)(n.p,{children:["\u4e5f\u5c31\u662f\u65b0\u7248\u672c\u5982\u679c\u4e0d\u9700\u8981\u81ea\u52a8\u6dfb\u52a0\u524d\u7f00\uff0c\u9700\u5728\u524d\u9762\u6dfb\u52a0 ",(0,i.jsx)(n.code,{children:"/"}),"\uff0c\u65e7\u7248\u672c\u4e0d\u9700\u8981\u3002"]})]})]}),(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"\u95ee\u9898\u4fee\u590d"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\xa0",(0,i.jsx)(l.Z,{children:"\u4fee\u590d"})," \u52a8\u6001 ",(0,i.jsx)(n.code,{children:"WebAPI"})," \u4e0d\u80fd\u6b63\u786e\u79fb\u9664 ",(0,i.jsx)(n.code,{children:"AppService"})," \u547d\u540d\u7684 ",(0,i.jsx)(n.code,{children:"Service"})," \u95ee\u9898 ",(0,i.jsx)("sup",{children:"4.8.8.47"})," ",(0,i.jsx)("sup",{children:"\u23f1\ufe0f2023.10.10"})," ",(0,i.jsx)(n.a,{href:"https://gitee.com/dotnetchina/Furion/issues/I86NLO",children:"#I86NL"})]}),"\n",(0,i.jsxs)(n.li,{children:["\xa0",(0,i.jsx)(l.Z,{children:"\u4fee\u590d"})," \u52a8\u6001 ",(0,i.jsx)(n.code,{children:"WebAPI"})," \u81ea\u5b9a\u4e49\u8def\u7531\u6a21\u677f\u53c2\u6570\u548c\u81ea\u52a8\u62fc\u63a5\u53c2\u6570\u51b2\u7a81\u95ee\u9898 ",(0,i.jsx)("sup",{children:"4.8.8.15"})," ",(0,i.jsx)("sup",{children:"\u23f1\ufe0f2023.05.15"})," ",(0,i.jsx)(n.a,{href:"https://gitee.com/dotnetchina/Furion/issues/I72ZZ2",children:"#I72ZZ2"})]}),"\n",(0,i.jsxs)(n.li,{children:["\xa0",(0,i.jsx)(l.Z,{children:"\u4fee\u590d"})," \u52a8\u6001 ",(0,i.jsx)(n.code,{children:"WebAPI"})," \u53bb\u9664\u53e0\u8bcd\u7c7b\u578b\u547d\u540d\u5982 ",(0,i.jsx)(n.code,{children:"ServiceService"})," \u524d\u540e\u7f00\u5f02\u5e38\u95ee\u9898 ",(0,i.jsx)("sup",{children:"4.8.7.32"})," ",(0,i.jsx)("sup",{children:"\u23f1\ufe0f2023.04.02"})," ",(0,i.jsx)(n.a,{href:"https://gitee.com/dotnetchina/Furion/issues/I6SB3Z",children:"#I6SB3Z"})]}),"\n",(0,i.jsxs)(n.li,{children:["\xa0",(0,i.jsx)(l.Z,{children:"\u4fee\u590d"})," \u52a8\u6001 ",(0,i.jsx)(n.code,{children:"WebAPI"})," \u4e0d\u652f\u6301\u5d4c\u5957\u7ee7\u627f ",(0,i.jsx)(n.code,{children:"[Route]"})," \u7279\u6027\u95ee\u9898 ",(0,i.jsx)("sup",{children:"4.8.6.8"})," ",(0,i.jsx)("sup",{children:"\u23f1\ufe0f2023.02.18"})," ",(0,i.jsx)(n.a,{href:"https://gitee.com/dotnetchina/Furion/issues/I6CLPT",children:"#I6CLPT"})]}),"\n"]}),"\n"]}),"\n"]}),(0,i.jsxs)(r,{style:{marginLeft:50},children:[(0,i.jsx)("summary",{children:"\u67e5\u770b\u53d8\u5316"}),(0,i.jsxs)("div",{children:[(0,i.jsxs)(n.p,{children:["\u8fc7\u53bb\u7248\u672c\u751f\u6210\u9519\u8bef\u91cd\u590d\u8def\u7531\uff0c\u5982\uff1a",(0,i.jsx)(n.code,{children:"api/system/SystemDictionary/api/system/SystemDictionary/Add"}),"\uff0c\u73b0\u5df2\u4fee\u6b63\u3002"]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {1,3,16,17}",children:'public class WithClass : IDynamicApiController\r\n{\r\n [Route("Add")]\r\n public void Add()\r\n {\r\n\r\n }\r\n\r\n [Route("Edit")]\r\n public void Edit()\r\n {\r\n\r\n }\r\n}\r\n\r\n[Route("api/system/SystemDictionary")]\r\npublic class SystemService : WithClass\r\n{\r\n public void Some()\r\n {\r\n }\r\n}\n'})})]})]}),(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\xa0",(0,i.jsx)(l.Z,{children:"\u4fee\u590d"})," \u52a8\u6001 ",(0,i.jsx)(n.code,{children:"WebAPI"})," \u81ea\u5b9a\u4e49 ",(0,i.jsx)(n.code,{children:"[HttpMethod(template)]"})," \u4e4b\u540e\u751f\u6210\u9519\u8bef\u8def\u7531 ",(0,i.jsx)("sup",{children:"4.8.6.1"})," ",(0,i.jsx)("sup",{children:"\u23f1\ufe0f2023.02.08"})," ",(0,i.jsx)(n.a,{href:"https://gitee.com/dotnetchina/Furion/commit/59fe53b5a9715ed139aff9075cb7fcaad01565b7",children:"59fe53b"})]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\xa0",(0,i.jsx)(l.Z,{children:"\u4fee\u590d"})," \u52a8\u6001 ",(0,i.jsx)(n.code,{children:"WebAPI"})," \u914d\u7f6e ",(0,i.jsx)(n.code,{children:"[Consumes]"})," \u7279\u6027\u540e ",(0,i.jsx)(n.code,{children:"Swagger"})," \u4e0d\u663e\u793a\u95ee\u9898 ",(0,i.jsx)("sup",{children:"4.8.4.12"})," ",(0,i.jsx)("sup",{children:"\u23f1\ufe0f2023.01.10"})," ",(0,i.jsx)(n.a,{href:"https://gitee.com/dotnetchina/Furion/commit/daf25f8c91a24904381d3536c0c8825ef833e9c9",children:"daf25f8"})]}),"\n"]}),"\n"]}),"\n"]})]})})]}),"\n","\n","\n",(0,i.jsx)(n.admonition,{title:"\u5c0f\u77e5\u8bc6",type:"tip",children:(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"\u52a8\u6001WebAPI"})," \u5b9e\u9645\u4e0a\u5c31\u662f\u5c06\u666e\u901a\u7684\u7c7b\u53d8\u4e3a ",(0,i.jsx)(n.code,{children:"Controller"}),"\uff0c\u4e5f\u5c31\u662f ",(0,i.jsx)(n.code,{children:"\u52a8\u6001WebAPI"})," \u5c31\u662f\u63a7\u5236\u5668\uff0c\u652f\u6301\u63a7\u5236\u5668\u4e00\u5207\u529f\u80fd\u3002"]})}),"\n",(0,i.jsx)(n.h2,{id:"511-\u4ec0\u4e48\u662f\u63a7\u5236\u5668",children:"5.1.1 \u4ec0\u4e48\u662f\u63a7\u5236\u5668"}),"\n",(0,i.jsx)(n.p,{children:"\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"}),"\n",(0,i.jsx)("img",{src:(0,c.Z)("img/kzq.png")}),"\n",(0,i.jsx)("p",{}),"\n",(0,i.jsxs)(n.p,{children:["\u5728 ",(0,i.jsx)(n.code,{children:"ASP.NET Core"})," \u4e2d\uff0c\u63a7\u5236\u5668\u6709\u4e24\u79cd\u8868\u73b0\u5f62\u5f0f\uff1a"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Mvc"}),"\uff08\u5e26\u89c6\u56fe\uff09"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"WebAPI"}),"\uff08RESTful API\uff09"]}),"\n"]}),"\n",(0,i.jsxs)(t.Z,{defaultValue:"mvc",values:[{label:"Mvc \u63a7\u5236\u5668",value:"mvc"},{label:"WebAPI \u63a7\u5236\u5668",value:"webapi"}],children:[(0,i.jsx)(o.Z,{value:"mvc",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {1,5,7}",children:"using Microsoft.AspNetCore.Mvc;\r\n\r\nnamespace Furion.Web.Entry.Controllers\r\n{\r\n public class MvcController : Controller\r\n {\r\n public IActionResult Index()\r\n {\r\n return View();\r\n }\r\n }\r\n}\n"})})}),(0,i.jsx)(o.Z,{value:"webapi",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {1,5,6,8,9}",children:'using Microsoft.AspNetCore.Mvc;\r\n\r\nnamespace Furion.Web.Entry.Controllers\r\n{\r\n [Route("api/[controller]")]\r\n public class WebApiController : ControllerBase\r\n {\r\n [HttpGet]\r\n public IActionResult Get()\r\n {\r\n return Content(nameof(Furion));\r\n }\r\n }\r\n}\n'})})})]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"Mvc"})," \u63a7\u5236\u5668\u548c ",(0,i.jsx)(n.code,{children:"WebAPI"})," \u63a7\u5236\u5668\u6700\u5927\u7684\u533a\u522b\u662f ",(0,i.jsx)(n.code,{children:"WebAPI"})," \u63a7\u5236\u5668\u4e0d\u5e26 ",(0,i.jsx)(n.strong,{children:"\u89c6\u56fe"})," \u548c\u901a\u8fc7 ",(0,i.jsx)(n.strong,{children:"\u8bf7\u6c42\u8c13\u8bcd\u548c\u8def\u7531\u5730\u5740\u54cd\u5e94\u884c\u4e3a"}),"\u3002"]}),"\n",(0,i.jsxs)(n.h2,{id:"512-mvc-\u63a7\u5236\u5668-\u7ea6\u5b9a\u548c\u7f3a\u70b9",children:["5.1.2 ",(0,i.jsx)(n.code,{children:"Mvc \u63a7\u5236\u5668"})," \u7ea6\u5b9a\u548c\u7f3a\u70b9"]}),"\n",(0,i.jsxs)(n.p,{children:["\u5728\u5b66\u4e60\u52a8\u6001 ",(0,i.jsx)(n.code,{children:"WebAPI"})," \u63a7\u5236\u5668\u4e4b\u524d\uff0c\u9996\u5148\u4e86\u89e3 ",(0,i.jsx)(n.code,{children:"ASP.NET Core"})," \u4e2d ",(0,i.jsx)(n.code,{children:"WebAPI"})," \u7684\u4e00\u4e9b\u7ea6\u5b9a\u548c\u6ce8\u610f\u4e8b\u9879\u3002"]}),"\n",(0,i.jsxs)(n.h3,{id:"5121-webapi-\u7ea6\u5b9a",children:["5.1.2.1 ",(0,i.jsx)(n.code,{children:"WebAPI"})," \u7ea6\u5b9a"]}),"\n",(0,i.jsxs)(n.p,{children:["\u5728 ",(0,i.jsx)(n.code,{children:"ASP.NET Core"})," \u5e94\u7528\u4e2d\uff0c\u4e00\u4e2a ",(0,i.jsx)(n.code,{children:"WebAPI"})," \u63a7\u5236\u5668\u9700\u9075\u5faa\u4ee5\u4e0b\u7ea6\u5b9a\uff1a"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\u63a7\u5236\u5668\u7c7b",(0,i.jsxs)(n.strong,{children:["\u5fc5\u987b\u7ee7\u627f ",(0,i.jsx)(n.code,{children:"ControllerBase"})," \u6216\u95f4\u63a5\u7ee7\u627f"]})]}),"\n",(0,i.jsxs)(n.li,{children:["\u52a8\u4f5c\u65b9\u6cd5",(0,i.jsxs)(n.strong,{children:["\u5fc5\u987b\u8d34\u6709 ",(0,i.jsx)(n.code,{children:"[HttpMethod]"})," \u7279\u6027\uff0c\u5982\uff1a",(0,i.jsx)(n.code,{children:"[HttpGet]"})]})]}),"\n",(0,i.jsxs)(n.li,{children:["\u63a7\u5236\u5668\u6216\u52a8\u4f5c\u65b9\u6cd5",(0,i.jsxs)(n.strong,{children:["\u81f3\u5c11\u6709\u4e00\u4e2a\u914d\u7f6e ",(0,i.jsx)(n.code,{children:"[Route]"})," \u7279\u6027"]})]}),"\n",(0,i.jsxs)(n.li,{children:["\u751f\u6210 ",(0,i.jsx)(n.code,{children:"WebAPI"})," \u8def\u7531\u5730\u5740\u65f6\u4f1a\u81ea\u52a8\u53bb\u6389\u63a7\u5236\u5668\u540d\u79f0 ",(0,i.jsx)(n.code,{children:"Controller"})," \u540e\u7f00\uff0c\u540c\u65f6\u4e5f\u4f1a\u53bb\u6389\u52a8\u4f5c\u65b9\u6cd5\u5339\u914d\u7684 ",(0,i.jsx)(n.code,{children:"HttpVerb"})," \u8c13\u8bcd\uff0c\u5982 ",(0,i.jsx)(n.code,{children:"GET\uff0cPOST\uff0cDELETE\uff0cPUT"})," \u7b49"]}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsxs)(n.strong,{children:["\u4e0d\u652f\u6301\u8fd4\u56de\u975e ",(0,i.jsx)(n.code,{children:"IEnumerable<T>"})," \u6cdb\u578b\u5bf9\u8c61"]})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsxs)(n.strong,{children:["\u4e0d\u652f\u6301\u7c7b\u7c7b\u578b\u53c2\u6570\u5728 ",(0,i.jsx)(n.code,{children:"GET\uff0cHEAD"})," \u8bf7\u6c42\u4e0b\u751f\u6210 ",(0,i.jsx)(n.code,{children:"Query"})," \u53c2\u6570"]})}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["\u9664\u4e86\u4e0a\u8ff0\u7ea6\u5b9a\u5916\uff0c",(0,i.jsx)(n.code,{children:"WebAPI"})," \u8def\u7531\u5730\u5740",(0,i.jsx)(n.strong,{children:"\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"]}),"\n",(0,i.jsxs)(n.h3,{id:"5122-net-core-webapi-\u7f3a\u70b9",children:["5.1.2.2 ",(0,i.jsx)(n.code,{children:".NET Core WebAPI"})," \u7f3a\u70b9"]}),"\n",(0,i.jsxs)(n.p,{children:["\u901a\u8fc7\u4e0a\u4e00\u7ae0\u8282\u53ef\u4ee5\u770b\u51fa\uff0c",(0,i.jsx)(n.code,{children:"ASP.NET Core"})," \u5e94\u7528\u5b9e\u73b0 ",(0,i.jsx)(n.code,{children:"WebAPI"})," \u9700\u8981\u9075\u5faa\u79cd\u79cd\u7ea6\u5b9a\uff0c\u800c\u4e14\u5bb9\u6613\u51fa\u9519\u3002"]}),"\n",(0,i.jsxs)(n.p,{children:["\u9664\u4e86\u8fd9\u4e9b\u7ea6\u5b9a\uff0c",(0,i.jsx)(n.code,{children:".NET Core WebAPI"})," \u6709\u4ee5\u4e0b\u7f3a\u70b9\uff1a"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"\u8def\u7531\u5730\u5740\u57fa\u672c\u9760\u624b\u5de5\u5b8c\u6210"}),"\n",(0,i.jsx)(n.li,{children:"\u5728\u73b0\u5728\u79fb\u52a8\u4e3a\u738b\u7684\u65f6\u4ee3\uff0c\u4e0d\u5229\u4e8e\u8fdb\u884c\u591a\u7248\u672c\u63a7\u5236"}),"\n",(0,i.jsxs)(n.li,{children:["\u5bf9\u63a5 ",(0,i.jsx)(n.code,{children:"Swagger"})," \u6587\u6863\u5206\u7ec4\u6bd4\u8f83\u590d\u6742"]}),"\n",(0,i.jsxs)(n.li,{children:["\u5b9e\u73b0 ",(0,i.jsx)(n.code,{children:"Policy"})," \u7b56\u7565\u6388\u6743\u4e5f\u6bd4\u8f83\u590d\u6742"]}),"\n",(0,i.jsx)(n.li,{children:"\u4e0d\u652f\u6301\u63a7\u5236\u5668\u70ed\u63d2\u62d4\u63d2\u4ef6\u5316"}),"\n",(0,i.jsxs)(n.li,{children:["\u96be\u4ee5\u5b9e\u73b0\u590d\u6742\u81ea\u5b9a\u4e49\u7684 ",(0,i.jsx)(n.code,{children:"RESTful API"})," \u98ce\u683c"]}),"\n"]}),"\n",(0,i.jsxs)(n.h2,{id:"513-\u52a8\u6001-webapi-\u63a7\u5236\u5668",children:["5.1.3 \u52a8\u6001 ",(0,i.jsx)(n.code,{children:"WebAPI"})," \u63a7\u5236\u5668"]}),"\n",(0,i.jsxs)(n.p,{children:["\u9488\u5bf9\u4ee5\u4e0a ",(0,i.jsx)(n.code,{children:"ASP.NET Core"})," \u63d0\u4f9b\u7684 ",(0,i.jsx)(n.code,{children:"WebAPI"})," \u5fc5\u987b\u9075\u5faa\u7684\u7ea6\u5b9a\u548c\u4e0d\u53ef\u907f\u514d\u7684\u7f3a\u70b9\uff0c",(0,i.jsx)(n.code,{children:"Furion"})," \u6846\u67b6\u63a8\u51fa\u4e00\u79cd\u66f4\u52a0\u7075\u6d3b\u521b\u5efa ",(0,i.jsx)(n.code,{children:"WebAPI"})," \u63a7\u5236\u5668\u7684\u65b9\u5f0f\u3002"]}),"\n",(0,i.jsxs)(n.p,{children:["\u8fd9\u4e2a\u65b9\u5f0f\u5728\u7ee7\u627f\u4e86 ",(0,i.jsx)(n.code,{children:"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 ",(0,i.jsx)(n.code,{children:"WebAPI"})," \u5177\u6709\u4ee5\u4e0b\u4f18\u70b9\uff1a"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\u5177\u5907\u539f\u6709\u7684 ",(0,i.jsx)(n.code,{children:"ControllerBase"})," \u6240\u6709\u529f\u80fd"]}),"\n",(0,i.jsxs)(n.li,{children:["\u652f\u6301",(0,i.jsx)(n.strong,{children:"\u4efb\u610f\u516c\u5f00 \u975e\u9759\u6001 \u975e\u62bd\u8c61 \u975e\u6cdb\u578b\u7c7b"}),"\u8f6c\u63a7\u5236\u5668"]}),"\n",(0,i.jsxs)(n.li,{children:["\u63d0\u4f9b\u66f4\u52a0\u7075\u6d3b\u65b9\u4fbf\u7684 ",(0,i.jsx)(n.code,{children:"IDynamicApiController"})," \u7a7a\u63a5\u53e3\u6216 ",(0,i.jsx)(n.code,{children:"[DynamicApiController]"})," \u7279\u6027\u66ff\u4ee3 ",(0,i.jsx)(n.code,{children:"ControllerBase"})," \u62bd\u8c61\u7c7b"]}),"\n",(0,i.jsxs)(n.li,{children:["\u53ef\u76f4\u63a5\u5728",(0,i.jsx)(n.strong,{children:"\u4efb\u610f\u516c\u5f00 \u975e\u9759\u6001 \u975e\u62bd\u8c61 \u975e\u6cdb\u578b\u7c7b"}),"\u8d34 ",(0,i.jsx)(n.code,{children:"[Route]"})," \u7279\u6027\u81ea\u52a8\u8f6c\u63a7\u5236\u5668"]}),"\n",(0,i.jsxs)(n.li,{children:["\u65e0\u9700\u624b\u52a8\u914d\u7f6e ",(0,i.jsx)(n.code,{children:"[HttpMethod]"})," \u7279\u6027\uff0c\u540c\u65f6\u652f\u6301\u4e00\u4e2a\u52a8\u4f5c\u65b9\u6cd5\u591a\u4e2a ",(0,i.jsx)(n.code,{children:"HttpVerb"})]}),"\n",(0,i.jsxs)(n.li,{children:["\u65e0\u9700\u624b\u52a8\u914d\u7f6e ",(0,i.jsx)(n.code,{children:"[Route]"})," \u7279\u6027\uff0c\u652f\u6301\u66f4\u52a0\u7075\u6d3b\u7684\u914d\u7f6e\u53ca\u81ea\u52a8\u8def\u7531\u751f\u6210"]}),"\n",(0,i.jsx)(n.li,{children:"\u652f\u6301\u8fd4\u56de\u6cdb\u578b\u63a5\u53e3\uff0c\u6cdb\u578b\u7c7b"}),"\n",(0,i.jsxs)(n.li,{children:["\u548c ",(0,i.jsx)(n.code,{children:"Swagger"})," \u6df1\u5ea6\u7ed3\u5408\uff0c\u63d0\u4f9b\u6781\u5176\u65b9\u4fbf\u7684\u521b\u5efa ",(0,i.jsx)(n.code,{children:"Swagger"})," \u5206\u7ec4\u914d\u7f6e"]}),"\n",(0,i.jsxs)(n.li,{children:["\u652f\u6301 ",(0,i.jsx)(n.code,{children:"Basic Auth\uff0cJwt\uff0cApiKey"})," \u7b49\u591a\u79cd\u6743\u9650\u7075\u6d3b\u914d\u7f6e"]}),"\n",(0,i.jsxs)(n.li,{children:["\u652f\u6301\u63a7\u5236\u5668\u3001\u52a8\u4f5c\u65b9\u6cd5",(0,i.jsx)(n.strong,{children:"\u7248\u672c\u63a7\u5236"}),"\u529f\u80fd"]}),"\n",(0,i.jsxs)(n.li,{children:["\u652f\u6301 ",(0,i.jsx)(n.code,{children:"GET\u3001HEAD"})," \u8bf7\u6c42\u81ea\u52a8\u8f6c\u6362 ",(0,i.jsx)(n.code,{children:"\u7c7b\u7c7b\u578b\u53c2\u6570"})]}),"\n",(0,i.jsxs)(n.li,{children:["\u652f\u6301\u751f\u6210 ",(0,i.jsx)(n.code,{children:"OAS3"})," \u63a5\u53e3\u89c4\u8303"]}),"\n"]}),"\n",(0,i.jsxs)(n.h2,{id:"514-\u6ce8\u518c\u52a8\u6001-webapi-\u670d\u52a1",children:["5.1.4 \u6ce8\u518c\u52a8\u6001 ",(0,i.jsx)(n.code,{children:"WebAPI"})," \u670d\u52a1"]}),"\n",(0,i.jsx)(n.admonition,{title:"\u5c0f\u63d0\u793a",type:"tip",children:(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:".AddDynamicApiControllers()"})," \u9ed8\u8ba4\u5df2\u7ecf\u96c6\u6210\u5728 ",(0,i.jsx)(n.code,{children:"AddInject()"})," \u4e2d\u4e86\uff0c",(0,i.jsx)(n.strong,{children:"\u65e0\u9700\u518d\u6b21\u6ce8\u518c"}),"\u3002\u4e5f\u5c31\u662f\u4e0b\u5217\u4ee3\u7801\u53ef\u4e0d\u914d\u7f6e\u3002"]})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:'showLineNumbers {11} title="Furion.Web.Core\\FurWebCoreStartup.cs"',children:"using Microsoft.Extensions.DependencyInjection;\r\n\r\nnamespace Furion.Web.Core\r\n{\r\n [AppStartup(800)]\r\n public sealed class FurWebCoreStartup : AppStartup\r\n {\r\n public void ConfigureServices(IServiceCollection services)\r\n {\r\n services.AddControllers()\r\n .AddDynamicApiControllers();\r\n }\r\n }\r\n}\n"})}),"\n",(0,i.jsx)(n.admonition,{title:"\u7279\u522b\u6ce8\u610f",type:"caution",children:(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:".AddDynamicApiControllers()"})," \u5fc5\u987b\u5728 ",(0,i.jsx)(n.code,{children:"services.AddControllers()"})," \u4e4b\u540e\u6ce8\u518c\u3002"]})}),"\n",(0,i.jsx)(n.h2,{id:"515-\u7b2c\u4e00\u4e2a\u4f8b\u5b50",children:"5.1.5 \u7b2c\u4e00\u4e2a\u4f8b\u5b50"}),"\n",(0,i.jsxs)(n.p,{children:["\u521b\u5efa\u4e00\u4e2a ",(0,i.jsx)(n.code,{children:"FurionAppService"})," \u7c7b\u7ee7\u627f ",(0,i.jsx)(n.code,{children:"IDynamicApiController"})," \u63a5\u53e3 \u6216 \u8d34 ",(0,i.jsx)(n.code,{children:"[DynamicApiController]"})," \u7279\u6027\uff0c\u5e76\u5728\u8fd9\u4e2a\u7c7b\u4e2d\u7f16\u5199\u4e00\u4e2a ",(0,i.jsx)(n.code,{children:"Get"})," \u65b9\u6cd5\u3002"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsxs)(n.strong,{children:[(0,i.jsx)(n.code,{children:"IDynamicApiController"})," \u65b9\u5f0f"]})}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {1,5,7}",children:'using Furion.DynamicApiController;\r\n\r\nnamespace Furion.Application\r\n{\r\n public class FurionAppService : IDynamicApiController\r\n {\r\n public string Get()\r\n {\r\n return $"Hello {nameof(Furion)}";\r\n }\r\n }\r\n}\n'})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsxs)(n.strong,{children:[(0,i.jsx)(n.code,{children:"[DynamicApiController]"})," \u65b9\u5f0f"]})}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {1,5,8}",children:'using Furion.DynamicApiController;\r\n\r\nnamespace Furion.Application\r\n{\r\n [DynamicApiController]\r\n public class FurionAppService\r\n {\r\n public string Get()\r\n {\r\n return $"Hello {nameof(Furion)}";\r\n }\r\n }\r\n}\n'})}),"\n",(0,i.jsxs)(n.p,{children:["\u5982\u4e0b\u56fe\u6240\u793a\uff0c\u4e00\u4e2a ",(0,i.jsx)(n.code,{children:"WebAPI"})," \u63a5\u53e3\u5c31\u8fd9\u4e48\u751f\u6210\u4e86\u3002"]}),"\n",(0,i.jsx)("img",{src:(0,c.Z)("img/dyglz.gif")}),"\n",(0,i.jsxs)(n.h2,{id:"516-\u52a8\u6001-webapi-\u539f\u7406\u89e3\u6790",children:["5.1.6 \u52a8\u6001 ",(0,i.jsx)(n.code,{children:"WebAPI"})," \u539f\u7406\u89e3\u6790"]}),"\n",(0,i.jsx)(n.h3,{id:"5161-\u63a7\u5236\u5668\u7279\u6027\u63d0\u4f9b\u5668",children:"5.1.6.1 \u63a7\u5236\u5668\u7279\u6027\u63d0\u4f9b\u5668"}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"Furion"})," \u6846\u67b6\u4f1a\u5728\u5e94\u7528\u542f\u52a8\u65f6\u6ce8\u518c ",(0,i.jsx)(n.code,{children:"DynamicApiControllerFeatureProvider"})," \u63a7\u5236\u5668\u7279\u6027\u63d0\u4f9b\u5668\uff0c\u8be5\u63d0\u4f9b\u5668\u7ee7\u627f\u81ea ",(0,i.jsx)(n.code,{children:"ControllerFeatureProvider"})," \u7c7b\u3002"]}),"\n",(0,i.jsxs)(n.p,{children:["\u63a5\u7740\u91cd\u5199 ",(0,i.jsx)(n.code,{children:"bool IsController(TypeInfo typeInfo)"})," \u65b9\u6cd5\uff0c\u7528\u6765\u6807\u8bc6\u63a7\u5236\u5668\u7c7b\u578b\u3002\u5728 ",(0,i.jsx)(n.code,{children:"Furion"})," \u6846\u67b6\u4e2d\uff0c",(0,i.jsxs)(n.strong,{children:["\u7ee7\u627f\u81ea ",(0,i.jsx)(n.code,{children:"ControllerBase"})," \u7c7b\u6216 ",(0,i.jsx)(n.code,{children:"IDynamicApiController"})," \u63a5\u53e3\u6216 ",(0,i.jsx)(n.code,{children:"[DynamicApiController]"})," \u7279\u6027\u90fd\u4f1a\u88ab\u6807\u8bb0\u4e3a\u63a7\u5236\u5668\u7c7b\u578b\u3002"]})]}),"\n",(0,i.jsx)(n.h3,{id:"5162-\u5e94\u7528\u6a21\u578b\u8f6c\u6362\u5668",children:"5.1.6.2 \u5e94\u7528\u6a21\u578b\u8f6c\u6362\u5668"}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"Furion"})," \u6846\u67b6\u540c\u65f6\u5728\u5e94\u7528\u542f\u52a8\u65f6\u6ce8\u518c ",(0,i.jsx)(n.code,{children:"DynamicApiControllerApplicationModelConvention"})," \u5e94\u7528\u6a21\u578b\u8f6c\u6362\u5668\uff0c\u8be5\u8f6c\u6362\u5668\u7ee7\u627f\u81ea ",(0,i.jsx)(n.code,{children:"IApplicationModelConvention"})," \u63a5\u53e3\u3002"]}),"\n",(0,i.jsxs)(n.p,{children:["\u63a5\u7740\u5b9e\u73b0 ",(0,i.jsx)(n.code,{children:"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"]}),"\n",(0,i.jsxs)(n.p,{children:["\u5b9e\u9645\u4e0a\u8be5\u65b9\u6cd5\u505a\u7684\u5c31\u662f\u6309\u7167 ",(0,i.jsx)(n.strong,{children:(0,i.jsx)(n.a,{href:"#521-webapi-%E7%BA%A6%E5%AE%9A",children:"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",(0,i.jsx)(n.strong,{children:"\u7248\u672c\u63a7\u5236\u3002"})]}),"\n",(0,i.jsxs)(n.h2,{id:"517-\u52a8\u6001-webapi-\u914d\u7f6e\u7ea6\u5b9a",children:["5.1.7 \u52a8\u6001 ",(0,i.jsx)(n.code,{children:"WebAPI"})," \u914d\u7f6e\u7ea6\u5b9a"]}),"\n",(0,i.jsx)(n.h3,{id:"5171-\u63a7\u5236\u5668\u9ed8\u8ba4\u7ea6\u5b9a",children:"5.1.7.1 \u63a7\u5236\u5668\u9ed8\u8ba4\u7ea6\u5b9a"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\u751f\u6210\u63a7\u5236\u5668\u540d\u79f0\u9ed8\u8ba4\u53bb\u9664\u4ee5 ",(0,i.jsx)(n.code,{children:"AppServices\uff0cAppService\uff0cApiController\uff0cController\uff0cServices\uff0cService"})," \u4f5c\u4e3a\u524d\u540e\u7f00\u7684\u5b57\u7b26\u4e32\u3002\u89c1\u7b2c\u4e00\u4e2a\u4f8b\u5b50\u4e2d\u7684 ",(0,i.jsx)(n.code,{children:"FurionAppService -> Furion"})," ",(0,i.jsx)(n.strong,{children:"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e"})]}),"\n",(0,i.jsxs)(n.li,{children:["\u63a7\u5236\u5668\u540d\u79f0\u5e26 ",(0,i.jsx)(n.code,{children:"V[0-9_]"})," \u7ed3\u5c3e\u7684\uff0c\u4f1a\u81ea\u52a8\u751f\u6210\u63a7\u5236\u5668\u7248\u672c\u53f7\uff0c\u5982 ",(0,i.jsx)(n.code,{children:"FurionAppServiceV2 -> Furion@2"}),"\uff0c",(0,i.jsx)(n.code,{children:"FurionAppServiceV1_1_0 -> Furion@1.1.0"}),"\u3002",(0,i.jsx)(n.strong,{children:"\u652f\u6301\u7248\u672c\u5206\u9694\u7b26\u914d\u7f6e"})]}),"\n",(0,i.jsxs)(n.li,{children:["\u63a7\u5236\u540d\u79f0\u4ee5 ",(0,i.jsx)(n.code,{children:"\u9a86\u9a7c\u547d\u540d\uff08CamelCase\uff09"})," \u4f1a\u81ea\u52a8\u5207\u5272\u6210\u591a\u4e2a\u5355\u8bcd ",(0,i.jsx)(n.code,{children:"-"})," \u8fde\u63a5\u3002",(0,i.jsx)(n.strong,{children:"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e"})]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"5172-\u52a8\u4f5c\u65b9\u6cd5\u9ed8\u8ba4\u7ea6\u5b9a",children:"5.1.7.2 \u52a8\u4f5c\u65b9\u6cd5\u9ed8\u8ba4\u7ea6\u5b9a"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\u751f\u6210\u7684\u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0\u9ed8\u8ba4\u53bb\u9664\u4ee5 ",(0,i.jsx)(n.code,{children:"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",(0,i.jsx)(n.strong,{children:"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e"})]}),"\n",(0,i.jsxs)(n.li,{children:["\u751f\u6210\u7684\u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0\u9ed8\u8ba4\u53bb\u9664\u4ee5 ",(0,i.jsx)(n.code,{children:"Async"})," \u4f5c\u4e3a\u524d\u540e\u7f00\u7684\u5b57\u7b26\u4e32\u3002",(0,i.jsx)(n.strong,{children:"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e"})]}),"\n",(0,i.jsxs)(n.li,{children:["\u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0\u5e26 ",(0,i.jsx)(n.code,{children:"V[0-9_]"})," \u7ed3\u5c3e\u7684\uff0c\u4f1a\u81ea\u52a8\u751f\u6210\u52a8\u4f5c\u65b9\u6cd5\u7248\u672c\u53f7\uff0c\u5982 ",(0,i.jsx)(n.code,{children:"ChangePasswordV2 -> ChangePassword@2"}),"\uff0c",(0,i.jsx)(n.code,{children:"ChangePasswordV1_1_0 -> ChangePassword@1.1.0"}),"\u3002",(0,i.jsx)(n.strong,{children:"\u652f\u6301\u7248\u672c\u5206\u9694\u7b26\u914d\u7f6e"})]}),"\n",(0,i.jsxs)(n.li,{children:["\u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0\u4ee5 ",(0,i.jsx)(n.code,{children:"\u9a86\u9a7c(\u9a7c\u5cf0)/\u5e15\u65af\u5361\u547d\u540d\uff08CamelCase/Pascal\uff09"})," \u4f1a\u81ea\u52a8\u5207\u5272\u6210\u591a\u4e2a\u5355\u8bcd ",(0,i.jsx)(n.code,{children:"-"})," \u8fde\u63a5\u3002",(0,i.jsx)(n.strong,{children:"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e"})]}),"\n",(0,i.jsxs)(n.li,{children:["\u52a8\u4f5c\u65b9\u6cd5\u53c2\u6570\u5c06\u81ea\u52a8\u8f6c\u4e3a\u5c0f\u5199\u3002",(0,i.jsx)(n.strong,{children:"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e"})]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"5173-\u8bf7\u6c42\u8c13\u8bcd\u9ed8\u8ba4\u7ea6\u5b9a",children:"5.1.7.3 \u8bf7\u6c42\u8c13\u8bcd\u9ed8\u8ba4\u7ea6\u5b9a"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\u52a8\u4f5c\u65b9\u6cd5\u540d","\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\u4ee5 ",(0,i.jsx)(n.code,{children:"Post/Add/Create/Insert/Submit/Change"})," \u5f00\u5934\uff0c\u5219\u6dfb\u52a0 ",(0,i.jsx)(n.code,{children:"[HttpPost]"})," \u7279\u6027\u3002"]}),"\n",(0,i.jsxs)(n.li,{children:["\u4ee5 ",(0,i.jsx)(n.code,{children:"GetAll/GetList/Get/Find/Fetch/Query"})," \u5f00\u5934\uff0c\u5219\u6dfb\u52a0 ",(0,i.jsx)(n.code,{children:"[HttpGet]"})," \u7279\u6027\u3002"]}),"\n",(0,i.jsxs)(n.li,{children:["\u4ee5 ",(0,i.jsx)(n.code,{children:"Put/Update"})," \u5f00\u5934\uff0c\u5219\u6dfb\u52a0 ",(0,i.jsx)(n.code,{children:"[HttpPut]"})," \u7279\u6027\u3002"]}),"\n",(0,i.jsxs)(n.li,{children:["\u4ee5 ",(0,i.jsx)(n.code,{children:"Delete/Remove/Clear"})," \u5f00\u5934\uff0c\u5219\u6dfb\u52a0 ",(0,i.jsx)(n.code,{children:"[HttpDelete]"})," \u7279\u6027\u3002"]}),"\n",(0,i.jsxs)(n.li,{children:["\u4ee5 ",(0,i.jsx)(n.code,{children:"Patch"})," \u5f00\u5934\uff0c\u5219\u6dfb\u52a0 ",(0,i.jsx)(n.code,{children:"[HttpPatch]"})," \u7279\u6027"]}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.strong,{children:"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e"})}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\u5982\u679c\u4e0d\u5728\u4e0a\u9762\u7ea6\u5b9a\u4e2d\uff0c\u5219\u9ed8\u8ba4\u6dfb\u52a0 ",(0,i.jsx)(n.code,{children:"[HttpPost]"})," \u7279\u6027\u3002",(0,i.jsx)(n.strong,{children:"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e"})]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"5174-\u8def\u7531\u5730\u5740\u9ed8\u8ba4\u7ea6\u5b9a",children:"5.1.7.4 \u8def\u7531\u5730\u5740\u9ed8\u8ba4\u7ea6\u5b9a"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\u9ed8\u8ba4\u4ee5 ",(0,i.jsx)(n.code,{children:"api"})," \u5f00\u5934\u3002",(0,i.jsx)(n.strong,{children:"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e"})]}),"\n",(0,i.jsxs)(n.li,{children:["\u9ed8\u8ba4\u8f6c\u6362\u4e3a\u5c0f\u5199\u8def\u7531\u5730\u5740\u3002",(0,i.jsx)(n.strong,{children:"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e"})]}),"\n",(0,i.jsxs)(n.li,{children:["\u751f\u6210\u63a7\u5236\u5668\u8def\u7531\u6a21\u677f\u683c\u5f0f\u4e3a\uff1a",(0,i.jsx)(n.code,{children:"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"})]}),"\n",(0,i.jsxs)(n.li,{children:["\u751f\u6210\u52a8\u4f5c\u65b9\u6cd5\u8def\u7531\u6a21\u677f\u683c\u5f0f\u4e3a\uff1a",(0,i.jsx)(n.code,{children:"\u524d\u7f6e\u53c2\u6570\u5217\u8868/\u6a21\u5757\u540d/[action@\u7248\u672c\u53f7]/\u540e\u7f6e\u53c2\u6570\u5217\u8868"})]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"5175-\u5176\u4ed6\u7ea6\u5b9a",children:"5.1.7.5 \u5176\u4ed6\u7ea6\u5b9a"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\u9ed8\u8ba4\u4e0d\u5904\u7406 ",(0,i.jsx)(n.code,{children:"ControllerBase"})," \u63a7\u5236\u5668\u7c7b\u578b\u3002",(0,i.jsx)(n.strong,{children:"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e"})]}),"\n",(0,i.jsxs)(n.li,{children:["\u9ed8\u8ba4\u4e0d\u5904\u7406 ",(0,i.jsx)(n.code,{children:"GET\uff0cHEAD"})," \u8bf7\u6c42\u7684\u5f15\u7528\u7c7b\u578b\u53c2\u6570\u3002",(0,i.jsx)(n.strong,{children:"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e"})]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"518-\u66f4\u591a\u4f8b\u5b50",children:"5.1.8 \u66f4\u591a\u4f8b\u5b50"}),"\n",(0,i.jsx)(n.h3,{id:"5181-\u591a\u79cd\u8bf7\u6c42\u8c13\u8bcd\u65b9\u6cd5",children:"5.1.8.1 \u591a\u79cd\u8bf7\u6c42\u8c13\u8bcd\u65b9\u6cd5"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {7,12,17,22,27}",children:'using Furion.DynamicApiController;\r\n\r\nnamespace Furion.Application\r\n{\r\n public class FurionAppService : IDynamicApiController\r\n {\r\n public string Get()\r\n {\r\n return $"GET \u8bf7\u6c42";\r\n }\r\n\r\n public string Post()\r\n {\r\n return $"POST \u8bf7\u6c42";\r\n }\r\n\r\n public string Delete()\r\n {\r\n return $"DELETE \u8bf7\u6c42";\r\n }\r\n\r\n public string Put()\r\n {\r\n return $"PUT \u8bf7\u6c42";\r\n }\r\n\r\n public string Patch()\r\n {\r\n return $"PATCH \u8bf7\u6c42";\r\n }\r\n }\r\n}\n'})}),"\n",(0,i.jsx)(n.p,{children:"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"}),"\n",(0,i.jsx)("img",{src:(0,c.Z)("img/dgqqwc.png")}),"\n",(0,i.jsx)(n.h3,{id:"5182-\u591a\u4e2a\u81ea\u5b9a\u4e49\u52a8\u4f5c\u65b9\u6cd5",children:"5.1.8.2 \u591a\u4e2a\u81ea\u5b9a\u4e49\u52a8\u4f5c\u65b9\u6cd5"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {7,12,17}",children:'using Furion.DynamicApiController;\r\n\r\nnamespace Furion.Application\r\n{\r\n public class FurionAppService : IDynamicApiController\r\n {\r\n public string GetVersion()\r\n {\r\n return $"v1.0.0";\r\n }\r\n\r\n public string ChangeProfile()\r\n {\r\n return "\u4fee\u6539\u6210\u529f";\r\n }\r\n\r\n public string DeleteUser()\r\n {\r\n return "\u5220\u9664\u6210\u529f";\r\n }\r\n }\r\n}\n'})}),"\n",(0,i.jsx)(n.p,{children:"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"}),"\n",(0,i.jsx)("img",{src:(0,c.Z)("img/dzmc.png")}),"\n",(0,i.jsx)(n.h3,{id:"5183-\u5e26\u53c2\u6570\u52a8\u4f5c\u65b9\u6cd5",children:"5.1.8.3 \u5e26\u53c2\u6570\u52a8\u4f5c\u65b9\u6cd5"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {7,12,17}",children:'using Furion.DynamicApiController;\r\n\r\nnamespace Furion.Application\r\n{\r\n public class FurionAppService : IDynamicApiController\r\n {\r\n public string GetUser(int id)\r\n {\r\n return $"{id}";\r\n }\r\n\r\n public string GetUser(int id, string name)\r\n {\r\n return $"{id} {name}";\r\n }\r\n\r\n public TestDto Add(TestDto testDto)\r\n {\r\n return testDto;\r\n }\r\n }\r\n}\n'})}),"\n",(0,i.jsx)(n.p,{children:"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"}),"\n",(0,i.jsx)("img",{src:(0,c.Z)("img/dcsff.gif")}),"\n",(0,i.jsxs)(n.h3,{id:"5184-gethead-\u7c7b\u7c7b\u578b\u53c2\u6570",children:["5.1.8.4 ",(0,i.jsx)(n.code,{children:"GET/HEAD"})," \u7c7b\u7c7b\u578b\u53c2\u6570"]}),"\n",(0,i.jsxs)(n.p,{children:["\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c",(0,i.jsx)(n.code,{children:"ASP.NET Core"})," \u4f1a\u5c06 ",(0,i.jsx)(n.code,{children:"GET/HEAD"})," \u8bf7\u6c42\u4e2d\u7684 ",(0,i.jsx)(n.code,{children:"\u7c7b\u7c7b\u578b\u53c2\u6570"})," \u8bbe\u7f6e\u4e3a ",(0,i.jsx)(n.code,{children:"[FromBody]"})," \u7ed1\u5b9a\uff0c\u5982\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {7}",children:"using Furion.DynamicApiController;\r\n\r\nnamespace Furion.Application\r\n{\r\n public class FurionAppService : IDynamicApiController\r\n {\r\n public TestDto GetTest(TestDto testDto)\r\n {\r\n return testDto;\r\n }\r\n }\r\n}\n"})}),"\n",(0,i.jsx)(n.p,{children:"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"}),"\n",(0,i.jsx)("img",{src:(0,c.Z)("img/getyycs.png")}),"\n",(0,i.jsxs)(n.p,{children:["\u4f46\u662f\uff0c",(0,i.jsx)(n.code,{children:"GET\u3001HEAD"})," \u8bf7\u6c42\u4e0d\u652f\u6301 ",(0,i.jsx)(n.code,{children:"From Body"})," \u7ed1\u5b9a\u3002\u6240\u4ee5\u6211\u4eec\u9700\u8981\u8f6c\u6362\u4e3a ",(0,i.jsx)(n.code,{children:"Query"})," \u67e5\u8be2\u53c2\u6570\u3002"]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"Furion"})," \u6846\u67b6\u652f\u6301\u4ee5\u4e0b\u4e24\u79cd\u65b9\u5f0f\u914d\u7f6e\uff1a"]}),"\n",(0,i.jsxs)(t.Z,{defaultValue:"fromquery",values:[{label:"[FromQuery] \u7279\u6027",value:"fromquery"},{label:"\u914d\u7f6e DynamicApiControllerSettings",value:"DynamicApiControllerSettings"}],children:[(0,i.jsx)(o.Z,{value:"fromquery",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {2,8}",children:"using Furion.DynamicApiController;\r\nusing Microsoft.AspNetCore.Mvc;\r\n\r\nnamespace Furion.Application\r\n{\r\n public class FurionAppService : IDynamicApiController\r\n {\r\n public TestDto GetTest([FromQuery] TestDto testDto)\r\n {\r\n return testDto;\r\n }\r\n }\r\n}\n"})})}),(0,i.jsx)(o.Z,{value:"DynamicApiControllerSettings",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-json",metastring:'showLineNumbers {2-4} title="Furion.Web.Entry/appsettings.json"',children:'{\r\n "DynamicApiControllerSettings": {\r\n "ModelToQuery": true\r\n }\r\n}\n'})})})]}),"\n",(0,i.jsx)(n.p,{children:"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"}),"\n",(0,i.jsx)("img",{src:(0,c.Z)("img/modeltoquery.png")}),"\n",(0,i.jsx)(n.h3,{id:"5185-\u81ea\u5b9a\u4e49\u53c2\u6570\u4f4d\u7f6e",children:"5.1.8.5 \u81ea\u5b9a\u4e49\u53c2\u6570\u4f4d\u7f6e"}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"Furion"})," \u6846\u67b6\u63d0\u4f9b\u4e86\u975e\u5e38\u65b9\u4fbf\u7684\u81ea\u5b9a\u4e49\u53c2\u6570\u4f4d\u7f6e\u7684\u7279\u6027 ",(0,i.jsx)(n.code,{children:"[ApiSeat]"}),"\uff0c\u901a\u8fc7 ",(0,i.jsx)(n.code,{children:"[ApiSeat]"})," \u53ef\u914d\u7f6e\u53c2\u6570\u4f4d\u7f6e\uff0c\u652f\u6301\u4ee5\u4e0b\u56db\u79cd\u4f4d\u7f6e\uff1a"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"ApiSeats.ControllerStart"}),"\uff1a\u63a7\u5236\u5668\u4e4b\u524d"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"ApiSeats.ControllerEnd"}),"\uff1a\u63a7\u5236\u5668\u4e4b\u540e"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"ApiSeats.ActionStart"}),"\uff1a\u52a8\u4f5c\u65b9\u6cd5\u4e4b\u524d"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"ApiSeats.ActionEnd"}),"\uff1a\u52a8\u4f5c\u65b9\u6cd5\u4e4b\u540e\u3002",(0,i.jsx)(n.strong,{children:"\u9ed8\u8ba4\u503c"})]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {8-9,15-20}",children:'using Furion.DynamicApiController;\r\nusing System;\r\n\r\nnamespace Furion.Application\r\n{\r\n public class FurionAppService : IDynamicApiController\r\n {\r\n // \u53c2\u6570\u9ed8\u8ba4\u4e3a ApiSeats.ActionEnd\r\n public string RouteSeat(int id, string name)\r\n {\r\n return "\u914d\u7f6e\u8def\u7531\u53c2\u6570\u4f4d\u7f6e";\r\n }\r\n\r\n public string RouteSeat(\r\n [ApiSeat(ApiSeats.ControllerStart)] int id, // \u63a7\u5236\u5668\u540d\u79f0\u4e4b\u524d\r\n [ApiSeat(ApiSeats.ControllerEnd)] string name, // \u63a7\u5236\u5668\u540d\u79f0\u4e4b\u540e\r\n [ApiSeat(ApiSeats.ControllerEnd)] int age, // \u63a7\u5236\u5668\u540d\u79f0\u4e4b\u540e\r\n [ApiSeat(ApiSeats.ActionStart)] decimal weight, // \u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0\u4e4b\u524d\r\n [ApiSeat(ApiSeats.ActionStart)] float height, // \u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0\u4e4b\u524d\r\n [ApiSeat(ApiSeats.ActionEnd)] DateTime birthday) // \u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0\u4e4b\u540e\uff08\u9ed8\u8ba4\u503c\uff09\r\n {\r\n return "\u914d\u7f6e\u8def\u7531\u53c2\u6570\u4f4d\u7f6e";\r\n }\r\n }\r\n}\n'})}),"\n",(0,i.jsx)(n.p,{children:"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"}),"\n",(0,i.jsx)("img",{src:(0,c.Z)("img/cswz.png")}),"\n",(0,i.jsx)(n.admonition,{title:"\u6e29\u99a8\u63d0\u793a",type:"note",children:(0,i.jsxs)(n.p,{children:["\u591a\u4e2a ",(0,i.jsx)(n.strong,{children:(0,i.jsx)(n.code,{children:"\u540c\u4f4d\u7f6e"})})," \u914d\u7f6e\u7684\u53c2\u6570\u5c06\u6309\u7167 ",(0,i.jsx)(n.strong,{children:(0,i.jsx)(n.code,{children:"\u5b9a\u4e49\u53c2\u6570\u987a\u5e8f"})})," \u8fdb\u884c\u6392\u5e8f\u3002"]})}),"\n",(0,i.jsx)(n.admonition,{title:"\u7279\u522b\u6ce8\u610f",type:"caution",children:(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"[ApiSeat]"})," \u53ea\u80fd\u5e94\u7528\u4e8e\u8d34\u4e86 ",(0,i.jsx)(n.code,{children:"[FromRoute]"})," \u7279\u6027\u7684\u53c2\u6570\u6216 ",(0,i.jsx)(n.code,{children:"\u57fa\u5143\u7c7b\u578b\u3001\u503c\u7c7b\u578b\u3001\u53ef\u7a7a\u57fa\u5143\u7c7b\u578b\u548c\u53ef\u7a7a\u503c\u7c7b\u578b"}),"\u3002"]})}),"\n",(0,i.jsx)(n.h3,{id:"5186-\u81ea\u5b9a\u4e49\u8bf7\u6c42\u8c13\u8bcd",children:"5.1.8.6 \u81ea\u5b9a\u4e49\u8bf7\u6c42\u8c13\u8bcd"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {2,8}",children:'using Furion.DynamicApiController;\r\nusing Microsoft.AspNetCore.Mvc;\r\n\r\nnamespace Furion.Application\r\n{\r\n public class FurionAppService : IDynamicApiController\r\n {\r\n [HttpPost]\r\n public string GetVersion()\r\n {\r\n return "1.0.0";\r\n }\r\n }\r\n}\n'})}),"\n",(0,i.jsx)(n.p,{children:"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"}),"\n",(0,i.jsx)("img",{src:(0,c.Z)("img/zdywc.png")}),"\n",(0,i.jsx)(n.h3,{id:"5187-\u652f\u6301\u591a\u4e2a\u8c13\u8bcd",children:"5.1.8.7 \u652f\u6301\u591a\u4e2a\u8c13\u8bcd"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {2,8}",children:'using Furion.DynamicApiController;\r\nusing Microsoft.AspNetCore.Mvc;\r\n\r\nnamespace Furion.Application\r\n{\r\n public class FurionAppService : IDynamicApiController\r\n {\r\n [HttpPost, HttpGet, AcceptVerbs("PUT", "DELETE")]\r\n public string GetVersion()\r\n {\r\n return "1.0.0";\r\n }\r\n }\r\n}\n'})}),"\n",(0,i.jsx)(n.p,{children:"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"}),"\n",(0,i.jsx)("img",{src:(0,c.Z)("img/dgwc.png")}),"\n",(0,i.jsx)(n.admonition,{title:"\u7279\u522b\u6ce8\u610f",type:"caution",children:(0,i.jsxs)(n.p,{children:["\u5982\u679c\u52a8\u4f5c\u65b9\u6cd5\u4e2d\u542b\u6709 ",(0,i.jsx)(n.code,{children:"\u7c7b\u7c7b\u578b\u53c2\u6570"}),"\uff0c\u4e14\u542b\u6709 ",(0,i.jsx)(n.code,{children:"POST/PUT/DELETE"})," \u4efb\u610f\u8bf7\u6c42\u8c13\u8bcd\uff0c\u90a3\u4e48\u8be5\u53c2\u6570\u4f1a\u81ea\u52a8\u6dfb\u52a0 ",(0,i.jsx)(n.code,{children:"[FromBody]"})," \u53c2\u6570\uff0c\u5373\u4f7f\u5728 ",(0,i.jsx)(n.code,{children:"GET/HEAD"})," \u8bf7\u6c42\u4e2d\u4e0d\u652f\u6301\u3002"]})}),"\n",(0,i.jsx)(n.h3,{id:"5188-\u652f\u6301\u81ea\u5b9a\u4e49\u8def\u7531",children:"5.1.8.8 \u652f\u6301\u81ea\u5b9a\u4e49\u8def\u7531"}),"\n",(0,i.jsx)(n.p,{children:"\u652f\u6301\u63a7\u5236\u5668\u548c\u52a8\u4f5c\u65b9\u6cd5\u81ea\u5b9a\u4e49\u8def\u7531\uff1a"}),"\n",(0,i.jsxs)(t.Z,{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"}],children:[(0,i.jsxs)(o.Z,{value:"kzqrl",children:[(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {2,6}",children:'using Furion.DynamicApiController;\r\nusing Microsoft.AspNetCore.Mvc;\r\n\r\nnamespace Furion.Application\r\n{\r\n [Route("customapi/mobile/[controller]")]\r\n public class FurionAppService : IDynamicApiController\r\n {\r\n public string GetVersion()\r\n {\r\n return "1.0.0";\r\n }\r\n }\r\n}\n'})}),(0,i.jsx)(n.p,{children:"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"}),(0,i.jsx)("img",{src:(0,c.Z)("img/kzqrl.png")})]}),(0,i.jsxs)(o.Z,{value:"dzffrl",children:[(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {2,8}",children:'using Furion.DynamicApiController;\r\nusing Microsoft.AspNetCore.Mvc;\r\n\r\nnamespace Furion.Application\r\n{\r\n public class FurionAppService : IDynamicApiController\r\n {\r\n [Route("customapi/[action]")]\r\n public string GetVersion()\r\n {\r\n return "1.0.0";\r\n }\r\n }\r\n}\n'})}),(0,i.jsx)(n.p,{children:"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"}),(0,i.jsx)("img",{src:(0,c.Z)("img/dzffrl.png")})]}),(0,i.jsxs)(o.Z,{value:"allrl",children:[(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {2,6,9}",children:'using Furion.DynamicApiController;\r\nusing Microsoft.AspNetCore.Mvc;\r\n\r\nnamespace Furion.Application\r\n{\r\n [Route("customapi/mobile/[controller]")]\r\n public class FurionAppService : IDynamicApiController\r\n {\r\n [Route("get/[action]")]\r\n public string GetVersion()\r\n {\r\n return "1.0.0";\r\n }\r\n }\r\n}\n'})}),(0,i.jsx)(n.p,{children:"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"}),(0,i.jsx)("img",{src:(0,c.Z)("img/allrl.png")})]}),(0,i.jsxs)(o.Z,{value:"vcrl",children:[(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {9}",children:'using Furion.DynamicApiController;\r\nusing Microsoft.AspNetCore.Mvc;\r\n\r\nnamespace Furion.Application\r\n{\r\n [Route("api/[controller]")]\r\n public class FurionAppService : IDynamicApiController\r\n {\r\n [HttpGet("get/[action]")]\r\n public string GetVersion()\r\n {\r\n return "1.0.0";\r\n }\r\n }\r\n}\n'})}),(0,i.jsx)(n.p,{children:"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"}),(0,i.jsx)("img",{src:(0,c.Z)("img/wcrl.png")})]})]}),"\n",(0,i.jsx)(n.admonition,{title:"\u5c0f\u63d0\u793a",type:"important",children:(0,i.jsxs)(n.p,{children:["\u52a8\u4f5c\u65b9\u6cd5\u81ea\u5b9a\u4e49\u8def\u7531\u5982\u679c\u4ee5 ",(0,i.jsx)(n.strong,{children:(0,i.jsx)(n.code,{children:"/"})})," \u5f00\u5934\uff0c\u5219\u4e0d\u4f1a\u5408\u5e76\u63a7\u5236\u5668\u8def\u7531\u3002"]})}),"\n",(0,i.jsx)(n.admonition,{title:"\u63a8\u8350\u914d\u7f6e",type:"tip",children:(0,i.jsxs)(n.p,{children:["\u81ea\u5b9a\u4e49\u8def\u7531\u5982\u679c\u9700\u8981\u7528\u5230 ",(0,i.jsx)(n.strong,{children:"\u63a7\u5236\u5668/\u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0"}),"\uff0c\u63a8\u8350\u4f7f\u7528 ",(0,i.jsx)(n.code,{children:"[controller]"})," \u6216 ",(0,i.jsx)(n.code,{children:"[action]"})," \u5360\u4f4d\u7b26\uff0c\u56e0\u4e3a\u8be5\u5360\u4f4d\u7b26\u5df2\u7ecf\u81ea\u52a8\u5904\u7406\u4e86 ",(0,i.jsx)(n.strong,{children:"\u524d\u540e\u7f00\u3001\u7248\u672c\u53f7\u3001\u6a21\u5757\u540d\u79f0"}),"\u7b49\u3002"]})}),"\n",(0,i.jsx)(n.h3,{id:"5189-\u591a\u8def\u7531\u968f\u610f\u7ec4\u5408",children:"5.1.8.9 \u591a\u8def\u7531\u968f\u610f\u7ec4\u5408"}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"Furion"})," \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"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {6-8,11-14}",children:'using Furion.DynamicApiController;\r\nusing Microsoft.AspNetCore.Mvc;\r\n\r\nnamespace Furion.Application\r\n{\r\n [Route("api/[controller]")]\r\n [Route("api/[controller]/second")]\r\n [Route("api/[controller]/three")]\r\n public class FurionAppService : IDynamicApiController\r\n {\r\n [HttpGet]\r\n [HttpGet("get/[action]")]\r\n [HttpPost]\r\n [HttpPost("post/cus-version")]\r\n public string GetVersion()\r\n {\r\n return "1.0.0";\r\n }\r\n }\r\n}\n'})}),"\n",(0,i.jsx)(n.p,{children:"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"}),"\n",(0,i.jsx)("img",{src:(0,c.Z)("img/dlrzh.gif")}),"\n",(0,i.jsx)(n.admonition,{title:"\u7279\u522b\u6ce8\u610f",type:"caution",children:(0,i.jsxs)(n.p,{children:["\u52a8\u4f5c\u65b9\u6cd5\u4e0d\u80fd\u540c\u65f6\u8d34 ",(0,i.jsx)(n.code,{children:"[Route]"})," \u548c ",(0,i.jsx)(n.code,{children:"[HttpMethod]"})," \u7279\u6027\uff0c\u53ea\u80fd\u4e8c\u53d6\u4e00\u3002"]})}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsxs)(n.p,{children:["\u5728 ",(0,i.jsx)(n.code,{children:"Furion 4.8.5.7+"})," \u7248\u672c\u63d0\u4f9b\u66f4\u52a0\u5f3a\u5927\u7684\u8def\u7531\u7ec4\u5408\u65b9\u5f0f\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {8,19,36}",children:'using Furion.DynamicApiController;\r\nusing Microsoft.AspNetCore.Mvc;\r\n\r\nnamespace WebApplication38;\r\n\r\n[Route("api/[controller]")]\r\n[Route("api2/[controller]")]\r\npublic class Test1Service : IDynamicApiController\r\n{\r\n [HttpGet("test")]\r\n [HttpPost]\r\n [AcceptVerbs("PUT", "PATCH")]\r\n public async Task GetTestName()\r\n {\r\n await Task.CompletedTask;\r\n }\r\n}\r\n\r\npublic class Test2Service : IDynamicApiController\r\n{\r\n [HttpGet("/root/test")]\r\n [HttpGet("test")]\r\n [HttpGet(Name = "other-test")]\r\n [HttpGet("template-test", Name = "other-test")]\r\n [HttpPost]\r\n [AcceptVerbs("PUT", "PATCH")]\r\n public async Task GetTestName()\r\n {\r\n await Task.CompletedTask;\r\n }\r\n}\r\n\r\n[Route("api/[controller]")]\r\n[Route("api2/[controller]/second")]\r\n[Route("api3/[controller]/three")]\r\npublic class Test3Service : IDynamicApiController\r\n{\r\n [HttpGet]\r\n [HttpGet("get/[action]")]\r\n [HttpPost]\r\n [HttpPost("post/cus-version")]\r\n public string GetVersion()\r\n {\r\n return "1.0.0";\r\n }\r\n}\n'})}),"\n",(0,i.jsx)("img",{src:(0,c.Z)("img/dy10.png")}),"\n",(0,i.jsx)(n.h3,{id:"51810-\u652f\u6301\u7248\u672c\u63a7\u5236",children:"5.1.8.10 \u652f\u6301\u7248\u672c\u63a7\u5236"}),"\n",(0,i.jsxs)(t.Z,{defaultValue:"kzqbb",values:[{label:"\u63a7\u5236\u5668\u7248\u672c",value:"kzqbb"},{label:"\u52a8\u4f5c\u65b9\u6cd5\u7248\u672c",value:"dzffbb"}],children:[(0,i.jsxs)(o.Z,{value:"kzqbb",children:[(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {5,13,21}",children:"using Furion.DynamicApiController;\r\n\r\nnamespace Furion.Application\r\n{\r\n public class FurionAppServiceV1 : IDynamicApiController\r\n {\r\n public string Get()\r\n {\r\n return nameof(Furion);\r\n }\r\n }\r\n\r\n public class FurionAppServiceV1_2 : IDynamicApiController\r\n {\r\n public string Get()\r\n {\r\n return nameof(Furion);\r\n }\r\n }\r\n\r\n public class FurionAppServiceV1_2_1 : IDynamicApiController\r\n {\r\n public string Get()\r\n {\r\n return nameof(Furion);\r\n }\r\n }\r\n}\n"})}),(0,i.jsx)(n.p,{children:"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"}),(0,i.jsx)("img",{src:(0,c.Z)("img/kzqbb.png")})]}),(0,i.jsxs)(o.Z,{value:"dzffbb",children:[(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {7,12,16}",children:"using Furion.DynamicApiController;\r\n\r\nnamespace Furion.Application\r\n{\r\n public class FurionAppService : IDynamicApiController\r\n {\r\n public string Get()\r\n {\r\n return nameof(Furion);\r\n }\r\n\r\n public string GetV1()\r\n {\r\n return nameof(Furion);\r\n }\r\n public string GetV2_1()\r\n {\r\n return nameof(Furion);\r\n }\r\n }\r\n}\n"})}),(0,i.jsx)(n.p,{children:"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"}),(0,i.jsx)("img",{src:(0,c.Z)("img/dzffbb.png")})]})]}),"\n",(0,i.jsx)(n.admonition,{title:"\u7248\u672c\u751f\u6210\u539f\u7406",type:"note",children:(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:(0,i.jsx)(n.code,{children:"V[0-9_]"})})," \u7ed3\u5c3e\u7684\u547d\u540d\u81ea\u52a8\u89e3\u6790\u6210\u7248\u672c\u53f7\uff0c\u5982 ",(0,i.jsx)(n.strong,{children:(0,i.jsx)(n.code,{children:"FurionAppServiceV2 -> Furion@2"})}),"\u3002"]})}),"\n",(0,i.jsxs)(n.admonition,{title:"\u7248\u672c\u590d\u5199",type:"tip",children:[(0,i.jsxs)(n.p,{children:["\u9664\u4e86\u901a\u8fc7\u7279\u5b9a\u540e\u7f00\u65b9\u5f0f\u4ee5\u5916\uff0c\u7248\u672c\u8fd8\u76f4\u63a5\u901a\u8fc7 ",(0,i.jsx)(n.code,{children:"[ApiDescriptionSettings]"})," \u8fdb\u884c\u590d\u5199\u3002\u5982\uff1a"]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {1,2}",children:'[ApiDescriptionSettings(Version = "4.0")]\r\npublic string GetV1()\r\n{\r\n return nameof(Furion);\r\n}\n'})}),(0,i.jsxs)(n.p,{children:["\u8fd9\u65f6\uff0c\u751f\u6210\u7248\u672c\u5c06\u91c7\u7528 ",(0,i.jsx)(n.code,{children:"4.0"})," \u66ff\u4ee3 ",(0,i.jsx)(n.code,{children:"1"})]})]}),"\n",(0,i.jsx)(n.h3,{id:"51811-\u4e0d\u516c\u5f00\u63a7\u5236\u5668\u6216\u52a8\u4f5c\u65b9\u6cd5",children:"5.1.8.11 \u4e0d\u516c\u5f00\u63a7\u5236\u5668\u6216\u52a8\u4f5c\u65b9\u6cd5"}),"\n",(0,i.jsxs)(n.p,{children:["\u6709\u4e9b\u65f6\u5019\uff0c\u6211\u4eec\u65e0\u9700\u5bfc\u51fa\u67d0\u4e2a\u52a8\u4f5c\u65b9\u6cd5\u6216\u63a7\u5236\u5668\uff08",(0,i.jsx)(n.strong,{children:"\u4e0d\u663e\u793a\u5230 Swagger"}),"\uff09\uff0c\u53ea\u9700\u8981\u6dfb\u52a0 ",(0,i.jsx)(n.code,{children:"[ApiDescriptionSettings(false)]"})," \u6216 ",(0,i.jsx)(n.code,{children:"[ApiDescriptionSettings(IgnoreApi = true)]"}),"\u5373\u53ef\u3002"]}),"\n",(0,i.jsxs)(n.p,{children:["\u53e6\u5916\u52a8\u4f5c\u65b9\u6cd5\u8fd8\u652f\u6301 ",(0,i.jsx)(n.code,{children:"[NonAction]"})," \u6807\u8bb0\u4e0d\u662f\u4e00\u4e2a\u6709\u6548\u7684\u63a7\u5236\u5668\u6216 Action\u3002"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {8,14,20,27}",children:"public class FurionAppService: IDynamicApiController\r\n{\r\n public string Export()\r\n {\r\n // ....\r\n }\r\n\r\n [ApiDescriptionSettings(false)] // \u4e0d\u5728 Swagger \u4e0a\u663e\u793a\r\n public string NoExport()\r\n {\r\n // ...\r\n }\r\n\r\n [ApiDescriptionSettings(IgnoreApi = true)] // \u4e0d\u5728 Swagger \u4e0a\u663e\u793a\r\n public string NoExport2()\r\n {\r\n // ...\r\n }\r\n\r\n [NonAction] // \u4e0d\u662f\u4e00\u4e2a API\r\n public string IsNotAPI()\r\n {\r\n // ...\r\n }\r\n}\r\n\r\n[ApiDescriptionSettings(false)] // \u4e0d\u5bfc\u51fa\r\npublic class NoExportServices: IDynamicApiController\r\n{\r\n // ....\r\n}\n"})}),"\n",(0,i.jsx)(n.h3,{id:"51812-\u4fdd\u6301\u63a7\u5236\u5668\u548c\u65b9\u6cd5\u547d\u540d",children:"5.1.8.12 \u4fdd\u6301\u63a7\u5236\u5668\u548c\u65b9\u6cd5\u547d\u540d"}),"\n",(0,i.jsxs)(n.p,{children:["\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u52a8\u6001 API \u4f1a\u5c06\u63a7\u5236\u5668\u548c\u65b9\u6cd5\u540d\u8f93\u51fa\u4e3a ",(0,i.jsx)(n.code,{children:"RESTFul"})," \u98ce\u683c\u7684\u8def\u7531\uff0c\u5982\u9700\u4fdd\u7559\u539f\u6709\u8bbe\u8ba1\uff0c\u53ea\u9700\u914d\u7f6e\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-json",metastring:"showLineNumbers {2-5}",children:'{\r\n "DynamicApiControllerSettings": {\r\n "KeepName": true,\r\n "KeepVerb": true,\r\n "LowercaseRoute": false\r\n }\r\n}\n'})}),"\n",(0,i.jsxs)(n.h3,{id:"51813-\u65b9\u6cd5\u53c2\u6570-fromquery-\u5316\u53c2\u6570\u975e\u5fc5\u586b\u53c2\u6570\u53ef\u9009",children:["5.1.8.13 \u65b9\u6cd5\u53c2\u6570 ",(0,i.jsx)(n.code,{children:"[FromQuery]"})," \u5316/\u53c2\u6570\u975e\u5fc5\u586b/\u53c2\u6570\u53ef\u9009"]}),"\n",(0,i.jsxs)(n.p,{children:["\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u6240\u6709\u7684\u57fa\u5143\u7c7b\u578b\u53c2\u6570\u90fd\u4f1a\u8d34\u4e0a ",(0,i.jsx)(n.code,{children:"[FromRoute]"})," \u7279\u6027\uff0c\u5982\u679c\u9700\u8981\u5c06\u53c2\u6570\u8c03\u6574\u4e3a ",(0,i.jsx)(n.code,{children:"[FromQuery]"})," \u4fee\u9970\uff0c\u53ea\u9700\u8981\u5728\u65b9\u6cd5\u4e0a\u9762\u8d34 ",(0,i.jsx)(n.code,{children:"[QueryParameters]"})," \u7279\u6027\u5373\u53ef\uff0c\u5982\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {1}",children:'[QueryParameters]\r\npublic string Get(int id, string name)\r\n{\r\n return nameof($"{id} {name}");\r\n}\n'})}),"\n",(0,i.jsxs)(n.p,{children:["\u751f\u6210\u7684\u8def\u7531\u4e3a\uff1a",(0,i.jsx)(n.code,{children:"https://xxx.com?id=1&name=Furion"})]}),"\n",(0,i.jsxs)(n.p,{children:["\u5982\u679c\u4e0d\u559c\u6b22\u6bcf\u4e2a\u90fd\u914d\u7f6e\uff0c\u4e5f\u53ef\u4ee5\u5168\u5c40\u914d\u7f6e\uff08",(0,i.jsx)(n.strong,{children:"\u53ea\u4f1a\u5f71\u54cd\u57fa\u5143\u7c7b\u578b\u7684\u53c2\u6570"}),"\uff09\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-json",metastring:"showLineNumbers {2-3}",children:'{\r\n "DynamicApiControllerSettings": {\r\n "UrlParameterization": true\r\n }\r\n}\n'})}),"\n",(0,i.jsx)(n.admonition,{title:"\u7279\u522b\u6ce8\u610f",type:"important",children:(0,i.jsxs)(n.p,{children:["\u8d34\u4e86 ",(0,i.jsx)(n.code,{children:"[QueryParameters]"})," \u4e4b\u540e\uff0c\u4f1a\u5bf9\u6240\u6709\u53c2\u6570\u5f71\u54cd\uff0c\u5305\u62ec\u7c7b\u7c7b\u578b\u53c2\u6570\uff0c\u5982\u679c\u4e0d\u9700\u8981\u5904\u7406\u67d0\u4e2a\u53c2\u6570\uff0c\u53ea\u9700\u8981\u8d34 ",(0,i.jsx)(n.code,{children:"[FromXXX]"})," \u7279\u6027\u5373\u53ef\u3002"]})}),"\n",(0,i.jsx)(n.h3,{id:"51814-\u53c2\u6570\u7ed1\u5b9a\u914d\u7f6e",children:"5.1.8.14 \u53c2\u6570\u7ed1\u5b9a\u914d\u7f6e"}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"Furion"})," \u6846\u67b6\u63d0\u4f9b\u4e86\u591a\u79cd\u53c2\u6570\u7279\u6027\u914d\u7f6e\u53c2\u6570\u7ed1\u5b9a\u89c4\u5219\uff1a"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"[FromRoute]"}),"\uff1a\u901a\u8fc7\u8def\u7531\u53c2\u6570\u7ed1\u5b9a\u503c"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"[FromQuery]"}),"\uff1a\u901a\u8fc7 ",(0,i.jsx)(n.code,{children:"Url"})," \u5730\u5740\u53c2\u6570\u7ed1\u5b9a\u503c"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"[FromBody]"}),"\uff1a\u901a\u8fc7 ",(0,i.jsx)(n.code,{children:"Request Body"})," \u53c2\u6570\u7ed1\u5b9a\u503c"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"[FromForm]"}),"\uff1a\u901a\u8fc7\u8868\u5355\u63d0\u4ea4\u7ed1\u5b9a\u503c"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"[FromHeader]"}),"\uff1a\u901a\u8fc7 ",(0,i.jsx)(n.code,{children:"Request Header"})," \u53c2\u6570\u7ed1\u5b9a\u503c"]}),"\n"]}),"\n",(0,i.jsxs)(n.h3,{id:"51815-\u81ea\u5b9a\u4e49\u6839\u636e\u65b9\u6cd5\u540d\u751f\u6210-httpmethod-\u89c4\u5219",children:["5.1.8.15 \u81ea\u5b9a\u4e49\u6839\u636e\u65b9\u6cd5\u540d\u751f\u6210 ",(0,i.jsx)(n.code,{children:"[HttpMethod]"})," \u89c4\u5219"]}),"\n",(0,i.jsxs)(n.p,{children:["\u5728 ",(0,i.jsx)(n.code,{children:"Furion"})," \u6846\u67b6\u4e2d\uff0c\u5728\u6ca1\u6709\u914d\u7f6e ",(0,i.jsx)(n.code,{children:"[HttpMethod]"})," \u7279\u6027\u7684\u60c5\u51b5\u4e0b\uff0c\u4f1a\u81ea\u52a8\u6839\u636e\u65b9\u6cd5\u540d\u7b2c\u4e00\u4e2a\u53c2\u6570\u8fdb\u884c\u5206\u6790\uff0c\u5e76\u751f\u6210\u5bf9\u5e94\u7684 ",(0,i.jsx)(n.code,{children:"[HttpMethod]"})," \u7279\u6027\uff0c\u89c4\u5219\u5982\u4e0b\uff1a"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\u52a8\u4f5c\u65b9\u6cd5\u540d","\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\u4ee5 ",(0,i.jsx)(n.code,{children:"Post/Add/Create/Insert/Submit"})," \u5f00\u5934\uff0c\u5219\u6dfb\u52a0 ",(0,i.jsx)(n.code,{children:"[HttpPost]"})," \u7279\u6027\u3002"]}),"\n",(0,i.jsxs)(n.li,{children:["\u4ee5 ",(0,i.jsx)(n.code,{children:"GetAll/GetList/Get/Find/Fetch/Query"})," \u5f00\u5934\uff0c\u5219\u6dfb\u52a0 ",(0,i.jsx)(n.code,{children:"[HttpGet]"})," \u7279\u6027\u3002"]}),"\n",(0,i.jsxs)(n.li,{children:["\u4ee5 ",(0,i.jsx)(n.code,{children:"Put/Update"})," \u5f00\u5934\uff0c\u5219\u6dfb\u52a0 ",(0,i.jsx)(n.code,{children:"[HttpPut]"})," \u7279\u6027\u3002"]}),"\n",(0,i.jsxs)(n.li,{children:["\u4ee5 ",(0,i.jsx)(n.code,{children:"Delete/Remove/Clear"})," \u5f00\u5934\uff0c\u5219\u6dfb\u52a0 ",(0,i.jsx)(n.code,{children:"[HttpDelete]"})," \u7279\u6027\u3002"]}),"\n",(0,i.jsxs)(n.li,{children:["\u4ee5 ",(0,i.jsx)(n.code,{children:"Patch"})," \u5f00\u5934\uff0c\u5219\u6dfb\u52a0 ",(0,i.jsx)(n.code,{children:"[HttpPatch]"})," \u7279\u6027"]}),"\n",(0,i.jsxs)(n.li,{children:["\u4ee5 ",(0,i.jsx)(n.code,{children:"Head"})," \u5f00\u5934\uff0c\u5219\u6dfb\u52a0 ",(0,i.jsx)(n.code,{children:"[HttpHead]"})," \u7279\u6027"]}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.strong,{children:"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e"})}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\u5982\u679c\u4e0d\u5728\u4e0a\u9762\u7ea6\u5b9a\u4e2d\uff0c\u5219\u9ed8\u8ba4\u6dfb\u52a0 ",(0,i.jsx)(n.code,{children:"[HttpPost]"})," \u7279\u6027\u3002",(0,i.jsx)(n.strong,{children:"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e"})]}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"\u4f46\u662f\uff0c\u6709\u4e9b\u65f6\u5019\u8fd9\u4e0d\u662f\u6211\u4eec\u60f3\u8981\u7684\u89c4\u5219"}),"\uff0c\u8fd9\u65f6\u6211\u4eec\u53ea\u9700\u8981\u5728 ",(0,i.jsx)(n.code,{children:"appsettings.json"})," \u4e2d\u914d\u7f6e\u5373\u53ef\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-json",metastring:"showLineNumbers {2,3}",children:'{\r\n "DynamicApiControllerSettings": {\r\n "VerbToHttpMethods": [\r\n ["getall", "HEAD"], // => getall \u4f1a\u88ab\u590d\u5199\u4e3a `[HttpHead]`\r\n ["other", "PUT"] // => \u65b0\u589e\u4e00\u6761\u65b0\u89c4\u5219\uff0c\u6bd4\u5982\uff0c\u4e00 `[other]` \u5f00\u5934\u4f1a\u8f6c\u6362\u4e3a `[HttpPut]` \u8bf7\u6c42\r\n ]\r\n }\r\n}\n'})}),"\n",(0,i.jsx)(n.admonition,{title:"\u7279\u522b\u6ce8\u610f",type:"important",children:(0,i.jsxs)(n.p,{children:["\u4e8c\u7ef4\u6570\u7ec4\u4e2d\u7684\u6bcf\u4e00\u4e2a\u5143\u7d20\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20",(0,i.jsx)(n.strong,{children:"\u5fc5\u987b\u662f\u5168\u5c0f\u5199"}),"\uff0c\u7b2c\u4e8c\u4e2a\u5143\u7d20",(0,i.jsx)(n.strong,{children:"\u5fc5\u987b\u662f\u5168\u5927\u5199\u5927\u5199"}),"\uff0c\u7b2c\u4e8c\u4e2a\u5143\u7d20\u53d6\u503c\u6709\uff1a",(0,i.jsx)(n.code,{children:"HEAD, GET, PUT, POST, PATCH, DELETE"})]})}),"\n",(0,i.jsx)(n.h3,{id:"51816-\u8def\u7531\u53c2\u6570\u975e\u5fc5\u586b\u9009\u586b",children:"5.1.8.16 \u8def\u7531\u53c2\u6570\u975e\u5fc5\u586b/\u9009\u586b"}),"\n",(0,i.jsxs)(n.p,{children:["\u5728 ",(0,i.jsx)(n.code,{children:"Furion v2.8.6"})," \u7248\u672c\u4e2d\u5b9e\u73b0\u4e86 ",(0,i.jsx)(n.code,{children:"[FromRoute]"})," \u53c2\u6570\u975e\u5fc5\u586b\u529f\u80fd\uff0c\u652f\u6301\u4ee5\u4e0b\u51e0\u79cd\u65b9\u5f0f\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {2,6,11,16}",children:"// \u65b9\u5f0f\u4e00\uff0c\u901a\u8fc7\u53ef\u7a7a ?\r\npublic object Method1(int id, Datetime? dateTime)\r\n{\r\n}\r\n\r\n// \u65b9\u5f0f\u4e8c\uff0c\u901a\u8fc7\u9ed8\u8ba4\u503c\r\npublic object Method1(int id, int age = 10)\r\n{\r\n}\r\n\r\n// \u65b9\u5f0f\u4e09\uff0c\u9ed8\u8ba4\u503c + \u53ef\u7a7a ?\r\npublic object Method1(int id, int? age = 10)\r\n{\r\n}\r\n\r\n// \u65b9\u5f0f\u56db\uff0c[FromQuery] \u4fee\u9970\r\npublic object Method1(int id, [FromQuery]string keyword)\r\n{\r\n}\n"})}),"\n",(0,i.jsxs)(n.h3,{id:"51817-formroute-\u8def\u7531\u7ea6\u675f",children:["5.1.8.17 ",(0,i.jsx)(n.code,{children:"[FormRoute]"})," \u8def\u7531\u7ea6\u675f"]}),"\n",(0,i.jsxs)(n.p,{children:["\u5728 ",(0,i.jsx)(n.code,{children:"Furion v2.8.6"})," \u7248\u672c\u4e2d\uff0c\u6dfb\u52a0\u4e86 ",(0,i.jsx)(n.code,{children:"[RouteConstraint]"})," \u7279\u6027\uff0c\u53ef\u914d\u7f6e\u8def\u7531\u7ea6\u675f\uff0c\u5982\uff1a",(0,i.jsx)(n.code,{children:'[RouteConstraint(":min(10)")]'})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {2}",children:'// \u6700\u5c0f\u503c 10\r\npublic object Method1([RouteConstraint(":min(10)")] int id)\r\n{\r\n}\n'})}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"[RouteConstraint]"})," \u652f\u6301\u8def\u7531\u7ea6\u675f\u7b26\u53f7\u5982\u4e0b\uff1a"]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"\u7b26\u53f7"}),(0,i.jsx)(n.th,{children:"\u63cf\u8ff0"}),(0,i.jsx)(n.th,{children:"\u4f8b\u5b50"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"*"})}),(0,i.jsx)(n.td,{children:"\u5339\u914d\u8def\u7531 0-n \u957f\u5ea6\uff0cFurion 4.8.6.2+ \u652f\u6301"}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:":*"})})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"alpha"})}),(0,i.jsx)(n.td,{children:"\u5339\u914d\u5927\u5199\u6216\u5c0f\u5199\u62c9\u4e01\u5b57\u6bcd\u5b57\u7b26\uff08a-z\u3001A-Z\uff09"}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:":alpha"})})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"bool"})}),(0,i.jsx)(n.td,{children:"bool \u7c7b\u578b"}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:":bool"})})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"datetime"})}),(0,i.jsx)(n.td,{children:"DateTime \u7c7b\u578b"}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:":datetime"})})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"decimal"})}),(0,i.jsx)(n.td,{children:"decimal \u7c7b\u578b"}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:":decimal"})})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"double"})}),(0,i.jsx)(n.td,{children:"double \u7c7b\u578b"}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:":double"})})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"float"})}),(0,i.jsx)(n.td,{children:"float \u7c7b\u578b"}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:":float"})})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"guid"})}),(0,i.jsx)(n.td,{children:"guid \u7c7b\u578b"}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:":guid"})})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"int"})}),(0,i.jsx)(n.td,{children:"int \u7c7b\u578b"}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:":int"})})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"long"})}),(0,i.jsx)(n.td,{children:"long \u7c7b\u578b"}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:":long"})})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"length"})}),(0,i.jsx)(n.td,{children:"\u5339\u914d\u957f\u5ea6\uff08\u5b57\u7b26\u4e32\uff09"}),(0,i.jsxs)(n.td,{children:[(0,i.jsx)(n.code,{children:":length(6)"})," \u6216 ",(0,i.jsx)(n.code,{children:":length(1,20)"})]})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"max"})}),(0,i.jsx)(n.td,{children:"\u6700\u5927\u503c"}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:":max(10)"})})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"maxlength"})}),(0,i.jsx)(n.td,{children:"\u6700\u5927\u957f\u5ea6\uff08\u5b57\u7b26\u4e32\uff09"}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:":maxlength(10)"})})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"min"})}),(0,i.jsx)(n.td,{children:"\u6700\u5c0f\u503c"}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:":min(10)"})})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"minlength"})}),(0,i.jsx)(n.td,{children:"\u6700\u5c0f\u957f\u5ea6\uff08\u5b57\u7b26\u4e32\uff09"}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:":minlength(10)"})})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"range"})}),(0,i.jsx)(n.td,{children:"\u53d6\u503c\u8303\u56f4"}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:":range(10,50)"})})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"regex"})}),(0,i.jsx)(n.td,{children:"\u6b63\u5219\u8868\u8fbe\u5f0f"}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:":regex(^\\d{3}-\\d{3}-\\d{4}$)"})})]})]})]}),"\n",(0,i.jsxs)(n.h3,{id:"51818-\u5c0f\u9a7c\u5cf0-\u8def\u7531\u8def\u5f84",children:["5.1.8.18 ",(0,i.jsx)(n.code,{children:"\u5c0f\u9a7c\u5cf0"})," \u8def\u7531\u8def\u5f84"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-json",metastring:"showLineNumbers {2-5}",children:'{\r\n "DynamicApiControllerSettings": {\r\n "LowercaseRoute": false,\r\n "KeepName": true,\r\n "AsLowerCamelCase": true\r\n }\r\n}\n'})}),"\n",(0,i.jsxs)(n.h3,{id:"51819-applicationxml-\u62a5\u6587\u53c2\u6570\u652f\u6301",children:["5.1.8.19 ",(0,i.jsx)(n.code,{children:"application/xml"})," \u62a5\u6587\u53c2\u6570\u652f\u6301"]}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\u5728 ",(0,i.jsx)(n.code,{children:"Startup.cs"})," \u4e2d\u542f\u7528 ",(0,i.jsx)(n.code,{children:"XML"})," \u8bf7\u6c42\u62a5\u6587\u683c\u5f0f\u652f\u6301"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {2-3}",children:"services.AddControllers() // .AddControllersWithViews()\r\n .AddXmlSerializerFormatters()\r\n .AddXmlDataContractSerializerFormatters()\n"})}),"\n",(0,i.jsxs)(n.admonition,{title:"\u5f02\u5e38\u5904\u7406",type:"warning",children:[(0,i.jsxs)(n.p,{children:["\u5982\u679c\u51fa\u73b0 ",(0,i.jsx)(n.code,{children:"XmlSerializer"})," \u5f02\u5e38\uff0c\u90a3\u4e48\u53ea\u9700\u8981\u79fb\u9664 ",(0,i.jsx)(n.code,{children:".AddXmlSerializerFormatters()"})," \u5373\u53ef\uff0c\u5982\uff1a"]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {2}",children:"services.AddControllers() // .AddControllersWithViews()\r\n .AddXmlDataContractSerializerFormatters()\n"})})]}),"\n",(0,i.jsxs)(n.ol,{start:"2",children:["\n",(0,i.jsx)(n.li,{children:"\u5b9a\u4e49\u5b9e\u4f53\u7c7b\u578b"}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers",children:"// \u5b9e\u4f53\u7c7b\u578b\r\npublic class People\r\n{\r\n // \u57fa\u7840\u7c7b\u578b\r\n public int Age { get; set; }\r\n public string Name { get; set; }\r\n public bool IsDeleted { get; set; }\r\n\r\n // \u6570\u7ec4\u7c7b\u578b\r\n public string[] Address { get; set; }\r\n\r\n // \u96c6\u5408\u7c7b\u578b\r\n public List<string> Emails { get; set; }\r\n\r\n // \u7c7b\u7c7b\u578b\r\n public Child Child { get; set; }\r\n}\r\n\r\npublic class Child\r\n{\r\n public string Name { get; set; }\r\n}\n"})}),"\n",(0,i.jsxs)(n.ol,{start:"3",children:["\n",(0,i.jsxs)(n.li,{children:["\u5728\u52a8\u6001 ",(0,i.jsx)(n.code,{children:"WebAPI"})," \u4e2d\u4f7f\u7528"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {3-4}",children:'public class XmlDemo : IDynamicApiController\r\n{\r\n //[Consumes("application/xml")] // \u5982\u679c\u8bbe\u7f6e\u4e86 [Consumes] \u90a3\u4e48\u5c31\u8868\u793a\u53ea\u80fd\u4f20\u9012 `accept= application/xml` \u683c\u5f0f\uff0c\u4e0d\u8bbe\u7f6e\u5219\u652f\u6301\u591a\u79cd\uff08XML/JSON)\r\n public People Test(People people)\r\n {\r\n return people;\r\n }\r\n}\n'})}),"\n",(0,i.jsxs)(n.admonition,{type:"important",children:[(0,i.jsxs)(n.mdxAdmonitionTitle,{children:[(0,i.jsx)(n.code,{children:"[Consumes]"})," \u548c ",(0,i.jsx)(n.code,{children:"[Produces]"})," \u8bf4\u660e"]}),(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"[Consumes]"})," \u7279\u6027\u662f\u7528\u6765\u5b9a\u4e49\u8f93\u5165\u53c2\u6570\u683c\u5f0f\uff0c\u5bf9\u5e94\u8bf7\u6c42\u62a5\u6587\u7684 ",(0,i.jsx)(n.code,{children:"accept"}),"\uff0c",(0,i.jsx)(n.code,{children:"[Produces]"})," \u7279\u6027\u662f\u7528\u6765\u5b9a\u4e49\u8fd4\u56de\u503c\u683c\u5f0f\uff0c\u5bf9\u5e94\u54cd\u5e94\u62a5\u6587\u7684 ",(0,i.jsx)(n.code,{children:"content-type"}),"\u3002"]})]}),"\n",(0,i.jsxs)(n.ol,{start:"4",children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"XML"})," \u683c\u5f0f\u8bf4\u660e\u53ca\u6ce8\u610f\u4e8b\u9879"]}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["\u652f\u6301\u4e24\u79cd ",(0,i.jsx)(n.code,{children:"XML"})," \u683c\u5f0f\u62a5\u6587\uff0c\u5982\uff1a"]}),"\n",(0,i.jsxs)(n.admonition,{title:"\u6ce8\u610f\u4e8b\u9879",type:"caution",children:[(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"XML"})," \u6807\u7b7e\u533a\u5206\u5927\u5c0f\u5199\uff0c\u5fc5\u987b\u4e25\u683c\u5bf9\u7167 ",(0,i.jsx)(n.code,{children:"C#"})," \u7c7b\u578b\u5b9a\u4e49\u58f0\u660e\u3002\u5bf9\u4e8e\u96c6\u5408/\u6570\u7ec4\u7c7b\u578b\uff0c\u5fc5\u987b\u9075\u5faa\u4e0b\u5217\u683c\u5f0f\uff1a"]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-xml",metastring:"showLineNumbers",children:"<\u5c5e\u6027\u540d>\r\n <C#\u7c7b\u578b></C#\u7c7b\u578b>\r\n</\u5c5e\u6027\u540d>\n"})}),(0,i.jsx)(n.p,{children:"\u5982\uff1a"}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-xml",metastring:"showLineNumbers {1,5,9,13,17,21}",children:"<Strings>\r\n <string>monksoul@outlook.com</string>\r\n <string>rustln@outlook.com</string>\r\n</Strings>\r\n<Ints>\r\n <int>1</int>\r\n <int>2</int>\r\n</Ints>\r\n<Bools>\r\n <boolean>true</boolean>\r\n <boolean>false</boolean>\r\n</Bools>\r\n<Decimals>\r\n <decimal>1.0</decimal>\r\n <decimal>2.0</decimal>\r\n</Decimals>\r\n<Floats>\r\n <float>1.0</float>\r\n <float>2.0</float>\r\n</Floats>\r\n<Childs>\r\n <Child>\r\n <Name>Furion</Name>\r\n </Child>\r\n</Childs>\n"})})]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"\u7b2c\u4e00\u79cd\uff08\u5e38\u7528\u683c\u5f0f\uff09"}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-xml",metastring:"showLineNumbers {1-2}",children:'<?xml version="1.0" encoding="UTF-8"?>\r\n<People>\r\n <Age>30</Age>\r\n <Name>\u767e\u5c0f\u50e7</Name>\r\n <IsDeleted>true</IsDeleted>\r\n <Address>\r\n <string>\u5e7f\u4e1c\u7701\u4e2d\u5c71\u5e02</string>\r\n <string>\u5e7f\u4e1c\u7701\u73e0\u6d77\u5e02</string>\r\n </Address>\r\n <Emails>\r\n <string>monksoul@outlook.com</string>\r\n <string>rustln@outlook.com</string>\r\n </Emails>\r\n <Child>\r\n <Name>Furion</Name>\r\n </Child>\r\n</People>\n'})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"\u7b2c\u4e8c\u79cd\uff08\u6807\u51c6\u683c\u5f0f\uff09"}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-xml",metastring:"showLineNumbers {1}",children:'<People xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">\r\n <Age>30</Age>\r\n <Name>\u767e\u5c0f\u50e7</Name>\r\n <IsDeleted>true</IsDeleted>\r\n <Address>\r\n <string>\u5e7f\u4e1c\u7701\u4e2d\u5c71\u5e02</string>\r\n <string>\u5e7f\u4e1c\u7701\u73e0\u6d77\u5e02</string>\r\n </Address>\r\n <Emails>\r\n <string>monksoul@outlook.com</string>\r\n <string>rustln@outlook.com</string>\r\n </Emails>\r\n <Child>\r\n <Name>Furion</Name>\r\n </Child>\r\n</People>\n'})}),"\n",(0,i.jsxs)(n.h2,{id:"519-apidescriptionsettings",children:["5.1.9 ",(0,i.jsx)(n.code,{children:"[ApiDescriptionSettings]"})]}),"\n",(0,i.jsxs)(n.p,{children:["\u9664\u4e86\u4e0a\u8ff0 ",(0,i.jsx)(n.code,{children:"ASP.NET Core"})," \u63d0\u4f9b\u7684\u914d\u7f6e\u5916\uff0c",(0,i.jsx)(n.code,{children:"Furion"})," \u6846\u67b6\u8fd8\u63d0\u4f9b\u4e86\u975e\u5e38\u5f3a\u5927\u4e14\u7075\u6d3b\u7684 ",(0,i.jsx)(n.code,{children:"[ApiDescriptionSettings]"})," \u7279\u6027\u3002"]}),"\n",(0,i.jsx)(n.h3,{id:"5191-\u5185\u7f6e\u914d\u7f6e",children:"5.1.9.1 \u5185\u7f6e\u914d\u7f6e"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Name"}),"\uff1a\u81ea\u5b9a\u4e49\u63a7\u5236\u5668/\u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0\uff0c",(0,i.jsx)(n.code,{children:"string"}),"\uff0c\u9ed8\u8ba4 ",(0,i.jsx)(n.code,{children:"null"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"KeepName"}),"\uff1a\u662f\u5426\u4fdd\u6301\u539f\u6709\u540d\u79f0\u4e0d\u5904\u7406\uff0c",(0,i.jsx)(n.code,{children:"bool"}),"\uff0c\u9ed8\u8ba4 ",(0,i.jsx)(n.code,{children:"false"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"SplitCamelCase"}),"\uff1a\u5207\u5272\u9a86\u9a7c(\u9a7c\u5cf0)/\u5e15\u65af\u5361\u547d\u540d\uff0c",(0,i.jsx)(n.code,{children:"bool"}),"\uff0c\u9ed8\u8ba4 ",(0,i.jsx)(n.code,{children:"true"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"KeepVerb"}),"\uff1a\u662f\u5426\u4fdd\u7559\u52a8\u4f5c\u65b9\u6cd5\u8bf7\u6c42\u8c13\u8bcd\uff0c",(0,i.jsx)(n.code,{children:"bool"}),"\uff0c\u9ed8\u8ba4 ",(0,i.jsx)(n.code,{children:"false"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Enabled"}),"\uff1a\u662f\u5426\u5bfc\u51fa\u63a5\u53e3\uff0c",(0,i.jsx)(n.code,{children:"bool"}),"\uff0c\u9ed8\u8ba4 ",(0,i.jsx)(n.code,{children:"true"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Module"}),"\uff1a\u6a21\u5757\u540d\uff0c",(0,i.jsx)(n.code,{children:"string"}),"\uff0c\u9ed8\u8ba4 ",(0,i.jsx)(n.code,{children:"null"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Version"}),"\uff1a\u7248\u672c\u53f7\uff0c",(0,i.jsx)(n.code,{children:"string"}),"\uff0c\u9ed8\u8ba4 ",(0,i.jsx)(n.code,{children:"null"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Groups"}),"\uff1a\u63a5\u53e3\u5206\u7ec4\uff0c\u53ef\u7ed3\u5408 ",(0,i.jsx)(n.code,{children:"Swagger"})," \u4e00\u8d77\u4f7f\u7528\uff0c",(0,i.jsx)(n.code,{children:"string[]"}),"\uff0c\u9ed8\u8ba4 ",(0,i.jsx)(n.code,{children:"null"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Tags"}),"\uff1a\u63a5\u53e3\u6807\u7b7e\uff0c\u53ef\u7ed3\u5408 ",(0,i.jsx)(n.code,{children:"Swagger"})," \u4e00\u8d77\u4f7f\u7528\uff0c",(0,i.jsx)(n.code,{children:"string[]"}),"\uff0c\u9ed8\u8ba4 ",(0,i.jsx)(n.code,{children:"null"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Order"}),"\uff1a\u914d\u7f6e\u63a7\u5236\u5668/\u52a8\u4f5c\u65b9\u6cd5\u6392\u5e8f\uff0c\u6570\u503c\u8d8a\u5927\u8d8a\u9760\u524d"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"LowercaseRoute"}),"\uff1a\u662f\u5426\u91c7\u7528\u5c0f\u5199\u8def\u7531\uff0c",(0,i.jsx)(n.code,{children:"bool"})," \u7c7b\u578b\uff0c\u9ed8\u8ba4 ",(0,i.jsx)(n.code,{children:"true"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"AsLowerCamelCase"}),"\uff1a\u542f\u7528\u5c0f\u9a7c\u5cf0\u547d\u540d\uff08\u9996\u5b57\u6bcd\u5c0f\u5199\uff09\uff0c\u9ed8\u8ba4 ",(0,i.jsx)(n.code,{children:"false"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Area"}),"\uff1a\u914d\u7f6e\u533a\u57df\u540d\u79f0\uff0c\u9ed8\u8ba4\u7a7a\uff0c",(0,i.jsx)(n.strong,{children:"\u53ea\u4f5c\u7528\u4e8e\u7c7b\u4e2d\u8d34"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Description"}),"\uff1a\u914d\u7f6e\u5355\u4e00\u63a5\u53e3\u66f4\u591a\u63cf\u8ff0\u529f\u80fd\uff0c\u53ea\u5728 ",(0,i.jsx)(n.code,{children:"\u65b9\u6cd5"})," \u4e2d\u6709\u6548\uff0c",(0,i.jsx)(n.strong,{children:"\u4ec5\u9650 v3.3.5+\u7248\u672c\u6709\u6548"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"ForceWithRoutePrefix"}),"\uff1a\u914d\u7f6e\u662f\u5426\u5f3a\u5236\u6dfb\u52a0 ",(0,i.jsx)(n.code,{children:"DefaultRoutePrefix"}),"\uff0c\u5f53\u63a7\u5236\u5668\u81ea\u5b9a\u4e49\u4e86 ",(0,i.jsx)(n.code,{children:"[Route]"})," \u6709\u6548\uff0c\u9ed8\u8ba4 ",(0,i.jsx)(n.code,{children:"false"}),"\uff0c",(0,i.jsx)(n.strong,{children:"\u4ec5\u9650 v3.4.1+\u7248\u672c\u6709\u6548"})]}),"\n"]}),"\n",(0,i.jsxs)(n.h3,{id:"5192-name-\u914d\u7f6e",children:["5.1.9.2 ",(0,i.jsx)(n.code,{children:"Name"})," \u914d\u7f6e"]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"Name"})," \u53c2\u6570\u53ef\u4ee5\u8986\u76d6\u52a8\u6001 ",(0,i.jsx)(n.code,{children:"WebAPI"})," \u81ea\u52a8\u751f\u6210\u7684\u63a7\u5236\u5668\u6216\u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0\u3002\u5982\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {5,8,14,20}",children:'using Furion.DynamicApiController;\r\n\r\nnamespace Furion.Application\r\n{\r\n [ApiDescriptionSettings(Name = "MyFur")]\r\n public class FurionAppService : IDynamicApiController\r\n {\r\n [ApiDescriptionSettings(Name = "MyGet")]\r\n public string Get()\r\n {\r\n return nameof(Furion);\r\n }\r\n\r\n [ActionName("MyTest")] // Furion 4.8.4.12+ \u652f\u6301\r\n public string Test()\r\n {\r\n return nameof(Furion);\r\n }\r\n\r\n [HttpGet(Name = "MyTest")] // Furion 4.8.4.12+ \u652f\u6301\uff0c\u6b64\u914d\u7f6e\u6709\u6548\u7684\u524d\u63d0\u662f\u63a7\u5236\u5668\u8d34\u6709 [Route] \u7279\u6027\r\n public string Test2()\r\n {\r\n return nameof(Furion);\r\n }\r\n }\r\n}\n'})}),"\n",(0,i.jsx)(n.p,{children:"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"}),"\n",(0,i.jsx)("img",{src:(0,c.Z)("img/namepz.png")}),"\n",(0,i.jsxs)(n.h3,{id:"5193-keepname-\u914d\u7f6e",children:["5.1.9.3 ",(0,i.jsx)(n.code,{children:"KeepName"})," \u914d\u7f6e"]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"KeepName"})," \u53c2\u6570\u53ef\u4ee5\u4fdd\u7559\u539f\u6709\u7684\u63a7\u5236\u5668\u6216\u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0\u3002\u5982\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {5,8}",children:"using Furion.DynamicApiController;\r\n\r\nnamespace Furion.Application\r\n{\r\n [ApiDescriptionSettings(KeepName = true)]\r\n public class FurionAppService : IDynamicApiController\r\n {\r\n [ApiDescriptionSettings(KeepName = true)]\r\n public string Get()\r\n {\r\n return nameof(Furion);\r\n }\r\n }\r\n}\n"})}),"\n",(0,i.jsx)(n.p,{children:"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"}),"\n",(0,i.jsx)("img",{src:(0,c.Z)("img/keepnamepz.png")}),"\n",(0,i.jsxs)(n.h3,{id:"5194-splitcamelcase-\u914d\u7f6e",children:["5.1.9.4 ",(0,i.jsx)(n.code,{children:"SplitCamelCase"})," \u914d\u7f6e"]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"SplitCamelCase"})," \u53c2\u6570\u9ed8\u8ba4\u5c06\u9a86\u9a7c(\u9a7c\u5cf0)\u547d\u540d\u5207\u5272\u6210\u591a\u4e2a\u5355\u8bcd\u5e76\u901a\u8fc7\u6307\u5b9a ",(0,i.jsx)(n.code,{children:"\u5360\u4f4d\u7b26"})," \u8fde\u63a5\u8d77\u6765\u3002\u9ed8\u8ba4 ",(0,i.jsx)(n.code,{children:"\u5360\u4f4d\u7b26"})," \u4e3a ",(0,i.jsx)(n.code,{children:"-"}),"\u3002\u9ed8\u8ba4\u4e3a ",(0,i.jsx)(n.code,{children:"true"}),"\u3002\u5982\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {5,8}",children:"using Furion.DynamicApiController;\r\n\r\nnamespace Furion.Application\r\n{\r\n [ApiDescriptionSettings(SplitCamelCase = false)]\r\n public class MyFurionAppService : IDynamicApiController\r\n {\r\n [ApiDescriptionSettings(SplitCamelCase = true)]\r\n public string ChangeUserName()\r\n {\r\n return nameof(Furion);\r\n }\r\n }\r\n}\n"})}),"\n",(0,i.jsx)(n.p,{children:"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"}),"\n",(0,i.jsx)("img",{src:(0,c.Z)("img/splitnamepz.png")}),"\n",(0,i.jsx)(n.admonition,{title:"\u7279\u522b\u6ce8\u610f",type:"important",children:(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"KeepName"})," \u4f18\u5148\u7ea7\u9ad8\u4e8e ",(0,i.jsx)(n.code,{children:"SplitCamelCase"}),"\uff0c\u4e5f\u5c31\u662f ",(0,i.jsx)(n.code,{children:"KeepName"})," \u8bbe\u7f6e\u4e3a ",(0,i.jsx)(n.code,{children:"true"}),"\uff0c\u5219\u4e0d\u4f1a\u5904\u7406 ",(0,i.jsx)(n.code,{children:"SplitCamelCase"})," \u53c2\u6570\u3002"]})}),"\n",(0,i.jsxs)(n.h3,{id:"5195-keepverb-\u914d\u7f6e",children:["5.1.9.5 ",(0,i.jsx)(n.code,{children:"KeepVerb"})," \u914d\u7f6e"]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"KeepVerb"})," \u53c2\u6570\u4f5c\u7528\u4e8e\u52a8\u4f5c\u65b9\u6cd5\uff0c\u6807\u8bc6\u662f\u5426\u4fdd\u7559\u52a8\u4f5c\u8c13\u8bcd\u3002\u5982\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {7}",children:"using Furion.DynamicApiController;\r\n\r\nnamespace Furion.Application\r\n{\r\n public class FurionAppService : IDynamicApiController\r\n {\r\n [ApiDescriptionSettings(KeepVerb = true)]\r\n public string GetVersion()\r\n {\r\n return nameof(Furion);\r\n }\r\n }\r\n}\n"})}),"\n",(0,i.jsx)(n.p,{children:"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"}),"\n",(0,i.jsx)("img",{src:(0,c.Z)("img/keepverbpz.png")}),"\n",(0,i.jsxs)(n.h3,{id:"5196-enabled-\u914d\u7f6e",children:["5.1.9.6 ",(0,i.jsx)(n.code,{children:"Enabled"})," \u914d\u7f6e"]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"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"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {12}",children:"using Furion.DynamicApiController;\r\n\r\nnamespace Furion.Application\r\n{\r\n public class FurionAppService : IDynamicApiController\r\n {\r\n public string GetVersion()\r\n {\r\n return nameof(Furion);\r\n }\r\n\r\n [ApiDescriptionSettings(false)]\r\n public string NoExport()\r\n {\r\n return nameof(Furion);\r\n }\r\n }\r\n}\n"})}),"\n",(0,i.jsx)(n.p,{children:"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"}),"\n",(0,i.jsx)("img",{src:(0,c.Z)("img/enablepz.png")}),"\n",(0,i.jsxs)(n.h3,{id:"5197-module-\u914d\u7f6e",children:["5.1.9.7 ",(0,i.jsx)(n.code,{children:"Module"})," \u914d\u7f6e"]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"Module"})," \u53c2\u6570\u53ef\u4ee5\u914d\u7f6e\u8def\u7531\u5206\u79bb\uff0c\u7c7b\u4f3c\u4e8e ",(0,i.jsx)(n.code,{children:"Mvc \u533a\u57df"})," \u7684\u4f5c\u7528\u3002"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {5,8}",children:'using Furion.DynamicApiController;\r\n\r\nnamespace Furion.Application\r\n{\r\n [ApiDescriptionSettings(Module = "mobile")]\r\n public class FurionAppService : IDynamicApiController\r\n {\r\n [ApiDescriptionSettings(Module = "user")]\r\n public string GetVersion()\r\n {\r\n return nameof(Furion);\r\n }\r\n }\r\n}\n'})}),"\n",(0,i.jsx)(n.p,{children:"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"}),"\n",(0,i.jsx)("img",{src:(0,c.Z)("img/modulepz.png")}),"\n",(0,i.jsxs)(n.h3,{id:"5198-version-\u914d\u7f6e",children:["5.1.9.8 ",(0,i.jsx)(n.code,{children:"Version"})," \u914d\u7f6e"]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"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\u5206\u9694\u7b26\u4e3a ",(0,i.jsx)(n.code,{children:"@"}),"\u3002\u5982\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {5,9-10}",children:'using Furion.DynamicApiController;\r\n\r\nnamespace Furion.Application\r\n{\r\n [ApiDescriptionSettings(Version = "1.0")]\r\n public class FurionAppService : IDynamicApiController\r\n {\r\n // V2.0.0 \u88ab\u590d\u5199\u6210 V2.1.1\r\n [ApiDescriptionSettings(Version = "2.1.1")]\r\n public string GetVersionV2_0_0()\r\n {\r\n return nameof(Furion);\r\n }\r\n }\r\n}\n'})}),"\n",(0,i.jsx)(n.p,{children:"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"}),"\n",(0,i.jsx)("img",{src:(0,c.Z)("img/versionpz.png")}),"\n",(0,i.jsxs)(n.h3,{id:"5199-groups-\u914d\u7f6e",children:["5.1.9.9 ",(0,i.jsx)(n.code,{children:"Groups"})," \u914d\u7f6e"]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"Groups"})," \u914d\u7f6e\u4e3b\u8981\u7528\u4e8e\u914d\u7f6e ",(0,i.jsx)(n.code,{children:"Swagger"})," \u5206\u7ec4\u4fe1\u606f\u3002"]}),"\n",(0,i.jsxs)(n.p,{children:["\u901a\u8fc7\u914d\u7f6e ",(0,i.jsx)(n.code,{children:"Groups"})," \u53c2\u6570\u53ef\u4ee5\u5c06",(0,i.jsx)(n.code,{children:"\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 ",(0,i.jsx)(n.code,{children:"[ApiDescriptionSettings(params Groups)]"})," \u6784\u9020\u51fd\u6570\u4f20\u5165\u6216\u6307\u5b9a ",(0,i.jsx)(n.code,{children:"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"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {5,13}",children:'using Furion.DynamicApiController;\r\n\r\nnamespace Furion.Application\r\n{\r\n [ApiDescriptionSettings("Default", "Common")]\r\n public class FurionAppService : IDynamicApiController\r\n {\r\n public string Get()\r\n {\r\n return nameof(Furion);\r\n }\r\n\r\n [ApiDescriptionSettings("Custom")]\r\n public int Get(int id)\r\n {\r\n return id;\r\n }\r\n }\r\n}\n'})}),"\n",(0,i.jsx)(n.p,{children:"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"}),"\n",(0,i.jsx)("img",{src:(0,c.Z)("img/dfz.gif")}),"\n",(0,i.jsxs)(n.h3,{id:"51910-tag-\u914d\u7f6e",children:["5.1.9.10 ",(0,i.jsx)(n.code,{children:"Tag"})," \u914d\u7f6e"]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"Tag"})," \u914d\u7f6e\u4e3b\u8981\u7528\u4e8e\u914d\u7f6e ",(0,i.jsx)(n.code,{children:"Swagger"})," \u6807\u7b7e\u5206\u7ec4\u4fe1\u606f\u53ca\u5408\u5e76\u6807\u7b7e\u3002\u4e5f\u5c31\u662f ",(0,i.jsx)(n.code,{children:"\u7ec4\u4e2d\u7ec4"}),":"]}),"\n",(0,i.jsxs)(t.Z,{defaultValue:"tag1",values:[{label:"\u6807\u7b7e\u547d\u540d",value:"tag1"},{label:"\u5408\u5e76\u6807\u7b7e",value:"tag2"}],children:[(0,i.jsxs)(o.Z,{value:"tag1",children:[(0,i.jsx)(n.h4,{id:"\u672a\u8d34\u6807\u7b7e\u4e4b\u524d",children:"\u672a\u8d34\u6807\u7b7e\u4e4b\u524d"}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers",children:"using Furion.DynamicApiController;\r\n\r\nnamespace Furion.Application\r\n{\r\n public class FurionAppService : IDynamicApiController\r\n {\r\n public string Get()\r\n {\r\n return nameof(Furion);\r\n }\r\n\r\n public int Get(int id)\r\n {\r\n return id;\r\n }\r\n }\r\n\r\n public class TestAppService : IDynamicApiController\r\n {\r\n public string Get()\r\n {\r\n return nameof(Furion);\r\n }\r\n\r\n public int Get(int id)\r\n {\r\n return id;\r\n }\r\n }\r\n}\n"})}),(0,i.jsx)(n.h4,{id:"\u8d34\u6807\u7b7e\u4e4b\u540e",children:"\u8d34\u6807\u7b7e\u4e4b\u540e"}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {5,19}",children:'using Furion.DynamicApiController;\r\n\r\nnamespace Furion.Application\r\n{\r\n [ApiDescriptionSettings(Tag = "\u5206\u7ec4\u4e00")]\r\n public class FurionAppService : IDynamicApiController\r\n {\r\n public string Get()\r\n {\r\n return nameof(Furion);\r\n }\r\n\r\n public int Get(int id)\r\n {\r\n return id;\r\n }\r\n }\r\n\r\n [ApiDescriptionSettings(Tag = "\u5206\u7ec4\u4e8c")]\r\n public class TestAppService : IDynamicApiController\r\n {\r\n public string Get()\r\n {\r\n return nameof(Furion);\r\n }\r\n\r\n public int Get(int id)\r\n {\r\n return id;\r\n }\r\n }\r\n}\n'})}),(0,i.jsx)(n.p,{children:"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"}),(0,i.jsx)("img",{src:(0,c.Z)("img/tag1.png")})]}),(0,i.jsxs)(o.Z,{value:"tag2",children:[(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {5,19}",children:'using Furion.DynamicApiController;\r\n\r\nnamespace Furion.Application\r\n{\r\n [ApiDescriptionSettings(Tag = "\u5408\u5e76\u6240\u6709\u6807\u7b7e")]\r\n public class FurionAppService : IDynamicApiController\r\n {\r\n public string Get()\r\n {\r\n return nameof(Furion);\r\n }\r\n\r\n public int Get(int id)\r\n {\r\n return id;\r\n }\r\n }\r\n\r\n [ApiDescriptionSettings(Tag = "\u5408\u5e76\u6240\u6709\u6807\u7b7e")]\r\n public class TestAppService : IDynamicApiController\r\n {\r\n public string Get()\r\n {\r\n return nameof(Furion);\r\n }\r\n\r\n public int Get(int id)\r\n {\r\n return id;\r\n }\r\n }\r\n}\n'})}),(0,i.jsx)(n.p,{children:"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"}),(0,i.jsx)("img",{src:(0,c.Z)("img/tag2.png")})]})]}),"\n",(0,i.jsx)(n.admonition,{title:"\u5c0f\u77e5\u8bc6",type:"tip",children:(0,i.jsxs)(n.p,{children:["\u5982\u679c ",(0,i.jsx)(n.code,{children:"Tag"})," \u540d\u5b57\u4e00\u6837\uff0c\u5219\u4f1a\u81ea\u52a8\u5408\u5e76\uff0c\u5426\u5219\u53ea\u662f\u547d\u540d\u3002"]})}),"\n",(0,i.jsxs)(n.h2,{id:"5110-dynamicapicontrollersettings-\u914d\u7f6e",children:["5.1.10 ",(0,i.jsx)(n.code,{children:"DynamicApiControllerSettings"})," \u914d\u7f6e"]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"Furion"})," \u8fd8\u63d0\u4f9b\u52a8\u6001 ",(0,i.jsx)(n.code,{children:"WebAPI"})," \u63a5\u53e3\u4e00\u4e9b\u5168\u5c40\u914d\u7f6e\u9009\u9879\uff0c\u5982\uff1a"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"DefaultRoutePrefix"}),"\uff1a\u9ed8\u8ba4\u8def\u7531\u524d\u7f00\uff0c",(0,i.jsx)(n.code,{children:"string"}),"\uff0c\u9ed8\u8ba4 ",(0,i.jsx)(n.code,{children:"api"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"DefaultHttpMethod"}),"\uff1a\u9ed8\u8ba4\u8bf7\u6c42\u8c13\u8bcd\uff0c",(0,i.jsx)(n.code,{children:"string"}),"\uff0c\u9ed8\u8ba4\uff1a",(0,i.jsx)(n.code,{children:"POST"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"DefaultModule"}),"\uff1a\u9ed8\u8ba4\u6a21\u5757\u540d\u79f0\uff08\u533a\u57df\uff09\uff0c\u53ef\u7528\u4f5c\u63a5\u53e3\u7248\u672c\uff0c",(0,i.jsx)(n.code,{children:"string"}),"\uff0c\u9ed8\u8ba4\uff1a",(0,i.jsx)(n.code,{children:"v1"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"LowercaseRoute"}),"\uff1a\u5c0f\u5199\u8def\u7531\u683c\u5f0f\uff0c",(0,i.jsx)(n.code,{children:"bool"}),"\uff0c\u9ed8\u8ba4\uff1a",(0,i.jsx)(n.code,{children:"true"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"AsLowerCamelCase"}),"\uff1a\u542f\u7528\u5c0f\u9a7c\u5cf0\u547d\u540d\uff08\u9996\u5b57\u6bcd\u5c0f\u5199\uff09\uff0c\u9ed8\u8ba4 ",(0,i.jsx)(n.code,{children:"false"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"KeepVerb"}),"\uff1a\u662f\u5426\u4fdd\u7559\u52a8\u4f5c\u8c13\u8bcd\uff0c",(0,i.jsx)(n.code,{children:"bool"}),"\uff0c\u9ed8\u8ba4\uff1a",(0,i.jsx)(n.code,{children:"false"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"KeepName"}),"\uff1a\u662f\u5426\u4fdd\u7559\u9ed8\u8ba4\u540d\u79f0\uff0c",(0,i.jsx)(n.code,{children:"bool"}),"\uff0c\u9ed8\u8ba4\uff1a",(0,i.jsx)(n.code,{children:"fasle"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"CamelCaseSeparator"}),"\uff1a\u9a86\u9a7c(\u9a7c\u5cf0)/\u5e15\u65af\u5361\u547d\u540d\u5206\u9694\u7b26\uff0c",(0,i.jsx)(n.code,{children:"string"}),"\uff0c\u9ed8\u8ba4\uff1a",(0,i.jsx)(n.code,{children:"-"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"VersionSeparator"}),"\uff1a\u7248\u672c\u5206\u9694\u7b26\uff0c",(0,i.jsx)(n.code,{children:"string"}),"\uff0c\u9ed8\u8ba4\uff1a",(0,i.jsx)(n.code,{children:"@"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"ModelToQuery"}),"\uff1a",(0,i.jsx)(n.code,{children:"GET/HEAD"})," \u8bf7\u6c42\u5c06 ",(0,i.jsx)(n.code,{children:"\u7c7b\u7c7b\u578b\u53c2\u6570\u8f6c\u67e5\u8be2\u53c2\u6570"}),"\uff0c",(0,i.jsx)(n.code,{children:"bool"}),"\uff0c\u9ed8\u8ba4 ",(0,i.jsx)(n.code,{children:"false"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"SupportedMvcController"}),"\uff1a\u662f\u5426\u652f\u6301 ",(0,i.jsx)(n.code,{children:"Mvc Controller"})," \u52a8\u6001\u914d\u7f6e\uff0c",(0,i.jsx)(n.code,{children:"bool"}),"\uff0c\u9ed8\u8ba4 ",(0,i.jsx)(n.code,{children:"false"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"UrlParameterization"}),"\uff1a\u8def\u7531\u53c2\u6570\u91c7\u7528 ",(0,i.jsx)(n.code,{children:"[FromQuery]"})," \u5316\uff0c\u9ed8\u8ba4 ",(0,i.jsx)(n.code,{children:"false"}),"\uff08",(0,i.jsx)(n.code,{children:"[FromRoute]"})," \u65b9\u5f0f\uff09"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"DefaultArea"}),"\uff1a\u914d\u7f6e\u9ed8\u8ba4\u533a\u57df\uff0c\u9ed8\u8ba4 ",(0,i.jsx)(n.code,{children:"null"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"ForceWithRoutePrefix"}),"\uff1a\u914d\u7f6e\u662f\u5426\u5f3a\u5236\u6dfb\u52a0 ",(0,i.jsx)(n.code,{children:"DefaultRoutePrefix"}),"\uff0c\u5f53\u63a7\u5236\u5668\u81ea\u5b9a\u4e49\u4e86 ",(0,i.jsx)(n.code,{children:"[Route]"})," \u6709\u6548\uff0c",(0,i.jsx)(n.strong,{children:"\u4ec5\u9650 v3.4.1+\u7248\u672c\u6709\u6548"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"AbandonControllerAffixes"}),"\uff1a\u9ed8\u8ba4\u53bb\u9664\u63a7\u5236\u5668\u540d\u79f0\u524d\u540e\u7f00\u5217\u8868\u540d\uff0c",(0,i.jsx)(n.code,{children:"string[]"}),"\uff0c\u9ed8\u8ba4\uff1a","\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.code,{children:"AppServices"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.code,{children:"AppService"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.code,{children:"ApiController"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.code,{children:"Controller"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.code,{children:"Services"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.code,{children:"Service"})}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"AbandonActionAffixes"}),"\uff1a\u9ed8\u8ba4\u53bb\u9664\u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0\u524d\u540e\u7f00\u5217\u8868\u540d\uff0c",(0,i.jsx)(n.code,{children:"string[]"}),"\uff0c\u9ed8\u8ba4\uff1a","\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.code,{children:"Async"})}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"VerbToHttpMethods"}),"\uff1a\u590d\u5199\u9ed8\u8ba4\u65b9\u6cd5\u540d\u8f6c ",(0,i.jsx)(n.code,{children:"[HttpMethod]"})," \u89c4\u5219\uff0c",(0,i.jsx)(n.code,{children:"string[][]"})," \u4e8c\u7ef4\u6570\u7ec4\u7c7b\u578b\uff0c\u5185\u7f6e\u5339\u914d\u89c4\u5219\u4e3a\uff1a","\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers",children:'["post"] = "POST",\r\n["add"] = "POST",\r\n["create"] = "POST",\r\n["insert"] = "POST",\r\n["submit"] = "POST",\r\n["get"] = "GET",\r\n["find"] = "GET",\r\n["fetch"] = "GET",\r\n["query"] = "GET",\r\n["put"] = "PUT",\r\n["update"] = "PUT",\r\n["delete"] = "DELETE",\r\n["remove"] = "DELETE",\r\n["clear"] = "DELETE",\r\n["patch"] = "PATCH"\n'})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"\u590d\u5199\u793a\u4f8b"}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-json",metastring:"showLineNumbers",children:'"DynamicApiControllerSettings": {\r\n "VerbToHttpMethods": [\r\n [ "getall", "HEAD" ], // => getall \u4f1a\u88ab\u590d\u5199\u4e3a `[HttpHead]`\r\n [ "other", "PUT" ] // => \u65b0\u589e\u4e00\u6761\u65b0\u89c4\u5219\uff0c\u6bd4\u5982\uff0c\u4e00 `[other]` \u5f00\u5934\u4f1a\u8f6c\u6362\u4e3a `[HttpPut]` \u8bf7\u6c42\r\n ]\r\n }\n'})}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.h3,{id:"51101-\u652f\u6301-mvc-\u63a7\u5236\u5668-\u52a8\u6001\u914d\u7f6e",children:["5.1.10.1 \u652f\u6301 ",(0,i.jsx)(n.code,{children:"Mvc \u63a7\u5236\u5668"})," \u52a8\u6001\u914d\u7f6e"]}),"\n",(0,i.jsxs)(n.p,{children:["\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c",(0,i.jsx)(n.code,{children:"Furion"})," \u52a8\u6001 ",(0,i.jsx)(n.code,{children:"WebAPI"})," \u63a5\u53e3\u4e0d\u5bf9 ",(0,i.jsx)(n.code,{children:"ControllerBase"})," \u7c7b\u578b\u8fdb\u884c\u4efb\u4f55\u5904\u7406\u3002\u5f53\u7136\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u624b\u52a8\u542f\u7528 ",(0,i.jsx)(n.code,{children:"ControllerBase"})," \u652f\u6301\u3002"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-json",metastring:'showLineNumbers {2-4} title="Furion.Web.Entry/appsettings.json"',children:'{\r\n "DynamicApiControllerSettings": {\r\n "SupportedMvcController": true\r\n }\r\n}\n'})}),"\n",(0,i.jsxs)(n.p,{children:["\u8bbe\u7f6e ",(0,i.jsx)(n.code,{children:"SupportedMvcController: true"})," \u540e\uff0c",(0,i.jsx)(n.code,{children:"Mvc ControllerBase"})," \u7c7b\u578b\u4e5f\u80fd\u548c\u52a8\u6001 ",(0,i.jsx)(n.code,{children:"WebAPI"})," \u4e00\u6837\u7684\u7075\u6d3b\u4e86\u3002\u4ee3\u7801\u5982\u4e0b\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {5}",children:"using Microsoft.AspNetCore.Mvc;\r\n\r\nnamespace Furion.Web.Entry.Controllers\r\n{\r\n public class MvcController : ControllerBase\r\n {\r\n public string Get()\r\n {\r\n return nameof(Furion);\r\n }\r\n }\r\n}\r\n\n"})}),"\n",(0,i.jsxs)(n.admonition,{title:"\u6ce8\u610f\u4e8b\u9879",type:"warning",children:[(0,i.jsxs)(n.p,{children:["\u542f\u7528\u8be5\u914d\u7f6e\u540e\uff0c\u5982\u679c ",(0,i.jsx)(n.code,{children:"Mvc \u63a7\u5236\u5668"})," \u6ca1\u6709\u4efb\u4f55 ",(0,i.jsx)(n.code,{children:"[Route]"})," \u7279\u6027\uff0c\u4f46\u662f\u8d34\u4e86 ",(0,i.jsx)(n.code,{children:"[ApiController]"})," \u7279\u6027\u5c06\u4f1a\u62a5\u9519\u3002\u539f\u56e0\u662f ",(0,i.jsx)(n.code,{children:"[ApiController]"})," \u7279\u6027\u5185\u90e8\u505a\u4e86\u8def\u7531\u7279\u6027\u68c0\u6d4b\u3002\u6240\u4ee5\u5efa\u8bae\u4f7f\u7528 ",(0,i.jsx)(n.code,{children:"[ApiDataValidation]"})," \u4ee3\u66ff\u3002"]}),(0,i.jsxs)(n.p,{children:["\u67e5\u770b ",(0,i.jsx)(n.a,{href:"https://github.com/dotnet/aspnetcore/blob/c565386a3ed135560bc2e9017aa54a950b4e35dd/src/Mvc/Mvc.Core/src/ApplicationModels/ApiBehaviorApplicationModelProvider.cs#L90",children:"ASP.NET Core - ApiBehaviorApplicationModelProvider \u6e90\u7801"})]})]}),"\n",(0,i.jsx)(n.h2,{id:"5111-\u5173\u4e8e-aop-\u62e6\u622a",children:"5.1.11 \u5173\u4e8e AOP \u62e6\u622a"}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"\u52a8\u6001WebAPI"})," \u652f\u6301 ",(0,i.jsx)(n.code,{children:"Controller"})," \u7684\u6240\u6709\u8fc7\u6ee4\u5668/\u7b5b\u9009\u5668\u62e6\u622a\uff0c\u4e5f\u5c31\u662f\u53ef\u4ee5\u901a\u8fc7 ",(0,i.jsx)(n.code,{children:"ActionFilter"}),"\uff0c",(0,i.jsx)(n.code,{children:"ResultFilter"})," \u8fdb\u884c\u62e6\u622a\u64cd\u4f5c\u3002\u5982\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {1,3}",children:"public class SampleAsyncActionFilter : IAsyncActionFilter\r\n{\r\n public async Task OnActionExecutionAsync(ActionExecutingContext context,ActionExecutionDelegate next)\r\n {\r\n // \u62e6\u622a\u4e4b\u524d\r\n\r\n var resultContext = await next();\r\n\r\n // \u62e6\u622a\u4e4b\u540e\r\n\r\n // \u5f02\u5e38\u62e6\u622a\r\n if(resultContext.Exception != null)\r\n {\r\n\r\n }\r\n }\r\n}\n"})}),"\n",(0,i.jsxs)(n.p,{children:["\u8be6\u7ec6\u7528\u6cd5\u53ef\u53c2\u89c1 ",(0,i.jsx)(n.a,{href:"https://docs.microsoft.com/zh-cn/aspnet/core/mvc/controllers/filters?view=aspnetcore-5.0",children:"ASP.NET Core 5.0 - \u7b5b\u9009\u5668"})]}),"\n",(0,i.jsxs)(n.h2,{id:"5112-\u8bbe\u7f6e-api-\u8d85\u65f6\u8bf7\u6c42\u65f6\u95f4",children:["5.1.12 \u8bbe\u7f6e ",(0,i.jsx)(n.code,{children:"api"})," \u8d85\u65f6\u8bf7\u6c42\u65f6\u95f4"]}),"\n",(0,i.jsxs)(n.p,{children:["\u5728 ",(0,i.jsx)(n.code,{children:"Program.cs"})," \u4e2d\u6dfb\u52a0 ",(0,i.jsx)(n.code,{children:".UseKestrel"})," \u914d\u7f6e\u5373\u53ef\uff0c\u5982\uff1a"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.code,{children:".NET5 \u7248\u672c"})}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {8-12}",children:"public static IHostBuilder CreateHostBuilder(string[] args)\r\n{\r\n return Host.CreateDefaultBuilder(args)\r\n .ConfigureWebHostDefaults(webBuilder =>\r\n {\r\n webBuilder.Inject()\r\n .UseStartup<Startup>()\r\n .UseKestrel(option =>\r\n {\r\n option.Limits.KeepAliveTimeout = TimeSpan.FromMinutes(20);\r\n option.Limits.RequestHeadersTimeout = TimeSpan.FromMinutes(20);\r\n });\r\n });\r\n}\n"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.code,{children:".NET6 \u7248\u672c"})}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {3-7}",children:"var app = builder.Build();\r\n\r\napp.Configuration.Get<WebHostBuilder>().ConfigureKestrel(x =>\r\n{\r\n x.Limits.KeepAliveTimeout = TimeSpan.FromMinutes(20);\r\n x.Limits.RequestHeadersTimeout = TimeSpan.FromMinutes(20);\r\n});\n"})}),"\n",(0,i.jsxs)(n.h2,{id:"5113-\u83b7\u53d6\u8def\u7531\u63a7\u5236\u5668action-\u5217\u8868",children:["5.1.13 \u83b7\u53d6\u8def\u7531/\u63a7\u5236\u5668/",(0,i.jsx)(n.code,{children:"Action"})," \u5217\u8868"]}),"\n",(0,i.jsxs)(n.p,{children:["\u6709\u65f6\u5019\u6211\u4eec\u9700\u8981\u83b7\u53d6\u5f53\u524d\u8def\u7531\u4fe1\u606f\uff0c\u6216\u6240\u6709\u63a7\u5236\u5668\u3001",(0,i.jsx)(n.code,{children:"Action"})," \u5217\u8868\uff0c\u800c\u5df2\u901a\u8fc7\u4ee5\u4e0b\u4ee3\u7801\u83b7\u53d6\uff1a"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.strong,{children:"\u83b7\u53d6\u5f53\u524d\u8def\u7531\u8868\u4fe1\u606f\uff08\u7b80\u6613\uff09"})}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {4,11,14}",children:"public class MetadataService : IDynamicApiController\r\n{\r\n private readonly IHttpContextAccessor _httpContextAccessor;\r\n public MetadataService(IHttpContextAccessor httpContextAccessor)\r\n {\r\n _httpContextAccessor = httpContextAccessor;\r\n }\r\n\r\n public RouteValueDictionary Print()\r\n {\r\n var routeValuesFeature = _httpContextAccessor.HttpContext.Features.Get<IRouteValuesFeature>();\r\n\r\n // \u83b7\u53d6\u8def\u7531\u4fe1\u606f\r\n var routeValues = routeValuesFeature.RouteValues;\r\n\r\n return routeValues;\r\n }\r\n}\n"})}),"\n",(0,i.jsx)(n.p,{children:"\u8f93\u51fa\uff1a"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-json",metastring:"showLineNumbers",children:'{\r\n "action": "print",\r\n "controller": "metadata"\r\n}\n'})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.strong,{children:"\u83b7\u53d6\u5f53\u524d\u7ec8\u70b9\u8def\u7531\u4fe1\u606f\uff08\u7b80\u6613\uff09"})}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {4,9,12,14-17,19-21}",children:'public class MetadataService : IDynamicApiController\r\n{\r\n private readonly IHttpContextAccessor _httpContextAccessor;\r\n public MetadataService(IHttpContextAccessor httpContextAccessor)\r\n {\r\n _httpContextAccessor = httpContextAccessor;\r\n }\r\n\r\n [Description("\u8fd9\u662f\u4e00\u6bb5\u63cf\u8ff0")]\r\n public void Print()\r\n {\r\n var endpointFeature = _httpContextAccessor.HttpContext.Features.Get<IEndpointFeature>();\r\n\r\n // \u83b7\u53d6\u8def\u7531\u7ec8\u70b9\u4fe1\u606f\r\n var routeEndpoint = endpointFeature.Endpoint as RouteEndpoint;\r\n var displayName = routeEndpoint.DisplayName; // \u8def\u7531\u6620\u5c04\u65b9\u6cd5 FullName\r\n var routePattern = routeEndpoint.RoutePattern; // \u8def\u7531\u8868\u8fbe\u5f0f\uff08\u8def\u5f84\uff09\r\n\r\n // \u83b7\u53d6\u8def\u7531\u5143\u6570\u636e\uff08\u7279\u6027\uff09\r\n var metadata = routeEndpoint.Metadata;\r\n var attribute = metadata.GetMetadata<DescriptionAttribute>(); // \u83b7\u53d6 [Description] \u7279\u6027\r\n }\r\n}\n'})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.strong,{children:"\u83b7\u53d6\u6240\u6709\u63a7\u5236\u5668\u5217\u8868"})}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {4,11-12,15}",children:"public class MetadataService : IDynamicApiController\r\n{\r\n private readonly ApplicationPartManager _applicationPartManager;\r\n public MetadataService(ApplicationPartManager applicationPartManager)\r\n {\r\n _applicationPartManager = applicationPartManager;\r\n }\r\n\r\n public void Print()\r\n {\r\n var controllerFeature = new ControllerFeature();\r\n _applicationPartManager.PopulateFeature(controllerFeature);\r\n\r\n // \u83b7\u53d6\u6240\u6709\u63a7\u5236\u5668\u5217\u8868\r\n IList<TypeInfo> controllers = controllerFeature.Controllers;\r\n }\r\n}\n"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsxs)(n.strong,{children:["\u83b7\u53d6\u6240\u6709 ",(0,i.jsx)(n.code,{children:"Action"})," \u5217\u8868\uff08\u5f3a\u5927\uff09"]})}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {4,12,16-25}",children:"public class MetadataService : IDynamicApiController\r\n{\r\n private readonly IActionDescriptorCollectionProvider _actionDescriptorCollectionProvider;\r\n public MetadataService(IActionDescriptorCollectionProvider actionDescriptorCollectionProvider)\r\n {\r\n _actionDescriptorCollectionProvider = actionDescriptorCollectionProvider;\r\n }\r\n\r\n public void Print()\r\n {\r\n // \u83b7\u53d6\u6240\u6709 Action \u5217\u8868\r\n var actionDescriptors = _actionDescriptorCollectionProvider.ActionDescriptors.Items;\r\n\r\n foreach (ActionDescriptor actionDescriptor in actionDescriptors)\r\n {\r\n // \u83b7\u53d6\u8bf7\u6c42\u7684\u65b9\u6cd5\r\n var method = (actionDescriptor as ControllerActionDescriptor).MethodInfo;\r\n\r\n // \u83b7\u53d6\u8def\u7531\u5730\u5740\r\n var route = actionDescriptor.AttributeRouteInfo.Template;\r\n\r\n // \u83b7\u53d6 HttpMethod\r\n var httpMethod = actionDescriptor.ActionConstraints?.OfType<HttpMethodActionConstraint>().FirstOrDefault()?.HttpMethods.First();\r\n\r\n // \u4efb\u4f55\u5173\u4e8e\u8fd9\u4e2a\u8def\u7531/\u65b9\u6cd5/\u63a7\u5236\u5668/\u7279\u6027\u7684\u4fe1\u606f\u90fd\u6709\r\n }\r\n }\r\n}\n"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsxs)(n.strong,{children:["\u83b7\u53d6\u6240\u6709 ",(0,i.jsx)(n.code,{children:"Action"})," \u5217\u8868\u5e26\u5206\u7ec4\u4fe1\u606f\uff08\u5f3a\u5927\uff09"]})}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {4,12,17,21-36}",children:"public class MetadataService : IDynamicApiController\r\n{\r\n private readonly IApiDescriptionGroupCollectionProvider _apiDescriptionGroupCollectionProvider;\r\n public MetadataService(IApiDescriptionGroupCollectionProvider apiDescriptionGroupCollectionProvider)\r\n {\r\n _apiDescriptionGroupCollectionProvider = apiDescriptionGroupCollectionProvider;\r\n }\r\n\r\n public void Print()\r\n {\r\n // \u83b7\u53d6\u6240\u6709\u63a7\u5236\u5668\u5217\u8868\r\n var apiDescriptionGroups = _apiDescriptionGroupCollectionProvider.ApiDescriptionGroups.Items;\r\n\r\n foreach (ApiDescriptionGroup group in apiDescriptionGroups)\r\n {\r\n // \u83b7\u53d6\u5f53\u524d\u5206\u7ec4\u7684\u6240\u6709 Actions\r\n var actions = group.Items;\r\n\r\n foreach (ApiDescription action in actions)\r\n {\r\n // \u8def\u7531\u5730\u5740\r\n var route = action.RelativePath;\r\n\r\n // HttpMethod\r\n var httpMethod = action.HttpMethod;\r\n\r\n // \u5206\u7ec4\u540d\r\n var groupName = action.GroupName;\r\n\r\n // Action \u63cf\u8ff0\u5668\r\n var actionDescriptor = action.ActionDescriptor;\r\n\r\n // \u83b7\u53d6\u8bf7\u6c42\u7684\u65b9\u6cd5\r\n var method = (actionDescriptor as ControllerActionDescriptor).MethodInfo;\r\n\r\n // \u4efb\u4f55\u5173\u4e8e\u8fd9\u4e2a\u8def\u7531/\u65b9\u6cd5/\u63a7\u5236\u5668/\u7279\u6027\u7684\u4fe1\u606f\u90fd\u6709\r\n }\r\n }\r\n }\r\n}\n"})}),"\n",(0,i.jsxs)(n.h2,{id:"5114-\u63d2\u4ef6\u5316-idynamicapiruntimechangeprovider",children:["5.1.14 \u63d2\u4ef6\u5316 ",(0,i.jsx)(n.code,{children:"IDynamicApiRuntimeChangeProvider"})]}),"\n",(0,i.jsx)(n.admonition,{title:"\u7248\u672c\u8bf4\u660e",type:"important",children:(0,i.jsxs)(n.p,{children:["\u4ee5\u4e0b\u5185\u5bb9\u4ec5\u9650 ",(0,i.jsx)(n.code,{children:"Furion 4.8.8.8 +"})," \u7248\u672c\u4f7f\u7528\u3002"]})}),"\n",(0,i.jsxs)(n.p,{children:["\u5728\u4e00\u4e9b\u7279\u5b9a\u7684\u9700\u6c42\u4e2d\uff0c\u6211\u4eec\u9700\u8981\u5728\u8fd0\u884c\u65f6",(0,i.jsxs)(n.strong,{children:["\u52a8\u6001\u7f16\u8bd1\u4ee3\u7801\uff0c\u5982\u52a8\u6001\u7f16\u5199 ",(0,i.jsx)(n.code,{children:"WebAPI"})]}),"\uff0c\u4e4b\u540e\u80fd\u591f\u5728\u4e0d\u91cd\u542f\u4e3b\u673a\u670d\u52a1\u7684\u60c5\u51b5\u4e0b\u5373\u53ef\u6709\u6548\u3002\u6bd4\u5982\u8fd9\u91cc\u52a8\u6001\u6dfb\u52a0 ",(0,i.jsx)(n.code,{children:"SomeClass"})," \u52a8\u6001 ",(0,i.jsx)(n.code,{children:"WebAPI"}),"\uff0c\u7136\u540e\u5728 ",(0,i.jsx)(n.code,{children:"Swagger/\u8def\u7531\u7cfb\u7edf"})," \u4e2d\u7acb\u5373\u6709\u6548\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {10,21-30,36-39}",children:'using Furion;\r\nusing Furion.DynamicApiController;\r\nusing Microsoft.AspNetCore.Mvc;\r\n\r\nnamespace YourProject.Application;\r\n\r\npublic class PluginApiServices : IDynamicApiController\r\n{\r\n private readonly IDynamicApiRuntimeChangeProvider _provider;\r\n public PluginApiServices(IDynamicApiRuntimeChangeProvider provider)\r\n {\r\n _provider = provider;\r\n }\r\n\r\n /// <summary>\r\n /// \u52a8\u6001\u6dfb\u52a0 WebAPI/Controller\r\n /// </summary>\r\n /// <param name="csharpCode"></param>\r\n /// <param name="assemblyName">\u53ef\u81ea\u884c\u6307\u5b9a\u7a0b\u5e8f\u96c6\u540d\u79f0</param>\r\n /// <returns></returns>\r\n public string Compile([FromBody] string csharpCode, [FromQuery] string assemblyName = default)\r\n {\r\n // \u7f16\u8bd1 C# \u4ee3\u7801\u5e76\u8fd4\u56de\u52a8\u6001\u7a0b\u5e8f\u96c6\r\n var dynamicAssembly = App.CompileCSharpClassCode(csharpCode, assemblyName);\r\n\r\n // \u5c06\u7a0b\u5e8f\u96c6\u6dfb\u52a0\u8fdb\u52a8\u6001 WebAPI \u5e94\u7528\u90e8\u4ef6\r\n _provider.AddAssembliesWithNotifyChanges(dynamicAssembly);\r\n\r\n // \u8fd4\u56de\u52a8\u6001\u7a0b\u5e8f\u96c6\u540d\u79f0\r\n return dynamicAssembly.GetName().Name;\r\n }\r\n\r\n /// <summary>\r\n /// \u79fb\u9664\u52a8\u6001\u7a0b\u5e8f\u96c6 WebAPI/Controller\r\n /// </summary>\r\n public void Remove(string assemblyName)\r\n {\r\n _provider.RemoveAssembliesWithNotifyChanges(assemblyName);\r\n }\r\n}\n'})}),"\n",(0,i.jsxs)(n.p,{children:["\u8fd9\u65f6\u53ea\u9700\u8981\u8bf7\u6c42 ",(0,i.jsx)(n.code,{children:"api/plugin-api/compile"})," \u63a5\u53e3\u540c\u65f6\u8bbe\u7f6e\u8bf7\u6c42 ",(0,i.jsx)(n.code,{children:"Content-Type"})," \u4e3a ",(0,i.jsx)(n.code,{children:"text/plain"}),"\uff0c\u63a5\u4e0b\u6765\u4f20\u5165 ",(0,i.jsx)(n.code,{children:"C# \u4ee3\u7801\u5b57\u7b26\u4e32"})," \u5373\u53ef\uff0c\u5982\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:'showLineNumbers title="\u52a8\u6001C#\u4ee3\u7801\u5b57\u7b26\u4e32"',children:"using Furion.DynamicApiController;\r\n\r\nnamespace YourProject.Application;\r\n\r\npublic class SomeClass : IDynamicApiController\r\n{\r\n public string GetName()\r\n {\r\n return nameof(Furion);\r\n }\r\n}\n"})}),"\n",(0,i.jsx)("img",{src:(0,c.Z)("img/dr1.png")}),"\n",(0,i.jsxs)(n.p,{children:["\u4e4b\u540e\u5237\u65b0\u6d4f\u89c8\u5668\u5373\u53ef\u770b\u5230\u6700\u65b0\u7684 ",(0,i.jsx)(n.code,{children:"API"}),"\uff1a"]}),"\n",(0,i.jsx)("img",{src:(0,c.Z)("img/dr2.png")}),"\n",(0,i.jsxs)(n.p,{children:["\u8fd8\u53ef\u4ee5\u5728\u8fd0\u884c\u65f6\u52a8\u6001\u5378\u8f7d\uff0c\u4f7f\u7528 ",(0,i.jsx)(n.code,{children:"DELETE"})," \u8bf7\u6c42 ",(0,i.jsx)(n.code,{children:"api/plugin-api"})," \u5373\u53ef\u3002"]}),"\n",(0,i.jsx)(n.h2,{id:"5115-\u53cd\u9988\u4e0e\u5efa\u8bae",children:"5.1.15 \u53cd\u9988\u4e0e\u5efa\u8bae"}),"\n",(0,i.jsx)(n.admonition,{title:"\u4e0e\u6211\u4eec\u4ea4\u6d41",type:"note",children:(0,i.jsxs)(n.p,{children:["\u7ed9 Furion \u63d0 ",(0,i.jsx)(n.a,{href:"https://gitee.com/dotnetchina/Furion/issues/new?issue",children:"Issue"}),"\u3002"]})})]})}function j(e={}){const{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(u,{...e})}):u(e)}},5162:(e,n,r)=>{r.d(n,{Z:()=>c});r(7294);var i=r(4334);const s={tabItem:"tabItem_Ymn6"};var l=r(5893);function c(e){let{children:n,hidden:r,className:c}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,i.Z)(s.tabItem,c),hidden:r,children:n})}},4866:(e,n,r)=>{r.d(n,{Z:()=>y});var i=r(7294),s=r(4334),l=r(2466),c=r(6550),t=r(469),o=r(1980),d=r(7392),a=r(12);function h(e){return i.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,i.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad <Tabs> child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the <Tabs> component should be <TabItem>, and every <TabItem> should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function p(e){const{values:n,children:r}=e;return(0,i.useMemo)((()=>{const e=n??function(e){return h(e).map((e=>{let{props:{value:n,label:r,attributes:i,default:s}}=e;return{value:n,label:r,attributes:i,default:s}}))}(r);return function(e){const n=(0,d.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in <Tabs>. Every value needs to be unique.`)}(e),e}),[n,r])}function x(e){let{value:n,tabValues:r}=e;return r.some((e=>e.value===n))}function u(e){let{queryString:n=!1,groupId:r}=e;const s=(0,c.k6)(),l=function(e){let{queryString:n=!1,groupId:r}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!r)throw new Error('Docusaurus error: The <Tabs> component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return r??null}({queryString:n,groupId:r});return[(0,o._X)(l),(0,i.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(s.location.search);n.set(l,e),s.replace({...s.location,search:n.toString()})}),[l,s])]}function j(e){const{defaultValue:n,queryString:r=!1,groupId:s}=e,l=p(e),[c,o]=(0,i.useState)((()=>function(e){let{defaultValue:n,tabValues:r}=e;if(0===r.length)throw new Error("Docusaurus error: the <Tabs> component requires at least one <TabItem> children component");if(n){if(!x({value:n,tabValues:r}))throw new Error(`Docusaurus error: The <Tabs> has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${r.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const i=r.find((e=>e.default))??r[0];if(!i)throw new Error("Unexpected error: 0 tabValues");return i.value}({defaultValue:n,tabValues:l}))),[d,h]=u({queryString:r,groupId:s}),[j,m]=function(e){let{groupId:n}=e;const r=function(e){return e?`docusaurus.tab.${e}`:null}(n),[s,l]=(0,a.Nk)(r);return[s,(0,i.useCallback)((e=>{r&&l.set(e)}),[r,l])]}({groupId:s}),g=(()=>{const e=d??j;return x({value:e,tabValues:l})?e:null})();(0,t.Z)((()=>{g&&o(g)}),[g]);return{selectedValue:c,selectValue:(0,i.useCallback)((e=>{if(!x({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);o(e),h(e),m(e)}),[h,m,l]),tabValues:l}}var m=r(2389);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var b=r(5893);function A(e){let{className:n,block:r,selectedValue:i,selectValue:c,tabValues:t}=e;const o=[],{blockElementScrollPositionUntilNextRender:d}=(0,l.o5)(),a=e=>{const n=e.currentTarget,r=o.indexOf(n),s=t[r].value;s!==i&&(d(n),c(s))},h=e=>{let n=null;switch(e.key){case"Enter":a(e);break;case"ArrowRight":{const r=o.indexOf(e.currentTarget)+1;n=o[r]??o[0];break}case"ArrowLeft":{const r=o.indexOf(e.currentTarget)-1;n=o[r]??o[o.length-1];break}}n?.focus()};return(0,b.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.Z)("tabs",{"tabs--block":r},n),children:t.map((e=>{let{value:n,label:r,attributes:l}=e;return(0,b.jsx)("li",{role:"tab",tabIndex:i===n?0:-1,"aria-selected":i===n,ref:e=>o.push(e),onKeyDown:h,onClick:a,...l,className:(0,s.Z)("tabs__item",g.tabItem,l?.className,{"tabs__item--active":i===n}),children:r??n},n)}))})}function v(e){let{lazy:n,children:r,selectedValue:s}=e;const l=(Array.isArray(r)?r:[r]).filter(Boolean);if(n){const e=l.find((e=>e.props.value===s));return e?(0,i.cloneElement)(e,{className:"margin-top--md"}):null}return(0,b.jsx)("div",{className:"margin-top--md",children:l.map(((e,n)=>(0,i.cloneElement)(e,{key:n,hidden:e.props.value!==s})))})}function C(e){const n=j(e);return(0,b.jsxs)("div",{className:(0,s.Z)("tabs-container",g.tabList),children:[(0,b.jsx)(A,{...e,...n}),(0,b.jsx)(v,{...e,...n})]})}function y(e){const n=(0,m.Z)();return(0,b.jsx)(C,{...e,children:h(e.children)},String(n))}},510:(e,n,r)=>{r.d(n,{Z:()=>B});r(7294);const i=(e,n,r)=>e?"string"==typeof e?e:e[n]||r:r;var s=r(5893);const l={display:"block"},c=e=>{let{size:n,color:r,style:c,...t}=e;const o=c?{...l,...c}:l;return(0,s.jsx)("svg",{viewBox:"0 0 1024 1024",width:n+"px",height:n+"px",style:o,...t,children:(0,s.jsx)("path",{d:"M856.4 292.8c-63.3-63.6-126.6-127.1-190.2-190.3-15.3-15.2-32.7-16.1-48.1-0.8-64.3 63.6-128.1 127.6-191.8 191.9-14 14.2-16.3 31.6-1.7 46 14.8 14.7 31.5 10.6 46.1-2.7 5.1-4.6 9.8-9.7 14.7-14.7 39.2-39.7 78.5-79.5 122.8-124.4 0 170 3 332.2-1.1 494-2.4 96.4-91.2 174.6-187.4 176.6-110.6 2.3-198.6-84.4-199-197.4-0.6-136.3-0.2-272.6-0.1-408.9 0-21.8-7.9-37.4-31.2-39.9-18.9-2-33.2 13.2-33.1 37.5 0 145.8-3.4 291.7 2.4 437.2 6 152.1 160.4 263.5 309.5 230.5C591.8 900 672.8 797.2 673.6 664.6c0.8-144 0.2-288.1 0.2-432.1v-33.3c11.2 10.2 17.6 15.4 23.3 21.3 38.5 38.4 76.7 77 115.3 115.2 14.8 14.6 32.2 19.2 47.8 2.9 13.8-14.8 10.3-31.7-3.8-45.8z",fill:i(r,0,"#333333")})})};c.defaultProps={size:18};const t=c,o={display:"block"},d=e=>{let{size:n,color:r,style:l,...c}=e;const t=l?{...o,...l}:o;return(0,s.jsxs)("svg",{viewBox:"0 0 1024 1024",width:n+"px",height:n+"px",style:t,...c,children:[(0,s.jsx)("path",{d:"M143.872 768a51.2 51.2 0 0 1-15.36-2.56 51.2 51.2 0 0 1-35.328-51.2V283.136a148.992 148.992 0 0 1 141.824-153.6h450.56a148.992 148.992 0 0 1 141.824 153.6V512a148.992 148.992 0 0 1-141.824 153.6H244.224l-60.928 80.896a51.2 51.2 0 0 1-39.424 21.504zM235.008 180.224a97.792 97.792 0 0 0-90.624 102.4v430.592L218.624 614.4h466.944a97.792 97.792 0 0 0 90.624-102.4V283.136a97.792 97.792 0 0 0-90.624-102.4z",fill:i(r,0,"#333333")}),(0,s.jsx)("path",{d:"M880.128 875.52a51.2 51.2 0 0 1-39.424-20.48l-60.928-80.896h-243.2a25.6 25.6 0 0 1 0-51.2h268.8l76.288 102.4v-295.936a25.6 25.6 0 0 1 25.6-25.6 25.6 25.6 0 0 1 25.6 25.6v293.888a51.2 51.2 0 0 1-51.2 51.2z",fill:i(r,1,"#333333")})]})};d.defaultProps={size:18};const a=d,h={display:"block"},p=e=>{let{size:n,color:r,style:l,...c}=e;const t=l?{...h,...l}:h;return(0,s.jsxs)("svg",{viewBox:"0 0 1024 1024",width:n+"px",height:n+"px",style:t,...c,children:[(0,s.jsx)("path",{d:"M223.425605 449.2744l161.632237 0 0 253.65714c0 16.954137 13.745049 30.699186 30.699186 30.699186 16.95516 0 30.699186-13.745049 30.699186-30.699186l0-284.356326c0-16.95516-13.744026-30.699186-30.699186-30.699186L291.035446 387.876028l217.23665-248.51605L733.039255 387.580293 607.104031 387.580293c-16.954137 0-30.699186 13.745049-30.699186 30.699186l0 284.652062c0 16.954137 13.745049 30.699186 30.699186 30.699186s30.699186-13.745049 30.699186-30.699186L637.803217 448.978664l164.448376 0c12.140505 0 23.140023-7.154957 28.063149-18.251689 4.922103-11.097756 2.841721-24.053835-5.307889-33.05279L530.62315 72.570829c-5.881964-6.495948-14.273075-10.134825-23.024389-10.091846-8.763594 0.076748-17.076934 3.895727-22.844288 10.494005L200.312188 398.371056c-7.92653 9.067516-9.818623 21.931498-4.839215 32.896224S211.383338 449.2744 223.425605 449.2744z",fill:i(r,0,"#333333")}),(0,s.jsx)("path",{d:"M222.354204 829.113381l581.732178 0c16.954137 0 30.699186-13.745049 30.699186-30.699186s-13.745049-30.699186-30.699186-30.699186L222.354204 767.715009c-16.954137 0-30.699186 13.745049-30.699186 30.699186S205.400067 829.113381 222.354204 829.113381z",fill:i(r,1,"#333333")}),(0,s.jsx)("path",{d:"M804.086381 896.729361 222.354204 896.729361c-16.954137 0-30.699186 13.745049-30.699186 30.699186s13.745049 30.699186 30.699186 30.699186l581.732178 0c16.954137 0 30.699186-13.745049 30.699186-30.699186S821.041542 896.729361 804.086381 896.729361z",fill:i(r,2,"#333333")})]})};p.defaultProps={size:18};const x=p,u={display:"block"},j=e=>{let{size:n,color:r,style:l,...c}=e;const t=l?{...u,...l}:u;return(0,s.jsx)("svg",{viewBox:"0 0 1024 1024",width:n+"px",height:n+"px",style:t,...c,children:(0,s.jsx)("path",{d:"M380.15463648 874.54223633c0 18.12744166-14.83154297 32.95898463-32.95898463 32.95898463s-32.95898463-14.83154297-32.95898462-32.95898463V228.9152832L172.71078883 370.86962865a33.04467773 33.04467773 0 0 1-46.60400416 0 33.04467773 33.04467773 0 0 1 0-46.6040034l197.55615234-198.14941406A32.76782227 32.76782227 0 0 1 347.0967749 116.52514674c0.03295924 0 0.06591772-0.03295924 0.09887695-0.03295924 1.54907201 0 2.90039088 0.69213867 4.41650366 0.88989258 2.66967773 0.39550781 5.40527318 0.59326172 7.94311548 1.61499049 12.03002904 4.94384766 20.59936549 16.71020508 20.59936549 30.45410156v725.0910642z m320.15698192 23.34155248a32.85351537 32.85351537 0 0 1-23.43383789 9.59106445c-0.03295924 0-0.06591772 0.03295924-0.09887696 0.03295924-1.54907201 0-2.90039088-0.69213867-4.41650365-0.92285182-2.70263697-0.36254857-5.40527318-0.56030248-7.94311549-1.61498972-12.03002904-4.91088842-20.59936549-16.67724584-20.59936473-30.42114309V149.45776367c0-18.12744166 14.83154297-32.95898463 32.95898387-32.95898463s32.95898463 14.83154297 32.95898463 32.95898463v645.60058619l141.52587916-141.92138697c12.81445313-12.82104467 33.81591797-12.82104467 46.63037109 0 12.78808619 12.81445313 12.78808619 33.77636719 0 46.60400416L700.3116184 897.88378881z",fill:i(r,0,"#333333")})})};j.defaultProps={size:18};const m=j,g={display:"block"},b=e=>{let{size:n,color:r,style:l,...c}=e;const t=l?{...g,...l}:g;return(0,s.jsx)("svg",{viewBox:"0 0 1172 1024",width:n+"px",height:n+"px",style:t,...c,children:(0,s.jsx)("path",{d:"M870.0416 250.4704a38.4 38.4 0 0 0-8.96 53.5552c13.056 18.2784 24.4224 37.8368 33.7408 58.112a38.4512 38.4512 0 0 0 50.944 18.8928 38.4512 38.4512 0 0 0 18.8416-50.944 436.0192 436.0192 0 0 0-40.96-70.6048 38.3488 38.3488 0 0 0-53.6064-9.0112zM181.4528 566.016a35.9936 35.9936 0 0 0 25.5488-10.5984L351.7952 410.624a36.096 36.096 0 1 0-51.0976-51.0976L217.6 442.5728C250.0096 278.1184 395.264 153.6 569.1392 153.6c50.7904 0 99.8912 10.3936 145.92 30.9248a38.4 38.4 0 1 0 31.232-70.0928 431.36 431.36 0 0 0-177.152-37.632c-214.6816 0-393.1136 156.416-428.4416 361.216L62.1568 359.4752a36.1984 36.1984 0 0 0-51.0976 51.0976l144.8448 144.7936a36.0448 36.0448 0 0 0 25.5488 10.6496zM978.5344 463.104a36.1984 36.1984 0 0 0-51.0976 0l-144.8448 144.7936a36.096 36.096 0 1 0 51.0976 51.0976l88.6272-88.576C894.3104 740.2496 746.8032 870.4 569.1392 870.4a357.7856 357.7856 0 0 1-325.2736-207.7184 38.4 38.4 0 1 0-69.7344 32.3072 434.3808 434.3808 0 0 0 394.9568 252.2112c215.1936 0 393.984-157.184 428.6464-362.7008l74.496 74.496a35.9936 35.9936 0 0 0 51.0976 0 36.096 36.096 0 0 0 0-51.0976l-144.7936-144.7936z",fill:i(r,0,"#333333")})})};b.defaultProps={size:18};const A=b,v={display:"block"},C=e=>{let{size:n,color:r,style:l,...c}=e;const t=l?{...v,...l}:v;return(0,s.jsxs)("svg",{viewBox:"0 0 1024 1024",width:n+"px",height:n+"px",style:t,...c,children:[(0,s.jsx)("path",{d:"M302 332a30 30 0 1 1 0-60h420a30 30 0 0 1 0 60H302zM302 542a30 30 0 0 1 0-60h420a30 30 0 0 1 0 60H302zM302 752a30 30 0 0 1 0-60h120a30 30 0 0 1 0 60H302z",fill:i(r,0,"#333333")}),(0,s.jsx)("path",{d:"M789.47 784.1a30 30 0 0 1 39.36 45.3l-144.24 125.25a30 30 0 0 1-19.68 7.35H214.85C163.4 962 122 919.46 122 867.38V156.62C122 104.54 163.4 62 214.85 62h594.3C860.6 62 902 104.54 902 156.62v529.05a30 30 0 1 1-60 0V156.62C842 137.3 827.09 122 809.15 122H214.85C196.91 122 182 137.3 182 156.62v710.76C182 886.7 196.91 902 214.85 902h438.84l135.78-117.9z",fill:i(r,1,"#333333")}),(0,s.jsx)("path",{d:"M692 931.19a30 30 0 1 1-60 0v-174.6C632 704.57 673.4 662 724.85 662h147.78a30 30 0 0 1 0 60h-147.78c-17.94 0-32.85 15.3-32.85 34.62v174.6z",fill:i(r,2,"#333333")})]})};C.defaultProps={size:18};const y=C,f={display:"block"},D=e=>{let{size:n,color:r,style:l,...c}=e;const t=l?{...f,...l}:f;return(0,s.jsxs)("svg",{viewBox:"0 0 1024 1024",width:n+"px",height:n+"px",style:t,...c,children:[(0,s.jsx)("path",{d:"M512 883.2A371.2 371.2 0 1 0 140.8 512 371.2 371.2 0 0 0 512 883.2z m0 64a435.2 435.2 0 1 1 435.2-435.2 435.2 435.2 0 0 1-435.2 435.2z",fill:i(r,0,"#333333")}),(0,s.jsx)("path",{d:"M557.056 512l122.368 122.368a31.744 31.744 0 1 1-45.056 45.056L512 557.056l-122.368 122.368a31.744 31.744 0 1 1-45.056-45.056L466.944 512 344.576 389.632a31.744 31.744 0 1 1 45.056-45.056L512 466.944l122.368-122.368a31.744 31.744 0 1 1 45.056 45.056z",fill:i(r,1,"#333333")})]})};D.defaultProps={size:18};const N=D,F={display:"block"},S=e=>{let{size:n,color:r,style:l,...c}=e;const t=l?{...F,...l}:F;return(0,s.jsxs)("svg",{viewBox:"0 0 1024 1024",width:n+"px",height:n+"px",style:t,...c,children:[(0,s.jsx)("path",{d:"M940 512H792V412c76.8 0 139-62.2 139-139 0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 34.8-28.2 63-63 63H232c-34.8 0-63-28.2-63-63 0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 76.8 62.2 139 139 139v100H84c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h148v96c0 6.5 0.2 13 0.7 19.3C164.1 728.6 116 796.7 116 876c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8 0-44.2 23.9-82.9 59.6-103.7 6 17.2 13.6 33.6 22.7 49 24.3 41.5 59 76.2 100.5 100.5S460.5 960 512 960s99.8-13.9 141.3-38.2c41.5-24.3 76.2-59 100.5-100.5 9.1-15.5 16.7-31.9 22.7-49C812.1 793.1 836 831.8 836 876c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8 0-79.3-48.1-147.4-116.7-176.7 0.4-6.4 0.7-12.8 0.7-19.3v-96h148c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM716 680c0 36.8-9.7 72-27.8 102.9-17.7 30.3-43 55.6-73.3 73.3-20.1 11.8-42 20-64.9 24.3V484c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v396.5c-22.9-4.3-44.8-12.5-64.9-24.3-30.3-17.7-55.6-43-73.3-73.3C317.7 752 308 716.8 308 680V412h408v268z",fill:i(r,0,"#333333")}),(0,s.jsx)("path",{d:"M304 280h56c4.4 0 8-3.6 8-8 0-28.3 5.9-53.2 17.1-73.5 10.6-19.4 26-34.8 45.4-45.4C450.9 142 475.7 136 504 136h16c28.3 0 53.2 5.9 73.5 17.1 19.4 10.6 34.8 26 45.4 45.4C650 218.9 656 243.7 656 272c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8 0-40-8.8-76.7-25.9-108.1-17.2-31.5-42.5-56.8-74-74C596.7 72.8 560 64 520 64h-16c-40 0-76.7 8.8-108.1 25.9-31.5 17.2-56.8 42.5-74 74C304.8 195.3 296 232 296 272c0 4.4 3.6 8 8 8z",fill:i(r,1,"#333333")})]})};S.defaultProps={size:18};const P=S,I={display:"block"},w=e=>{let{size:n,color:r,style:l,...c}=e;const t=l?{...I,...l}:I;return(0,s.jsxs)("svg",{viewBox:"0 0 1024 1024",width:n+"px",height:n+"px",style:t,...c,children:[(0,s.jsx)("path",{d:"M512 71.68c-242.688 0-440.32 197.632-440.32 440.32s197.632 440.32 440.32 440.32 440.32-197.632 440.32-440.32-197.632-440.32-440.32-440.32z m0 819.2c-208.896 0-378.88-169.984-378.88-378.88s169.984-378.88 378.88-378.88 378.88 169.984 378.88 378.88-169.984 378.88-378.88 378.88z",fill:i(r,0,"#333333")}),(0,s.jsx)("path",{d:"M542.72 261.12H481.28v220.16H261.12v61.44h220.16v220.16h61.44v-220.16h220.16V481.28h-220.16z",fill:i(r,1,"#333333")})]})};w.defaultProps={size:18};const T=w,M={display:"block"},L=e=>{let{size:n,color:r,style:l,...c}=e;const t=l?{...M,...l}:M;return(0,s.jsx)("svg",{viewBox:"0 0 1024 1024",width:n+"px",height:n+"px",style:t,...c,children:(0,s.jsx)("path",{d:"M384 896h-64v-70.4c0-15.2-10.4-28-24.8-31.2C159.2 768 64 644.8 64 496v-32h64v32c0 118.4 73.6 215.2 179.2 236 44.8 8.8 76.8 48 76.8 94.4v69.6zM704 896h-64v-70.4c0-45.6 32-85.6 76.8-94.4C822.4 711.2 896 614.4 896 496v-32h64v32c0 148.8-95.2 272-231.2 298.4-14.4 3.2-24.8 16-24.8 31.2v70.4zM512.8 640l-41.6-37.6c-147.2-133.6-244-208-244-316.8 0-88 68.8-156.8 156.8-156.8 49.6 0 97.6 23.2 128.8 60C544 152 592 128.8 641.6 128.8c88 0 156.8 68.8 156.8 156.8 0 108-96.8 183.2-244 316.8L512.8 640z",fill:i(r,0,"#333333")})})};L.defaultProps={size:18};const E=L,G={display:"block"},H=e=>{let{size:n,color:r,style:l,...c}=e;const t=l?{...G,...l}:G;return(0,s.jsx)("svg",{viewBox:"0 0 1024 1024",width:n+"px",height:n+"px",style:t,...c,children:(0,s.jsx)("path",{d:"M942.4615936 284.62787926c-14.30911886-14.12709945-37.31996786-14.05468217-51.48229632 0.21920654L517.97142983 661.27810333 139.75544149 286.45003606c-14.30911886-14.16232846-37.31996786-14.05468217-51.51948344 0.21920654-14.16232846 14.30911886-14.05468217 37.35519687 0.21920654 51.51948345l401.99014627 398.34974663c0.61847666 0.61847666 1.41897273 0.76526706 2.03940637 1.34655658 0.14483342 0.14483342 0.18201941 0.32685283 0.32685283 0.47364324 7.09877874 7.02636259 16.38375538 10.55911595 25.63154489 10.55911595 9.35739278 0 18.75001458-3.60516949 25.85075143-10.77636551l398.34974663-401.99014628C956.84312974 321.8382427 956.73548345 298.7921647 942.4615936 284.62787926z",fill:i(r,0,"#333333")})})};H.defaultProps={size:18};const V=H,z={display:"block"},R=e=>{let{size:n,color:r,style:l,...c}=e;const t=l?{...z,...l}:z;return(0,s.jsx)("svg",{viewBox:"0 0 1024 1024",width:n+"px",height:n+"px",style:t,...c,children:(0,s.jsx)("path",{d:"M81.5384064 739.37212074c14.30911886 14.12709945 37.31996786 14.05468217 51.48229632-0.21920654L506.02857017 362.72189667 884.24455851 737.54996394c14.30911886 14.16232846 37.31996786 14.05468217 51.51948344-0.21920654 14.16232846-14.30911886 14.05468217-37.35519687-0.21920654-51.51948345l-401.99014627-398.34974663c-0.61847666-0.61847666-1.41897273-0.76526706-2.03940637-1.34655658-0.14483342-0.14483342-0.18201941-0.32685283-0.32685282-0.47364324-7.09877874-7.02636259-16.38375538-10.55911595-25.6315449-10.55911595-9.35739278 0-18.75001458 3.60516949-25.85075143 10.77636551l-398.34974663 401.99014628C67.15687026 702.1617573 67.26451655 725.2078353 81.5384064 739.37212074z",fill:i(r,0,"#333333")})})};R.defaultProps={size:18};const W=R,Z=e=>{let{name:n,...r}=e;switch(n){case"youhua":return(0,s.jsx)(t,{...r});case"dayi":return(0,s.jsx)(a,{...r});case"shengji":return(0,s.jsx)(x,{...r});case"tiaozheng":return(0,s.jsx)(m,{...r});case"gengxin":return(0,s.jsx)(A,{...r});case"wendang":return(0,s.jsx)(y,{...r});case"shanchu":return(0,s.jsx)(N,{...r});case"bug":return(0,s.jsx)(P,{...r});case"xinzeng":return(0,s.jsx)(T,{...r});case"fuwu":return(0,s.jsx)(E,{...r});case"down":return(0,s.jsx)(V,{...r});case"up":return(0,s.jsx)(W,{...r})}return null},k={label:"label_p8vM",icon:"icon_knQK"};function B(e){const{children:n}=e,r={"\u65b0\u589e":{icon:"xinzeng",bgColor:"#39b54a"},"\u4fee\u590d":{icon:"bug",bgColor:"#9c26b0"},"\u6587\u6863":{icon:"wendang",bgColor:"rgb(79, 147, 255)"},"\u66f4\u65b0":{icon:"gengxin",bgColor:"#0081ff"},"\u8c03\u6574":{icon:"tiaozheng",bgColor:"#333"},"\u5347\u7ea7":{icon:"shengji",bgColor:"#e03997"},"\u79fb\u9664":{icon:"shanchu",bgColor:"#666"},"\u7b54\u7591":{icon:"dayi",bgColor:"#bbb"},"\u4f18\u5316":{icon:"youhua",bgColor:"#38e550"}};return(0,s.jsxs)("label",{className:k.label,title:n,style:{backgroundColor:r[n].bgColor},children:[(0,s.jsx)(Z,{name:r[n].icon,color:"white",size:14,className:k.icon})," ",n]})}},1151:(e,n,r)=>{r.d(n,{Z:()=>t,a:()=>c});var i=r(7294);const s={},l=i.createContext(s);function c(e){const n=i.useContext(l);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function t(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:c(e.components),i.createElement(l.Provider,{value:n},e.children)}}}]); |