Skip to content

Commit

Permalink
fix(swagger): swagger测试tag时,无法调用任何结构,参入参数无法解析
Browse files Browse the repository at this point in the history
1. 兼容json和form两种格式 parm 2. 更新post update body json

Closes #3
  • Loading branch information
minibear2333 committed Jun 20, 2021
1 parent a344bae commit b66be89
Show file tree
Hide file tree
Showing 7 changed files with 171 additions and 179 deletions.
114 changes: 55 additions & 59 deletions docs/docs.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
// This file was generated by swaggo/swag at
// 2021-06-17 22:15:02.037541 +0800 CST m=+0.017465621
// 2021-06-20 16:22:58.944567 +0800 CST m=+0.063645120

package docs

Expand Down Expand Up @@ -48,12 +48,13 @@ var doc = `{
],
"type": "integer",
"default": 1,
"description": "状态",
"description": "状态,是否启用(0 为禁用、1 为启用)",
"name": "state",
"in": "query"
},
{
"type": "integer",
"default": 1,
"description": "页码",
"name": "page",
"in": "query"
Expand Down Expand Up @@ -93,38 +94,12 @@ var doc = `{
"summary": "新增标签",
"parameters": [
{
"maxLength": 100,
"minLength": 3,
"description": "标签名称",
"name": "name",
"description": "请求体",
"name": "data",
"in": "body",
"required": true,
"schema": {
"type": "string"
}
},
{
"enum": [
0,
1
],
"default": 1,
"description": "是否启用(0 为禁用、1 为启用)",
"name": "state",
"in": "body",
"schema": {
"type": "integer"
}
},
{
"maxLength": 100,
"minLength": 3,
"description": "创建者",
"name": "created_by",
"in": "body",
"required": true,
"schema": {
"type": "string"
"$ref": "#/definitions/service.CreateTagRequest"
}
}
],
Expand Down Expand Up @@ -165,37 +140,12 @@ var doc = `{
"required": true
},
{
"maxLength": 100,
"minLength": 3,
"description": "标签名称",
"name": "name",
"in": "body",
"schema": {
"type": "string"
}
},
{
"enum": [
0,
1
],
"default": 1,
"description": "是否启用(0 为禁用、1 为启用)",
"name": "state",
"in": "body",
"schema": {
"type": "integer"
}
},
{
"maxLength": 100,
"minLength": 3,
"description": "修改者",
"name": "modified_by",
"description": "请求体",
"name": "data",
"in": "body",
"required": true,
"schema": {
"type": "string"
"$ref": "#/definitions/service.UpdateTagRequest"
}
}
],
Expand Down Expand Up @@ -338,6 +288,52 @@ var doc = `{
"$ref": "#/definitions/app.Pager"
}
}
},
"service.CreateTagRequest": {
"type": "object",
"required": [
"created_by",
"name"
],
"properties": {
"created_by": {
"description": "创建者",
"type": "string"
},
"name": {
"description": "标签名称",
"type": "string"
},
"state": {
"description": "状态,是否启用(0 为禁用、1 为启用)",
"type": "integer"
}
}
},
"service.UpdateTagRequest": {
"type": "object",
"required": [
"id",
"modifiedBy"
],
"properties": {
"id": {
"description": "标签id",
"type": "integer"
},
"modifiedBy": {
"description": "修改者",
"type": "string"
},
"name": {
"description": "标签名称",
"type": "string"
},
"state": {
"description": "状态,是否启用(0 为禁用、1 为启用)",
"type": "integer"
}
}
}
}
}`
Expand Down
112 changes: 54 additions & 58 deletions docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@
],
"type": "integer",
"default": 1,
"description": "状态",
"description": "状态,是否启用(0 为禁用、1 为启用)",
"name": "state",
"in": "query"
},
{
"type": "integer",
"default": 1,
"description": "页码",
"name": "page",
"in": "query"
Expand Down Expand Up @@ -75,38 +76,12 @@
"summary": "新增标签",
"parameters": [
{
"maxLength": 100,
"minLength": 3,
"description": "标签名称",
"name": "name",
"description": "请求体",
"name": "data",
"in": "body",
"required": true,
"schema": {
"type": "string"
}
},
{
"enum": [
0,
1
],
"default": 1,
"description": "是否启用(0 为禁用、1 为启用)",
"name": "state",
"in": "body",
"schema": {
"type": "integer"
}
},
{
"maxLength": 100,
"minLength": 3,
"description": "创建者",
"name": "created_by",
"in": "body",
"required": true,
"schema": {
"type": "string"
"$ref": "#/definitions/service.CreateTagRequest"
}
}
],
Expand Down Expand Up @@ -147,37 +122,12 @@
"required": true
},
{
"maxLength": 100,
"minLength": 3,
"description": "标签名称",
"name": "name",
"in": "body",
"schema": {
"type": "string"
}
},
{
"enum": [
0,
1
],
"default": 1,
"description": "是否启用(0 为禁用、1 为启用)",
"name": "state",
"in": "body",
"schema": {
"type": "integer"
}
},
{
"maxLength": 100,
"minLength": 3,
"description": "修改者",
"name": "modified_by",
"description": "请求体",
"name": "data",
"in": "body",
"required": true,
"schema": {
"type": "string"
"$ref": "#/definitions/service.UpdateTagRequest"
}
}
],
Expand Down Expand Up @@ -320,6 +270,52 @@
"$ref": "#/definitions/app.Pager"
}
}
},
"service.CreateTagRequest": {
"type": "object",
"required": [
"created_by",
"name"
],
"properties": {
"created_by": {
"description": "创建者",
"type": "string"
},
"name": {
"description": "标签名称",
"type": "string"
},
"state": {
"description": "状态,是否启用(0 为禁用、1 为启用)",
"type": "integer"
}
}
},
"service.UpdateTagRequest": {
"type": "object",
"required": [
"id",
"modifiedBy"
],
"properties": {
"id": {
"description": "标签id",
"type": "integer"
},
"modifiedBy": {
"description": "修改者",
"type": "string"
},
"name": {
"description": "标签名称",
"type": "string"
},
"state": {
"description": "状态,是否启用(0 为禁用、1 为启用)",
"type": "integer"
}
}
}
}
}
Loading

0 comments on commit b66be89

Please sign in to comment.