Files
zyplayer-doc/zyplayer-doc-swagger-plus/src/main/resources/dist/assets/DocView.1d0defca.js

5 lines
25 KiB
JavaScript
Raw Normal View History

2021-11-17 23:11:54 +08:00
import{N as $,r as b,R as ve,o as m,c as T,w as r,a as l,p as u,t as L,x as j,e as R,b as x,F as C,n as O,V as de,W as Pe,P as c,X as be,Y as Se,Z as we,O as ue,y as U,d as xe,$ as ke,Q as Le}from"./vendor.ee21a423.js";import{P as me,a as ce,b as Re,u as Te,x as Ie,m as Oe}from"./unitConvert.c16ab317.js";import{_ as B}from"./main.b335ea75.js";import{g as Ce,z as De}from"./custom.33a00f74.js";let ee=["file","string","integer","long","double","object","number","boolean","ref"];var fe={getRequestParamList(t,n){if(!t)return[];let d=1,e=[];for(let h=0;h<t.length;h++){let o=t[h],s=o.description||"",i=o.type,f=o.format,v=o["x-example"],g,y,a;i==="array"?this.isSchemaRef(o.items)?(g=this.getSchemaRef(o.items),y=this.getParamDefinitions(g,n,d,{},0)):o.schema?this.isSchemaRef(o.schema.items)?(g=this.getSchemaRef(o.schema.items),y=this.getParamDefinitions(g,n,d,{},0)):o.schema.type&&(g=o.schema.type):o.items&&o.items.type?g=o.items.type:this.logMessage("001",i,o):i?ee.indexOf(i)>=0||this.logMessage("003",i,o):o.schema?this.isSchemaRef(o.schema)?(i=this.getSchemaRef(o.schema),y=this.getParamDefinitions(i,n,d,{},0)):o.schema.type?(i=o.schema.type,o.schema.additionalProperties?(a={},y=this.getAdditionalProperties(o.schema.additionalProperties,a,n,d,{},0),f=a.type):o.schema.items?this.isSchemaRef(o.schema.items)?(g=this.getSchemaRef(o.schema.items),y=this.getParamDefinitions(g,n,d,{},0)):o.schema.items.type?g=o.schema.items.type:this.log("0014",i,o):this.log("0011",i,o)):this.logMessage("0013",i,o):o.items&&o.items.type?(i=o.items.type,o.items.additionalProperties?(a={},y=this.getAdditionalProperties(o.items.additionalProperties,a,n,d,{},0),f=a.type):this.logMessage("0012",i,o)):this.logMessage("002",i,o),v&&(s=s?s+"\uFF0C":"",s+="\u4F8B\uFF1A"+v),o.enum&&o.enum.length>0&&(s=s||"\u679A\u4E3E\u7C7B\u578B",s+="\uFF0C\u53EF\u9009\u503C\uFF1A"+o.enum.join("\u3001")),e.push({type:i,key:d,in:o.in,name:o.name,subType:g,required:o.required?"\u662F":"\u5426",format:f,enum:o.enum,example:v,collectionFormat:o.collectionFormat,description:s,additional:a,children:y}),d++}return e},getResponseParamList(t,n){let d=[],e=1;return Object.keys(t).forEach(h=>{let o=t[h],s,i;this.isSchemaRef(o.schema)&&(s=this.getSchemaRef(o.schema),i=this.getParamDefinitions(s,n,e,{},0)),d.push({code:h,type:s,key:e,desc:o.description,schemas:i}),e++}),d},isSchemaRef(t){return!!(t&&(t.originalRef||t.$ref))},getSchemaRef(t){return t.originalRef?t.originalRef:t.$ref&&t.$ref.indexOf("#/definitions/")===0?t.$ref.replace("#/definitions/",""):(this.logMessage("9467","",t),"")},getParamDefinitions(t,n,d,e,h){let o=n[t];if(h>=10||!o||(e[t]=(e[t]||0)+1,e[t]>2))return;let s=[],i=o.type,f=o.properties,v=1;if(i==="object"){let g={};Object.keys(f).forEach(y=>{let a=f[y],_=a.type,k=a.format,P=a.description||"",I=a.example||a["x-example"],w,N,F,J=d+"_"+v,A;Object.keys(g).forEach(D=>{e[D]=void 0}),_==="array"?this.isSchemaRef(a.items)?(w=this.getSchemaRef(a.items),A=this.getParamDefinitions(w,n,J,e,h+1)):a.items&&a.items.type?w=a.items.type:this.logMessage("004",_,a):_==="object"?a.additionalProperties?(N={},A=this.getAdditionalProperties(a.additionalProperties,N,n,J,e,h+1),k=N.type):this.log("0041",_,a):_?ee.indexOf(_)>=0||this.logMessage("006",_,a):this.isSchemaRef(a)?(_=this.getSchemaRef(a),A=this.getParamDefinitions(_,n,J,e,h+1)):this.logMessage("005",_,a),I&&(P=P?P+"\uFF0C":"",P+="\u4F8B\uFF1A"+I),a.items&&a.items.enum&&a.items.enum.length>0&&(F=a.items.enum,P=P||"\u679A\u4E3E\u7C7B\u578B",P+="\uFF0C\u53EF\u9009\u503C\uFF1A"+a.items.enum.join("\u3001")),s.push({type:_,name:y,key:J,subType:w,format:k,description:P,enum:F,additional:N,example:I,children:A}),v++,g[_]=1})}return s.length>0?s:void 0},getAdditionalProperties(t,n,d,e,h,o){if(this.isSchemaRef(t))return n.type=this.getSchemaRef(t),n.children=this.getParamDefinitions(n.type,d,e,h,o+1),n.additional;if(t.additionalProperties)return n.type=t.type,n.additional={},this.getAdditionalProperties(t.additionalProperties,n.additional,d,e,h,o+1);if(t.type==="array")if(n.type=t.type,this.isSchemaRef(t.items)){let s=this.getSchemaRef(t.ite
2021-11-15 23:18:15 +08:00
// \u8BF7\u6C42\u5931\u8D25\uFF0C\u4EE5\u4E0B\u4E3A\u5C01\u88C5\u7684\u8FD4\u56DE\u503C\u5BF9\u8C61\uFF0C\u4EC5\u4F9B\u53C2\u8003
`;f.value=P+JSON.stringify(t.result.data),v.value=P+JSON.stringify(t.result.data,null,4)}a()}};return _(),be(n,()=>_()),{activePage:d,bodyShowType:e,bodyShowTypeChange:a,unitConvert:Te,bodyShowFormatType:h,bodyShowFormatPreview:o,previewHtmlRef:y,resultData:g,resultHeaders:s,resultCookies:i,resultHeadersColumns:[{title:"KEY",dataIndex:"name"},{title:"VALUE",dataIndex:"value"}],resultCookiesColumns:[{title:"KEY",dataIndex:"name"},{title:"VALUE",dataIndex:"value"}],resultDataInit:P=>{P.setFontSize(16)},resultDataContentOrigin:f,resultDataContentFormat:v,resultDataConfig:{wrap:!0,readOnly:!0,autoScrollEditorIntoView:!0,enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0,minLines:30,maxLines:30}}}},Xe={key:0,style:{"margin-bottom":"30px"}},Ge={key:0,style:{"margin-bottom":"30px"}},Ye={style:{"margin-bottom":"10px"}},Ze=u("\u683C\u5F0F\u5316"),We=u("\u539F\u59CB\u503C"),$e=u("\u9884\u89C8"),et=u("JSON"),tt=u("HTML"),at=u("XML"),ot=u("JavaScript"),nt=u("TEXT"),rt={key:2},lt={key:0,ref:"previewHtmlRef",width:"100%",height:"570px",style:{border:"0"}},st={class:"status-info-box"},it=u(" \u72B6\u6001\u7801\uFF1A"),dt=u(" \u8017\u65F6\uFF1A"),ut=u(" \u5927\u5C0F\uFF1A"),mt={key:1},ct={style:{color:"#f00"}},ft={class:"status-info-box"},yt=u(" \u8017\u65F6\uFF1A"),ht={key:1,style:{"margin-top":"20px"}},_t={key:2,style:{"margin-top":"20px",color:"#aaa"}};function pt(t,n,d,e,h,o){const s=b("a-radio-button"),i=b("a-radio-group"),f=b("a-select-option"),v=b("a-select"),g=b("ace-editor"),y=b("a-tab-pane"),a=b("a-table"),_=b("a-tabs"),k=b("a-skeleton"),P=b("a-spin"),I=b("a-empty");return d.result.data?(m(),x("div",Xe,[d.result.data.data||d.result.data.status===200?(m(),x("div",Ge,[l(_,{activeKey:e.activePage,"onUpdate:activeKey":n[4]||(n[4]=w=>e.activePage=w),onTabClick:n[5]||(n[5]=()=>{}),style:{padding:"5px 10px 0"}},{rightExtra:r(()=>[R("span",st,[it,R("span",null,L(e.resultData.status||"200"),1),dt,R("span",null,L(e.unitConvert.formatSeconds(e.resultData.useTime||0)),1),ut,R("span",null,L(e.unitConvert.formatFileSize(e.resultData.contentLength||0)),1)])]),default:r(()=>[l(y,{tab:"Body",key:"body",forceRender:""},{default:r(()=>[R("div",Ye,[l(i,{value:e.bodyShowType,"onUpdate:value":n[0]||(n[0]=w=>e.bodyShowType=w),onChange:e.bodyShowTypeChange,size:"small"},{default:r(()=>[l(s,{value:"format"},{default:r(()=>[Ze]),_:1}),l(s,{value:"row"},{default:r(()=>[We]),_:1}),l(s,{value:"preview"},{default:r(()=>[$e]),_:1})]),_:1},8,["value","onChange"]),e.bodyShowType==="format"?(m(),T(v,{key:0,value:e.bodyShowFormatType,"onUpdate:value":n[1]||(n[1]=w=>e.bodyShowFormatType=w),size:"small",style:{"margin-left":"10px",width:"100px"}},{default:r(()=>[l(f,{value:"json"},{default:r(()=>[et]),_:1}),l(f,{value:"html"},{default:r(()=>[tt]),_:1}),l(f,{value:"xml"},{default:r(()=>[at]),_:1}),l(f,{value:"javascript"},{default:r(()=>[ot]),_:1}),l(f,{value:"text"},{default:r(()=>[nt]),_:1})]),_:1},8,["value"])):O("",!0)]),e.bodyShowType==="format"?(m(),T(g,{key:0,value:e.resultDataContentFormat,"onUpdate:value":n[2]||(n[2]=w=>e.resultDataContentFormat=w),onInit:e.resultDataInit,lang:e.bodyShowFormatType,theme:"monokai",width:"100%",height:"100",options:e.resultDataConfig},null,8,["value","onInit","lang","options"])):e.bodyShowType==="row"?(m(),T(g,{key:1,value:e.resultDataContentOrigin,"onUpdate:value":n[3]||(n[3]=w=>e.resultDataContentOrigin=w),onInit:e.resultDataInit,lang:"text",theme:"chrome",width:"100%",height:"100",options:e.resultDataConfig},null,8,["value","onInit","options"])):e.bodyShowType==="preview"?(m(),x("div",rt,[e.bodyShowFormatPreview==="html"?(m(),x("iframe",lt,null,512)):(m(),x(C,{key:1},[u(L(e.resultDataContentOrigin),1)],64))])):O("",!0)]),_:1}),l(y,{tab:"Headers",key:"headers",forceRender:""},{default:r(()=>[l(a,{dataSource:e.resultHeaders,columns:e.resultHeadersColumns,size:"small",pagination:!1,scroll:{y:"300px"}},null,8,["dataSource","columns"])]),_:1}),l(y,{tab:"Cookies",key:"cookies",forceRender:""},{default:r(()=>[l(a,{dataSource:e.resultCookies,columns:e.resultCookiesColumns,size:"small",pagination:!1,scrol