This commit is contained in:
2025-04-16 22:47:17 +08:00
parent 7a7d8a7d01
commit 1a0d461f03
5 changed files with 391 additions and 131 deletions

View File

@@ -5,20 +5,30 @@
<meta name="description" content="Shop电商app后端接口">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="assets/bootstrap.min.css" rel="stylesheet" media="screen">
<link href="assets/prism.css" rel="stylesheet" />
<link href="assets/main.css" rel="stylesheet" media="screen, print">
<link href="assets/favicon.ico" rel="icon" type="image/x-icon">
<link href="assets/apple-touch-icon.png" rel="apple-touch-icon" sizes="180x180">
<link href="assets/favicon-32x32.png" rel="icon" type="image/png" sizes="32x32">
<link href="assets/favicon-16x16.png"rel="icon" type="image/png" sizes="16x16">
<link href="assets/bootstrap.min.css?v=1744814761090" rel="stylesheet" media="screen">
<link href="assets/prism.css?v=1744814761090" rel="stylesheet" />
<link href="assets/prism-toolbar.css?v=1744814761090" rel="stylesheet" />
<link href="assets/prism-diff-highlight.css?v=1744814761090" rel="stylesheet" />
<link href="assets/main.css?v=1744814761090" rel="stylesheet" media="screen, print">
<link href="assets/favicon.ico?v=1744814761090" rel="icon" type="image/x-icon">
<link href="assets/apple-touch-icon.png?v=1744814761090" rel="apple-touch-icon" sizes="180x180">
<link href="assets/favicon-32x32.png?v=1744814761090" rel="icon" type="image/png" sizes="32x32">
<link href="assets/favicon-16x16.png?v=1744814761090" rel="icon" type="image/png" sizes="16x16">
</head>
<body class="container-fluid">
<!-- SIDENAV -->
<script id="template-sidenav" type="text/x-handlebars-template">
<nav id="scrollingNav">
<nav id="scrollingNav" class="col-sm-3 col-lg-2 sidebar-offcanvas">
<div class="nav-toggle visible-xs">
<button type="button" class="btn btn-link" data-toggle="offcanvas">
<span class="sr-only">{{__ "Toggle navigation"}}</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="sidenav-search">
<input class="form-control search" data-action='filter-search' type="text" placeholder="{{__ "Filter..."}}">
<span class="search-reset">x</span>
@@ -145,7 +155,12 @@
<p>{{{nl2br article.description}}}</p>
{{/if}}
<span class="method meth-{{toLowerCase article.type}}">{{article.type}}</span>
<pre data-type="{{toLowerCase article.type}}"><code class="language-http">{{article.url}}</code></pre>
<pre
data-type="{{toLowerCase article.type}}"
data-prismjs-copy="{{__ "Copy"}}"
data-prismjs-copy-error="{{__ "Press Ctrl+C to copy"}}"
data-prismjs-copy-success="{{__ "copied!"}}"
><code class="language-http">{{article.url}}</code></pre>
{{#if article.permission}}
<p>
@@ -174,7 +189,12 @@
<div class="tab-content">
{{#each article.examples}}
<div class="tab-pane{{#ifCond @index '==' 0}} active{{/ifCond}}" id="examples-{{../id}}-{{@index}}">
<pre data-type="{{type}}"><code class="language-{{type}}">{{content}}</code></pre>
<pre
data-type="{{type}}"
data-prismjs-copy="{{__ "Copy"}}"
data-prismjs-copy-error="{{__ "Press Ctrl+C to copy"}}"
data-prismjs-copy-success="{{__ "copied!"}}"
><code class="language-{{type}}">{{content}}</code></pre>
</div>
{{/each}}
</div>
@@ -207,8 +227,9 @@
<tbody>
{{#each params}}
<tr>
<td class="code">{{this.field}}&nbsp;&nbsp;
{{#if optional}}
<td class="code">
{{{nestObject this}}}
{{#if this.optional}}
<span class="label optional">{{__ "optional"}}</span>
{{else}}
{{#if ../template.showRequiredLabels}}
@@ -252,8 +273,9 @@
<tbody>
{{#each params}}
<tr>
<td class="code">{{this.field}}&nbsp;&nbsp;
{{#if optional}}
<td class="code">
{{{nestObject this}}}
{{#if this.optional}}
<span class="label optional">{{__ "optional"}}</span>
{{else}}
{{#if ../template.showRequiredLabels}}
@@ -302,11 +324,12 @@
<tbody>
{{#each this}}
<tr>
<td class="code">{{{splitFill field "." "&nbsp;&nbsp;"}}}
<td class="code">
{{{nestObject this}}}
{{#if optional}}
<span class="label optional">{{__ "optional"}}</span>
{{else}}
{{#if ../template.showRequiredLabels}}
{{#if ../../template.showRequiredLabels}}
<span class="label required">{{__ "required"}}</span>
{{/if}}
{{/if}}</td>
@@ -343,7 +366,12 @@
<div class="tab-content">
{{#each params.examples}}
<div class="tab-pane{{#ifCond @index '==' 0}} active{{/ifCond}}" id="{{../section}}-examples-{{../id}}-{{@index}}">
<pre data-type="{{type}}"><code class="language-{{type}}">{{reformat content type}}</code></pre>
<pre
data-type="{{type}}"
data-prismjs-copy="{{__ "Copy"}}"
data-prismjs-copy-error="{{__ "Press Ctrl+C to copy"}}"
data-prismjs-copy-success="{{__ "copied!"}}"
><code class="language-{{type}}">{{reformat content type}}</code></pre>
</div>
{{/each}}
</div>
@@ -413,12 +441,13 @@
<div class="{{../id}}-sample-request-param-fields {{../id}}-sample-header-content-type-fields">
{{#each this}}
<div class="form-group">
{{#ifNotObject type}}
<label class="col-md-3 control-label" for="sample-request-param-field-{{field}}">{{field}}</label>
<div class="input-group">
<div class="input-group-addon">{{{type}}}</div>
{{#if allowedValues}}
<div class="input-group-addon sample-request-select">
<select class="form-control" data-name="{{field}}" data-family="query" data-group="{{@../index}}" {{#if optional}}data-optional="true"{{/if}}>
<select class="form-control" data-name="{{dot2bracket this}}" data-family="query" data-group="{{@../index}}" {{#if optional}}data-optional="true"{{/if}}>
<option value="" class="empty">&lt;{{__ "No value"}}&gt;</option>
{{#each allowedValues}}
<option {{#ifCond ../defaultValue '===' this}} selected {{/ifCond}}value="{{{removeDblQuotes this}}}">{{{removeDblQuotes this}}}</option>
@@ -432,14 +461,15 @@
class="{{#ifCond type '!==' 'Boolean'}}form-control{{/ifCond}} sample-request-param"
type="{{setInputType type}}"
value="{{#if defaultValue}}{{ defaultValue }}{{/if}}"
placeholder="{{#if defaultValue}}{{ defaultValue }}{{else}}{{field}}{{/if}}"
data-name="{{field}}"
placeholder="{{#if defaultValue}}{{ defaultValue }}{{/if}}"
data-name="{{dot2bracket this}}"
data-family="query"
data-group="{{@../index}}"
{{#if optional}}data-optional="true"{{/if}}>
</div></div>
{{/if}}
</div>
{{/ifNotObject}}
</div>
{{/each}}
</div>
@@ -452,12 +482,13 @@
<div class="{{../id}}-sample-request-param-fields {{../id}}-sample-header-content-type-fields">
{{#each article.query}}
<div class="form-group">
{{#ifNotObject type}}
<label class="col-md-3 control-label" for="sample-request-param-field-{{field}}">{{field}}{{#if optional}} ({{__ "optional"}}){{/if}}</label>
<div class="input-group col-md-6">
<div class="input-group-addon">{{{type}}}</div>
{{#if allowedValues}}
<div class="input-group-addon sample-request-select">
<select class="form-control" data-name="{{field}}" data-family="query" data-group="{{@../index}}" {{#if optional}}data-optional="true"{{/if}}>
<select class="form-control" data-name="{{dot2bracket this}}" data-family="query" data-group="{{@../index}}" {{#if optional}}data-optional="true"{{/if}}>
<option value="" class="empty">&lt;{{__ "No value"}}&gt;</option>
{{#each allowedValues}}
<option {{#ifCond ../defaultValue '===' this}} selected {{/ifCond}}value="{{{removeDblQuotes this}}}">{{{removeDblQuotes this}}}</option>
@@ -471,14 +502,15 @@
class="{{#ifCond type '!==' 'Boolean'}}form-control{{/ifCond}} sample-request-input"
type="{{setInputType type}}"
value="{{#if defaultValue}}{{ defaultValue }}{{/if}}"
placeholder="{{#if defaultValue}}{{ defaultValue }}{{else}}{{field}}{{/if}}"
data-name="{{field}}"
placeholder="{{#if defaultValue}}{{ defaultValue }}{{/if}}"
data-name="{{dot2bracket this}}"
data-family="query"
data-group="{{@../index}}"
{{#if optional}}data-optional="true"{{/if}}>
</div></div>
{{/if}}
</div>
{{/ifNotObject}}
</div>
{{/each}}
</div>
@@ -511,12 +543,13 @@
<div hidden class="col-md-9" id="sample-request-body-form-input-{{this.id}}">
{{#each article.body}}
<div class="form-group">
{{#ifNotObject type}}
<label class="col-md-3 control-label" for="sample-request-param-field-{{field}}">{{field}}</label>
<div class="input-group">
<div class="input-group-addon">{{{type}}}</div>
{{#if allowedValues}}
<div class="input-group-addon sample-request-select">
<select class="form-control" data-name="{{field}}" data-family="body" data-group="{{@../index}}" {{#if optional}}data-optional="true"{{/if}}>
<select class="form-control" data-name="{{dot2bracket this}}" data-family="body" data-group="{{@../index}}" {{#if optional}}data-optional="true"{{/if}}>
<option value="" class="empty">&lt;{{__ "No value"}}&gt;</option>
{{#each allowedValues}}
<option {{#ifCond ../defaultValue '===' this}} selected {{/ifCond}}value="{{{removeDblQuotes this}}}">{{{removeDblQuotes this}}}</option>
@@ -531,14 +564,15 @@
type="{{setInputType type}}"
value="{{#ifCond type '!==' 'Boolean'}}{{#if defaultValue}}{{ defaultValue }}{{/if}}{{/ifCond}}"
{{#if checked}}checked{{/if}}
placeholder="{{field}}"
placeholder="{{#if defaultValue}}{{ defaultValue }}{{/if}}"
data-family="body"
data-name="{{field}}"
data-name="{{dot2bracket this}}"
data-content-type="form"
{{#if optional}}data-optional="true"{{/if}}>
</div></div>
{{/if}}
</div>
{{/ifNotObject}}
</div>
{{/each}}
</div>
@@ -555,7 +589,12 @@
{{__ "Response"}}
<button class="btn btn-default btn-xs pull-right sample-request-clear">X</button>
</h3>
<pre data-type="json"><code class="language-json sample-request-response-json"></code></pre>
<pre
data-type="json"
data-prismjs-copy="{{__ "Copy"}}"
data-prismjs-copy-error="{{__ "Press Ctrl+C to copy"}}"
data-prismjs-copy-success="{{__ "copied!"}}"
><code class="language-json sample-request-response-json"></code></pre>
</div>
</fieldset>
</form>
@@ -597,7 +636,13 @@
{{/if}}
<span class="method meth-{{toLowerCase compare.type}}">{{compare.type}}</span>
<pre data-type="{{toLowerCase article.type}}" class="language-html">{{{showDiff article.url compare.url}}}</pre>
<pre
data-type="{{toLowerCase article.type}}"
data-prismjs-copy="{{__ "Copy"}}"
data-prismjs-copy-error="{{__ "Press Ctrl+C to copy"}}"
data-prismjs-copy-success="{{__ "copied!"}}"
class="language-html"
>{{{showDiff article.url compare.url}}}</pre>
{{subTemplate "article-compare-permission" article=article compare=compare}}
@@ -605,19 +650,19 @@
{{#each_compare_title article.examples compare.examples}}
{{#if typeSame}}
<li{{#ifCond index '==' 0}} class="active"{{/ifCond}}>
<a href="#compare-examples-{{../../article.id}}-{{index}}" role="tab" data-toggle="tab">{{{showDiff source.title compare.title}}}</a>
<a href="#compare-examples-{{../article.id}}-{{index}}" role="tab" data-toggle="tab">{{{showDiff source.title compare.title}}}</a>
</li>
{{/if}}
{{#if typeIns}}
<li{{#ifCond index '==' 0}} class="active"{{/ifCond}}>
<a href="#compare-examples-{{../../article.id}}-{{index}}"><ins>{{{source.title}}}</ins></a>
<a href="#compare-examples-{{../article.id}}-{{index}}"><ins>{{{source.title}}}</ins></a>
</li>
{{/if}}
{{#if typeDel}}
<li{{#ifCond index '==' 0}} class="active"{{/ifCond}}>
<a href="#compare-examples-{{../../article.id}}-{{index}}"><del>{{{compare.title}}}</del></a>
<a href="#compare-examples-{{../article.id}}-{{index}}"><del>{{{compare.title}}}</del></a>
</li>
{{/if}}
{{/each_compare_title}}
@@ -627,27 +672,45 @@
{{#each_compare_title article.examples compare.examples}}
{{#if typeSame}}
<div class="tab-pane{{#ifCond index '==' 0}} active{{/ifCond}}" id="compare-examples-{{../../article.id}}-{{index}}">
<pre data-type="{{source.type}}" class="language-{{source.type}}">{{{showDiff source.content compare.content}}}</pre>
<div class="tab-pane{{#ifCond index '==' 0}} active{{/ifCond}}" id="compare-examples-{{../article.id}}-{{index}}">
<pre
data-type="{{source.type}}"
data-prismjs-copy="{{__ "Copy"}}"
data-prismjs-copy-error="{{__ "Press Ctrl+C to copy"}}"
data-prismjs-copy-success="{{__ "copied!"}}"
><code class="language-diff-{{source.type}} diff-highlight">{{{showDiff source.content compare.content "code"}}}</code></pre>
</div>
{{/if}}
{{#if typeIns}}
<div class="tab-pane{{#ifCond index '==' 0}} active{{/ifCond}}" id="compare-examples-{{../../article.id}}-{{index}}">
<pre data-type="{{source.type}}" class="language-{{source.type}}">{{{source.content}}}</pre>
<div class="tab-pane{{#ifCond index '==' 0}} active{{/ifCond}}" id="compare-examples-{{../article.id}}-{{index}}">
<pre
data-type="{{source.type}}"
data-prismjs-copy="{{__ "Copy"}}"
data-prismjs-copy-error="{{__ "Press Ctrl+C to copy"}}"
data-prismjs-copy-success="{{__ "copied!"}}"
><code class="language-{{source.type}}">{{{source.content}}}</code></pre>
</div>
{{/if}}
{{#if typeDel}}
<div class="tab-pane{{#ifCond index '==' 0}} active{{/ifCond}}" id="compare-examples-{{../../article.id}}-{{index}}">
<pre data-type="{{compare.type}}" class="language-{{source.type}}">{{{compare.content}}}</pre>
<div class="tab-pane{{#ifCond index '==' 0}} active{{/ifCond}}" id="compare-examples-{{../article.id}}-{{index}}">
<pre
data-type="{{compare.type}}"
data-prismjs-copy="{{__ "Copy"}}"
data-prismjs-copy-error="{{__ "Press Ctrl+C to copy"}}"
data-prismjs-copy-success="{{__ "copied!"}}"
><code class="language-{{source.type}}">{{{compare.content}}}</code></pre>
</div>
{{/if}}
{{/each_compare_title}}
</div>
{{subTemplate "article-compare-param-block" source=article.header compare=compare.header _hasType=_hasTypeInHeaderFields section="header"}}
{{subTemplate "article-compare-param-block" source=article.parameter compare=compare.parameter _hasType=_hasTypeInParameterFields section="parameter"}}
{{subTemplate "article-compare-query-block" source=article.query compare=compare.query _hasType=_hasTypeInParameterFields section="query"}}
{{subTemplate "article-compare-body-block" source=article.body compare=compare.body _hasType=_hasTypeInParameterFields section="body"}}
{{subTemplate "article-compare-param-block" source=article.success compare=compare.success _hasType=_hasTypeInSuccessFields section="success"}}
{{subTemplate "article-compare-param-block" source=article.error compare=compare.error _col1="Name" _hasType=_hasTypeInErrorFields section="error"}}
@@ -776,19 +839,19 @@
{{#each_compare_title source.examples compare.examples}}
{{#if typeSame}}
<li{{#ifCond index '==' 0}} class="active"{{/ifCond}}>
<a href="#{{../../section}}-compare-examples-{{../../article.id}}-{{index}}" role="tab" data-toggle="tab">{{{showDiff source.title compare.title}}}</a>
<a href="#{{../section}}-compare-examples-{{../article.id}}-{{index}}" role="tab" data-toggle="tab">{{{showDiff source.title compare.title}}}</a>
</li>
{{/if}}
{{#if typeIns}}
<li{{#ifCond index '==' 0}} class="active"{{/ifCond}}>
<a href="#{{../../section}}-compare-examples-{{../../article.id}}-{{index}}"><ins>{{{source.title}}}</ins></a>
<a href="#{{../section}}-compare-examples-{{../article.id}}-{{index}}"><ins>{{{source.title}}}</ins></a>
</li>
{{/if}}
{{#if typeDel}}
<li{{#ifCond index '==' 0}} class="active"{{/ifCond}}>
<a href="#{{../../section}}-compare-examples-{{../../article.id}}-{{index}}"><del>{{{compare.title}}}</del></a>
<a href="#{{../section}}-compare-examples-{{../article.id}}-{{index}}"><del>{{{compare.title}}}</del></a>
</li>
{{/if}}
{{/each_compare_title}}
@@ -798,20 +861,35 @@
{{#each_compare_title source.examples compare.examples}}
{{#if typeSame}}
<div class="tab-pane{{#ifCond index '==' 0}} active{{/ifCond}}" id="{{../../section}}-compare-examples-{{../../article.id}}-{{index}}">
<pre data-type="{{source.type}}" class="language-{{source.type}}">{{{showDiff source.content compare.content}}}</pre>
<div class="tab-pane{{#ifCond index '==' 0}} active{{/ifCond}}" id="{{../section}}-compare-examples-{{../article.id}}-{{index}}">
<pre
data-type="{{source.type}}"
data-prismjs-copy="{{__ "Copy"}}"
data-prismjs-copy-error="{{__ "Press Ctrl+C to copy"}}"
data-prismjs-copy-success="{{__ "copied!"}}"
><code class="language-diff-{{source.type}} diff-highlight">{{{showDiff source.content compare.content "code"}}}</code></pre>
</div>
{{/if}}
{{#if typeIns}}
<div class="tab-pane{{#ifCond index '==' 0}} active{{/ifCond}}" id="{{../../section}}-compare-examples-{{../../article.id}}-{{index}}">
<pre data-type="{{source.type}}"><code class="language-{{source.type}}">{{{source.content}}}</code></pre>
<div class="tab-pane{{#ifCond index '==' 0}} active{{/ifCond}}" id="{{../section}}-compare-examples-{{../article.id}}-{{index}}">
<pre
data-type="{{source.type}}"
data-prismjs-copy="{{__ "Copy"}}"
data-prismjs-copy-error="{{__ "Press Ctrl+C to copy"}}"
data-prismjs-copy-success="{{__ "copied!"}}"
><code class="language-{{source.type}}">{{{source.content}}}</code></pre>
</div>
{{/if}}
{{#if typeDel}}
<div class="tab-pane{{#ifCond index '==' 0}} active{{/ifCond}}" id="{{../../section}}-compare-examples-{{../../article.id}}-{{index}}">
<pre data-type="{{compare.type}}"><code class="language-{{source.type}}">{{{compare.content}}}</code></pre>
<div class="tab-pane{{#ifCond index '==' 0}} active{{/ifCond}}" id="{{../section}}-compare-examples-{{../article.id}}-{{index}}">
<pre
data-type="{{compare.type}}"
data-prismjs-copy="{{__ "Copy"}}"
data-prismjs-copy-error="{{__ "Press Ctrl+C to copy"}}"
data-prismjs-copy-success="{{__ "copied!"}}"
><code class="language-{{source.type}}">{{{compare.content}}}</code></pre>
</div>
{{/if}}
{{/each_compare_title}}
@@ -820,13 +898,49 @@
{{/if}}
</script>
<script id="template-article-compare-query-block" type="text/x-handlebars-template">
{{#if article.query}}
<h2>{{__ "Query Parameter(s)"}}</h2>
<table class="table table-hover">
<thead>
<tr>
<th style="width: 30%">{{#if ../_col1}}{{__ ../_col1}}{{else}}{{__ "Field"}}{{/if}}</th>
{{#unless this.Type compare=null}}
<th style="width: 10%">{{__ "Type"}}</th>
{{/unless}}
<th style="width: {{#if ../_hasType}}60%{{else}}70%{{/if}}">{{__ "Description"}}</th>
</tr>
</thead>
{{subTemplate "article-compare-param-block-body" source=source compare=compare _hasType=this.type}}
</table>
{{/if}}
</script>
<script id="template-article-compare-body-block" type="text/x-handlebars-template">
{{#if article.body}}
<h2>{{__ "Request Body"}}</h2>
<table class="table table-hover">
<thead>
<tr>
<th style="width: 30%">{{#if ../_col1}}{{__ ../_col1}}{{else}}{{__ "Field"}}{{/if}}</th>
{{#unless this.Type compare=null}}
<th style="width: 10%">{{__ "Type"}}</th>
{{/unless}}
<th style="width: {{#if ../_hasType}}60%{{else}}70%{{/if}}">{{__ "Description"}}</th>
</tr>
</thead>
{{subTemplate "article-compare-param-block-body" source=source compare=compare _hasType=this.type}}
</table>
{{/if}}
</script>
<script id="template-article-compare-param-block-body" type="text/x-handlebars-template">
<tbody>
{{#each_compare_field source compare}}
{{#if typeSame}}
<tr>
<td class="code">
{{{splitFill source.field "." "&nbsp;&nbsp;"}}}
{{{nestObject source}}}
{{#if source.optional}}
{{#if compare.optional}} <span class="label label-optional">{{__ "optional"}}</span>
{{else}} <span class="label label-optional label-ins">{{__ "optional"}}</span>
@@ -859,7 +973,7 @@
{{#if typeIns}}
<tr class="ins">
<td class="code">
{{{splitFill source.field "." "&nbsp;&nbsp;"}}}
{{{nestObject source}}}
{{#if source.optional}} <span class="label label-optional label-ins">{{__ "optional"}}</span>{{/if}}
</td>
@@ -879,7 +993,7 @@
{{#if typeDel}}
<tr class="del">
<td class="code">
{{{splitFill compare.field "." "&nbsp;&nbsp;"}}}
{{{nestObject compare}}}
{{#if compare.optional}} <span class="label label-optional label-del">{{__ "optional"}}</span>{{/if}}
</td>
@@ -901,9 +1015,9 @@
</script>
<div class="container-fluid">
<div class="row">
<div id="sidenav" class="span2"></div>
<div id="content">
<div class="row row-offcanvas row-offcanvas-left">
<div id="sidenav" class="col-sm-3 col-lg-2"></div>
<div id="content" class="col-sm-9 col-lg-10">
<div id="project"></div>
<div id="header"></div>
<div id="sections"></div>
@@ -928,6 +1042,6 @@
</div>
</div>
<script src="assets/main.bundle.js"></script>
<script src="assets/main.bundle.js?v=1744814761090"></script>
</body>
</html>