From 2a5c2578ac806611ca5a4cb380f541922f6a24ef Mon Sep 17 00:00:00 2001 From: MXWXZ Date: Mon, 9 Sep 2019 02:53:05 +0800 Subject: [PATCH] method change --- backend/CHANGELOG.md | 4 ++-- backend/api/buyinfo/main.go | 4 ++-- backend/api/sellinfo/main.go | 4 ++-- backend/doc/api_data.js | 4 ++-- backend/doc/api_data.json | 4 ++-- backend/doc/api_project.js | 2 +- backend/doc/api_project.json | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/backend/CHANGELOG.md b/backend/CHANGELOG.md index e68f2dc..3b0e5b1 100644 --- a/backend/CHANGELOG.md +++ b/backend/CHANGELOG.md @@ -4,8 +4,8 @@ 1. `transaction` 模块被完全移除 ### 新增 -1. `POST "/buyInfo/:buyInfoID"` 修改状态 -2. `POST "/sellInfo/:sellInfoID"` 修改状态 +1. `PUT "/buyInfo/:buyInfoID"` 修改状态 +2. `PUT "/sellInfo/:sellInfoID"` 修改状态 ### BUG修复 1. 修复message被错误标记为已读的问题 diff --git a/backend/api/buyinfo/main.go b/backend/api/buyinfo/main.go index e712ca2..231be65 100644 --- a/backend/api/buyinfo/main.go +++ b/backend/api/buyinfo/main.go @@ -14,7 +14,7 @@ import ( func setupRouter() *gin.Engine { router, rg := utils.CreateAPIGroup() rg.GET("/buyInfo/:buyInfoID", getBuyInfo) - rg.POST("/buyInfo/:buyInfoID", updateBuyInfo) + rg.PUT("/buyInfo/:buyInfoID", updateBuyInfo) rg.GET("/buyInfo", findBuyInfo) rg.POST("/buyInfo", addBuyInfo) return router @@ -60,7 +60,7 @@ func getBuyInfo(c *gin.Context) { } /** - * @api {post} /buyInfo/:buyInfoID UpdateBuyInfo + * @api {put} /buyInfo/:buyInfoID UpdateBuyInfo * @apiVersion 1.0.0 * @apiGroup BuyInfo * @apiPermission self/admin diff --git a/backend/api/sellinfo/main.go b/backend/api/sellinfo/main.go index ed6e8dd..b6b5e51 100644 --- a/backend/api/sellinfo/main.go +++ b/backend/api/sellinfo/main.go @@ -14,7 +14,7 @@ import ( func setupRouter() *gin.Engine { router, rg := utils.CreateAPIGroup() rg.GET("/sellInfo/:sellInfoID", getSellInfo) - rg.POST("/sellInfo/:sellInfoID", updateSellInfo) + rg.PUT("/sellInfo/:sellInfoID", updateSellInfo) rg.GET("/sellInfo", findSellInfo) rg.POST("/sellInfo", addSellInfo) return router @@ -60,7 +60,7 @@ func getSellInfo(c *gin.Context) { } /** - * @api {post} /sellInfo/:sellInfoID UpdateSellInfo + * @api {put} /sellInfo/:sellInfoID UpdateSellInfo * @apiVersion 1.0.0 * @apiGroup SellInfo * @apiPermission self/admin diff --git a/backend/doc/api_data.js b/backend/doc/api_data.js index 9794f9a..1e6713b 100644 --- a/backend/doc/api_data.js +++ b/backend/doc/api_data.js @@ -319,7 +319,7 @@ define({ "api": [ } }, { - "type": "post", + "type": "put", "url": "/buyInfo/:buyInfoID", "title": "UpdateBuyInfo", "version": "1.0.0", @@ -1088,7 +1088,7 @@ define({ "api": [ } }, { - "type": "post", + "type": "put", "url": "/sellInfo/:sellInfoID", "title": "UpdateSellInfo", "version": "1.0.0", diff --git a/backend/doc/api_data.json b/backend/doc/api_data.json index 341240f..9f287d6 100644 --- a/backend/doc/api_data.json +++ b/backend/doc/api_data.json @@ -319,7 +319,7 @@ } }, { - "type": "post", + "type": "put", "url": "/buyInfo/:buyInfoID", "title": "UpdateBuyInfo", "version": "1.0.0", @@ -1088,7 +1088,7 @@ } }, { - "type": "post", + "type": "put", "url": "/sellInfo/:sellInfoID", "title": "UpdateSellInfo", "version": "1.0.0", diff --git a/backend/doc/api_project.js b/backend/doc/api_project.js index 7838914..ae0485f 100644 --- a/backend/doc/api_project.js +++ b/backend/doc/api_project.js @@ -21,7 +21,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2019-09-08T18:38:23.473Z", + "time": "2019-09-08T18:52:41.653Z", "url": "http://apidocjs.com", "version": "0.17.7" } diff --git a/backend/doc/api_project.json b/backend/doc/api_project.json index e214e29..30f7da7 100644 --- a/backend/doc/api_project.json +++ b/backend/doc/api_project.json @@ -21,7 +21,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2019-09-08T18:38:23.473Z", + "time": "2019-09-08T18:52:41.653Z", "url": "http://apidocjs.com", "version": "0.17.7" }