liuxiaolong
2020-06-05 7c811247ecf143e08c576986a884bedadc57dd66
controllers/area.go
@@ -14,10 +14,12 @@
   Id string `json:"id"`
   ParentId string `json:"parentId"`
   Name string `json:"name"`
   Alias string `json:"alias"`
}
// @Summary 显示树形结构
// @Description 显示左侧所有区域和摄像机
// @Security ApiKeyAuth
// @Produce json
// @Tags menu
// @Param parentid query string true "区域的id"
@@ -38,6 +40,7 @@
// @Summary 显示Gb28181树形结构
// @Description 显示Gb28181树形结构
// @Security ApiKeyAuth
// @Produce json
// @Tags menu
// @Param parentid query string true "区域的id"
@@ -56,20 +59,19 @@
   util.ResponseFormat(c, code.Success, arr)
}
// @Security ApiKeyAuth
// @Accept x-www-form-urlencoded
// @Summary 刷新Gb28181平台树
// @Description 刷新Gb28181平台树
// @Produce json
// @Tags menu
// @Param id formData string true "国标平台id"
// @Param id formData string false "国标平台id"
// @Success 200 {string} json "{"code":200, data:"",msg:"请求成功", success:true}"
// @Failure 200 {string} json "{"code":500, data:"",msg:"请求失败", success:false}"
// @Router /data/api-v/area/gb28181TreeRefresh [post]
func (ac AreaController) Gb28181TreeRefresh(c *gin.Context) {
   id := c.PostForm("id")
   if id =="" {
      util.ResponseFormat(c, code.RequestParamError, "参数错误")
      return
   }
   var api dbapi.AreaApi
   if api.Gb28181TreeRefresh(id) {
      util.ResponseFormat(c,code.UpdateSuccess,"更新成功")
@@ -78,6 +80,7 @@
   }
}
// @Security ApiKeyAuth
// @Summary 删除Gb28181平台
// @Description 删除Gb28181平台
// @Produce json
@@ -94,12 +97,14 @@
   }
}
// @Security ApiKeyAuth
// @Summary 添加menu的区域
// @Description 添加目录上区域
// @Accept x-www-form-urlencoded
// @Produce json
// @Tags menu
// @Param name query string true "区域名字"
// @Param parentId query int true "上一级父id"
// @Param name formData string true "区域名字"
// @Param parentId formData string 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/add [post]
@@ -121,14 +126,16 @@
   }
}
// @Security ApiKeyAuth
// @Summary 修改名字
// @Description 修改区域名字
// @Accept  json
// @Accept x-www-form-urlencoded
// @Produce json
// @Tags menu
// @Param id query int true "区域id"
// @Param name query string true "区域名字"
// @Param parentId query int true "上一级父id"
// @Param id formData string true "区域id"
// @Param name formData string true "区域名字"
// @Param parentId formData string true "上一级父id"
// @Param alias formData string false "备注名称"
// @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 [post]
@@ -144,10 +151,12 @@
      util.ResponseFormat(c, code.RequestParamError, "parentId参数错误")
      return
   }
   alias := c.PostForm("alias")
   var model = AreaVo{
      Id:id,
      ParentId:parentId,
      Name:name,
      Alias: alias,
   }
   paramBody := util.Struct2Map(model)
   var api dbapi.AreaApi
@@ -158,11 +167,13 @@
   }
}
// @Security ApiKeyAuth
// @Summary 删除一个区域
// @Description 点击删除按钮时删除一个区域
// @Accept x-www-form-urlencoded
// @Produce json
// @Tags menu
// @Param id query int true "当前id"
// @Param id formData string 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 [post]