"use strict";(self.webpackChunkfurion=self.webpackChunkfurion||[]).push([[2583],{5174:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>u,contentTitle:()=>a,default:()=>j,frontMatter:()=>d,metadata:()=>h,toc:()=>x});var i=r(5893),s=r(1151),c=r(510),l=r(4996),o=r(5162),t=r(4866);const d={id:"specification-document",title:"6. \u89c4\u8303\u5316\u63a5\u53e3\u6587\u6863",sidebar_label:"6. \u89c4\u8303\u5316\u63a5\u53e3\u6587\u6863 (Swagger)"},a=void 0,h={id:"specification-document",title:"6. \u89c4\u8303\u5316\u63a5\u53e3\u6587\u6863",description:"\ud83d\udcdd \u6a21\u5757\u66f4\u65b0\u65e5\u5fd7",source:"@site/docs/specification-document.mdx",sourceDirName:".",slug:"/specification-document",permalink:"/docs/specification-document",draft:!1,unlisted:!1,editUrl:"https://gitee.com/dotnetchina/Furion/tree/v4/handbook/docs/specification-document.mdx",tags:[],version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1700660755,formattedLastUpdatedAt:"Nov 22, 2023",frontMatter:{id:"specification-document",title:"6. \u89c4\u8303\u5316\u63a5\u53e3\u6587\u6863",sidebar_label:"6. \u89c4\u8303\u5316\u63a5\u53e3\u6587\u6863 (Swagger)"},sidebar:"docs",previous:{title:"5.6 Vue/React/Angular \u8bf7\u6c42\u4ee3\u7406",permalink:"/docs/clientapi"},next:{title:"7. \u53cb\u597d\u5f02\u5e38\u5904\u7406",permalink:"/docs/friendly-exception"}},u={},x=[{value:"6.1 \u4ec0\u4e48\u662f\u63a5\u53e3\u6587\u6863",id:"61-\u4ec0\u4e48\u662f\u63a5\u53e3\u6587\u6863",level:2},{value:"6.2 \u4e3a\u4ec0\u4e48\u8981\u5199\u63a5\u53e3\u6587\u6863",id:"62-\u4e3a\u4ec0\u4e48\u8981\u5199\u63a5\u53e3\u6587\u6863",level:2},{value:"6.3 \u4e3a\u4ec0\u4e48\u9700\u8981\u89c4\u8303\u5316\u6587\u6863",id:"63-\u4e3a\u4ec0\u4e48\u9700\u8981\u89c4\u8303\u5316\u6587\u6863",level:2},{value:"6.3.1 \u534f\u8bae\u89c4\u8303",id:"631-\u534f\u8bae\u89c4\u8303",level:3},{value:"6.3.2 \u63a5\u53e3\u8def\u5f84\u89c4\u8303",id:"632-\u63a5\u53e3\u8def\u5f84\u89c4\u8303",level:3},{value:"6.3.3 \u7248\u672c\u63a7\u5236\u89c4\u8303",id:"633-\u7248\u672c\u63a7\u5236\u89c4\u8303",level:3},{value:"6.3.4 \u63a5\u53e3\u547d\u540d\u89c4\u8303",id:"634-\u63a5\u53e3\u547d\u540d\u89c4\u8303",level:3},{value:"6.3.5 \u8bf7\u6c42\u53c2\u6570\u89c4\u8303",id:"635-\u8bf7\u6c42\u53c2\u6570\u89c4\u8303",level:3},{value:"6.3.6 \u8fd4\u56de\u6570\u636e\u89c4\u8303",id:"636-\u8fd4\u56de\u6570\u636e\u89c4\u8303",level:3},{value:"6.4 \u4ec0\u4e48\u662f Swagger",id:"64-\u4ec0\u4e48\u662f-swagger",level:2},{value:"6.5 Swagger \u4f7f\u7528",id:"65-swagger-\u4f7f\u7528",level:2},{value:"6.5.1 \u6ce8\u518c\u670d\u52a1",id:"651-\u6ce8\u518c\u670d\u52a1",level:3},{value:"6.5.2 \u9ed8\u8ba4\u5730\u5740",id:"652-\u9ed8\u8ba4\u5730\u5740",level:3},{value:"6.5.3 \u9ed8\u8ba4\u5206\u7ec4",id:"653-\u9ed8\u8ba4\u5206\u7ec4",level:3},{value:"6.5.4 \u6587\u6863\u6ce8\u91ca",id:"654-\u6587\u6863\u6ce8\u91ca",level:3},{value:"6.5.5 \u591a\u5206\u7ec4\u652f\u6301",id:"655-\u591a\u5206\u7ec4\u652f\u6301",level:3},{value:"6.5.6 \u591a\u5206\u7ec4\u6392\u5e8f",id:"656-\u591a\u5206\u7ec4\u6392\u5e8f",level:3},{value:"6.5.7 \u591a\u5206\u7ec4\u4fe1\u606f\u914d\u7f6e",id:"657-\u591a\u5206\u7ec4\u4fe1\u606f\u914d\u7f6e",level:3},{value:"6.5.8 \u63a7\u5236\u5668\u548c\u65b9\u6cd5\u6392\u5e8f",id:"658-\u63a7\u5236\u5668\u548c\u65b9\u6cd5\u6392\u5e8f",level:3},{value:"6.5.9 \u7ec4\u4e2d\u7ec4\uff08\u6807\u7b7e\uff09",id:"659-\u7ec4\u4e2d\u7ec4\u6807\u7b7e",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:"6.5.10 \u9ed8\u8ba4\u5c55\u5f00\u6240\u6709\u6587\u6863",id:"6510-\u9ed8\u8ba4\u5c55\u5f00\u6240\u6709\u6587\u6863",level:3},{value:"6.5.11 \u914d\u7f6e\u6587\u6863\u6807\u9898",id:"6511-\u914d\u7f6e\u6587\u6863\u6807\u9898",level:3},{value:"6.5.12 \u6388\u6743\u63a7\u5236",id:"6512-\u6388\u6743\u63a7\u5236",level:3},{value:"6.5.13 \u5728\u7ebf\u6d4b\u8bd5",id:"6513-\u5728\u7ebf\u6d4b\u8bd5",level:3},{value:"6.5.14 \u6027\u80fd\u76d1\u89c6 MiniProfiler
",id:"6514-\u6027\u80fd\u76d1\u89c6-miniprofiler",level:3},{value:"6.5.15 \u5b9a\u4e49\u63a5\u53e3\u8f93\u51fa\u7c7b\u578b",id:"6515-\u5b9a\u4e49\u63a5\u53e3\u8f93\u51fa\u7c7b\u578b",level:3},{value:"6.5.16 \u9690\u85cf\u7279\u5b9a\u5206\u7ec4",id:"6516-\u9690\u85cf\u7279\u5b9a\u5206\u7ec4",level:3},{value:"6.5.17 \u4e2d\u6587\u4e71\u7801\u95ee\u9898",id:"6517-\u4e2d\u6587\u4e71\u7801\u95ee\u9898",level:3},{value:"6.5.18 \u751f\u4ea7\u73af\u5883\u4e2d\u5173\u95ed Swagger
",id:"6518-\u751f\u4ea7\u73af\u5883\u4e2d\u5173\u95ed-swagger",level:3},{value:"6.5.19 \u8bbe\u7f6e Example Value
\u9ed8\u8ba4\u503c",id:"6519-\u8bbe\u7f6e-example-value-\u9ed8\u8ba4\u503c",level:3},{value:"6.5.20 \u81ea\u5b9a\u4e49 Swagger
\u914d\u7f6e",id:"6520-\u81ea\u5b9a\u4e49-swagger-\u914d\u7f6e",level:3},{value:"6.5.21 \u914d\u7f6e Swagger
\u7684 SchemaIds
",id:"6521-\u914d\u7f6e-swagger\u7684-schemaids",level:3},{value:"6.5.22 \u81ea\u5b9a\u4e49 swagger.json
\u8def\u7531\u6a21\u677f",id:"6522-\u81ea\u5b9a\u4e49-swaggerjson-\u8def\u7531\u6a21\u677f",level:3},{value:"6.5.23 \u5173\u4e8e application/x-www-form-urlencoded
\u8bf7\u6c42",id:"6523-\u5173\u4e8e-applicationx-www-form-urlencoded-\u8bf7\u6c42",level:3},{value:"6.5.24 Swagger
\u51fa\u73b0 CORS
\u95ee\u9898\u89e3\u51b3",id:"6524-swagger-\u51fa\u73b0-cors-\u95ee\u9898\u89e3\u51b3",level:3},{value:"6.5.25 Swagger
\u51fa\u73b0\u9ed8\u8ba4 text/xml
/text/plain
\u53c2\u6570\u95ee\u9898\u89e3\u51b3",id:"6525-swagger-\u51fa\u73b0\u9ed8\u8ba4-textxmltextplain-\u53c2\u6570\u95ee\u9898\u89e3\u51b3",level:3},{value:"6.5.26 Swagger
\u591a\u8bed\u8a00\u652f\u6301",id:"6526-swagger-\u591a\u8bed\u8a00\u652f\u6301",level:3},{value:"6.5.27 \u81ea\u5b9a\u4e49\u903b\u8f91\u63a7\u5236 Swagger
\u6bcf\u4e00\u4e2a api
\u53ef\u89c1\u6027",id:"6527-\u81ea\u5b9a\u4e49\u903b\u8f91\u63a7\u5236-swagger-\u6bcf\u4e00\u4e2a-api-\u53ef\u89c1\u6027",level:3},{value:"6.5.28 \u914d\u7f6e MVC
\u63a7\u5236\u5668\u652f\u6301\u89c4\u8303\u5316\u5904\u7406",id:"6528-\u914d\u7f6e-mvc-\u63a7\u5236\u5668\u652f\u6301\u89c4\u8303\u5316\u5904\u7406",level:3},{value:"6.5.29 Swagger
\u5237\u65b0\u8bb0\u4f4f\u6388\u6743\u72b6\u6001",id:"6529-swagger-\u5237\u65b0\u8bb0\u4f4f\u6388\u6743\u72b6\u6001",level:3},{value:"6.5.30 \u5e26\u767b\u5f55\u7684 Swagger
\u6587\u6863",id:"6530-\u5e26\u767b\u5f55\u7684-swagger-\u6587\u6863",level:3},{value:"\u914d\u7f6e\u8bf4\u660e",id:"\u914d\u7f6e\u8bf4\u660e",level:4},{value:"\u914d\u7f6e\u793a\u4f8b",id:"\u914d\u7f6e\u793a\u4f8b",level:4},{value:"6.5.31 inheritdoc
\u5b9e\u73b0\u6ce8\u91ca\u7ee7\u627f",id:"6531-inheritdoc-\u5b9e\u73b0\u6ce8\u91ca\u7ee7\u627f",level:3},{value:"6.5.32 \u542f\u7528 All Groups
\u5206\u7ec4\u529f\u80fd",id:"6532-\u542f\u7528-all-groups-\u5206\u7ec4\u529f\u80fd",level:3},{value:"6.5.33 \u63a5\u53e3\u8fc7\u65f6\u63a7\u5236",id:"6533-\u63a5\u53e3\u8fc7\u65f6\u63a7\u5236",level:3},{value:"6.5.34 \u5355\u4e00\u63a5\u53e3\u66f4\u591a\u63cf\u8ff0",id:"6534-\u5355\u4e00\u63a5\u53e3\u66f4\u591a\u63cf\u8ff0",level:3},{value:"6.5.35 Swagger
\u5f02\u5e38/\u4e0d\u80fd\u663e\u793a/\u9519\u8bef\u5904\u7406",id:"6535-swagger-\u5f02\u5e38\u4e0d\u80fd\u663e\u793a\u9519\u8bef\u5904\u7406",level:3},{value:"6.5.36 \u81ea\u5b9a\u4e49 Swagger
\u7684 SchemaId
",id:"6536-\u81ea\u5b9a\u4e49-swagger-\u7684-schemaid",level:3},{value:"6.5.37 \u81ea\u5b9a\u4e49 Swagger
\u7684 OperationId
",id:"6537-\u81ea\u5b9a\u4e49-swagger-\u7684-operationid",level:3},{value:"6.5.38 Swagger
\u63a5\u53e3\u6587\u6863\u652f\u6301\u5b8c\u6574\u7684 Markdown
",id:"6538-swagger-\u63a5\u53e3\u6587\u6863\u652f\u6301\u5b8c\u6574\u7684-markdown",level:3},{value:"6.5.39 \u7b2c\u4e09\u65b9 UI
\u96c6\u6210\uff0c\u5982 Knife4jUI
",id:"6539-\u7b2c\u4e09\u65b9-ui-\u96c6\u6210\u5982-knife4jui",level:3},{value:"6.5.40 \u6dfb\u52a0 Swagger
\u8bf7\u6c42\u54cd\u5e94\u62e6\u622a",id:"6540-\u6dfb\u52a0-swagger-\u8bf7\u6c42\u54cd\u5e94\u62e6\u622a",level:3},{value:"6.5.41 \u679a\u4e3e\u7c7b\u578b\u503c",id:"6541-\u679a\u4e3e\u7c7b\u578b\u503c",level:3},{value:"6.6 SpecificationDocumentSettings
\u914d\u7f6e",id:"66-specificationdocumentsettings-\u914d\u7f6e",level:2},{value:"6.7 \u7edf\u4e00\u8fd4\u56de\u503c\u6a21\u578b/\u89c4\u8303\u5316\u7ed3\u679c/API \u8fd4\u56de\u503c",id:"67-\u7edf\u4e00\u8fd4\u56de\u503c\u6a21\u578b\u89c4\u8303\u5316\u7ed3\u679capi-\u8fd4\u56de\u503c",level:2},{value:"6.7.1 \u6392\u9664\u89c4\u8303\u5316\u5904\u7406",id:"671-\u6392\u9664\u89c4\u8303\u5316\u5904\u7406",level:3},{value:"6.7.2 \u89c4\u8303\u5316\u7ed3\u679c\u6dfb\u52a0\u989d\u5916\u6570\u636e",id:"672-\u89c4\u8303\u5316\u7ed3\u679c\u6dfb\u52a0\u989d\u5916\u6570\u636e",level:3},{value:"6.7.3 \u81ea\u5b9a\u4e49\u7279\u522b\u63a5\u53e3\u89c4\u8303\u5316\u7ed3\u679c",id:"673-\u81ea\u5b9a\u4e49\u7279\u522b\u63a5\u53e3\u89c4\u8303\u5316\u7ed3\u679c",level:3},{value:"6.8 \u652f\u6301\u591a\u5957\u89c4\u8303\u5316\u914d\u7f6e",id:"68-\u652f\u6301\u591a\u5957\u89c4\u8303\u5316\u914d\u7f6e",level:2},{value:"6.9 \u9488\u5bf9\u7279\u5b9a\u63a7\u5236\u5668\u6216\u7279\u5b9a\u65b9\u6cd5\u914d\u7f6e\u5e8f\u5217\u5316\u9009\u9879",id:"69-\u9488\u5bf9\u7279\u5b9a\u63a7\u5236\u5668\u6216\u7279\u5b9a\u65b9\u6cd5\u914d\u7f6e\u5e8f\u5217\u5316\u9009\u9879",level:2},{value:"6.9.1 \u901a\u8fc7 JsonResult
\u8bbe\u7f6e\u7b2c\u4e8c\u4e2a\u53c2\u6570",id:"691-\u901a\u8fc7-jsonresult-\u8bbe\u7f6e\u7b2c\u4e8c\u4e2a\u53c2\u6570",level:3},{value:"6.9.2 \u6ce8\u518c\u591a\u5957\u5e8f\u5217\u5316\u914d\u7f6e\u9009\u9879 (\u63a8\u8350)",id:"692-\u6ce8\u518c\u591a\u5957\u5e8f\u5217\u5316\u914d\u7f6e\u9009\u9879-\u63a8\u8350",level:3},{value:"6.10 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"610-\u53cd\u9988\u4e0e\u5efa\u8bae",level:2}];function p(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",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.jsx)("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)(c.Z,{children:"\u65b0\u589e"})," \u89c4\u8303\u5316\u5904\u7406\u81ea\u52a8\u8fc7\u6ee4 ",(0,i.jsx)(n.code,{children:"SSE"})," \u8bf7\u6c42\u3001\u6587\u4ef6\u8bf7\u6c42\u3001\u56fe\u7247\u8bf7\u6c42 ",(0,i.jsx)("sup",{children:"4.9.1.6"})," ",(0,i.jsx)("sup",{children:"\u23f1\ufe0f2023.11.22"})," ",(0,i.jsx)(n.a,{href:"https://gitee.com/dotnetchina/Furion/issues/I8IP6D",children:"#I8IP6D"})]}),"\n",(0,i.jsxs)(n.li,{children:["\xa0",(0,i.jsx)(c.Z,{children:"\u65b0\u589e"})," \u89c4\u8303\u5316\u6587\u6863\u679a\u4e3e\u652f\u6301 ",(0,i.jsx)(n.code,{children:"[EnumToNumber]"})," \u7279\u6027\u914d\u7f6e\u751f\u6210\u524d\u7aef\u679a\u4e3e\u5b9a\u4e49\u4ee3\u7801\u662f\u5b57\u7b26\u4e32\u503c\u8fd8\u662f\u6574\u6570\u503c\u7c7b\u578b\uff0c\u9ed8\u8ba4\u4e3a\u5b57\u7b26\u4e32\u503c ",(0,i.jsx)("sup",{children:"4.8.8.35"})," ",(0,i.jsx)("sup",{children:"\u23f1\ufe0f2023.07.06"})," ",(0,i.jsx)(n.a,{href:"https://gitee.com/dotnetchina/Furion/issues/I7IZ7S",children:"#I7IZ7S"})]}),"\n",(0,i.jsxs)(n.li,{children:["\xa0",(0,i.jsx)(c.Z,{children:"\u65b0\u589e"})," ",(0,i.jsx)(n.code,{children:"Swagger"})," \u5206\u7ec4\u4fe1\u606f\u53ef\u5728\u4efb\u610f\u914d\u7f6e\u6587\u4ef6\u4e2d\u901a\u8fc7 ",(0,i.jsx)(n.code,{children:"[openapi:\u5206\u7ec4\u540d]"})," \u8fdb\u884c\u914d\u7f6e ",(0,i.jsx)("sup",{children:"4.8.8.26"})," ",(0,i.jsx)("sup",{children:"\u23f1\ufe0f2023.06.20"})," ",(0,i.jsx)(n.a,{href:"https://gitee.com/dotnetchina/Furion/commit/a70eed3ec5f3081fbdc08312fdb4770f39f27cc0",children:"a70eed3"})]}),"\n",(0,i.jsxs)(n.li,{children:["\xa0",(0,i.jsx)(c.Z,{children:"\u65b0\u589e"})," ",(0,i.jsx)(n.code,{children:"Swagger"})," \u8bf7\u6c42\u6388\u6743\u5931\u8d25\u540e\u81ea\u52a8\u9000\u51fa\u6388\u6743\u72b6\u6001 ",(0,i.jsx)("sup",{children:"4.8.6.12"})," ",(0,i.jsx)("sup",{children:"\u23f1\ufe0f2023.02.20"})," ",(0,i.jsx)(n.a,{href:"https://gitee.com/dotnetchina/Furion/pulls/717",children:"!717"})]}),"\n",(0,i.jsxs)(n.li,{children:["\xa0",(0,i.jsx)(c.Z,{children:"\u65b0\u589e"})," ",(0,i.jsx)(n.code,{children:"Swagger"})," \u542f\u7528\u767b\u5f55\u540e\u914d\u7f6e ",(0,i.jsx)(n.code,{children:"CheckUrl"})," \u53ef\u83b7\u53d6\u672c\u5730\u5b58\u50a8\u7684 ",(0,i.jsx)(n.code,{children:"Authorization"})," \u8bf7\u6c42\u62a5\u6587\u5934 ",(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/I6E3LB",children:"#I6E3LB"})]}),"\n",(0,i.jsxs)(n.li,{children:["\xa0",(0,i.jsx)(c.Z,{children:"\u65b0\u589e"})," ",(0,i.jsx)(n.code,{children:"Swagger"})," \u652f\u6301\u590d\u5236\u8def\u7531\u5730\u5740\u529f\u80fd ",(0,i.jsx)("sup",{children:"4.8.4.13"})," ",(0,i.jsx)("sup",{children:"\u23f1\ufe0f2023.01.11"})," ",(0,i.jsx)(n.a,{href:"https://gitee.com/dotnetchina/Furion/issues/I5VNJI",children:"#I5VNJI"})]}),"\n"]}),"\n"]}),"\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)(c.Z,{children:"\u4fee\u590d"})," ",(0,i.jsx)(n.code,{children:"Swagger"})," \u8fdb\u884c\u5206\u7ec4\u540e ",(0,i.jsx)(n.code,{children:"Tags"})," \u4e0d\u80fd\u8fdb\u884c\u5206\u7ec4\u8fc7\u6ee4\u95ee\u9898 ",(0,i.jsx)("sup",{children:"4.8.8.22"})," ",(0,i.jsx)("sup",{children:"\u23f1\ufe0f2023.05.25"})," ",(0,i.jsx)(n.a,{href:"https://gitee.com/dotnetchina/Furion/issues/I78A55",children:"#I78A55"})]}),"\n",(0,i.jsxs)(n.li,{children:["\xa0",(0,i.jsx)(c.Z,{children:"\u4fee\u590d"})," \u56e0 ",(0,i.jsx)(n.code,{children:"4.8.7.22"})," \u7248\u672c\u5bfc\u81f4\u52a8\u6001 ",(0,i.jsx)(n.code,{children:"WebAPI"})," \u7c7b\u578b\u6ce8\u91ca\u4e22\u5931\u95ee\u9898 ",(0,i.jsx)("sup",{children:"4.8.7.27"})," ",(0,i.jsx)("sup",{children:"\u23f1\ufe0f2023.03.29"})," ",(0,i.jsx)(n.a,{href:"https://gitee.com/dotnetchina/Furion/issues/I6QM23",children:"#I6QM23"})]}),"\n",(0,i.jsxs)(n.li,{children:["\xa0",(0,i.jsx)(c.Z,{children:"\u4fee\u590d"})," ",(0,i.jsx)(n.code,{children:"Swagger UI"})," \u4e0d\u663e\u793a ",(0,i.jsx)(n.code,{children:"ControllerBase"})," \u6d3e\u751f\u7c7b\u6ce8\u91ca ",(0,i.jsx)("sup",{children:"4.8.7.22"})," ",(0,i.jsx)("sup",{children:"\u23f1\ufe0f2023.03.27"})," ",(0,i.jsx)(n.a,{href:"https://gitee.com/dotnetchina/Furion/issues/I6QM23",children:"#I6QM23"})]}),"\n",(0,i.jsxs)(n.li,{children:["\xa0",(0,i.jsx)(c.Z,{children:"\u4fee\u590d"})," \u542f\u7528\u89c4\u8303\u5316\u7ed3\u679c\u540e\u5bfc\u81f4 ",(0,i.jsx)(n.code,{children:"WebSocket"})," \u8fde\u63a5\u65ad\u5f00\u65f6\u51fa\u73b0\u5f02\u5e38 ",(0,i.jsx)("sup",{children:"4.8.7.20"})," ",(0,i.jsx)("sup",{children:"\u23f1\ufe0f2023.03.23"})," ",(0,i.jsx)(n.a,{href:"https://gitee.com/dotnetchina/Furion/issues/I6PI5E",children:"#I6PI5E"})]}),"\n",(0,i.jsxs)(n.li,{children:["\xa0",(0,i.jsx)(c.Z,{children:"\u4fee\u590d"})," ",(0,i.jsx)(n.code,{children:"Swagger"})," \u63a5\u53e3\u6392\u5e8f\u540c\u65f6\u6307\u5b9a ",(0,i.jsx)(n.code,{children:"Tag"})," \u548c ",(0,i.jsx)(n.code,{children:"Order"})," \u4e4b\u540e\u65e0\u6548 ",(0,i.jsx)("sup",{children:"4.8.7.2"})," ",(0,i.jsx)("sup",{children:"\u23f1\ufe0f2023.03.01"})," ",(0,i.jsx)(n.a,{href:"https://gitee.com/dotnetchina/Furion/issues/I6IQDI",children:"#I6IQDI"})," ",(0,i.jsx)(n.a,{href:"https://gitee.com/dotnetchina/Furion/issues/I6IP66",children:"#I6IP66"})]}),"\n",(0,i.jsxs)(n.li,{children:["\xa0",(0,i.jsx)(c.Z,{children:"\u4fee\u590d"})," \u89c4\u8303\u5316\u7ed3\u679c\u4e0d\u5e26 ",(0,i.jsx)(n.code,{children:"mini-profiler"})," \u7248\u672c\u542f\u52a8\u767b\u5f55 ",(0,i.jsx)(n.code,{children:"UI"})," \u540e\u4e0d\u80fd\u4f20\u9012 ",(0,i.jsx)(n.code,{children:"headers"})," \u95ee\u9898 ",(0,i.jsx)("sup",{children:"4.8.6.11"})," ",(0,i.jsx)("sup",{children:"\u23f1\ufe0f2023.02.20"})," ",(0,i.jsx)(n.a,{href:"https://gitee.com/dotnetchina/Furion/issues/I6G8IR",children:"#I6G8IR"})]}),"\n",(0,i.jsxs)(n.li,{children:["\xa0",(0,i.jsx)(c.Z,{children:"\u4fee\u590d"})," ",(0,i.jsxs)(n.strong,{children:["\u89c4\u8303\u5316\u7ed3\u679c\u4e0d\u652f\u6301 ",(0,i.jsx)(n.code,{children:"OData"})," \u534f\u8bae\u63a7\u5236\u5668"]})," ",(0,i.jsx)("sup",{children:"4.8.5.5"})," ",(0,i.jsx)("sup",{children:"\u23f1\ufe0f2023.02.01"})," ",(0,i.jsx)(n.a,{href:"https://gitee.com/dotnetchina/Furion/pulls/571",children:"!571"})]}),"\n",(0,i.jsxs)(n.li,{children:["\xa0",(0,i.jsx)(c.Z,{children:"\u4fee\u590d"})," \u542f\u7528 ",(0,i.jsx)(n.code,{children:"Swagger"})," \u767b\u5f55\u529f\u80fd\u4e4b\u540e\u4e0d\u80fd\u89e6\u53d1\u54cd\u5e94\u62e6\u622a\u5668 ",(0,i.jsx)("sup",{children:"4.8.5.5"})," ",(0,i.jsx)("sup",{children:"\u23f1\ufe0f2023.02.01"})," ",(0,i.jsx)(n.a,{href:"https://gitee.com/dotnetchina/Furion/issues/I6C9A2",children:"#I6C9A2"})," ",(0,i.jsx)(n.a,{href:"https://gitee.com/dotnetchina/Furion/pulls/702",children:"!702"})," ",(0,i.jsx)(n.a,{href:"https://gitee.com/dotnetchina/Furion/pulls/703",children:"!703"})]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"\u5176\u4ed6\u8c03\u6574"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\xa0",(0,i.jsx)(c.Z,{children:"\u8c03\u6574"})," \u89c4\u8303\u5316\u6587\u6863\u679a\u4e3e\u751f\u6210 ",(0,i.jsx)(n.code,{children:"json"})," \u683c\u5f0f\uff0c\u7531 ",(0,i.jsx)(n.code,{children:"int32"})," \u6539\u4e3a ",(0,i.jsx)(n.code,{children:"string"})," ",(0,i.jsx)("sup",{children:"4.8.8.34"})," ",(0,i.jsx)("sup",{children:"\u23f1\ufe0f2023.07.02"})," ",(0,i.jsx)(n.a,{href:"https://gitee.com/dotnetchina/Furion/issues/I7HOPR",children:"#I7HOPR"})]}),"\n",(0,i.jsxs)(n.li,{children:["\xa0",(0,i.jsx)(c.Z,{children:"\u8c03\u6574"})," \u89c4\u8303\u5316\u6587\u6863\u9ed8\u8ba4 ",(0,i.jsx)(n.code,{children:"Title"})," \u89e3\u6790\u89c4\u5219\uff0c\u4e0d\u518d\u81ea\u52a8\u6dfb\u52a0\u7a7a\u683c ",(0,i.jsx)("sup",{children:"4.8.8.26"})," ",(0,i.jsx)("sup",{children:"\u23f1\ufe0f2023.06.20"})," ",(0,i.jsx)(n.a,{href:"https://gitee.com/dotnetchina/Furion/commit/24b7a4768471d312cbdff6a31739a0d9d4918c83",children:"24b7a47"})]}),"\n"]}),"\n"]}),"\n"]})})})]}),"\n","\n","\n",(0,i.jsx)(n.h2,{id:"61-\u4ec0\u4e48\u662f\u63a5\u53e3\u6587\u6863",children:"6.1 \u4ec0\u4e48\u662f\u63a5\u53e3\u6587\u6863"}),"\n",(0,i.jsx)(n.p,{children:"\u5728\u73b0\u5728\u79fb\u52a8\u4e3a\u738b\u3001\u591a\u7aef\u4e92\u8f85\u3001\u524d\u7aef\u767e\u82b1\u9f50\u653e\u7684\u5f00\u653e\u65f6\u4ee3\uff0c\u4e0d\u518d\u662f\u4e00\u4eba\u5305\u63fd\u5f0f\u5f00\u53d1\uff0c\u5927\u5bb6\u5404\u53f8\u5176\u804c\uff0c\u540e\u7aef\u5de5\u7a0b\u5e08\u8d1f\u8d23\u63a5\u53e3\u5f00\u53d1\uff0c\u524d\u7aef\u8d1f\u8d23\u63a5\u53e3\u8054\u8c03\uff0c\u4e5f\u5c31\u662f\u4e92\u8054\u7f51\u73b0\u5728\u6d41\u884c\u7684\u524d\u540e\u7aef\u5206\u79bb\u67b6\u6784\u3002"}),"\n",(0,i.jsx)(n.p,{children:"\u6240\u4ee5\u5c31\u9700\u8981\u7531\u524d\u540e\u7aef\u5de5\u7a0b\u5e08\u5171\u540c\u5b9a\u4e49\u63a5\u53e3\uff0c\u7f16\u5199\u63a5\u53e3\u6587\u6863\uff0c\u4e4b\u540e\u5927\u5bb6\u6309\u7167\u8fd9\u4e2a\u63a5\u53e3\u6587\u6863\u8fdb\u884c\u5f00\u53d1\u3001\u7ef4\u62a4\u53ca\u5f00\u653e\u7ed9\u7b2c\u4e09\u65b9\u3002"}),"\n",(0,i.jsx)(n.h2,{id:"62-\u4e3a\u4ec0\u4e48\u8981\u5199\u63a5\u53e3\u6587\u6863",children:"6.2 \u4e3a\u4ec0\u4e48\u8981\u5199\u63a5\u53e3\u6587\u6863"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"\u80fd\u591f\u8ba9\u524d\u7aef\u5f00\u53d1\u4e0e\u540e\u53f0\u5f00\u53d1\u4eba\u5458\u66f4\u597d\u7684\u914d\u5408\uff0c\u63d0\u9ad8\u5de5\u4f5c\u6548\u7387"}),"\n",(0,i.jsx)(n.li,{children:"\u9879\u76ee\u8fed\u4ee3\u6216\u8005\u9879\u76ee\u4eba\u5458\u66f4\u8fed\u65f6\uff0c\u65b9\u4fbf\u540e\u671f\u4eba\u5458\u67e5\u770b\u548c\u7ef4\u62a4"}),"\n",(0,i.jsx)(n.li,{children:"\u65b9\u4fbf\u6d4b\u8bd5\u4eba\u5458\u8fdb\u884c\u63a5\u53e3\u6d4b\u8bd5"}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"63-\u4e3a\u4ec0\u4e48\u9700\u8981\u89c4\u8303\u5316\u6587\u6863",children:"6.3 \u4e3a\u4ec0\u4e48\u9700\u8981\u89c4\u8303\u5316\u6587\u6863"}),"\n",(0,i.jsx)(n.p,{children:"\u7531\u4e8e\u6bcf\u4e2a\u516c\u53f8\u540e\u7aef\u4eba\u5458\u6280\u672f\u53c2\u5dee\u4e0d\u9f50\uff0c\u6280\u672f\u6587\u6863\u80fd\u529b\u4e5f\u4e0d\u4f8b\u5916\uff0c\u5bfc\u81f4\u63a5\u53e3\u5b9a\u4e49\u53ca\u6587\u6863\u4e94\u82b1\u516b\u95e8\uff0c\u4e0d\u540c\u9879\u76ee\u6216\u4e0d\u540c\u516c\u53f8\u5bf9\u63a5\u6781\u5176\u56f0\u96be\uff0c\u800c\u4e14\u4f53\u9a8c\u7cdf\u7cd5\u3002\u6240\u4ee5\uff0c\u65e0\u89c4\u77e9\u4e0d\u6210\u65b9\u5706\uff0c\u4e3a\u4e86\u5f00\u53d1\u4eba\u5458\u95f4\u66f4\u597d\u7684\u914d\u5408\uff0c\u8feb\u5207\u9700\u8981\u6574\u7406\u51fa\u4e00\u5957\u89c4\u8303\u3002"}),"\n",(0,i.jsx)(n.p,{children:"\u901a\u5e38\u63a5\u53e3\u89c4\u8303\u5206\u4e3a\u516d\u4e2a\u90e8\u5206\uff1a"}),"\n",(0,i.jsx)(n.h3,{id:"631-\u534f\u8bae\u89c4\u8303",children:"6.3.1 \u534f\u8bae\u89c4\u8303"}),"\n",(0,i.jsx)(n.p,{children:"\u4e3a\u4e86\u786e\u4fdd\u4e0d\u540c\u7cfb\u7edf/\u6a21\u5757\u95f4\u7684\u6570\u636e\u4ea4\u4e92\uff0c\u9700\u8981\u4e8b\u5148\u7ea6\u5b9a\u597d\u901a\u8baf\u534f\u8bae\uff0c\u5982\uff1aTCP\u3001HTTP\u3001HTTPS \u534f\u8bae\u3002\u4e3a\u4e86\u786e\u4fdd\u6570\u636e\u4ea4\u4e92\u5b89\u5168\uff0c\u5efa\u8bae\u4f7f\u7528 HTTPS \u534f\u8bae"}),"\n",(0,i.jsx)(n.h3,{id:"632-\u63a5\u53e3\u8def\u5f84\u89c4\u8303",children:"6.3.2 \u63a5\u53e3\u8def\u5f84\u89c4\u8303"}),"\n",(0,i.jsxs)(n.p,{children:["\u4f5c\u4e3a\u63a5\u53e3\u8def\u5f84\uff0c\u4e3a\u4e86\u65b9\u4fbf\u6e05\u6670\u7684\u533a\u5206\u6765\u81ea\u4e0d\u540c\u7684\u7cfb\u7edf\uff0c\u53ef\u4ee5\u91c7\u7528\u4e0d\u540c\u7cfb\u7edf/\u6a21\u5757\u540d\u4f5c\u4e3a\u63a5\u53e3\u8def\u5f84\u524d\u7f00\uff0c\u5982\uff1a\u652f\u4ed8\u6a21\u5757\uff1a",(0,i.jsx)(n.code,{children:"/pay/xxx"}),"\uff0c\u8ba2\u5355\u6a21\u5757\uff1a",(0,i.jsx)(n.code,{children:"/order/xxx"})]}),"\n",(0,i.jsx)(n.h3,{id:"633-\u7248\u672c\u63a7\u5236\u89c4\u8303",children:"6.3.3 \u7248\u672c\u63a7\u5236\u89c4\u8303"}),"\n",(0,i.jsxs)(n.p,{children:['\u4e3a\u4e86\u4fbf\u4e8e\u540e\u671f\u63a5\u53e3\u7684\u5347\u7ea7\u548c\u7ef4\u62a4\uff0c\u5efa\u8bae\u5728\u63a5\u53e3\u8def\u5f84\u4e2d\u52a0\u5165\u7248\u672c\u53f7\uff0c\u4fbf\u4e8e\u7ba1\u7406\uff0c\u5b9e\u73b0\u63a5\u53e3\u591a\u7248\u672c\u7684\u53ef\u7ef4\u62a4\u6027\u3002\u5982\uff1a\u63a5\u53e3\u8def\u5f84\u4e2d\u6dfb\u52a0\u7c7b\u4f3c"',(0,i.jsx)(n.code,{children:"v1"}),'"\u3001"',(0,i.jsx)(n.code,{children:"v2"}),'"\u7b49\u7248\u672c\u53f7']}),"\n",(0,i.jsx)(n.h3,{id:"634-\u63a5\u53e3\u547d\u540d\u89c4\u8303",children:"6.3.4 \u63a5\u53e3\u547d\u540d\u89c4\u8303"}),"\n",(0,i.jsxs)(n.p,{children:['\u548c C# \u547d\u540d\u89c4\u8303\u4e00\u6837\uff0c\u597d\u7684\u3001\u7edf\u4e00\u7684\u63a5\u53e3\u547d\u540d\u89c4\u8303\uff0c\u4e0d\u4ec5\u53ef\u4ee5\u589e\u5f3a\u5176\u53ef\u8bfb\u6027\uff0c\u800c\u4e14\u8fd8\u4f1a\u51cf\u5c11\u5f88\u591a\u4e0d\u5fc5\u8981\u7684\u53e3\u5934/\u4e66\u9762\u4e0a\u7684\u89e3\u91ca\u3002\u53ef\u4f7f\u7528"\u9a7c\u5cf0\u547d\u540d\u6cd5"\u6309\u7167\u5b9e\u73b0\u63a5\u53e3\u7684',(0,i.jsx)(n.strong,{children:"\u4e1a\u52a1\u7c7b\u578b\u3001\u4e1a\u52a1\u573a\u666f"}),"\u7b49\u547d\u540d\uff0c\u6709\u5fc5\u8981\u65f6\u53ef\u91c7\u53d6\u591a\u7ea7\u76ee\u5f55\u547d\u540d\uff0c\u4f46\u76ee\u5f55\u4e0d\u5b9c\u8fc7\u957f\uff0c\u4e24\u7ea7\u76ee\u5f55\u8f83\u4e3a\u9002\u5b9c"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"\u5e38\u89c1\u547d\u540d\u65b9\u5f0f"}),":","\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"\u63a5\u53e3\u540d\u79f0\u52a8\u8bcd\u524d/\u540e\u7f00\u5316"}),"\uff1a \u63a5\u53e3\u540d\u79f0\u4ee5\u63a5\u53e3\u6570\u636e\u64cd\u4f5c\u7684\u52a8\u8bcd\u4e3a\u524d/\u540e\u7f00\uff0c\u5e38\u89c1\u52a8\u8bcd\u6709\uff1a",(0,i.jsx)(n.code,{children:"Add\u3001Delete\u3001Update\u3001Query\u3001Get\u3001Send\u3001Save\u3001Detail\u3001List"}),"\u7b49\uff0c\u5982\uff1a\u65b0\u5efa\u7528\u6237 ",(0,i.jsx)(n.code,{children:"AddUser"}),"\u3001\u67e5\u8be2\u8ba2\u5355\u8be6\u60c5 ",(0,i.jsx)(n.code,{children:"QueryOrderDetail"}),"\u3002"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"\u63a5\u53e3\u540d\u79f0\u52a8\u8bcd + \u8bf7\u6c42\u65b9\u5f0f"}),"\uff1a\u63a5\u53e3\u8def\u5f84\u4e2d\u5305\u542b\u5177\u4f53\u63a5\u53e3\u540d\u79f0\u7684\u540d\u8bcd\uff0c\u63a5\u53e3\u6570\u636e\u64cd\u4f5c\u52a8\u4f5c\u4ee5 HTTP \u8bf7\u6c42\u65b9\u5f0f\u6765\u533a\u5206\u3002\u5e38\u7528\u7684 HTTP \u8bf7\u6c42\u65b9\u5f0f\u6709\uff1a","\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"GET"}),"\uff1a\u4ece\u670d\u52a1\u5668\u53d6\u51fa\u8d44\u6e90\uff08\u4e00\u9879\u6216\u591a\u9879\uff09"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"POST"}),"\uff1a\u5728\u670d\u52a1\u5668\u65b0\u5efa\u4e00\u4e2a\u8d44\u6e90"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"PUT"}),"\uff1a\u5728\u670d\u52a1\u5668\u66f4\u65b0\u8d44\u6e90\uff08\u5ba2\u6237\u7aef\u63d0\u4f9b\u6539\u53d8\u540e\u7684\u5b8c\u6574\u8d44\u6e90\uff09"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"PATCH"}),"\uff1a\u5728\u670d\u52a1\u5668\u66f4\u65b0\u8d44\u6e90\uff08\u5ba2\u6237\u7aef\u63d0\u4f9b\u6539\u53d8\u7684\u5c5e\u6027\uff09"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"DELETE"}),"\uff1a\u4ece\u670d\u52a1\u5668\u5220\u9664\u8d44\u6e90"]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"635-\u8bf7\u6c42\u53c2\u6570\u89c4\u8303",children:"6.3.5 \u8bf7\u6c42\u53c2\u6570\u89c4\u8303"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"\u8bf7\u6c42\u65b9\u5f0f"}),"\uff1a\u6309\u7167 ",(0,i.jsx)(n.code,{children:"GET\u3001POST\u3001PUT"})," \u7b49\u542b\u4e49\u5b9a\u4e49\uff0c\u907f\u514d\u51fa\u73b0\u4e0d\u4e00\u81f4\u73b0\u8c61\uff0c\u5bf9\u4eba\u9020\u6210\u8bef\u89e3\u3001\u6b67\u4e49","\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"\u8bf7\u6c42\u5934"}),"\uff1a\u8bf7\u6c42\u5934\u6839\u636e\u9879\u76ee\u9700\u6c42\u6dfb\u52a0\u914d\u7f6e\u53c2\u6570\u3002\u5982\uff1a\u8bf7\u6c42\u6570\u636e\u683c\u5f0f\uff0c",(0,i.jsx)(n.code,{children:"accept=application/json"})," \u7b49\u3002\u5982\u6709\u9700\u8981\uff0c\u8bf7\u6c42\u5934\u53ef\u6839\u636e\u9879\u76ee\u9700\u6c42\u8981\u6c42\u4f20\u5165\u7528\u6237 token\u3001\u552f\u4e00\u9a8c\u7b7e\u7801\u7b49\u52a0\u5bc6\u6570\u636e"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"\u8bf7\u6c42\u53c2\u6570/\u8bf7\u6c42\u4f53"}),"\uff1a \u8bf7\u6c42\u53c2\u6570\u5b57\u6bb5\uff0c\u5c3d\u53ef\u80fd\u4e0e\u6570\u636e\u5e93\u8868\u5b57\u6bb5\u3001\u5bf9\u8c61\u5c5e\u6027\u540d\u7b49\u4fdd\u6301\u4e00\u81f4\uff0c\u56e0\u4e3a\u4fdd\u6301\u4e00\u81f4\u662f\u6700\u7701\u4e8b\uff0c\u6700\u8212\u670d\u7684\u4e00\u4ef6\u4e8b"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"636-\u8fd4\u56de\u6570\u636e\u89c4\u8303",children:"6.3.6 \u8fd4\u56de\u6570\u636e\u89c4\u8303"}),"\n",(0,i.jsxs)(n.p,{children:["\u7edf\u4e00\u89c4\u8303\u8fd4\u56de\u6570\u636e\u7684\u683c\u5f0f\uff0c\u5bf9\u5df1\u5bf9\u5f7c\u90fd\u6709\u597d\u5904\uff0c\u6b64\u5904\u4ee5 json \u683c\u5f0f\u4e3a\u4f8b\u3002\u8fd4\u56de\u6570\u636e\u5e94\u5305\u542b\uff1a",(0,i.jsx)(n.strong,{children:"\u8fd4\u56de\u72b6\u6001\u7801\u3001\u8fd4\u56de\u72b6\u6001\u4fe1\u606f\u3001\u5177\u4f53\u6570\u636e"}),"\u3002",(0,i.jsx)(n.strong,{children:"\u8fd4\u56de\u6570\u636e\u4e2d\u7684\u72b6\u6001\u7801\u3001\u72b6\u6001\u4fe1\u606f\uff0c\u5e38\u6307\u5177\u4f53\u7684\u4e1a\u52a1\u72b6\u6001\uff0c\u4e0d\u5efa\u8bae\u548c HTTP \u72b6\u6001\u7801\u6df7\u5728\u4e00\u8d77"}),"\u3002HTTP \u72b6\u6001\uff0c\u662f\u7528\u6765\u4f53\u73b0 HTTP \u94fe\u8def\u72b6\u6001\u60c5\u51b5\uff0c\u5982\uff1a404-Not Found\u3002HTTP \u72b6\u6001\u7801\u548c json \u7ed3\u679c\u4e2d\u7684\u72b6\u6001\u7801\uff0c\u5e76\u5b58\u5c1a\u53ef\uff0c\u7528\u4e8e\u4f53\u73b0\u4e0d\u540c\u7ef4\u5ea6\u7684\u72b6\u6001\u3002"]}),"\n",(0,i.jsx)(n.h2,{id:"64-\u4ec0\u4e48\u662f-swagger",children:"6.4 \u4ec0\u4e48\u662f Swagger"}),"\n",(0,i.jsx)(n.p,{children:"\u76f8\u4fe1\u65e0\u8bba\u662f\u524d\u7aef\u8fd8\u662f\u540e\u7aef\u5f00\u53d1\uff0c\u90fd\u6216\u591a\u6216\u5c11\u5730\u88ab\u63a5\u53e3\u6587\u6863\u6298\u78e8\u8fc7\u3002\u524d\u7aef\u7ecf\u5e38\u62b1\u6028\u540e\u7aef\u7ed9\u7684\u63a5\u53e3\u6587\u6863\u4e0e\u5b9e\u9645\u60c5\u51b5\u4e0d\u4e00\u81f4\u3002\u540e\u7aef\u53c8\u89c9\u5f97\u7f16\u5199\u53ca\u7ef4\u62a4\u63a5\u53e3\u6587\u6863\u4f1a\u8017\u8d39\u4e0d\u5c11\u7cbe\u529b\uff0c\u7ecf\u5e38\u6765\u4e0d\u53ca\u66f4\u65b0\u3002"}),"\n",(0,i.jsx)(n.p,{children:"\u5176\u5b9e\u65e0\u8bba\u662f\u524d\u7aef\u8c03\u7528\u540e\u7aef\uff0c\u8fd8\u662f\u540e\u7aef\u8c03\u7528\u540e\u7aef\uff0c\u90fd\u671f\u671b\u6709\u4e00\u4e2a\u597d\u7684\u63a5\u53e3\u6587\u6863\u3002\u4f46\u662f\u8fd9\u4e2a\u63a5\u53e3\u6587\u6863\u5bf9\u4e8e\u7a0b\u5e8f\u5458\u6765\u8bf4\uff0c\u5c31\u8ddf\u6ce8\u91ca\u4e00\u6837\uff0c\u7ecf\u5e38\u4f1a\u62b1\u6028\u522b\u4eba\u5199\u7684\u4ee3\u7801\u6ca1\u6709\u5199\u6ce8\u91ca\uff0c\u7136\u800c\u81ea\u5df1\u5199\u8d77\u4ee3\u7801\u8d77\u6765\uff0c\u6700\u8ba8\u538c\u7684\uff0c\u4e5f\u662f\u5199\u6ce8\u91ca\u3002\u6240\u4ee5\u4ec5\u4ec5\u53ea\u901a\u8fc7\u5f3a\u5236\u6765\u89c4\u8303\u5927\u5bb6\u662f\u4e0d\u591f\u7684\uff0c\u968f\u7740\u65f6\u95f4\u63a8\u79fb\uff0c\u7248\u672c\u8fed\u4ee3\uff0c\u63a5\u53e3\u6587\u6863\u5f80\u5f80\u5f88\u5bb9\u6613\u5c31\u8ddf\u4e0d\u4e0a\u4ee3\u7801\u4e86\u3002"}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsxs)(n.strong,{children:["\u53d1\u73b0\u4e86\u75db\u70b9\u5c31\u8981\u53bb\u627e\u89e3\u51b3\u65b9\u6848\u3002\u89e3\u51b3\u65b9\u6848\u7528\u7684\u4eba\u591a\u4e86\uff0c\u5c31\u6210\u4e86\u6807\u51c6\u7684\u89c4\u8303\uff0c\u8fd9\u5c31\u662f ",(0,i.jsx)(n.code,{children:"Swagger"})," \u7684\u7531\u6765"]}),"\u3002"]}),"\n",(0,i.jsxs)(n.p,{children:["\u901a\u8fc7\u8fd9\u5957\u89c4\u8303\uff0c\u4f60\u53ea\u9700\u8981\u6309\u7167\u5b83\u7684\u89c4\u8303\u53bb\u5b9a\u4e49\u63a5\u53e3\u53ca\u63a5\u53e3\u76f8\u5173\u7684\u4fe1\u606f\u3002\u518d\u901a\u8fc7 ",(0,i.jsx)(n.code,{children:"Swagger"})," \u884d\u751f\u51fa\u6765\u7684\u4e00\u7cfb\u5217\u9879\u76ee\u548c\u5de5\u5177\uff0c\u5c31\u53ef\u4ee5\u505a\u5230\u751f\u6210\u5404\u79cd\u683c\u5f0f\u7684\u63a5\u53e3\u6587\u6863\uff0c\u751f\u6210\u591a\u79cd\u8bed\u8a00\u7684\u5ba2\u6237\u7aef\u548c\u670d\u52a1\u7aef\u7684\u4ee3\u7801\uff0c\u4ee5\u53ca\u5728\u7ebf\u63a5\u53e3\u8c03\u8bd5\u9875\u9762\u7b49\u7b49\u3002"]}),"\n",(0,i.jsxs)(n.p,{children:["\u8fd9\u6837\uff0c\u5982\u679c\u6309\u7167\u65b0\u7684\u5f00\u53d1\u6a21\u5f0f\uff0c\u5728\u5f00\u53d1\u65b0\u7248\u672c\u6216\u8005\u8fed\u4ee3\u7248\u672c\u7684\u65f6\u5019\uff0c\u53ea\u9700\u8981\u66f4\u65b0 ",(0,i.jsx)(n.code,{children:"Swagger"})," \u63cf\u8ff0\u6587\u4ef6\uff0c\u5c31\u53ef\u4ee5\u81ea\u52a8\u751f\u6210\u63a5\u53e3\u6587\u6863\u548c\u5ba2\u6237\u7aef\u670d\u52a1\u7aef\u4ee3\u7801\uff0c\u505a\u5230\u8c03\u7528\u7aef\u4ee3\u7801\u3001\u670d\u52a1\u7aef\u4ee3\u7801\u4ee5\u53ca\u63a5\u53e3\u6587\u6863\u7684\u4e00\u81f4\u6027\u3002"]}),"\n",(0,i.jsxs)(n.p,{children:["\u6240\u4ee5\uff0cSwagger \u662f\u4e00\u4e2a\u89c4\u8303\u548c\u5b8c\u6574\u7684\u6846\u67b6\uff0c\u7528\u4e8e\u751f\u6210\u3001\u63cf\u8ff0\u3001\u8c03\u7528\u548c\u53ef\u89c6\u5316",(0,i.jsx)(n.code,{children:"RESTful"})," \u98ce\u683c\u7684 ",(0,i.jsx)(n.code,{children:"Web"})," \u670d\u52a1\u3002"]}),"\n",(0,i.jsxs)(n.p,{children:["\u603b\u4f53\u76ee\u6807\u662f\u4f7f\u5ba2\u6237\u7aef\u548c\u6587\u4ef6\u7cfb\u7edf\u4f5c\u4e3a\u670d\u52a1\u5668\u4ee5\u540c\u6837\u7684\u901f\u5ea6\u6765\u66f4\u65b0\u3002\u6587\u4ef6\u7684\u65b9\u6cd5\u3001\u53c2\u6570\u548c\u6a21\u578b\u7d27\u5bc6\u96c6\u6210\u5230\u670d\u52a1\u5668\u7aef\u7684\u4ee3\u7801\uff0c\u5141\u8bb8 API \u6765\u59cb\u7ec8\u4fdd\u6301\u540c\u6b65\u3002",(0,i.jsx)(n.code,{children:"Swagger"})," \u8ba9\u90e8\u7f72\u7ba1\u7406\u548c\u4f7f\u7528\u529f\u80fd\u5f3a\u5927\u7684 ",(0,i.jsx)(n.code,{children:"API"})," \u4ece\u672a\u5982\u6b64\u7b80\u5355\u3002"]}),"\n",(0,i.jsx)(n.h2,{id:"65-swagger-\u4f7f\u7528",children:"6.5 Swagger \u4f7f\u7528"}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"Furion"})," \u6846\u67b6\u63d0\u4f9b\u4e86\u975e\u5e38\u65b9\u4fbf\u4e14\u7075\u6d3b\u7684 ",(0,i.jsx)(n.code,{children:"Swagger"})," \u914d\u7f6e\uff0c\u65e0\u9700\u589e\u52a0\u989d\u5916\u5b66\u4e60\u6210\u672c\u3002"]}),"\n",(0,i.jsx)(n.h3,{id:"651-\u6ce8\u518c\u670d\u52a1",children:"6.5.1 \u6ce8\u518c\u670d\u52a1"}),"\n",(0,i.jsxs)(n.admonition,{title:"\u5c0f\u63d0\u793a",type:"tip",children:[(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:".AddInject[XXX]()"})," \u5df2\u7ecf\u5305\u542b\u4e86 ",(0,i.jsx)(n.code,{children:".AddSpecificationDocuments()"})," \u6ce8\u518c\uff0c",(0,i.jsx)(n.strong,{children:"\u65e0\u9700\u518d\u6b21\u6ce8\u518c"}),"\u3002"]}),(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:".UseInject()"})," \u5df2\u7ecf\u5305\u542b\u4e86 ",(0,i.jsx)(n.code,{children:".UseSpecificationDocuments()"})," \u6ce8\u518c\uff0c",(0,i.jsx)(n.strong,{children:"\u65e0\u9700\u518d\u6b21\u6ce8\u518c"}),"\u3002"]})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:'showLineNumbers {13,21} title="Furion.Web.Core\\Startup.cs"',children:"using Microsoft.AspNetCore.Builder;\r\nusing Microsoft.AspNetCore.Hosting;\r\nusing Microsoft.Extensions.DependencyInjection;\r\nusing Microsoft.Extensions.Hosting;\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.AddSpecificationDocuments();\r\n services.AddControllers();\r\n }\r\n\r\n public void Configure(IApplicationBuilder app, IWebHostEnvironment env)\r\n {\r\n // Other Codes\r\n\r\n app.UseSpecificationDocuments();\r\n\r\n app.UseEndpoints(endpoints =>\r\n {\r\n endpoints.MapControllers();\r\n });\r\n }\r\n }\r\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:"services.AddSpecificationDocuments()"})," \u901a\u5e38\u548c ",(0,i.jsx)(n.code,{children:".AddDynamicApiControllers()"})," \u6210\u5bf9\u51fa\u73b0\u3002"]})}),"\n",(0,i.jsx)(n.h3,{id:"652-\u9ed8\u8ba4\u5730\u5740",children:"6.5.2 \u9ed8\u8ba4\u5730\u5740"}),"\n",(0,i.jsxs)(n.p,{children:["\u5728 ",(0,i.jsx)(n.code,{children:"Furion"})," \u6846\u67b6\u4e2d\uff0c\u9ed8\u8ba4 ",(0,i.jsx)(n.code,{children:"\u89c4\u8303\u5316\u6587\u6863"})," \u5730\u5740\u4e3a ",(0,i.jsx)(n.code,{children:"/api"})," \u76ee\u5f55\uff0c",(0,i.jsx)(n.strong,{children:"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e"}),"\u3002"]}),"\n",(0,i.jsx)(n.p,{children:"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"}),"\n",(0,i.jsx)("img",{src:(0,l.Z)("img/swagger1.png")}),"\n",(0,i.jsx)(n.p,{children:"\u53ef\u4ee5\u901a\u8fc7\u4e24\u79cd\u65b9\u5f0f\u914d\u7f6e\uff1a"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:'app.UseInject("\u8def\u7531")'})," \u65b9\u5f0f\uff0c\u5982"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers",children:'app.UseInject("testapi"); // \u90a3\u4e48 /testapi \u5c31\u662f\u89c4\u8303\u5316\u5730\u5740\n'})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e"}),"\uff1a"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {3}",children:'{\r\n "SpecificationDocumentSettings": {\r\n "RoutePrefix": "testapi"\r\n }\r\n}\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsxs)(n.strong,{children:["\u914d\u7f6e\u6587\u4ef6\u4f18\u5148\u7ea7\u5927\u4e8e ",(0,i.jsx)(n.code,{children:"UseInject()"})," \u65b9\u5f0f"]})}),"\n",(0,i.jsx)(n.h3,{id:"653-\u9ed8\u8ba4\u5206\u7ec4",children:"6.5.3 \u9ed8\u8ba4\u5206\u7ec4"}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"Furion"})," \u6846\u67b6\u4e2d\u9ed8\u8ba4\u5206\u7ec4\u540d\u4e3a ",(0,i.jsx)(n.code,{children:"Default"}),"\uff0c",(0,i.jsx)(n.strong,{children:"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e"}),"\u3002"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {3}",children:'{\r\n "SpecificationDocumentSettings": {\r\n "DefaultGroupName": "MyGroup"\r\n }\r\n}\n'})}),"\n",(0,i.jsx)(n.h3,{id:"654-\u6587\u6863\u6ce8\u91ca",children:"6.5.4 \u6587\u6863\u6ce8\u91ca"}),"\n",(0,i.jsxs)(n.p,{children:["\u89c4\u8303\u5316\u6587\u6863\u9ed8\u8ba4\u626b\u63cf ",(0,i.jsx)(n.code,{children:"Furion.Application"}),"\uff0c",(0,i.jsx)(n.code,{children:"Furion.Web.Core"}),"\uff0c",(0,i.jsx)(n.code,{children:"Furion.Web.Entry"})," \u4e09\u4e2a\u7a0b\u5e8f\u96c6",(0,i.jsx)(n.code,{children:".xml"})," \u6ce8\u91ca\u6587\u4ef6\uff0c",(0,i.jsx)(n.strong,{children:"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e"}),"\u3002"]}),"\n",(0,i.jsxs)(n.p,{children:["\u53ea\u652f\u6301 ",(0,i.jsx)(n.code,{children:"///"})," \u6807\u8bc6\u7684\u6ce8\u91ca\u8bed\u6cd5\uff0c\u5982\uff1a",(0,i.jsx)(n.strong,{children:"\u7c7b\u3001\u65b9\u6cd5\u3001\u5c5e\u6027\u3001\u53c2\u6570\u3001\u8fd4\u56de\u503c\u3001\u9a8c\u8bc1\u7279\u6027"}),"\u3002"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {5-7,10-13,19-23}",children:'using Furion.DynamicApiController;\r\n\r\nnamespace Furion.Application\r\n{\r\n /// \r\n /// \u7c7b\u6ce8\u91ca\r\n /// \r\n public class FurionAppService : IDynamicApiController\r\n {\r\n /// \r\n /// \u65b9\u6cd5\u6ce8\u91ca\r\n /// \r\n /// \r\n public string Get()\r\n {\r\n return nameof(Furion);\r\n }\r\n\r\n /// \r\n /// \u5e26 ID \u53c2\u6570\u7684\u65b9\u6cd5\u6ce8\u91ca\r\n /// \r\n /// \r\n /// \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,l.Z)("img/swagger2.png")}),"\n",(0,i.jsx)(n.admonition,{title:"\u5c0f\u63d0\u793a",type:"note",children:(0,i.jsxs)(n.p,{children:["\u5982\u679c\u6587\u6863\u6ce8\u91ca\u6ca1\u6709\u663e\u793a\uff0c\u8bf7\u68c0\u67e5\u9879\u76ee ",(0,i.jsx)(n.code,{children:"\u5c5e\u6027->\u751f\u6210->\u8f93\u51fa"})," \u4e2d XML \u6587\u6863\u662f\u5426\u914d\u7f6e\u8f93\u51fa\u8def\u5f84\u3002",(0,i.jsx)(n.strong,{children:"\u6ce8\u610f\uff1a\u53ea\u6709\u4e0d\u5e26\u8def\u5f84\u7684 \u3010\u9879\u76ee\u540d\u79f0.xml\u3011 \u624d\u4f1a\u81ea\u52a8\u52a0\u8f7d\u3002"})]})}),"\n",(0,i.jsxs)(n.admonition,{title:"\u7279\u522b\u8bf4\u660e",type:"info",children:[(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"Debug"})," \u6a21\u5f0f\u4e0b\u548c ",(0,i.jsx)(n.code,{children:"Release"})," \u6a21\u5f0f\u4e0b\u7684\u6ce8\u91ca\u6587\u4ef6\u662f\u4e0d\u901a\u7528\u7684\uff0c\u6240\u4ee5\u5bfc\u81f4\u5f88\u591a\u5f00\u53d1\u8005\u53d1\u5e03\u5230\u670d\u52a1\u5668\u4e0a\u53d1\u73b0\u6ca1\u6709\u663e\u793a\u6ce8\u91ca\u3002\u6211\u4eec\u53ea\u9700\u8981\u5728 ",(0,i.jsx)(n.code,{children:"Visual Studio"})," \u4e2d\u5207\u6362 ",(0,i.jsx)(n.code,{children:"Debug"})," \u6a21\u5f0f\u4e3a ",(0,i.jsx)(n.code,{children:"Release"}),"\uff0c\u7136\u540e\u91cd\u65b0\u914d\u7f6e\u4e00\u6b21\u5373\u53ef\u3002"]}),(0,i.jsxs)(n.p,{children:["\u8fd9\u6837\u4e0d\u7ba1\u662f ",(0,i.jsx)(n.code,{children:"Debug"})," \u8fd8\u662f ",(0,i.jsx)(n.code,{children:"Release"})," \u6a21\u5f0f\u90fd\u4f1a\u663e\u793a\u6ce8\u91ca\u4e86\u3002"]})]}),"\n",(0,i.jsx)(n.h3,{id:"655-\u591a\u5206\u7ec4\u652f\u6301",children:"6.5.5 \u591a\u5206\u7ec4\u652f\u6301"}),"\n",(0,i.jsxs)(n.p,{children:["\u591a\u5206\u7ec4\u662f\u4e00\u4e2a\u7cfb\u7edf\u4e2d\u5fc5\u5907\u529f\u80fd\uff0c\u6211\u4eec\u53ef\u4ee5\u5c06\u7cfb\u7edf\u5212\u5206\u4e3a\u591a\u4e2a\u6a21\u5757\uff0c\u6bcf\u4e2a\u6a21\u5757\u90fd\u72ec\u7acb\u7684 ",(0,i.jsx)(n.code,{children:"api"})," \u914d\u7f6e\u3002\u5728 ",(0,i.jsx)(n.code,{children:"Furion"})," \u6846\u67b6\u4e2d\uff0c\u5b9e\u73b0\u591a\u5206\u7ec4\u975e\u5e38\u7b80\u5355\u3002\u5982\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {5,21,32}",children:'using Furion.DynamicApiController;\r\n\r\nnamespace Furion.Application\r\n{\r\n [ApiDescriptionSettings("Group1")]\r\n public class FurionAppService : IDynamicApiController\r\n {\r\n /// \r\n /// \u968f\u7236\u7c7b Group1 \u5206\u7ec4\r\n /// \r\n /// \r\n public string Post()\r\n {\r\n return nameof(Furion);\r\n }\r\n\r\n /// \r\n /// \u5728 Group1\u3001Group3 \u90fd\u6709\u6211\r\n /// \r\n /// \r\n [ApiDescriptionSettings("Group1", "Group3")]\r\n public string Get()\r\n {\r\n return nameof(Furion);\r\n }\r\n\r\n /// \r\n /// \u6211\u53ea\u5728 Group2 \u51fa\u73b0\r\n /// \r\n /// \r\n /// \r\n [ApiDescriptionSettings("Group2")]\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,l.Z)("img/swagger3.gif")}),"\n",(0,i.jsx)(n.h3,{id:"656-\u591a\u5206\u7ec4\u6392\u5e8f",children:"6.5.6 \u591a\u5206\u7ec4\u6392\u5e8f"}),"\n",(0,i.jsxs)(t.Z,{defaultValue:"fz1",values:[{label:"\u65b9\u5f0f\u4e00",value:"fz1"},{label:"\u65b9\u5f0f\u4e8c",value:"fz2"}],children:[(0,i.jsxs)(o.Z,{value:"fz1",children:[(0,i.jsx)(n.p,{children:(0,i.jsxs)(n.strong,{children:["\u901a\u8fc7\u5206\u7ec4\u540d\u79f0\u6dfb\u52a0 ",(0,i.jsx)(n.code,{children:"@\u6574\u6570"})," \u8fdb\u884c\u6392\u5e8f"]})}),(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("Group1@1")]\r\n public class FurionAppService : IDynamicApiController\r\n {\r\n public string Post()\r\n {\r\n return nameof(Furion);\r\n }\r\n\r\n [ApiDescriptionSettings("Group1", "Group3")]\r\n public string Get()\r\n {\r\n return nameof(Furion);\r\n }\r\n\r\n [ApiDescriptionSettings("Group@2")]\r\n public int Get(int id)\r\n {\r\n return id;\r\n }\r\n }\r\n}\n'})}),(0,i.jsxs)(n.p,{children:["\u53ef\u4ee5\u901a\u8fc7\u5728\u5206\u7ec4\u540d\u540e\u9762\u6dfb\u52a0 ",(0,i.jsx)(n.code,{children:"@\u6574\u6570"})," \u8fdb\u884c\u6392\u5e8f\uff0c",(0,i.jsx)(n.code,{children:"\u6574\u6570"})," \u8d8a\u5927\u6392\u524d\u9762\u3002\u5982\u679c\u5206\u7ec4\u540d\u79f0\u591a\u6b21\u6307\u5b9a\u4e14\u591a\u6b21\u6307\u5b9a\u4e86 ",(0,i.jsx)(n.code,{children:"@\u6574\u6570"})," \uff0c\u5219\u81ea\u52a8",(0,i.jsx)(n.strong,{children:"\u53d6\u8be5\u5206\u7ec4\u6700\u5927\u7684\u6574\u6570"}),"\u8fdb\u884c\u6392\u5e8f\u3002"]})]}),(0,i.jsxs)(o.Z,{value:"fz2",children:[(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"\u901a\u8fc7\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e\u6392\u5e8f"})}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-json",metastring:'showLineNumbers {2-17} title="Furion.Web.Entry/appsettings.json"',children:'{\r\n "SpecificationDocumentSettings": {\r\n "GroupOpenApiInfos": [\r\n {\r\n "Group": "Group1",\r\n "Order": 1\r\n },\r\n {\r\n "Group": "Group2",\r\n "Order": 2\r\n },\r\n {\r\n "Group": "Group3",\r\n "Order": 0\r\n }\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,l.Z)("img/swagger4.png")}),"\n",(0,i.jsx)(n.admonition,{title:"\u6392\u5e8f\u8bf4\u660e",type:"tip",children:(0,i.jsxs)(n.p,{children:["\u5206\u7ec4\u9ed8\u8ba4\u6392\u5e8f ",(0,i.jsx)(n.code,{children:"Order"})," \u4e3a ",(0,i.jsx)(n.code,{children:"0"}),"\u3002\u5982\u679c\u540c\u65f6\u914d\u7f6e\u4e86 ",(0,i.jsx)(n.code,{children:"@\u6574\u6570"})," \u548c ",(0,i.jsx)(n.code,{children:"appsettings.json"})," \u914d\u7f6e\u6587\u4ef6\uff0c\u90a3\u4e48\u4f18\u5148\u91c7\u7528 ",(0,i.jsx)(n.code,{children:"appsettings.json"})," \u4e2d\u7684 ",(0,i.jsx)(n.code,{children:"Order"})]})}),"\n",(0,i.jsx)(n.h3,{id:"657-\u591a\u5206\u7ec4\u4fe1\u606f\u914d\u7f6e",children:"6.5.7 \u591a\u5206\u7ec4\u4fe1\u606f\u914d\u7f6e"}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"Furion"})," \u6846\u67b6\u63d0\u4f9b\u4e86\u53ef\u901a\u8fc7 ",(0,i.jsx)(n.code,{children:"appsetting.json"})," \u914d\u7f6e\u5206\u7ec4\u4fe1\u606f\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-json",metastring:'showLineNumbers {3-20} title="Furion.Web.Entry/appsettings.json"',children:'{\r\n "SpecificationDocumentSettings": {\r\n "GroupOpenApiInfos": [\r\n {\r\n "Group": "Group1",\r\n "Title": "\u5206\u7ec4\u6807\u9898",\r\n "Description": "\u8fd9\u91cc\u662f\u5206\u7ec4\u63cf\u8ff0",\r\n "Version": "\u7248\u672c\u53f7",\r\n "TermsOfService": "http://furion.baiqian.ltd",\r\n "Contact": {\r\n "Name": "\u767e\u5c0f\u50e7",\r\n "Url": "https://gitee.com/monksoul",\r\n "Email": "monksoul@outlook.com"\r\n },\r\n "License": {\r\n "Name": "MIT",\r\n "Url": "https://gitee.com/dotnetchina/Furion/blob/alpha/LICENSE"\r\n }\r\n }\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,l.Z)("img/swagger5.png")}),"\n",(0,i.jsx)(n.hr,{}),"\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.26 +"})," \u7248\u672c\u4f7f\u7528\u3002"]})}),"\n",(0,i.jsxs)(n.p,{children:["\u81ea\u8be5\u7248\u672c\u5f00\u59cb\uff0c\u53ef\u4ee5\u5728\u4efb\u4f55\u914d\u7f6e\u6587\u4ef6\u4e2d\u6dfb\u52a0 ",(0,i.jsx)(n.code,{children:"[openapi:\u5206\u7ec4\u540d]"})," \u4f5c\u4e3a ",(0,i.jsx)(n.code,{children:"Key"})," \u8fdb\u884c\u914d\u7f6e\uff0c\u800c\u65e0\u9700\u5728 ",(0,i.jsx)(n.code,{children:"SpecificationDocumentSettings:GroupOpenApiInfos"})," \u4e2d\u6307\u5b9a\u3002"]}),"\n",(0,i.jsxs)(n.p,{children:["\u5982\u679c\u4e24\u79cd\u65b9\u5f0f\u540c\u65f6\u914d\u7f6e\uff0c\u90a3\u4e48 ",(0,i.jsx)(n.code,{children:"GroupOpenApiInfos"})," \u4e2d\u7684\u5c5e\u6027\u503c\u53ea\u6709\u5728 ",(0,i.jsx)(n.code,{children:"[openapi:\u5206\u7ec4\u540d]"})," \u914d\u7f6e\u4e2d\u5b58\u5728\u624d\u4f1a\u8986\u76d6\uff0c\u4e0d\u5b58\u5728\u5219\u4fdd\u7559\u3002"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-json",metastring:"showLineNumbers {2}",children:'{\r\n "[openapi:Group1]": {\r\n "Title": "\u6211\u662f\u81ea\u5b9a\u4e49\u7684\u6807\u9898",\r\n "Order": 10,\r\n "Description": "\u6211\u662f\u81ea\u5b9a\u4e49\u7684\u63cf\u8ff0",\r\n "Version": "2.0.0",\r\n "TermsOfService": "https://furion.net",\r\n "Contact": {\r\n "Name": "Furion.NET",\r\n "Url": "https://gitee.com/monksoul",\r\n "Email": "support@furion.net"\r\n },\r\n "License": {\r\n "Name": "MIT",\r\n "Url": "https://gitee.com/dotnetchina/Furion/blob/v4/LICENSE"\r\n }\r\n }\r\n}\n'})}),"\n",(0,i.jsx)(n.h3,{id:"658-\u63a7\u5236\u5668\u548c\u65b9\u6cd5\u6392\u5e8f",children:"6.5.8 \u63a7\u5236\u5668\u548c\u65b9\u6cd5\u6392\u5e8f"}),"\n",(0,i.jsxs)(n.p,{children:["\u6709\u65f6\u5019\u6211\u4eec\u9700\u8981\u5bf9\u63a7\u5236\u5668\u6216\u8005\u65b9\u6cd5\u8fdb\u884c\u6392\u5e8f\uff0c\u6846\u67b6\u63d0\u4f9b\u4e86 ",(0,i.jsx)(n.code,{children:"[ApiDescriptionSettings]"})," \u7279\u6027\u7684 ",(0,i.jsx)(n.code,{children:"Order"})," \u5c5e\u6027\uff0c",(0,i.jsx)(n.strong,{children:"\u5176\u503c\u8d8a\u5927\u6392\u5e8f\u8d8a\u9760\u524d"}),"\uff0c\u5982\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {1,9,15,22}",children:"[ApiDescriptionSettings(Order = 10)]\r\npublic class FurionAppService : IDynamicApiController\r\n{\r\n public string Post()\r\n {\r\n return nameof(Furion);\r\n }\r\n\r\n [ApiDescriptionSettings(Order = 5)]\r\n public string Get()\r\n {\r\n return nameof(Furion);\r\n }\r\n\r\n [ApiDescriptionSettings(Order = 4)]\r\n public int Get(int id)\r\n {\r\n return id;\r\n }\r\n}\r\n\r\n[ApiDescriptionSettings(Order = 9)]\r\npublic class Furion2AppService : IDynamicApiController\r\n{\r\n // ...\r\n}\r\n\n"})}),"\n",(0,i.jsx)(n.admonition,{title:"\u6392\u5e8f\u8bf4\u660e",type:"tip",children:(0,i.jsxs)(n.p,{children:["\u6700\u7ec8\u8f93\u51fa\u5230 ",(0,i.jsx)(n.code,{children:"Swagger"})," \u754c\u9762\u65f6\uff0c",(0,i.jsx)(n.code,{children:"FurionAppService"})," \u6bd4 ",(0,i.jsx)(n.code,{children:"Furion2AppService"})," \u9760\u524d\uff0c\u800c ",(0,i.jsx)(n.code,{children:"FurionAppService"})," \u4e2d\u5b9a\u4e49\u7684\u65b9\u6cd5\u6392\u5e8f\u65f6\uff1a",(0,i.jsx)(n.code,{children:"Get"})," > ",(0,i.jsx)(n.code,{children:"Get(int id)"})," > ",(0,i.jsx)(n.code,{children:"Post"}),"\u3002"]})}),"\n",(0,i.jsx)(n.h3,{id:"659-\u7ec4\u4e2d\u7ec4\u6807\u7b7e",children:"6.5.9 \u7ec4\u4e2d\u7ec4\uff08\u6807\u7b7e\uff09"}),"\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,l.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,l.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.jsx)(n.h3,{id:"6510-\u9ed8\u8ba4\u5c55\u5f00\u6240\u6709\u6587\u6863",children:"6.5.10 \u9ed8\u8ba4\u5c55\u5f00\u6240\u6709\u6587\u6863"}),"\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 "SpecificationDocumentSettings": {\r\n "DocExpansionState": "Full"\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,l.Z)("img/swagger6.gif")}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"DocExpansionState"})," \u914d\u7f6e\u8bf4\u660e\uff1a"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"List"}),"\uff1a\u5217\u8868\u5f0f\uff08\u5c55\u5f00\u5b50\u7c7b\uff09\uff0c",(0,i.jsx)(n.strong,{children:"\u9ed8\u8ba4\u503c"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Full"}),"\uff1a\u5b8c\u5168\u5c55\u5f00"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"None"}),"\uff1a\u5217\u8868\u5f0f\uff08\u4e0d\u5c55\u5f00\u5b50\u7c7b\uff09"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"6511-\u914d\u7f6e\u6587\u6863\u6807\u9898",children:"6.5.11 \u914d\u7f6e\u6587\u6863\u6807\u9898"}),"\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 "SpecificationDocumentSettings": {\r\n "DocumentTitle": "\u6211\u662f\u81ea\u5b9a\u4e49\u6807\u9898"\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,l.Z)("img/swagger7.png")}),"\n",(0,i.jsx)(n.h3,{id:"6512-\u6388\u6743\u63a7\u5236",children:"6.5.12 \u6388\u6743\u63a7\u5236"}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsxs)(n.strong,{children:["\u65b0\u7248\u672c ",(0,i.jsx)(n.code,{children:"Furion"})," \u5df2\u7ecf\u9ed8\u8ba4\u542f\u7528\u4e86 Bearer Token \u6388\u6743\u914d\u7f6e\uff0c\u65e0\u9700\u624b\u52a8\u914d\u7f6e"]}),"\uff0c\u5982\u9700\u624b\u52a8\u914d\u7f6e\uff0c\u53ef\u624b\u52a8\u6dfb\u52a0\u4ee5\u4e0b\u7c7b\u4f3c\u914d\u7f6e\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-json",metastring:'showLineNumbers title="Furion.Web.Entry/appsettings.json"',children:'{\r\n "SpecificationDocumentSettings": {\r\n "EnableAuthorized": true,\r\n\r\n "SecurityDefinitions": [\r\n {\r\n "Id": "Bearer",\r\n "Type": "Http",\r\n "Name": "Authorization",\r\n "Description": "JWT Authorization header using the Bearer scheme.",\r\n "BearerFormat": "JWT",\r\n "Scheme": "bearer",\r\n "In": "Header",\r\n\r\n "Requirement": {\r\n "Scheme": {\r\n "Reference": {\r\n "Id": "Bearer",\r\n "Type": "SecurityScheme"\r\n },\r\n "Accesses": []\r\n }\r\n }\r\n }\r\n ]\r\n }\r\n}\n'})}),"\n",(0,i.jsx)(n.h3,{id:"6513-\u5728\u7ebf\u6d4b\u8bd5",children:"6.5.13 \u5728\u7ebf\u6d4b\u8bd5"}),"\n",(0,i.jsx)(n.p,{children:"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"}),"\n",(0,i.jsx)("img",{src:(0,l.Z)("img/swagger8.gif")}),"\n",(0,i.jsxs)(n.h3,{id:"6514-\u6027\u80fd\u76d1\u89c6-miniprofiler",children:["6.5.14 \u6027\u80fd\u76d1\u89c6 ",(0,i.jsx)(n.code,{children:"MiniProfiler"})]}),"\n",(0,i.jsxs)(n.p,{children:["\u89c4\u8303\u5316\u6587\u6863\u9ed8\u8ba4\u96c6\u6210\u4e86 ",(0,i.jsx)(n.code,{children:"MiniProfiler"})," \u7b2c\u4e09\u65b9\u6027\u80fd\u7ec4\u4ef6\uff0c\u901a\u8fc7\u8be5\u7ec4\u4ef6\u53ef\u4ee5\u65b9\u4fbf\u67e5\u770b\u8bf7\u6c42\u6027\u80fd\u3001\u5f02\u5e38\u5806\u6808\u3001\u6570\u636e\u5e93\u64cd\u4f5c\u7b49\u4fe1\u606f\u3002\u9ed8\u8ba4\u5728 ",(0,i.jsx)(n.code,{children:"Swagger"})," \u9996\u9875\u5de6\u4e0a\u89d2\u663e\u793a\u3002"]}),"\n",(0,i.jsx)(n.p,{children:"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"}),"\n",(0,i.jsx)("img",{src:(0,l.Z)("img/mipr.png")}),"\n",(0,i.jsx)(n.admonition,{title:"\u5c0f\u63d0\u793a",type:"note",children:(0,i.jsxs)(n.p,{children:["\u4e5f\u53ef\u4ee5\u901a\u8fc7 ",(0,i.jsx)(n.strong,{children:(0,i.jsx)(n.code,{children:"appsetting.json"})})," \u4e2d ",(0,i.jsx)(n.strong,{children:(0,i.jsx)(n.code,{children:"AppSettings:InjectMiniProfiler"})})," \u8bbe\u4e3a ",(0,i.jsx)(n.strong,{children:(0,i.jsx)(n.code,{children:"false"})})," \u5173\u95ed\u3002"]})}),"\n",(0,i.jsx)(n.h3,{id:"6515-\u5b9a\u4e49\u63a5\u53e3\u8f93\u51fa\u7c7b\u578b",children:"6.5.15 \u5b9a\u4e49\u63a5\u53e3\u8f93\u51fa\u7c7b\u578b"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {2,8-9}",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 [ProducesResponseType(201, Type = typeof(TestDto))]\r\n [ProducesResponseType(400)]\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,l.Z)("img/fhzlx.png")}),"\n",(0,i.jsx)(n.h3,{id:"6516-\u9690\u85cf\u7279\u5b9a\u5206\u7ec4",children:"6.5.16 \u9690\u85cf\u7279\u5b9a\u5206\u7ec4"}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"Furion"})," \u65b0\u7248\u672c\u63d0\u4f9b\u4e86\u9690\u85cf\u5206\u7ec4\u7684 ",(0,i.jsx)(n.code,{children:"Visible"})," \u914d\u7f6e\uff0c\u8bbe\u7f6e\u4e3a ",(0,i.jsx)(n.code,{children:"false"})," \u4e4b\u540e\u8be5\u5206\u7ec4\u5c06\u4e0d\u663e\u793a\u5728\u89c4\u8303\u5316\u6587\u6863\u4e2d\uff0c\u5982\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-json",metastring:'showLineNumbers title="appsetting.json"',children:'{\r\n "SpecificationDocumentSettings": {\r\n "GroupOpenApiInfos": [\r\n {\r\n "Group": "Group1",\r\n "Visible": false\r\n }\r\n ]\r\n }\r\n}\n'})}),"\n",(0,i.jsx)(n.h3,{id:"6517-\u4e2d\u6587\u4e71\u7801\u95ee\u9898",children:"6.5.17 \u4e2d\u6587\u4e71\u7801\u95ee\u9898"}),"\n",(0,i.jsxs)(n.p,{children:["\u9ed8\u8ba4\u60c5\u51b5\u4e0b,",(0,i.jsx)(n.code,{children:".json"})," \u6587\u4ef6\u5e76\u672a\u91c7\u7528 ",(0,i.jsx)(n.code,{children:"utf-8"})," \u7f16\u7801\uff0c\u6240\u4ee5\u5982\u679c\u914d\u7f6e\u4e2d\u6587\u5206\u7ec4\u4fe1\u606f\u5c31\u4f1a\u51fa\u73b0\u4e71\u7801\u60c5\u51b5\uff0c\u8fd9\u65f6\u5019\uff0c\u53ea\u9700\u8981\u4fee\u6539 ",(0,i.jsx)(n.code,{children:".json"})," \u6587\u4ef6\u7f16\u7801\u4e3a ",(0,i.jsx)(n.code,{children:"utf-8"})," \u5373\u53ef\u3002"]}),"\n",(0,i.jsxs)(n.h3,{id:"6518-\u751f\u4ea7\u73af\u5883\u4e2d\u5173\u95ed-swagger",children:["6.5.18 \u751f\u4ea7\u73af\u5883\u4e2d\u5173\u95ed ",(0,i.jsx)(n.code,{children:"Swagger"})]}),"\n",(0,i.jsxs)(n.p,{children:["\u5982\u679c\u4e0d\u9700\u8981\u7ebf\u4e0a\u73af\u5883\u5f00\u542f ",(0,i.jsx)(n.code,{children:"Swagger"})," \u529f\u80fd\uff0c\u53ea\u9700\u8981\u5728 ",(0,i.jsx)(n.code,{children:"appsetting.json"})," \u914d\u7f6e\u5373\u53ef\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-json",metastring:"showLineNumbers {3}",children:'{\r\n "AppSettings": {\r\n "InjectSpecificationDocument": false\r\n }\r\n}\n'})}),"\n",(0,i.jsxs)(n.h3,{id:"6519-\u8bbe\u7f6e-example-value-\u9ed8\u8ba4\u503c",children:["6.5.19 \u8bbe\u7f6e ",(0,i.jsx)(n.code,{children:"Example Value"})," \u9ed8\u8ba4\u503c"]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"Swagger"})," \u4f1a\u81ea\u52a8\u6839\u636e\u5bf9\u8c61\u7c7b\u578b\u8f93\u5165\u53c2\u6570\u6dfb\u52a0 ",(0,i.jsx)(n.code,{children:"Example Value"})," \u9ed8\u8ba4\u503c\uff0c\u4f46\u662f\u8be5\u9ed8\u8ba4\u503c\u901a\u5e38\u662f\u5bf9\u8c61\u5c5e\u6027\u7684\u7c7b\u578b\u5b57\u7b26\u4e32\u6216\u7f3a\u7701\u503c\uff0c\u5982\u679c\u6211\u4eec\u9700\u8981\u81ea\u5b9a\u4e49\u8fd9\u4e9b\u9ed8\u8ba4\u503c\uff0c\u53ea\u9700\u8981\u6dfb\u52a0 ",(0,i.jsx)(n.code,{children:"/// \u9ed8\u8ba4\u503c"})," \u6ce8\u91ca\u5373\u53ef\u3002"]}),"\n",(0,i.jsx)(n.p,{children:"\u5982\uff1a"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {4}",children:"/// \r\n/// \u5e74\u9f84\r\n/// \r\n/// 13\r\n[Required, Range(10, 110)]\r\npublic int Age { get; set; }\n"})}),"\n",(0,i.jsx)(n.p,{children:"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"}),"\n",(0,i.jsx)("img",{src:(0,l.Z)("img/sd20.png")}),"\n",(0,i.jsx)(n.p,{children:"\u66f4\u591a\u7c7b\u578b\u9ed8\u8ba4\u503c\u8bbe\u7f6e\u793a\u4f8b\uff1a"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"bool"})," \u7c7b\u578b\uff1a",(0,i.jsx)(n.code,{children:"/// true"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"string"})," \u7c7b\u578b\uff1a",(0,i.jsx)(n.code,{children:"/// foobar"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"number"})," \u7c7b\u578b\uff1a",(0,i.jsx)(n.code,{children:"/// 123"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"null"})," \u7c7b\u578b\uff1a ",(0,i.jsx)(n.code,{children:"/// null"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"array"})," \u7c7b\u578b\uff1a",(0,i.jsx)(n.code,{children:"/// [ 1, 2, 3 ]"})]}),"\n"]}),"\n",(0,i.jsxs)(n.admonition,{type:"important",children:[(0,i.jsxs)(n.mdxAdmonitionTitle,{children:["\u5173\u4e8e ",(0,i.jsx)(n.code,{children:"object"})," \u7c7b\u578b\u8f93\u5165\u53c2\u6570"]}),(0,i.jsxs)(n.p,{children:["\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c",(0,i.jsx)(n.code,{children:"Example Value"})," \u4e0d\u4f1a\u663e\u793a ",(0,i.jsx)(n.code,{children:"object"})," \u7c7b\u578b\u7684\u5bf9\u8c61\u5c5e\u6027\uff0c\u56e0\u4e3a ",(0,i.jsx)(n.code,{children:"Swagger"})," \u8ba4\u4e3a\u8fd9\u662f\u4e0d\u5408\u7406\u7684\u5b9a\u4e49\u3002\u5982\u679c\u9700\u8981\u5f3a\u5236\u663e\u793a\uff0c\u53ea\u9700\u8981\u6dfb\u52a0 ",(0,i.jsx)(n.code,{children:'/// "object"'})," \u6ce8\u91ca\u5373\u53ef\u3002"]})]}),"\n",(0,i.jsxs)(n.h3,{id:"6520-\u81ea\u5b9a\u4e49-swagger-\u914d\u7f6e",children:["6.5.20 \u81ea\u5b9a\u4e49 ",(0,i.jsx)(n.code,{children:"Swagger"})," \u914d\u7f6e"]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"Furion"})," \u6846\u67b6\u9664\u4e86\u5185\u7f6e\u4e86\u4e0d\u5c11\u914d\u7f6e\u4ee5\u5916\uff0c\u8fd8\u63d0\u4f9b\u4e86\u76f4\u63a5\u914d\u7f6e ",(0,i.jsx)(n.code,{children:"Swagger"})," Api \u7684\u53c2\u6570\uff0c\u5982\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {5}",children:"public void ConfigureServices(IServiceCollection services)\r\n{\r\n services.AddInject(options =>\r\n {\r\n options.ConfigureSwaggerGen(gen =>\r\n {\r\n // ....\r\n });\r\n });\r\n}\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {6,11}",children:" public void Configure(IApplicationBuilder app, IWebHostEnvironment env)\r\n {\r\n // \u5982\u679c\u4f7f\u7528 Furion 4.4.8+ \u7248\u672c\u53ef\u4ee5 app.UseInject(options => {}) \u4e86\uff0c\u65e0\u9700\u6307\u5b9a configure:\r\n app.UseInject(configure: options =>\r\n {\r\n options.ConfigureSwagger(swg =>\r\n {\r\n // ....\r\n });\r\n\r\n options.ConfigureSwaggerUI(ui =>\r\n {\r\n // ....\r\n });\r\n });\r\n}\r\n\n"})}),"\n",(0,i.jsxs)(n.h3,{id:"6521-\u914d\u7f6e-swagger\u7684-schemaids",children:["6.5.21 \u914d\u7f6e ",(0,i.jsx)(n.code,{children:"Swagger"}),"\u7684 ",(0,i.jsx)(n.code,{children:"SchemaIds"})]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"Furion"})," \u6846\u67b6\u9ed8\u8ba4\u53ea\u663e\u793a\u540d\u79f0\uff0c\u5982\u679c\u9700\u8981\u81ea\u5b9a\u4e49\u663e\u793a\u89c4\u5219\uff0c\u53ea\u9700\u8981\u6dfb\u52a0\u914d\u7f6e\u5373\u53ef\u3002"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {4,6}",children:"services.AddControllersWithViews()\r\n .AddInject(options =>\r\n {\r\n options.ConfigureSwaggerGen(gen =>\r\n {\r\n gen.CustomSchemaIds(x => x.FullName);\r\n });\r\n });\n"})}),"\n",(0,i.jsxs)(n.h3,{id:"6522-\u81ea\u5b9a\u4e49-swaggerjson-\u8def\u7531\u6a21\u677f",children:["6.5.22 \u81ea\u5b9a\u4e49 ",(0,i.jsx)(n.code,{children:"swagger.json"})," \u8def\u7531\u6a21\u677f"]}),"\n",(0,i.jsxs)(n.p,{children:["\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c",(0,i.jsx)(n.code,{children:"Furion"})," \u6846\u67b6\u4f1a\u751f\u6210\u7edf\u4e00\u7684\u5206\u7ec4\u6a21\u677f\uff0c\u5982\uff1a",(0,i.jsx)(n.code,{children:"swagger/{documentName}/swagger.json"}),"\uff0c",(0,i.jsx)(n.code,{children:"{documentName}"})," \u4f1a\u5728\u8fd0\u884c\u65f6\u66ff\u6362\u4e3a\u5206\u7ec4\u540d\uff0c\u5982\u9700\u81ea\u5b9a\u4e49\uff0c\u914d\u7f6e ",(0,i.jsx)(n.code,{children:"RouteTemplate"})," \u5373\u53ef\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-json",metastring:'showLineNumbers title="appsetting.json"',children:'{\r\n "SpecificationDocumentSettings": {\r\n "RouteTemplate": "myapp/{documentName}/xxxx.json"\r\n }\r\n}\n'})}),"\n",(0,i.jsxs)(n.h3,{id:"6523-\u5173\u4e8e-applicationx-www-form-urlencoded-\u8bf7\u6c42",children:["6.5.23 \u5173\u4e8e ",(0,i.jsx)(n.code,{children:"application/x-www-form-urlencoded"})," \u8bf7\u6c42"]}),"\n",(0,i.jsxs)(n.p,{children:["\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c",(0,i.jsx)(n.code,{children:"Swagger"})," \u5e76\u672a\u6dfb\u52a0 ",(0,i.jsx)(n.code,{children:"application/x-www-form-urlencoded"})," \u652f\u6301\uff0c\u5982\u9700\u542f\u7528\u8be5\u914d\u7f6e\uff0c\u53ea\u9700\u5728\u65b9\u6cd5\u9876\u90e8\u8d34 ",(0,i.jsx)(n.code,{children:"[Consumes]"})," \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,2}",children:'[Consumes("application/x-www-form-urlencoded")]\r\npublic async Task Test([FromForm] TestRequest testRequest)\r\n{\r\n // ....\r\n}\r\n\r\npublic class TestRequest\r\n{\r\n public string TestValue { get; set; }\r\n}\n'})}),"\n",(0,i.jsx)(n.admonition,{title:"\u7279\u522b\u6ce8\u610f",type:"important",children:(0,i.jsxs)(n.p,{children:["\u53c2\u6570\u5fc5\u987b\u8d34 ",(0,i.jsx)(n.code,{children:"[FromForm]"})," \u7279\u6027\u3002\u53e6\u5916\u8bf7\u6c42\u65f6\u5c06\u53c2\u6570\u6309 ",(0,i.jsx)(n.code,{children:"URL"})," \u5730\u5740\u62fc\u63a5\u5e76\u653e\u5728 ",(0,i.jsx)(n.code,{children:"Body"})," \u4e2d\u8bf7\u6c42\u3002"]})}),"\n",(0,i.jsxs)(n.h3,{id:"6524-swagger-\u51fa\u73b0-cors-\u95ee\u9898\u89e3\u51b3",children:["6.5.24 ",(0,i.jsx)(n.code,{children:"Swagger"})," \u51fa\u73b0 ",(0,i.jsx)(n.code,{children:"CORS"})," \u95ee\u9898\u89e3\u51b3"]}),"\n",(0,i.jsxs)(n.p,{children:["\u5982\u679c ",(0,i.jsx)(n.code,{children:"Swagger"})," \u51fa\u73b0\u4ee5\u4e0b\u9519\u8bef\uff0c\u5982\u56fe\uff1a"]}),"\n",(0,i.jsx)("img",{src:(0,l.Z)("img/swerror.png")}),"\n",(0,i.jsx)(n.p,{children:"\u5219\u9700\u8981\u6dfb\u52a0\u4ee5\u4e0b\u914d\u7f6e\uff1a"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-json",metastring:"showLineNumbers {2,3}",children:'{\r\n "SpecificationDocumentSettings": {\r\n "HideServers": true\r\n }\r\n}\n'})}),"\n",(0,i.jsxs)(n.h3,{id:"6525-swagger-\u51fa\u73b0\u9ed8\u8ba4-textxmltextplain-\u53c2\u6570\u95ee\u9898\u89e3\u51b3",children:["6.5.25 ",(0,i.jsx)(n.code,{children:"Swagger"})," \u51fa\u73b0\u9ed8\u8ba4 ",(0,i.jsx)(n.code,{children:"text/xml"}),"/",(0,i.jsx)(n.code,{children:"text/plain"})," \u53c2\u6570\u95ee\u9898\u89e3\u51b3"]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"\u4ea7\u751f\u6b64\u539f\u56e0\u6709\u4e24\u4e2a\u5fc5\u8981\u6761\u4ef6\uff1a"})}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\u4f7f\u7528\u4e86 ",(0,i.jsx)(n.code,{children:"Microsoft.AspNetCore.Mvc.NewtonsoftJson"})," \u5305\u5e76\u6dfb\u52a0\u4e86 ",(0,i.jsx)(n.code,{children:"AddNewtonsoftJson()"})," \u6ce8\u518c\u3002"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:".AddNewtonsoftJson()"})," \u5199\u5728\u4e86 ",(0,i.jsx)(n.code,{children:".AddInjectWithUnifyResult()"})," \u540e\u9762\u3002"]}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["\u6240\u4ee5\u89e3\u51b3\u65b9\u6cd5\u662f\uff0c\u5148\u6ce8\u518c ",(0,i.jsx)(n.code,{children:".AddNewtonsoftJson()"})," \u518d\u6ce8\u518c\u89c4\u8303\u5316\u7ed3\u679c\uff0c\u5982\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {2}",children:"services.AddControllers()\r\n .AddNewtonsoftJson()\r\n .AddInjectWithUnifyResult();\n"})}),"\n",(0,i.jsxs)(n.h3,{id:"6526-swagger-\u591a\u8bed\u8a00\u652f\u6301",children:["6.5.26 ",(0,i.jsx)(n.code,{children:"Swagger"})," \u591a\u8bed\u8a00\u652f\u6301"]}),"\n",(0,i.jsxs)(n.p,{children:["\u5728 ",(0,i.jsx)(n.code,{children:"Furion 2.9.0 + "})," \u7248\u672c\u5df2\u7ecf\u652f\u6301\u4e86 ",(0,i.jsx)(n.code,{children:"Swagger"})," \u6587\u6863\u5730\u5740 ",(0,i.jsx)(n.code,{children:"?culture=en-US"})," \u53c2\u6570\u591a\u8bed\u8a00\u8f6c\u53d1\u529f\u80fd\u4e86\uff0c\u4e5f\u5c31\u662f ",(0,i.jsx)(n.code,{children:"Swagger"})," \u5730\u5740\u5e26 ",(0,i.jsx)(n.code,{children:"?culture="})," \u53c2\u6570\u5c06\u81ea\u52a8\u6dfb\u52a0\u5230\u6bcf\u4e00\u4e2a\u8bf7\u6c42\u7684 ",(0,i.jsx)(n.code,{children:"api"})," \u5730\u5740\u4e2d\u3002"]}),"\n",(0,i.jsxs)(n.h3,{id:"6527-\u81ea\u5b9a\u4e49\u903b\u8f91\u63a7\u5236-swagger-\u6bcf\u4e00\u4e2a-api-\u53ef\u89c1\u6027",children:["6.5.27 \u81ea\u5b9a\u4e49\u903b\u8f91\u63a7\u5236 ",(0,i.jsx)(n.code,{children:"Swagger"})," \u6bcf\u4e00\u4e2a ",(0,i.jsx)(n.code,{children:"api"})," \u53ef\u89c1\u6027"]}),"\n",(0,i.jsxs)(n.p,{children:["\u6709\u65f6\u5019\u6211\u4eec\u9700\u8981\u81ea\u5b9a\u4e49 ",(0,i.jsx)(n.code,{children:"Swagger"})," \u63a5\u53e3\u53ef\u89c1\u6027\uff0c\u6bd4\u5982\u6839\u636e\u6743\u9650\uff0c\u4e0d\u540c\u7528\u6237\u7c7b\u578b\uff0c\u5404\u79cd\u903b\u8f91\u63a7\u5236\uff0c\u5982\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {4,6}",children:"// \u4e5f\u53ef\u4ee5\u7528 .AddInjectWithUnifyResult\r\nservices.AddInject(options =>\r\n{\r\n options.ConfigureSwaggerGen(gen =>\r\n {\r\n gen.DocInclusionPredicate((currentGroup, apiDescription) =>\r\n {\r\n // Furion \u5185\u90e8\u68c0\u67e5\uff0c\u5fc5\u987b\u653e\u7b2c\u4e00\u884c\r\n var isShow = SpecificationDocumentBuilder.CheckApiDescriptionInCurrentGroup(currentGroup, apiDescription);\r\n\r\n // \u83b7\u53d6\u5f53\u524d\u65b9\u6cd5\r\n _ = apiDescription.TryGetMethodInfo(out var method);\r\n\r\n // \u6709\u4e86\u65b9\u6cd5\uff0c\u8fd9\u91cc\u505a\u4f60\u60f3\u505a\u7684\u4e8b\u60c5\uff0cisShow \u8bbe\u7f6e true \u53ef\u89c1\uff0c\u8bbe\u7f6e false \u4e0d\u53ef\u89c1\r\n\r\n return isShow;\r\n });\r\n });\r\n});\n"})}),"\n",(0,i.jsxs)(n.h3,{id:"6528-\u914d\u7f6e-mvc-\u63a7\u5236\u5668\u652f\u6301\u89c4\u8303\u5316\u5904\u7406",children:["6.5.28 \u914d\u7f6e ",(0,i.jsx)(n.code,{children:"MVC"})," \u63a7\u5236\u5668\u652f\u6301\u89c4\u8303\u5316\u5904\u7406"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-json",metastring:"showLineNumbers",children:'{\r\n "UnifyResultSettings": {\r\n "SupportMvcController": true\r\n }\r\n}\n'})}),"\n",(0,i.jsxs)(n.h3,{id:"6529-swagger-\u5237\u65b0\u8bb0\u4f4f\u6388\u6743\u72b6\u6001",children:["6.5.29 ",(0,i.jsx)(n.code,{children:"Swagger"})," \u5237\u65b0\u8bb0\u4f4f\u6388\u6743\u72b6\u6001"]}),"\n",(0,i.jsxs)(n.p,{children:["\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c",(0,i.jsx)(n.code,{children:"Swagger"})," \u5237\u65b0\u6d4f\u89c8\u5668\u540e\uff0c\u6388\u6743\u72b6\u6001\u5c06\u88ab\u91cd\u7f6e\uff0c\u4e5f\u5c31\u662f\u9700\u8981\u91cd\u65b0\u767b\u5f55\uff0c\u901a\u8fc7\u4e0b\u9762\u4ee3\u7801\u5728 ",(0,i.jsx)(n.strong,{children:"\u7528\u6237\u767b\u5f55\u6210\u529f\u540e"})," \u8c03\u7528\u5373\u53ef\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers",children:'// ....\u9a8c\u8bc1\u7528\u6237\u540d/\u5bc6\u7801....\r\n\r\n_httpContextAccessor.HttpContext.SigninToSwagger("\u4f20\u5165 token");\n'})}),"\n",(0,i.jsxs)(n.h3,{id:"6530-\u5e26\u767b\u5f55\u7684-swagger-\u6587\u6863",children:["6.5.30 \u5e26\u767b\u5f55\u7684 ",(0,i.jsx)(n.code,{children:"Swagger"})," \u6587\u6863"]}),"\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 v3.3.3+"})," \u7248\u672c\u4f7f\u7528\u3002"]})}),"\n",(0,i.jsxs)(n.p,{children:["\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c",(0,i.jsx)(n.code,{children:"Swagger"})," \u662f\u4efb\u4f55\u4eba\u90fd\u53ef\u4ee5\u8bbf\u95ee\u7684\uff0c\u8fd9\u6837\u4e5f\u66b4\u9732\u51fa\u4e00\u4e9b\u5b89\u5168\u95ee\u9898\uff0c\u6240\u4ee5\u5728\u8be5\u7248\u672c\u4e4b\u540e\u6dfb\u52a0\u4e86\u767b\u5f55\u529f\u80fd\uff0c\u53ea\u9700\u8981\u914d\u7f6e ",(0,i.jsx)(n.code,{children:"SpecificationDocumentSettings"})," \u7684 ",(0,i.jsx)(n.code,{children:"LoginInfo"})," \u5373\u53ef\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-json",metastring:"showLineNumbers {2-6}",children:'{\r\n "SpecificationDocumentSettings": {\r\n "LoginInfo": {\r\n "Enabled": true,\r\n "CheckUrl": "/Home/CheckUrl",\r\n "SubmitUrl": "/Home/SubmitUrl",\r\n "UserName": "admin",\r\n "Password": "admin"\r\n }\r\n }\r\n}\n'})}),"\n",(0,i.jsx)(n.h4,{id:"\u914d\u7f6e\u8bf4\u660e",children:"\u914d\u7f6e\u8bf4\u660e"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"LoginInfo"}),"\uff1a\u914d\u7f6e ",(0,i.jsx)(n.code,{children:"Swagger"})," \u662f\u5426\u9700\u8981\u767b\u5f55\u624d\u80fd\u8bbf\u95ee\uff0c",(0,i.jsx)(n.code,{children:"SpecificationLoginInfo"})," \u7c7b\u578b\uff0c\u9ed8\u8ba4 ",(0,i.jsx)(n.code,{children:"null"}),"\uff0c",(0,i.jsx)(n.strong,{children:"\u4ec5\u5728 Furion v3.3.3+` \u6709\u6548"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Enabled"}),"\uff1a\u662f\u5426\u542f\u7528\u767b\u5f55\u6388\u6743\uff0c\u9ed8\u8ba4 ",(0,i.jsx)(n.code,{children:"false"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"CheckUrl"}),"\uff1a\u68c0\u67e5\u767b\u5f55\u72b6\u6001\u7684 ",(0,i.jsx)(n.code,{children:"Url"})," \u5730\u5740\uff0c",(0,i.jsxs)(n.strong,{children:["\u8be5\u5730\u5740\u5fc5\u987b\u662f ",(0,i.jsx)(n.code,{children:"POST"})," \u8bf7\u6c42"]}),"\uff0c\u5df2\u6388\u6743\u8fd4\u56de ",(0,i.jsx)(n.code,{children:"200"}),"\uff0c\u5426\u5219\u8fd4\u56de ",(0,i.jsx)(n.code,{children:"401"}),"\uff0c\u652f\u6301\u76f8\u5bf9\u5730\u5740\uff0c\u4ee5 ",(0,i.jsx)(n.code,{children:"/"})," \u5f00\u5934"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"SubmitUrl"}),"\uff1a\u63d0\u4ea4\u767b\u5f55\u7684 ",(0,i.jsx)(n.code,{children:"Url"})," \u5730\u5740\uff0c",(0,i.jsxs)(n.strong,{children:["\u8be5\u5730\u5740\u5fc5\u987b\u662f ",(0,i.jsx)(n.code,{children:"POST"})," \u8bf7\u6c42\u4e14\u53ea\u6709\u4e00\u4e2a ",(0,i.jsx)(n.code,{children:"SpecificationAuth"})," \u7c7b\u578b\u53c2\u6570"]}),"\uff0c\u6210\u529f\u767b\u5f55\u8fd4\u56de ",(0,i.jsx)(n.code,{children:"200"}),"\uff0c\u5426\u5219\u8fd4\u56de ",(0,i.jsx)(n.code,{children:"401"}),"\uff0c\u652f\u6301\u76f8\u5bf9\u5730\u5740\uff0c\u4ee5 ",(0,i.jsx)(n.code,{children:"/"})," \u5f00\u5934"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h4,{id:"\u914d\u7f6e\u793a\u4f8b",children:"\u914d\u7f6e\u793a\u4f8b"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {10-14,16-31}",children:'using Furion.SpecificationDocument;\r\nusing Microsoft.AspNetCore.Authorization;\r\nusing Microsoft.AspNetCore.Mvc;\r\nusing System.ComponentModel.DataAnnotations;\r\n\r\nnamespace Furion.Web.Entry.Controllers;\r\n\r\npublic class HomeController : Controller\r\n{\r\n [HttpPost, AllowAnonymous, NonUnify]\r\n public int CheckUrl()\r\n {\r\n return 401;\r\n }\r\n\r\n [HttpPost, AllowAnonymous, NonUnify]\r\n public int SubmitUrl([FromForm] SpecificationAuth auth)\r\n {\r\n // \u8bfb\u53d6\u914d\u7f6e\u4fe1\u606f\r\n var userName = App.Configuration["SpecificationDocumentSettings:LoginInfo:UserName"];\r\n var password = App.Configuration["SpecificationDocumentSettings:LoginInfo:Password"];\r\n\r\n if (auth.UserName == userName && auth.Password == password)\r\n {\r\n return 200;\r\n }\r\n else\r\n {\r\n return 401;\r\n }\r\n }\r\n}\n'})}),"\n",(0,i.jsx)("img",{src:(0,l.Z)("img/swgdl.png")}),"\n",(0,i.jsxs)(n.h3,{id:"6531-inheritdoc-\u5b9e\u73b0\u6ce8\u91ca\u7ee7\u627f",children:["6.5.31 ",(0,i.jsx)(n.code,{children:"inheritdoc"})," \u5b9e\u73b0\u6ce8\u91ca\u7ee7\u627f"]}),"\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 v3.3.3+"})," \u7248\u672c\u4f7f\u7528\u3002"]})}),"\n",(0,i.jsxs)(n.p,{children:["\u5728\u8fc7\u53bb\u6211\u4eec\u5728\u63a5\u53e3\u5b9a\u4e49\u7684\u65f6\u5019\u7f16\u5199\u4e86\u5b8c\u6574\u7684\u6210\u5458\u6ce8\u91ca\uff0c\u7136\u540e\u5728\u6d3e\u751f\u6210\u5458\u4e2d\u53c8\u8981\u91cd\u590d\u5199\u4e00\u6b21\uff0c\u5b9e\u9645\u4e0a\u505a\u4e86\u5f88\u5927\u65e0\u7528\u529f\uff0c\u73b0\u5728 ",(0,i.jsx)(n.code,{children:"Furion"})," \u652f\u6301\u4e86\u6ce8\u91ca\u7ee7\u627f\u4e86\uff0c\u540c\u65f6 ",(0,i.jsx)(n.code,{children:"Swagger"})," \u4e2d\u4e5f\u80fd\u6b63\u786e\u663e\u793a\u3002"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {5,8,14}",children:'using Furion.DynamicApiController;\r\n\r\nnamespace Furion.Application\r\n{\r\n /// \r\n public class TestInheritdoc : ITestInheritdoc, IDynamicApiController\r\n {\r\n /// \r\n public string GetName()\r\n {\r\n return "Furion";\r\n }\r\n\r\n /// \r\n public string GetVersion()\r\n {\r\n return "3.3.3";\r\n }\r\n }\r\n\r\n /// \r\n /// \u6d4b\u8bd5\u6ce8\u91ca\u7ee7\u627f\r\n /// \r\n public interface ITestInheritdoc\r\n {\r\n /// \r\n /// \u83b7\u53d6\u540d\u79f0\r\n /// \r\n /// \r\n string GetName();\r\n\r\n /// \r\n /// \u83b7\u53d6\u7248\u672c\r\n /// \r\n /// \r\n string GetVersion();\r\n }\r\n}\r\n\n'})}),"\n",(0,i.jsx)(n.p,{children:"\u663e\u793a\u6548\u679c\uff1a"}),"\n",(0,i.jsx)("img",{src:(0,l.Z)("img/cdr22.png")}),"\n",(0,i.jsx)(n.admonition,{title:"\u6ce8\u610f\u4e8b\u9879",type:"important",children:(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:""})," \u4e0d\u6307\u5b9a ",(0,i.jsx)(n.code,{children:"cref"})," ",(0,i.jsx)(n.strong,{children:"\u4ec5\u9650\u6210\u5458\u53ef\u7528"}),"\u4e14\u6240\u5728\u7684\u7c7b\u578b\u5fc5\u987b\u6307\u5b9a ",(0,i.jsx)(n.code,{children:''}),"\uff0c\u8fd9\u6837\u624d\u80fd\u81ea\u52a8\u8bc6\u522b\u3002"]})}),"\n",(0,i.jsxs)(n.h3,{id:"6532-\u542f\u7528-all-groups-\u5206\u7ec4\u529f\u80fd",children:["6.5.32 \u542f\u7528 ",(0,i.jsx)(n.code,{children:"All Groups"})," \u5206\u7ec4\u529f\u80fd"]}),"\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 v3.3.4+"})," \u7248\u672c\u4f7f\u7528\u3002"]})}),"\n",(0,i.jsxs)(n.p,{children:["\u6709\u65f6\u5019\u6211\u4eec\u4e3a\u4e86\u66f4\u597d\u7684\u5bf9\u63a5\u53e3\u8fdb\u884c\u5f52\u7c7b\uff0c\u914d\u7f6e\u4e86 ",(0,i.jsx)(n.code,{children:"Swagger"})," \u591a\u4e2a\u5206\u7ec4\u7684\u529f\u80fd\uff0c\u4f46\u8fd9\u6837\u4e5f\u5bf9\u751f\u6210\u5ba2\u6237\u7aef\u8bf7\u6c42\u4ee3\u7801\u9020\u6210\u4e86\u56f0\u6270\uff0c\u6240\u4ee5\u6dfb\u52a0\u4e86\u65b0\u7684\u914d\u7f6e\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-json",metastring:"showLineNumbers {2-3}",children:'{\r\n "SpecificationDocumentSettings": {\r\n "EnableAllGroups": true\r\n }\r\n}\n'})}),"\n",(0,i.jsx)(n.h3,{id:"6533-\u63a5\u53e3\u8fc7\u65f6\u63a7\u5236",children:"6.5.33 \u63a5\u53e3\u8fc7\u65f6\u63a7\u5236"}),"\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 v3.3.5+"})," \u7248\u672c\u4f7f\u7528\u3002"]})}),"\n",(0,i.jsxs)(n.p,{children:["\u6709\u65f6\u5019\u6211\u4eec\u67d0\u4e2a\u63a5\u53e3\u5df2\u7ecf\u8fc7\u65f6\uff0c\u63d0\u793a\u5c3d\u65e9\u8c03\u7528\u6700\u65b0\u63a5\u53e3\uff0c\u53ea\u9700\u8981\u5728\u65b9\u6cd5\u4e0a\u9762\u8d34 ",(0,i.jsx)(n.code,{children:"[Obsolete]"})," \u5373\u53ef\uff0c\u5982\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {1,7}",children:'[Obsolete("GetName() \u5df2\u7ecf\u8fc7\u65f6\uff0c\u8bf7\u8c03\u7528 GetFrameworkName() \u66ff\u4ee3")]\r\npublic string GetName()\r\n{\r\n return nameof(Furion);\r\n}\r\n\r\n[Obsolete]\r\npublic string Other()\r\n{\r\n // ...\r\n}\n'})}),"\n",(0,i.jsx)("img",{src:(0,l.Z)("img/swg2.png")}),"\n",(0,i.jsx)(n.h3,{id:"6534-\u5355\u4e00\u63a5\u53e3\u66f4\u591a\u63cf\u8ff0",children:"6.5.34 \u5355\u4e00\u63a5\u53e3\u66f4\u591a\u63cf\u8ff0"}),"\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 v3.3.5+"})," \u7248\u672c\u4f7f\u7528\u3002"]})}),"\n",(0,i.jsxs)(n.p,{children:["\u5728\u8be5\u7248\u672c\u65b0\u589e\u4e86 ",(0,i.jsx)(n.code,{children:"[ApiDescriptionSettings]"})," \u7684 ",(0,i.jsx)(n.code,{children:"Description"})," \u5c5e\u6027\uff0c\u652f\u6301\u5b9a\u4e49\u66f4\u591a\u63cf\u8ff0\uff0c\u5982\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {1}",children:'[ApiDescriptionSettings(Description = "\u6211\u662f\u4e00\u6bb5\u63cf\u8ff0\uff0c\u663e\u793a\u66f4\u591a\u5185\u5bb9 ")]\r\npublic string add()\r\n{\r\n //....\r\n}\n'})}),"\n",(0,i.jsx)("img",{src:(0,l.Z)("img/swg1.png")}),"\n",(0,i.jsxs)(n.h3,{id:"6535-swagger-\u5f02\u5e38\u4e0d\u80fd\u663e\u793a\u9519\u8bef\u5904\u7406",children:["6.5.35 ",(0,i.jsx)(n.code,{children:"Swagger"})," \u5f02\u5e38/\u4e0d\u80fd\u663e\u793a/\u9519\u8bef\u5904\u7406"]}),"\n",(0,i.jsxs)(n.p,{children:["\u6709\u65f6\u5019\u53ef\u80fd\u56e0\u4e3a\u9519\u8bef\u7684\u914d\u7f6e\u5bfc\u81f4 ",(0,i.jsx)(n.code,{children:"Swagger"})," \u4e0d\u80fd\u663e\u793a\uff0c\u8fd9\u65f6\u5019\u53ea\u9700\u8981\u590d\u5236\u63d0\u793a\u7684\u9519\u8bef ",(0,i.jsx)(n.code,{children:".json"})," \u94fe\u63a5\u5730\u5740\u5230\u6d4f\u89c8\u5668\u4e2d\u8bbf\u95ee\u5373\u53ef\uff0c\u5982\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",metastring:"showLineNumbers",children:"https://localhost:\u4f60\u7684\u7aef\u53e3/swagger/Default/swagger.json\n"})}),"\n",(0,i.jsxs)(n.p,{children:["\u540e\u9762\u7684 ",(0,i.jsx)(n.code,{children:"/swagger/Default/swagger.json"})," \u5c31\u662f ",(0,i.jsx)(n.code,{children:"Swagger"})," \u9519\u8bef\u63d0\u793a\u7684 ",(0,i.jsx)(n.code,{children:".json"})," \u94fe\u63a5\u5730\u5740\u3002"]}),"\n",(0,i.jsx)(n.p,{children:"\u8fd9\u6837\u5c31\u53ef\u4ee5\u770b\u5230\u8be6\u7ec6\u7684\u9519\u8bef\u4e86\u3002"}),"\n",(0,i.jsx)("img",{src:(0,l.Z)("img/sperr.png")}),"\n",(0,i.jsx)("img",{src:(0,l.Z)("img/sperr2.png")}),"\n",(0,i.jsxs)(n.h3,{id:"6536-\u81ea\u5b9a\u4e49-swagger-\u7684-schemaid",children:["6.5.36 \u81ea\u5b9a\u4e49 ",(0,i.jsx)(n.code,{children:"Swagger"})," \u7684 ",(0,i.jsx)(n.code,{children:"SchemaId"})]}),"\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 v3.6.4+"})," \u7248\u672c\u4f7f\u7528\u3002"]})}),"\n",(0,i.jsxs)(n.p,{children:["\u6709\u65f6\u5019\uff0c\u4e0d\u540c\u7a0b\u5e8f\u96c6\u4f1a\u5b9a\u4e49\u76f8\u540c\u7684\u7c7b\u578b\u540d\u79f0 ",(0,i.jsx)(n.code,{children:"Name"}),"\uff0c\u8fd9\u6837\u5c31\u4f1a\u5bfc\u81f4\u751f\u6210 ",(0,i.jsx)(n.code,{children:"Swagger"})," \u7684 ",(0,i.jsx)(n.code,{children:"SchemaId"})," \u51fa\u73b0\u51b2\u7a81\uff0c\u8fd9\u65f6\u53ea\u9700\u8981\u5728\u7c7b\u578b\u4e0a\u8d34 ",(0,i.jsx)(n.code,{children:"[SchemaId]"})," \u7279\u6027\u5373\u53ef\uff0c\u5982\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {3}",children:'using Furion.SpecificationDocument;\r\n\r\n[SchemaId("Other_")]\r\npublic class PersonDto\r\n{\r\n // ...\r\n}\n'})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"SchemaIdAttribute"})," \u914d\u7f6e\u9009\u9879\uff1a","\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"SchemaId"}),"\uff1a\u81ea\u5b9a\u4e49 ",(0,i.jsx)(n.code,{children:"SchemaId"}),"\uff0c\u5b57\u7b26\u4e32\u7c7b\u578b\uff0c\u53ea\u80fd\u662f ",(0,i.jsx)(n.code,{children:"\u5b57\u6bcd,\u6570\u5b57\uff0c\u4e0b\u5212\u7ebf"})," \u7ec4\u5408"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Replace"}),"\uff1a\u662f\u5426\u5b8c\u5168\u66ff\u6362\uff0c",(0,i.jsx)(n.code,{children:"bool"})," \u7c7b\u578b\uff0c\u9ed8\u8ba4 ",(0,i.jsx)(n.code,{children:"false"}),"\uff0c\u9ed8\u8ba4\u662f\u4f5c\u4e3a\u524d\u7f00\u62fc\u63a5\uff0c\u5982\u4e0a\u9762\u7684 ",(0,i.jsx)(n.code,{children:"PersonDto"})," \u4f1a\u751f\u6210 ",(0,i.jsx)(n.code,{children:"Other_PersonDto"}),"\uff0c\u5982\u679c\u8bbe\u7f6e\u4e3a ",(0,i.jsx)(n.code,{children:"true"}),"\uff0c\u5219\u76f4\u63a5\u4f7f\u7528 ",(0,i.jsx)(n.code,{children:"Other_"})]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.h3,{id:"6537-\u81ea\u5b9a\u4e49-swagger-\u7684-operationid",children:["6.5.37 \u81ea\u5b9a\u4e49 ",(0,i.jsx)(n.code,{children:"Swagger"})," \u7684 ",(0,i.jsx)(n.code,{children:"OperationId"})]}),"\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.1.7+"})," \u7248\u672c\u4f7f\u7528\u3002"]})}),"\n",(0,i.jsxs)(n.p,{children:["\u901a\u8fc7\u6211\u4eec\u6839\u636e ",(0,i.jsx)(n.code,{children:"swagger.json"})," \u751f\u6210\u524d\u7aef\u4ee3\u7801\u65f6\uff0c",(0,i.jsx)(n.code,{children:"Swagger"})," \u4f1a\u81ea\u52a8\u6839\u636e\u8def\u7531\u5730\u5740\u751f\u6210\u8c03\u7528\u7684 ",(0,i.jsx)(n.code,{children:"api"})," \u540d\u79f0\uff0c\u4f46\u8fd9\u6837\u7684\u540d\u79f0\u5f80\u5f80\u4e0d\u6613\u8bfb\uff0c\u8fd9\u65f6\u5019\u53ef\u81ea\u5b9a\u4e49 ",(0,i.jsx)(n.code,{children:"[OperationId]"})," \u6765\u914d\u7f6e\u751f\u6210\u7684\u524d\u7aef\u540d\u79f0\u3002"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {5}",children:'using Furion.SpecificationDocument;\r\n\r\npublic class PersonDto\r\n{\r\n [OperationId("MyClientMethodName")]\r\n public string TestMethod()\r\n {\r\n // ...\r\n }\r\n}\n'})}),"\n",(0,i.jsxs)(n.h3,{id:"6538-swagger-\u63a5\u53e3\u6587\u6863\u652f\u6301\u5b8c\u6574\u7684-markdown",children:["6.5.38 ",(0,i.jsx)(n.code,{children:"Swagger"})," \u63a5\u53e3\u6587\u6863\u652f\u6301\u5b8c\u6574\u7684 ",(0,i.jsx)(n.code,{children:"Markdown"})]}),"\n",(0,i.jsxs)(n.p,{children:["\u5728 ",(0,i.jsx)(n.code,{children:"Furion"})," \u6700\u65b0\u7248\u4e2d\uff0c\u652f\u6301\u4e86\u5b8c\u6574\u7684 ",(0,i.jsx)(n.code,{children:"Markdown"})," \u6ce8\u518c\uff0c\u5982\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {4,80}",children:'/// \r\n/// \u6d4b\u8bd5 Markdown\r\n/// \r\n/// \r\n/// # \u5148\u77e5 / Furion ([\u63a2\u7d22\u7248](https://gitee.com/dotnetchina/Furion/tree/experimental/))\r\n///\r\n/// \u4e00\u4e2a\u5e94\u7528\u7a0b\u5e8f\u6846\u67b6\uff0c\u60a8\u53ef\u4ee5\u5c06\u5b83\u96c6\u6210\u5230\u4efb\u4f55.NET/C# \u5e94\u7528\u7a0b\u5e8f\u4e2d\u3002\r\n///\r\n/// An application framework that you can integrate into any.NET/C# application.\r\n///\r\n/// ## \u5b89\u88c5 / Installation\r\n///\r\n/// - [Package Manager] (https://www.nuget.org/packages/Furion)\r\n///\r\n/// ```powershell\r\n/// Install-Package Furion\r\n/// ```\r\n///\r\n/// - [.NET CLI] (https://www.nuget.org/packages/Furion)\r\n///\r\n/// ```powershell\r\n/// dotnet add package Furion\r\n/// ```\r\n///\r\n/// ## \u4f8b\u5b50 / Examples\r\n///\r\n/// \u6211\u4eec\u5728[\u4e3b\u9875](http://furion.baiqian.ltd)\u4e0a\u6709\u4e0d\u5c11\u4f8b\u5b50\uff0c\u8fd9\u662f\u8ba9\u60a8\u5165\u95e8\u7684\u7b2c\u4e00\u4e2a\uff1a\r\n///\r\n/// We have several examples [on the website] (http://furion.baiqian.ltd). Here is the first one to get you started:\r\n///\r\n/// ```cs\r\n/// Serve.Run();\r\n///\r\n/// [DynamicApiController]\r\n/// public class HelloService\r\n/// {\r\n/// public string Say()\r\n/// {\r\n/// return "Hello, Furion";\r\n/// }\r\n/// }\r\n/// ```\r\n///\r\n/// \u6253\u5f00\u6d4f\u89c8\u5668\u8bbf\u95ee `https://localhost:5001`\u3002\r\n///\r\n/// Open browser access `https://localhost:5001`.\r\n///\r\n/// ## \u6587\u6863 / Documentation\r\n///\r\n/// \u60a8\u53ef\u4ee5\u5728[\u4e3b\u9875] (http://furion.baiqian.ltd)\u6216[\u5907\u4efd\u4e3b\u9875](http://furion.baiqian.ltd)\u627e\u5230 Furion \u6587\u6863\u3002\r\n///\r\n/// You can find the Furion documentation[on the website](http://furion.baiqian.ltd) or [on the backup website](http://furion.baiqian.ltd).\r\n///\r\n/// ## \u8d21\u732e / Contributing\r\n///\r\n/// \u8be5\u5b58\u50a8\u5e93\u7684\u4e3b\u8981\u76ee\u7684\u662f\u7ee7\u7eed\u53d1\u5c55 Furion \u6838\u5fc3\uff0c\u4f7f\u5176\u66f4\u5feb\u3001\u66f4\u6613\u4e8e\u4f7f\u7528\u3002 Furion \u7684\u5f00\u53d1\u5728[Gitee](https://gitee.com/dotnetchina/Furion) \u4e0a\u516c\u5f00\u8fdb\u884c\uff0c\u6211\u4eec\u611f\u8c22\u793e\u533a\u8d21\u732e\u9519\u8bef\u4fee\u590d\u548c\u6539\u8fdb\u3002\r\n///\r\n/// \u9605\u8bfb[\u8d21\u732e\u6307\u5357] (http://furion.baiqian.ltd/docs/contribute)\u5185\u5bb9\uff0c\u4e86\u89e3\u5982\u4f55\u53c2\u4e0e\u6539\u8fdb Furion\u3002\r\n///\r\n/// The main purpose of this repository is to continue evolving Furion core, making it faster and easier to use.Development of Furion happens in the open on[Gitee] (https://gitee.com/dotnetchina/Furion), and we are grateful to the community for contributing bugfixes and improvements.\r\n///\r\n/// Read[contribution documents] (http://furion.baiqian.ltd/docs/contribute) to learn how you can take part in improving Furion.\r\n///\r\n/// ## \u8bb8\u53ef\u8bc1 / License\r\n///\r\n/// Furion \u91c7\u7528[MIT](https://gitee.com/dotnetchina/Furion/blob/v4/LICENSE) \u5f00\u6e90\u8bb8\u53ef\u8bc1\u3002\r\n///\r\n/// Furion uses the[MIT] (https://gitee.com/dotnetchina/Furion/blob/v4/LICENSE) open source license.\r\n///\r\n/// ```\r\n/// Copyright\xa9 2020-present \u767e\u5c0f\u50e7, Baiqian Co., Ltd.\r\n/// Furion is licensed under Mulan PSL v2.\r\n/// You can use this software according to the terms andconditions of the Mulan PSL v2.\r\n/// You may obtain a copy of Mulan PSL v2 at:\r\n/// https://gitee.com/dotnetchina/Furion/blob/v4/LICENSE\r\n/// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUTWARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.\r\n/// See the Mulan PSL v2 for more details.\r\n/// ```\r\n///\r\n/// \r\n/// \r\npublic string Hello()\r\n{\r\n return "Furion";\r\n}\n'})}),"\n",(0,i.jsx)("img",{src:(0,l.Z)("img/mdx.png")}),"\n",(0,i.jsxs)(n.h3,{id:"6539-\u7b2c\u4e09\u65b9-ui-\u96c6\u6210\u5982-knife4jui",children:["6.5.39 \u7b2c\u4e09\u65b9 ",(0,i.jsx)(n.code,{children:"UI"})," \u96c6\u6210\uff0c\u5982 ",(0,i.jsx)(n.code,{children:"Knife4jUI"})]}),"\n",(0,i.jsxs)(n.p,{children:["\u5728 ",(0,i.jsx)(n.code,{children:"Furion"})," \u6846\u67b6\u4e2d\uff0c\u96c6\u6210\u7b2c\u4e09\u65b9 ",(0,i.jsx)(n.code,{children:"SwaggerUI"})," \u975e\u5e38\u5bb9\u6613\uff0c\u6bd4\u5982\u96c6\u6210 ",(0,i.jsx)(n.code,{children:"IGeekFan.AspNetCore.Knife4jUI"}),"\uff1a"]}),"\n",(0,i.jsx)(n.admonition,{title:"\u5b89\u88c5\u5305",type:"note",children:(0,i.jsxs)(n.p,{children:["\u53ea\u9700\u8981\u5728 ",(0,i.jsx)(n.code,{children:"YourPoject.Web.Core"})," \u5c42\u5b89\u88c5 ",(0,i.jsx)(n.code,{children:"IGeekFan.AspNetCore.Knife4jUI"})," \u5373\u53ef\u3002"]})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsxs)(n.strong,{children:[(0,i.jsx)(n.code,{children:"Knife4jUI"})," \u72ec\u7acb\u7248\u672c\u914d\u7f6e"]})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {1,3,12}",children:'var routePrefix = "api"; // \u5b9a\u4e49 swagger \u8def\u7531\u5730\u5740\uff0c\u5982\u679c\u662f\u8ddf\u76ee\u5f55\uff0c\u8bbe\u7f6e string.Empty \u5373\u53ef\r\n\r\napp.UseKnife4UI(options =>\r\n{\r\n options.RoutePrefix = routePrefix; // \u914d\u7f6e Knife4UI \u8def\u7531\u5730\u5740\r\n foreach (var groupInfo in SpecificationDocumentBuilder.GetOpenApiGroups())\r\n {\r\n options.SwaggerEndpoint("/" + groupInfo.RouteTemplate, groupInfo.Title);\r\n }\r\n});\r\n\r\napp.UseInject(routePrefix); // \u914d\u7f6e Furion \u8def\u7531\u5730\u5740\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsxs)(n.strong,{children:[(0,i.jsx)(n.code,{children:"Knife4jUI"})," \u548c ",(0,i.jsx)(n.code,{children:"Swagger"})," \u5171\u5b58\u7248\u672c\u914d\u7f6e"]})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {1,3,10}",children:'app.UseKnife4UI(options =>\r\n{\r\n options.RoutePrefix = "newapi"; // \u914d\u7f6e Knife4UI \u8def\u7531\u5730\u5740\uff0c\u73b0\u5728\u662f /newapi\r\n foreach (var groupInfo in SpecificationDocumentBuilder.GetOpenApiGroups())\r\n {\r\n options.SwaggerEndpoint("/" + groupInfo.RouteTemplate, groupInfo.Title);\r\n }\r\n});\r\n\r\napp.UseInject(); // Furion \u9ed8\u8ba4 api \u5730\u5740\u4e3a /api\n'})}),"\n",(0,i.jsx)("img",{src:(0,l.Z)("img/sg20.png")}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsxs)(n.strong,{children:["\u5982\u9700\u5b9e\u73b0\u767b\u5f55\u4e4b\u540e\u81ea\u52a8\u5c06 ",(0,i.jsx)(n.code,{children:"token"})," \u6dfb\u52a0\u5230\u5934\u90e8\u53ef\u5728\u767b\u5f55\u63a5\u53e3 ",(0,i.jsx)(n.code,{children:"AfterScript"})," \u6267\u884c\u4ee5\u4e0b\u4ee3\u7801\uff1a"]})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:'ke.global.setAllHeader(\r\n "Authorization",\r\n "Bearer " + ke.response.headers["access-token"]\r\n);\n'})}),"\n",(0,i.jsx)("img",{src:(0,l.Z)("img/kni.jpg")}),"\n",(0,i.jsxs)(n.h3,{id:"6540-\u6dfb\u52a0-swagger-\u8bf7\u6c42\u54cd\u5e94\u62e6\u622a",children:["6.5.40 \u6dfb\u52a0 ",(0,i.jsx)(n.code,{children:"Swagger"})," \u8bf7\u6c42\u54cd\u5e94\u62e6\u622a"]}),"\n",(0,i.jsxs)(n.p,{children:["\u6709\u65f6\u5019\u6211\u4eec\u5e0c\u671b\u5728 ",(0,i.jsx)(n.code,{children:"Swagger"})," \u8bf7\u6c42\u4e4b\u524d\u8fdb\u884c\u62e6\u622a\uff0c\u6bd4\u5982\u4fee\u6539 ",(0,i.jsx)(n.code,{children:"Url"})," \u53c2\u6570\uff0c\u6dfb\u52a0\u989d\u5916\u8bf7\u6c42\u5934\u7b49\uff0c\u53c8\u6216\u8005\u60f3\u5728\u54cd\u5e94\u4e4b\u540e\u6253\u5370\u8fd4\u56de\u503c\u5230\u63a7\u5236\u53f0\u6216\u8fdb\u884c\u5176\u4ed6\u64cd\u4f5c\u3002\u8fd9\u65f6\u5019\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u5f0f\u5904\u7406\uff0c\u5982\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {1,3,6,8}",children:'app.UseInject(options =>\r\n{\r\n options.ConfigureSwaggerUI(ui =>\r\n {\r\n // \u8bf7\u6c42\u62e6\u622a\r\n ui.UseRequestInterceptor("function(request) { return defaultRequestInterceptor(request); }");\r\n // \u54cd\u5e94\u62e6\u622a\r\n ui.UseResponseInterceptor("function(response) { return defaultResponseInterceptor(response); }");\r\n });\r\n});\n'})}),"\n",(0,i.jsxs)(n.p,{children:["\u6ce8\u610f\uff0c",(0,i.jsx)(n.code,{children:"UseRequestInterceptor"})," \u548c ",(0,i.jsx)(n.code,{children:"UseResponseInterceptor"})," \u4ee3\u7801\u4e0d\u80fd\u6362\u884c\u4e14\u987b\u5728 ",(0,i.jsx)(n.code,{children:"defaultRequestInterceptor(request)"})," \u548c ",(0,i.jsx)(n.code,{children:"defaultResponseInterceptor(response)"})," \u4e4b\u524d\u7f16\u5199\u81ea\u5b9a\u4e49\u4ee3\u7801\uff0c\u5426\u5219\u4f1a\u62a5\u9519\u3002"]}),"\n",(0,i.jsxs)(n.p,{children:["\u4e0b\u9762\u7ed9\u51fa\u8bf7\u6c42\u6dfb\u52a0\u81ea\u5b9a\u4e49 ",(0,i.jsx)(n.code,{children:"header"})," \u793a\u4f8b\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {6}",children:"app.UseInject(options =>\r\n{\r\n options.ConfigureSwaggerUI(ui =>\r\n {\r\n // \u6dfb\u52a0\u8bf7\u6c42\u5934 framework: Furion\uff0c\u6ce8\u610f\u4ee3\u7801\u4e0d\u80fd\u6362\u884c\uff0c\u5426\u5219 Swagger \u65e0\u6cd5\u52a0\u8f7d !!!!\r\n ui.UseRequestInterceptor(\"function(request) { request.headers['framework']='Furion'; return defaultRequestInterceptor(request); }\");\r\n });\r\n});\n"})}),"\n",(0,i.jsx)(n.h3,{id:"6541-\u679a\u4e3e\u7c7b\u578b\u503c",children:"6.5.41 \u679a\u4e3e\u7c7b\u578b\u503c"}),"\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.35 +"})," \u7248\u672c\u4f7f\u7528\u3002"]})}),"\n",(0,i.jsxs)(n.p,{children:["\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u679a\u4e3e\u7c7b\u578b\u503c\u4f1a\u751f\u6210\u5b57\u7b26\u4e32\u7c7b\u578b\uff0c\u5982\u9700\u751f\u6210\u503c\u7c7b\u578b\u5219\u6dfb\u52a0 ",(0,i.jsx)(n.code,{children:"[EnumToNumber]"})," \u7279\u6027\uff0c\u4f46\u8fd8\u6709\u4e00\u79cd\u60c5\u51b5\uff0c\u90a3\u5c31\u662f",(0,i.jsx)(n.strong,{children:"\u5982\u679c\u679a\u4e3e\u9879\u5b58\u5728\u4e2d\u6587\uff0c\u4f1a\u5f3a\u5236\u751f\u6210\u4e3a\u503c\u7c7b\u578b"}),"\u3002"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"\u7f3a\u7701\u60c5\u51b5"}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers",children:"public enum NoticeTypeEnum\r\n{\r\n NOTICE = 1,\r\n ANNOUNCEMENT = 2,\r\n}\n"})}),"\n",(0,i.jsxs)(n.p,{children:["\u9ed8\u8ba4\u751f\u6210 ",(0,i.jsx)(n.code,{children:"TypeScript"})," \u4ee3\u7801\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-ts",metastring:"showLineNumbers {2-3}",children:'export enum NoticeTypeEnum {\r\n NOTICE = "NOTICE",\r\n ANNOUNCEMENT = "ANNOUNCEMENT",\r\n}\n'})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"\u914d\u7f6e\u60c5\u51b5"}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {1}",children:"[EnumToNumber]\r\npublic enum NoticeTypeEnum\r\n{\r\n NOTICE = 1,\r\n ANNOUNCEMENT = 2,\r\n}\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-ts",metastring:"showLineNumbers {2-3}",children:"export enum NoticeTypeEnum {\r\n NUMBER_1 = 1,\r\n NUMBER_2 = 2,\r\n}\n"})}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsxs)(n.strong,{children:["\u8fd9\u79cd\u7684 ",(0,i.jsx)(n.code,{children:"NUMBER_"})," \u89c4\u5219 ",(0,i.jsx)(n.code,{children:"Furion"})," \u65e0\u6cd5\u63a7\u5236\uff0c\u8fd9\u662f ",(0,i.jsx)(n.code,{children:"Swagger"})," \u751f\u6210\u7684\u3002"]})," \u8fd8\u53ef\u4ee5\u8bbe\u7f6e ",(0,i.jsx)(n.code,{children:"[EnumToNumber(false)]"})," \u751f\u6210\u5b57\u7b26\u4e32\u7c7b\u578b\u3002"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"\u5b58\u5728\u4e2d\u6587\u60c5\u51b5"}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {5}",children:"public enum NoticeTypeEnum\r\n{\r\n NOTICE = 1,\r\n ANNOUNCEMENT = 2,\r\n \u4e2d\u6587\r\n}\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-ts",metastring:"showLineNumbers {2-4}",children:"export enum NoticeTypeEnum {\r\n NUMBER_1 = 1,\r\n NUMBER_2 = 2,\r\n NUMBER_3 = 3,\r\n}\n"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"\u9664\u4e86\u4e0a\u9762\u72ec\u7acb\u914d\u7f6e\u4ee5\u5916\u8fd8\u652f\u6301\u5168\u5c40\u914d\u7f6e\uff1a"}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-json",metastring:"showLineNumbers {2-3}",children:'{\r\n "SpecificationDocumentSettings": {\r\n "EnumToNumber": true\r\n }\r\n}\n'})}),"\n",(0,i.jsxs)(n.h2,{id:"66-specificationdocumentsettings-\u914d\u7f6e",children:["6.6 ",(0,i.jsx)(n.code,{children:"SpecificationDocumentSettings"})," \u914d\u7f6e"]}),"\n",(0,i.jsxs)(n.p,{children:["\u9664\u4e86\u4e0a\u8ff0\u4f8b\u5b50\u5916\uff0c",(0,i.jsx)(n.code,{children:"Furion"})," \u63d0\u4f9b\u4e86\u4e00\u4e9b\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:"DocumentTitle"}),"\uff1a\u6587\u6863\u6807\u9898\uff0c",(0,i.jsx)(n.code,{children:"string"}),"\uff0c\u9ed8\u8ba4 ",(0,i.jsx)(n.code,{children:"Specification Api Document"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"DefaultGroupName"}),"\uff1a\u9ed8\u8ba4\u5206\u7ec4\u540d\uff0c",(0,i.jsx)(n.code,{children:"string"}),"\uff0c\u9ed8\u8ba4 ",(0,i.jsx)(n.code,{children:"Default"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"EnableAuthorized"}),"\uff1a\u662f\u5426\u542f\u7528\u6743\u9650\u63a7\u5236\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:"FormatAsV2"}),"\uff1a\u91c7\u7528 ",(0,i.jsx)(n.code,{children:"Swagger 2.0"})," \u7248\u672c\uff0c",(0,i.jsx)(n.code,{children:"bool"}),"\uff0c\u9ed8\u8ba4 ",(0,i.jsx)(n.code,{children:"false"})," ",(0,i.jsx)(n.strong,{children:(0,i.jsx)(n.a,{href:"https://github.com/domaindrivendev/Swashbuckle.WebApi/issues/1393",children:"\u5df2\u5f03\u7528"})})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"RoutePrefix"}),"\uff1a\u89c4\u8303\u5316\u6587\u6863\u5730\u5740\uff0c",(0,i.jsx)(n.code,{children:"string"}),"\uff0c\u9ed8\u8ba4 ",(0,i.jsx)(n.code,{children:"api"}),"\uff0c",(0,i.jsx)(n.strong,{children:"\u5982\u679c\u5e0c\u671b\u5728\u9996\u9875\uff0c\u6539\u4e3a\u7a7a\u5b57\u7b26\u4e32\u5373\u53ef"}),"\u3002"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"DocExpansionState"}),"\uff1a\u6587\u6863\u663e\u793a\u65b9\u5f0f\uff0c",(0,i.jsx)(n.code,{children:"DocExpansion"}),"\uff0c\u9ed8\u8ba4 ",(0,i.jsx)(n.code,{children:"List"}),"\uff0c\u53d6\u503c\uff1a","\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"List"}),"\uff1a\u5217\u8868\u5f0f\uff08\u5c55\u5f00\u5b50\u7c7b\uff09\uff0c",(0,i.jsx)(n.strong,{children:"\u9ed8\u8ba4\u503c"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Full"}),"\uff1a\u5b8c\u5168\u5c55\u5f00"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"None"}),"\uff1a\u5217\u8868\u5f0f\uff08\u4e0d\u5c55\u5f00\u5b50\u7c7b\uff09"]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"XmlComments"}),"\uff1a\u7a0b\u5e8f\u96c6\u6ce8\u91ca\u63cf\u8ff0\u6587\u4ef6\u540d\uff08\u53ef\u5e26 ",(0,i.jsx)(n.code,{children:".xml"}),"\uff0c",(0,i.jsx)(n.code,{children:"string"}),"\uff0c\u9ed8\u8ba4 ",(0,i.jsx)(n.code,{children:"Furion.Application, Furion.Web.Entry, Furion.Web.Core"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"GroupOpenApiInfos"}),"\uff1a\u5206\u7ec4\u4fe1\u606f\u914d\u7f6e\uff0c",(0,i.jsx)(n.code,{children:"SpecificationOpenApiInfo[]"}),"\uff0c\u9ed8\u8ba4 ",(0,i.jsx)(n.code,{children:"{ 'Group': 'Default'}"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"SecurityDefinitions"}),"\uff1a\u5b89\u5168\u7b56\u7565\u5b9a\u4e49\u914d\u7f6e\uff0c",(0,i.jsx)(n.code,{children:"SpecificationOpenApiSecurityScheme[]"}),"\uff0c\u9ed8\u8ba4 ",(0,i.jsx)(n.code,{children:"[]"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Servers"}),"\uff1a\u914d\u7f6e Server \u4e0b\u62c9\u5217\u8868\uff0c",(0,i.jsx)(n.code,{children:"OpenApiServer[]"})," \u7c7b\u578b\uff0c\u9ed8\u8ba4 ",(0,i.jsx)(n.code,{children:"[]"}),"\uff0c\u5982\uff1a",(0,i.jsx)(n.code,{children:'{Servers:[ { Url:"\u5730\u5740", Description:"\u63cf\u8ff0"} ]}'})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"HideServers"}),"\uff1a\u662f\u5426\u9690\u85cf Server \u4e0b\u62c9\u5217\u8868\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:"RouteTemplate"}),"\uff1a\u914d\u7f6e\u6587\u6863 ",(0,i.jsx)(n.code,{children:"swagger.json"})," \u8def\u7531\u6a21\u677f\uff0c\u9ed8\u8ba4\u6a21\u677f\uff1a",(0,i.jsx)(n.code,{children:"swagger/{documentName}/swagger.json"}),", ",(0,i.jsx)(n.code,{children:"{documentName}"})," \u4ee3\u8868\u5206\u7ec4\u540d\uff0c",(0,i.jsx)(n.strong,{children:"\u5fc5\u987b\u4fdd\u7559\u539f\u6837"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"PackagesGroups"}),"\uff1a\u914d\u7f6e\u6a21\u5757\u5316\u5185\u7f6e\u5206\u7ec4\u540d\u79f0\uff0c",(0,i.jsx)(n.code,{children:"string[]"})," \u7c7b\u578b\uff0c\u9ed8\u8ba4 ",(0,i.jsx)(n.code,{children:"[]"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"EnableEnumSchemaFilter"}),"\uff1a\u542f\u7528\u679a\u4e3e Schema \u7b5b\u9009\u5668\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:"EnableTagsOrderDocumentFilter"}),"\uff1a\u542f\u7528\u6807\u7b7e\u6392\u5e8f\u7b5b\u9009\u5668\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:"ServerDir"}),"\uff1a\u914d\u7f6e ",(0,i.jsx)(n.code,{children:"IIS"})," \u6dfb\u52a0 ",(0,i.jsx)(n.code,{children:"Application"})," \u90e8\u7f72\u540d\uff0c",(0,i.jsx)(n.code,{children:"string"})," \u7c7b\u578b\uff0c\u9ed8\u8ba4\u7a7a\uff0c",(0,i.jsx)(n.strong,{children:"\u4ec5\u5728 Furion v3.2.0+` \u6709\u6548"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"LoginInfo"}),"\uff1a\u914d\u7f6e ",(0,i.jsx)(n.code,{children:"Swagger"})," \u662f\u5426\u9700\u8981\u767b\u5f55\u624d\u80fd\u8bbf\u95ee\uff0c",(0,i.jsx)(n.code,{children:"SpecificationLoginInfo"})," \u7c7b\u578b\uff0c\u9ed8\u8ba4 ",(0,i.jsx)(n.code,{children:"null"}),"\uff0c",(0,i.jsx)(n.strong,{children:"\u4ec5\u5728 Furion v3.3.3+` \u6709\u6548"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Enabled"}),"\uff1a\u662f\u5426\u542f\u7528\u767b\u5f55\u6388\u6743\uff0c\u9ed8\u8ba4 ",(0,i.jsx)(n.code,{children:"false"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"CheckUrl"}),"\uff1a\u68c0\u67e5\u767b\u5f55\u72b6\u6001\u7684 ",(0,i.jsx)(n.code,{children:"Url"})," \u5730\u5740\uff0c",(0,i.jsxs)(n.strong,{children:["\u8be5\u5730\u5740\u5fc5\u987b\u662f ",(0,i.jsx)(n.code,{children:"POST"})," \u8bf7\u6c42"]}),"\uff0c\u5df2\u6388\u6743\u8fd4\u56de ",(0,i.jsx)(n.code,{children:"200"}),"\uff0c\u5426\u5219\u8fd4\u56de ",(0,i.jsx)(n.code,{children:"401"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"SubmitUrl"}),"\uff1a\u63d0\u4ea4\u767b\u5f55\u7684 ",(0,i.jsx)(n.code,{children:"Url"})," \u5730\u5740\uff0c",(0,i.jsxs)(n.strong,{children:["\u8be5\u5730\u5740\u5fc5\u987b\u662f ",(0,i.jsx)(n.code,{children:"POST"})," \u8bf7\u6c42\u4e14\u53ea\u6709\u4e00\u4e2a ",(0,i.jsx)(n.code,{children:"SpecificationAuth"})," \u7c7b\u578b\u53c2\u6570"]}),"\uff0c\u6210\u529f\u767b\u5f55\u8fd4\u56de ",(0,i.jsx)(n.code,{children:"200"}),"\uff0c\u5426\u5219\u8fd4\u56de ",(0,i.jsx)(n.code,{children:"401"}),"\uff0c\u652f\u6301\u76f8\u5bf9\u5730\u5740\uff0c\u4ee5 ",(0,i.jsx)(n.code,{children:"/"})," \u5f00\u5934"]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"EnableAllGroups"}),"\uff1a\u542f\u7528 ",(0,i.jsx)(n.code,{children:"Swagger"})," \u603b\u5206\u7ec4\u529f\u80fd\uff0c\u81ea\u52a8\u5c06\u6240\u6709\u5206\u7ec4\u7684\u63a5\u53e3\u5408\u5e76\u5230 ",(0,i.jsx)(n.code,{children:"All Groups"})," \u4e2d\uff0c",(0,i.jsx)(n.code,{children:"bool"})," \u7c7b\u578b\uff0c\u9ed8\u8ba4 ",(0,i.jsx)(n.code,{children:"false"}),"\uff0c",(0,i.jsx)(n.strong,{children:"\u4ec5\u5728 Furion v3.3.4+` \u6709\u6548"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"EnumToNumber"}),"\uff1a\u679a\u4e3e\u7c7b\u578b\u751f\u6210\u503c\u7c7b\u578b\uff0c",(0,i.jsx)(n.code,{children:"bool"})," \u7c7b\u578b\uff0c\u9ed8\u8ba4 ",(0,i.jsx)(n.code,{children:"false"}),"\uff0c",(0,i.jsx)(n.strong,{children:"\u4ec5\u5728 Furion 4.8.8.35+` \u6709\u6548"})]}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["\u53e6\u5916 ",(0,i.jsx)(n.code,{children:"SpecificationOpenApiInfo"})," \u5185\u7f6e\u914d\u7f6e\u5982\u4e0b\uff1a"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Group"}),"\uff1a\u5206\u7ec4\u552f\u4e00\u6807\u8bc6\uff0c",(0,i.jsx)(n.code,{children:"string"})," \u7c7b\u578b\uff0c\u5fc5\u586b"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Order"}),"\uff1a\u5206\u7ec4\u6392\u5e8f\uff0c",(0,i.jsx)(n.code,{children:"int"})," \u7c7b\u578b\uff0c\u6570\u5b57\u8d8a\u5927\u6392\u524d\u9762\uff0c\u9ed8\u8ba4 ",(0,i.jsx)(n.code,{children:"0"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Visible"}),"\uff1a\u914d\u7f6e\u5206\u7ec4\u662f\u5426\u53ef\u89c1\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:"Title"}),"\uff1a\u914d\u7f6e\u5206\u7ec4\u6807\u9898\uff0c",(0,i.jsx)(n.code,{children:"string"})," \u7c7b\u578b"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Description"}),"\uff1a\u914d\u7f6e\u5206\u7ec4\u63cf\u8ff0\uff0c",(0,i.jsx)(n.code,{children:"string"})," \u7c7b\u578b"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Version"}),"\uff1a\u914d\u7f6e\u5206\u7ec4\u7248\u672c\uff0c\u9ed8\u8ba4 ",(0,i.jsx)(n.code,{children:"1.0"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"TermsOfService"}),"\uff1a\u914d\u7f6e\u76f8\u5173\u94fe\u63a5\u5730\u5740\uff0c",(0,i.jsx)(n.code,{children:"Uri"})," \u7c7b\u578b"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Contact"}),"\uff1a\u914d\u7f6e\u8054\u7cfb\u65b9\u5f0f\uff0c",(0,i.jsx)(n.code,{children:"OpenApiContact"})," \u7c7b\u578b"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"License"}),"\uff1a\u914d\u7f6e\u534f\u8bae\uff0c",(0,i.jsx)(n.code,{children:"OpenApiLicense"})," \u7c7b\u578b"]}),"\n"]}),"\n",(0,i.jsx)(n.p,{children:"\u914d\u7f6e\u793a\u4f8b\uff1a"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-json",metastring:"showLineNumbers",children:'{\r\n "SpecificationDocumentSettings": {\r\n "GroupOpenApiInfos": [\r\n {\r\n "Group": "Group1",\r\n "Title": "\u5206\u7ec4\u6807\u9898",\r\n "Description": "\u8fd9\u91cc\u662f\u5206\u7ec4\u63cf\u8ff0",\r\n "Version": "\u7248\u672c\u53f7",\r\n "TermsOfService": "http://furion.baiqian.ltd",\r\n "Contact": {\r\n "Name": "\u767e\u5c0f\u50e7",\r\n "Url": "https://gitee.com/monksoul",\r\n "Email": "monksoul@outlook.com"\r\n },\r\n "License": {\r\n "Name": "MIT",\r\n "Url": "https://gitee.com/dotnetchina/Furion/blob/alpha/LICENSE"\r\n }\r\n }\r\n ]\r\n }\r\n}\n'})}),"\n",(0,i.jsx)(n.h2,{id:"67-\u7edf\u4e00\u8fd4\u56de\u503c\u6a21\u578b\u89c4\u8303\u5316\u7ed3\u679capi-\u8fd4\u56de\u503c",children:"6.7 \u7edf\u4e00\u8fd4\u56de\u503c\u6a21\u578b/\u89c4\u8303\u5316\u7ed3\u679c/API \u8fd4\u56de\u503c"}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"Furion"})," \u6846\u67b6\u63d0\u4f9b ",(0,i.jsx)(n.code,{children:"\u89c4\u8303\u5316\u7ed3\u679c"})," \u529f\u80fd\uff0c\u53ef\u4ee5\u901a\u8fc7\u5b9e\u73b0 ",(0,i.jsx)(n.code,{children:"IUnifyResultProvider"})," \u63d0\u4f9b\u5668\u5b9e\u73b0\u7edf\u4e00\u89c4\u8303\u5316\u8fd4\u56de\u503c\u5b9a\u5236\uff0c\u5982\uff1a"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.strong,{children:"\u5b9a\u4e49\u7ed3\u679c\u5305\u88c5\u7c7b\u578b"})}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {1-2}",children:"// \u5fc5\u987b\u662f\u6cdb\u578b\u7c7b\u578b\r\npublic class YourRESTfulResult\r\n{\r\n /// \r\n /// \u72b6\u6001\u7801\r\n /// \r\n public int? StatusCode { get; set; }\r\n\r\n /// \r\n /// \u6570\u636e\r\n /// \r\n public T Data { get; set; }\r\n\r\n /// \r\n /// \u6267\u884c\u6210\u529f\r\n /// \r\n public bool Succeeded { get; set; }\r\n\r\n /// \r\n /// \u9519\u8bef\u4fe1\u606f\r\n /// \r\n public object Errors { get; set; }\r\n\r\n /// \r\n /// \u9644\u52a0\u6570\u636e\r\n /// \r\n public object Extras { get; set; }\r\n\r\n /// \r\n /// \u65f6\u95f4\u6233\r\n /// \r\n public long Timestamp { get; set; }\r\n}\n"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsxs)(n.strong,{children:["\u5b9a\u4e49 ",(0,i.jsx)(n.code,{children:"IUnifyResultProvider"})," \u5b9e\u73b0\u7c7b\uff0c\u5e76\u8d34\u7279\u6027 ",(0,i.jsx)(n.code,{children:"[UnifyModel(typeof(YourRESTfulResult<>))]"})]})}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {15-16,24,36,48,61}",children:'using Furion.DataValidation;\r\nusing Furion.DependencyInjection;\r\nusing Furion.UnifyResult.Internal;\r\nusing Microsoft.AspNetCore.Http;\r\nusing Microsoft.AspNetCore.Mvc;\r\nusing Microsoft.AspNetCore.Mvc.Filters;\r\nusing System;\r\nusing System.Threading.Tasks;\r\n\r\nnamespace YourProject.UnifyResult\r\n{\r\n /// \r\n /// RESTful \u98ce\u683c\u8fd4\u56de\u503c\r\n /// \r\n [UnifyModel(typeof(YourRESTfulResult<>))]\r\n public class YourRESTfulResultProvider : IUnifyResultProvider\r\n {\r\n /// \r\n /// \u5f02\u5e38\u8fd4\u56de\u503c\r\n /// \r\n /// \r\n /// \r\n /// \r\n public IActionResult OnException(ExceptionContext context, ExceptionMetadata metadata)\r\n {\r\n return new JsonResult(YourRESTfulResult(metadata.StatusCode, data: metadata.Data, errors: metadata.Errors)\r\n , UnifyContext.GetSerializerSettings(context)); // \u5f53\u524d\u884c\u4ec5\u9650 Furion 4.6.6+ \u4f7f\u7528\r\n }\r\n\r\n /// \r\n /// \u6210\u529f\u8fd4\u56de\u503c\r\n /// \r\n /// \r\n /// \r\n /// \r\n public IActionResult OnSucceeded(ActionExecutedContext context, object data)\r\n {\r\n return new JsonResult(YourRESTfulResult(StatusCodes.Status200OK, true, data)\r\n , UnifyContext.GetSerializerSettings(context)); // \u5f53\u524d\u884c\u4ec5\u9650 Furion 4.6.6+ \u4f7f\u7528\r\n }\r\n\r\n /// \r\n /// \u9a8c\u8bc1\u5931\u8d25\u8fd4\u56de\u503c\r\n /// \r\n /// \r\n /// \r\n /// \r\n public IActionResult OnValidateFailed(ActionExecutingContext context, ValidationMetadata metadata)\r\n {\r\n return new JsonResult(YourRESTfulResult(metadata.StatusCode ?? StatusCodes.Status400BadRequest, data: metadata.Data, errors: metadata.ValidationResult)\r\n , UnifyContext.GetSerializerSettings(context)); // \u5f53\u524d\u884c\u4ec5\u9650 Furion 4.6.6+ \u4f7f\u7528\r\n }\r\n\r\n /// \r\n /// \u7279\u5b9a\u72b6\u6001\u7801\u8fd4\u56de\u503c\r\n /// \r\n /// \r\n /// \r\n /// \r\n /// \r\n public async Task OnResponseStatusCodes(HttpContext context, int statusCode, UnifyResultSettingsOptions unifyResultSettings)\r\n {\r\n // \u8bbe\u7f6e\u54cd\u5e94\u72b6\u6001\u7801\r\n UnifyContext.SetResponseStatusCodes(context, statusCode, unifyResultSettings);\r\n\r\n switch (statusCode)\r\n {\r\n // \u5904\u7406 401 \u72b6\u6001\u7801\r\n case StatusCodes.Status401Unauthorized:\r\n await context.Response.WriteAsJsonAsync(YourRESTfulResult(statusCode, errors: "401 Unauthorized")\r\n , App.GetOptions()?.JsonSerializerOptions);\r\n break;\r\n // \u5904\u7406 403 \u72b6\u6001\u7801\r\n case StatusCodes.Status403Forbidden:\r\n await context.Response.WriteAsJsonAsync(YourRESTfulResult(statusCode, errors: "403 Forbidden")\r\n , App.GetOptions()?.JsonSerializerOptions);\r\n break;\r\n default: break;\r\n }\r\n }\r\n\r\n /// \r\n /// \u8fd4\u56de RESTful \u98ce\u683c\u7ed3\u679c\u96c6\r\n /// \r\n /// \r\n /// \r\n /// \r\n /// \r\n /// \r\n private static YourRESTfulResult