diff --git a/docs/api/api_docs.go b/docs/api/api_docs.go index f2b7312..8eeacb0 100644 --- a/docs/api/api_docs.go +++ b/docs/api/api_docs.go @@ -136,7 +136,7 @@ const docTemplateapi = `{ "application/json" ], "tags": [ - "地址" + "地址[Personal]" ], "summary": "标签添加", "responses": { @@ -155,7 +155,7 @@ const docTemplateapi = `{ } } }, - "/ab/peer/add/{id}": { + "/ab/peer/add/{guid}": { "post": { "security": [ { @@ -196,6 +196,90 @@ const docTemplateapi = `{ } } } + }, + "delete": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "删除地址", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "地址[Personal]" + ], + "summary": "删除地址", + "parameters": [ + { + "type": "string", + "description": "id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrorResponse" + } + } + } + } + }, + "/ab/peer/update/{guid}": { + "put": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "更新地址", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "地址[Personal]" + ], + "summary": "更新地址", + "parameters": [ + { + "type": "string", + "description": "id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrorResponse" + } + } + } } }, "/ab/peers": { @@ -374,7 +458,109 @@ const docTemplateapi = `{ } } }, - "/ab/tags/{id}": { + "/ab/tag/rename/{guid}": { + "put": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "标签", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "地址[Personal]" + ], + "summary": "标签重命名", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrorResponse" + } + } + } + } + }, + "/ab/tag/update/{guid}": { + "put": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "标签", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "地址[Personal]" + ], + "summary": "标签修改颜色", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrorResponse" + } + } + } + } + }, + "/ab/tag/{guid}": { + "delete": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "标签", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "地址[Personal]" + ], + "summary": "标签删除", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrorResponse" + } + } + } + } + }, + "/ab/tags/{guid}": { "post": { "security": [ { diff --git a/docs/api/api_swagger.json b/docs/api/api_swagger.json index 14b681e..e775ebd 100644 --- a/docs/api/api_swagger.json +++ b/docs/api/api_swagger.json @@ -129,7 +129,7 @@ "application/json" ], "tags": [ - "地址" + "地址[Personal]" ], "summary": "标签添加", "responses": { @@ -148,7 +148,7 @@ } } }, - "/ab/peer/add/{id}": { + "/ab/peer/add/{guid}": { "post": { "security": [ { @@ -189,6 +189,90 @@ } } } + }, + "delete": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "删除地址", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "地址[Personal]" + ], + "summary": "删除地址", + "parameters": [ + { + "type": "string", + "description": "id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrorResponse" + } + } + } + } + }, + "/ab/peer/update/{guid}": { + "put": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "更新地址", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "地址[Personal]" + ], + "summary": "更新地址", + "parameters": [ + { + "type": "string", + "description": "id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrorResponse" + } + } + } } }, "/ab/peers": { @@ -367,7 +451,109 @@ } } }, - "/ab/tags/{id}": { + "/ab/tag/rename/{guid}": { + "put": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "标签", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "地址[Personal]" + ], + "summary": "标签重命名", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrorResponse" + } + } + } + } + }, + "/ab/tag/update/{guid}": { + "put": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "标签", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "地址[Personal]" + ], + "summary": "标签修改颜色", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrorResponse" + } + } + } + } + }, + "/ab/tag/{guid}": { + "delete": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "标签", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "地址[Personal]" + ], + "summary": "标签删除", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrorResponse" + } + } + } + } + }, + "/ab/tags/{guid}": { "post": { "security": [ { diff --git a/docs/api/api_swagger.yaml b/docs/api/api_swagger.yaml index 60879af..2136e96 100644 --- a/docs/api/api_swagger.yaml +++ b/docs/api/api_swagger.yaml @@ -228,8 +228,34 @@ paths: - BearerAuth: [] summary: 标签添加 tags: - - 地址 - /ab/peer/add/{id}: + - 地址[Personal] + /ab/peer/add/{guid}: + delete: + consumes: + - application/json + description: 删除地址 + parameters: + - description: id + in: path + name: id + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + type: string + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/response.ErrorResponse' + security: + - BearerAuth: [] + summary: 删除地址 + tags: + - 地址[Personal] post: consumes: - application/json @@ -256,6 +282,33 @@ paths: summary: 添加地址 tags: - 地址[Personal] + /ab/peer/update/{guid}: + put: + consumes: + - application/json + description: 更新地址 + parameters: + - description: id + in: path + name: id + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + type: string + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/response.ErrorResponse' + security: + - BearerAuth: [] + summary: 更新地址 + tags: + - 地址[Personal] /ab/peers: post: consumes: @@ -364,7 +417,70 @@ paths: summary: 共享地址簿 tags: - 地址[Personal] - /ab/tags/{id}: + /ab/tag/{guid}: + delete: + consumes: + - application/json + description: 标签 + produces: + - application/json + responses: + "200": + description: OK + schema: + type: string + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/response.ErrorResponse' + security: + - BearerAuth: [] + summary: 标签删除 + tags: + - 地址[Personal] + /ab/tag/rename/{guid}: + put: + consumes: + - application/json + description: 标签 + produces: + - application/json + responses: + "200": + description: OK + schema: + type: string + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/response.ErrorResponse' + security: + - BearerAuth: [] + summary: 标签重命名 + tags: + - 地址[Personal] + /ab/tag/update/{guid}: + put: + consumes: + - application/json + description: 标签 + produces: + - application/json + responses: + "200": + description: OK + schema: + type: string + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/response.ErrorResponse' + security: + - BearerAuth: [] + summary: 标签修改颜色 + tags: + - 地址[Personal] + /ab/tags/{guid}: post: consumes: - application/json