Skip to content

Commit

Permalink
refact: update swagger
Browse files Browse the repository at this point in the history
  • Loading branch information
doyouhaobaby committed Nov 29, 2020
1 parent 3c5c524 commit df5ab96
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 49 deletions.
5 changes: 4 additions & 1 deletion apis/index.html
Expand Up @@ -54,13 +54,16 @@
return response.json();
})
.then(function(apis) {
var url = '/swagger/user';
var url = '/swagger/web';
if (window.location.hash) {
url = window.location.hash.substr(1)
}

var primaryName = '';
for (var i=0;i<apis.length;i++) {
if (!apis[i]['url']) {
continue;
}
if (apis[i]['url'].indexOf(url) != -1) {
primaryName = apis[i]['name'];
}
Expand Down
50 changes: 2 additions & 48 deletions router/apis/api.php
Expand Up @@ -23,58 +23,12 @@
* @see 基于 PHP 8 注解路由 \App\App\Controller\Petstore\Store
*
* @OA\Info(
* description="This is a sample Petstore server. You can find
* out more about Swagger at
* [http://swagger.io](http://swagger.io) or on
* [irc.freenode.net, #swagger](http://swagger.io/irc/).",
* description="The QueryPHP application Apis",
* version="1.0.0",
* title="Swagger Petstore",
* termsOfService="http://swagger.io/terms/",
* @OA\Contact(
* email="apiteam@swagger.io"
* ),
* @OA\License(
* name="Apache 2.0",
* url="http://www.apache.org/licenses/LICENSE-2.0.html"
* )
* title="QueryPHP Apis",
* )
*/
class _
{
// 占位防止代码格式化工具将注释破坏
}

/**
* @OA\Tag(
* name="pet",
* description="Everything about your Pets",
* @OA\ExternalDocumentation(
* description="Find out more",
* url="http://swagger.io"
* )
* )
* @OA\Tag(
* name="store",
* description="Access to Petstore orders",
* )
* @OA\Tag(
* name="user",
* description="Operations about user",
* @OA\ExternalDocumentation(
* description="Find out more about store",
* url="http://swagger.io"
* )
* )
* @OA\Server(
* description="SwaggerHUB API Mocking 1.0.0",
* url="https://virtserver.swaggerhub.com/swagger/Petstore"
* )
* @OA\ExternalDocumentation(
* description="Find out more about Swagger",
* url="http://swagger.io",
* )
*/
class __
{
// 占位防止代码格式化工具将注释破坏
}

0 comments on commit df5ab96

Please sign in to comment.