From 4017349920b546f42460cedb8a63be8d03b12774 Mon Sep 17 00:00:00 2001
From: liuxiaolong <736321739@qq.com>
Date: 星期三, 03 七月 2019 19:40:22 +0800
Subject: [PATCH] fix area bug
---
controllers/area.go | 8 ++++----
router/router.go | 4 ++--
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/controllers/area.go b/controllers/area.go
index 0b5ff28..6dbf8e8 100644
--- a/controllers/area.go
+++ b/controllers/area.go
@@ -87,7 +87,7 @@
// @Param area body controllers.AreaVo true "鍖哄煙缁撴瀯"
// @Success 200 {string} json "{"code":200, data:"",msg:"璇锋眰鎴愬姛", success:true}"
// @Failure 200 {string} json "{"code":"閿欒鐮�", data:"鍑洪敊淇℃伅",msg:"璇锋眰澶辫触", success:false}"
-// @Router /data/api-v/area/update/{id} [put]
+// @Router /data/api-v/area/update [post]
func (ac AreaController) AreaUpdate(c *gin.Context) {
var api dbapi.AreaApi
var model AreaVo
@@ -112,13 +112,13 @@
// @Param id query int true "褰撳墠id"
// @Success 200 {string} json "{"code":200, data:"鍒犻櫎鐨勫尯鍩熶俊鎭�",msg:"璇锋眰鎴愬姛", success:true}"
// @Failure 200 {string} json "{"code":"閿欒鐮�", data:"鍑洪敊淇℃伅",msg:"璇锋眰澶辫触", success:false}"
-// @Router /data/api-v/area/del [get]
+// @Router /data/api-v/area/del [post]
func (ac AreaController) AreaDelete(c *gin.Context) {
var api dbapi.AreaApi
- id := c.Query("id")
+ id := c.PostForm("id")
areaId, err := strconv.Atoi(id)
if err != nil {
- util.ResponseFormat(c, code.ComError, "浼犲叆闈炴暣褰㈡棤娉曡В鏋�")
+ util.ResponseFormat(c, code.ComError, "鍙傛暟鏈夎")
return
}
diff --git a/router/router.go b/router/router.go
index 103fa46..fbc8054 100644
--- a/router/router.go
+++ b/router/router.go
@@ -60,8 +60,8 @@
{
area.GET("/localmenu", areaController.CameraTree)
area.POST("/add", areaController.AreaAdd)
- area.GET("/del", areaController.AreaDelete)
- area.PUT("/update/:id", areaController.AreaUpdate)
+ area.POST("/del", areaController.AreaDelete)
+ area.POST("/update", areaController.AreaUpdate)
}
//鎽勫儚鏈虹鐞�
--
Gitblit v1.8.0