From 0222e79afe45d9fc55aed9a7e62ca239c228ab73 Mon Sep 17 00:00:00 2001
From: 554325746@qq.com <554325746@qq.com>
Date: 星期一, 23 十二月 2019 10:24:12 +0800
Subject: [PATCH] add sys comeback sh
---
controllers/area.go | 94 +++++++++++++++++++++++++++++++++++++++++------
1 files changed, 82 insertions(+), 12 deletions(-)
diff --git a/controllers/area.go b/controllers/area.go
index 9825af2..59e7f97 100644
--- a/controllers/area.go
+++ b/controllers/area.go
@@ -14,13 +14,17 @@
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 int true "鍖哄煙鐨刬d"
+// @Param parentid query string true "鍖哄煙鐨刬d"
+// @Param searchType query int true "鏌ヨ绫诲瀷锛�0锛氬叏閮紝1锛氬垎鏋愭憚鍍忔満锛�2锛氱洃鎺ф憚鍍忔満锛�"
+// @Param cameraName query string false "鎽勫儚鏈哄悕绉�"
// @Success 200 {string} json "{"code":200, msg:"鐩綍缁撴瀯鏁版嵁"}"
// @Failure 500 {string} json "{"code":500, msg:"杩斿洖閿欒淇℃伅"}"
// @Router /data/api-v/area/localmenu [get]
@@ -28,19 +32,79 @@
parentIdStr := c.Query("parentid")
searchTypeStr := c.Query("searchType")
cameraName := c.Query("cameraName")
- treeType := c.Query("type")
var api dbapi.AreaApi
- arr := api.GetLocalCameraTree(parentIdStr, searchTypeStr, cameraName, treeType)
+ arr := api.GetLocalCameraTree(parentIdStr, searchTypeStr, cameraName)
util.ResponseFormat(c, code.Success, arr)
}
-// @Summary 娣诲姞menu鐨勫尯鍩�
-// @Description 娣诲姞鐩綍涓婂尯鍩�
+// @Summary 鏄剧ずGb28181鏍戝舰缁撴瀯
+// @Description 鏄剧ずGb28181鏍戝舰缁撴瀯
+// @Security ApiKeyAuth
// @Produce json
// @Tags menu
-// @Param name query string true "鍖哄煙鍚嶅瓧"
-// @Param parentId query int true "涓婁竴绾х埗id"
+// @Param parentid query string true "鍖哄煙鐨刬d"
+// @Param searchType query int true "鏌ヨ绫诲瀷锛�0锛氬叏閮紝1锛氬垎鏋愭憚鍍忔満锛�2锛氱洃鎺ф憚鍍忔満锛�"
+// @Param cameraName query string false "鎽勫儚鏈哄悕绉�"
+// @Success 200 {string} json "{"code":200, msg:"鐩綍缁撴瀯鏁版嵁"}"
+// @Failure 500 {string} json "{"code":500, msg:"杩斿洖閿欒淇℃伅"}"
+// @Router /data/api-v/area/gb28181Tree [get]
+func (ac AreaController) CameraGb28181Tree(c *gin.Context) {
+ parentIdStr := c.Query("parentid")
+ searchTypeStr := c.Query("searchType")
+ cameraName := c.Query("cameraName")
+
+ var api dbapi.AreaApi
+ arr := api.GetGb28181CameraTree(parentIdStr, searchTypeStr, cameraName)
+ 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 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")
+
+ var api dbapi.AreaApi
+ if api.Gb28181TreeRefresh(id) {
+ util.ResponseFormat(c,code.UpdateSuccess,"鏇存柊鎴愬姛")
+ } else {
+ util.ResponseFormat(c,code.UpdateFail, "鏇存柊澶辫触")
+ }
+}
+
+// @Security ApiKeyAuth
+// @Summary 鍒犻櫎Gb28181骞冲彴
+// @Description 鍒犻櫎Gb28181骞冲彴
+// @Produce json
+// @Tags menu
+// @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/gb28181TreeDelete [post]
+func (ac AreaController) Gb28181TreeDelete(c *gin.Context) {
+ var api dbapi.AreaApi
+ if api.Gb28181TreeDelete() {
+ util.ResponseFormat(c,code.DelSuccess,"鍒犻櫎鎴愬姛")
+ } else {
+ util.ResponseFormat(c,code.ComError, "鍒犻櫎澶辫触")
+ }
+}
+
+// @Security ApiKeyAuth
+// @Summary 娣诲姞menu鐨勫尯鍩�
+// @Description 娣诲姞鐩綍涓婂尯鍩�
+// @Accept x-www-form-urlencoded
+// @Produce json
+// @Tags menu
+// @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]
@@ -62,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]
@@ -85,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
@@ -99,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]
--
Gitblit v1.8.0