| | |
| | | "fmt" |
| | | "strconv" |
| | | "basic.com/valib/logger.git" |
| | | "webserver/cache" |
| | | |
| | | "github.com/gin-gonic/gin" |
| | | |
| | |
| | | fmt.Println(areaId) |
| | | } |
| | | |
| | | // @Summary 根据server获取所有摄像机列表及信息 |
| | | // @Description 根据server获取所有摄像机列表及信息 |
| | | // @Produce json |
| | | // @Tags camera |
| | | // @Param cameraName query string false "摄像机名称" |
| | | // @Success 200 {string} json "{"code":200, success:true, msg:"", data:""}" |
| | | // @Failure 500 {string} json "{"code":500, success:false, msg:"",data:""}" |
| | | // @Router /data/api-v/camera/getAllCamerasByServer [get] |
| | | func (cc CameraController) GetAllCamerasByServer(c *gin.Context) { |
| | | localConf, err2 := cache.GetServerInfo() |
| | | if err2 !=nil || localConf.ServerId == "" { |
| | | logger.Debug("localConfig is wrong!!!") |
| | | util.ResponseFormat(c,code.ComError,"服务器本机未配置serverId") |
| | | return |
| | | } |
| | | var api dbapi.CameraApi |
| | | cameraName := c.Query("cameraName") |
| | | b,d := api.GetAllCamerasByServer(localConf.ServerId, cameraName) |
| | | if b { |
| | | util.ResponseFormat(c,code.Success, d) |
| | | } else { |
| | | util.ResponseFormat(c,code.ComError, "") |
| | | } |
| | | } |
| | | |
| | | // @Summary 获取运行类型获取摄像机列表 |
| | | // @Description 获取运行类型获取摄像机列表 |
| | | // @Produce json |