New file |
| | |
| | | package controllers |
| | | |
| | | import ( |
| | | "basic.com/pubsub/esutil.git" |
| | | "basic.com/valib/logger.git" |
| | | "github.com/gin-gonic/gin" |
| | | "strconv" |
| | | "webserver/cache" |
| | | "webserver/extend/code" |
| | | "webserver/extend/config" |
| | | "webserver/extend/util" |
| | | ) |
| | | |
| | | type Buckers struct { |
| | | } |
| | | |
| | | func (b *Buckers) GetBuckets(c *gin.Context) { |
| | | var info interface{} |
| | | localConf, err := cache.GetServerInfo() |
| | | if err != nil || localConf.AlarmIp == "" || localConf.ServerId == "" { |
| | | logger.Debug("localConfig is wrong!!!") |
| | | util.ResponseFormat(c, code.ComError, "es config err") |
| | | return |
| | | } |
| | | ip := localConf.AlarmIp |
| | | port := strconv.Itoa(int(localConf.AlarmPort)) |
| | | c.BindJSON(&info) |
| | | inf := info.(map[string]interface{}) |
| | | startTime := inf["startTime"].(string) |
| | | endTime := inf["endTime"].(string) |
| | | cameraId := inf["cameraId"].([]string) |
| | | thresholdTime := inf["thresholdTime"].(float64) |
| | | resDate, err := esutil.GetfaceDataBucketsBycameraIdAndTime(cameraId, startTime, endTime, thresholdTime, ip, port, config.EsInfo.EsIndex.AiOcean.IndexName) |
| | | if err != nil { |
| | | util.ResponseFormat(c, code.FailedQuery, err) |
| | | return |
| | | } |
| | | util.ResponseFormat(c, code.Success, resDate) |
| | | } |
| | |
| | | |
| | | UpgradeSuccess = &Code{http.StatusOK, true, "升级成功"} |
| | | UpgradeFail = &Code{http.StatusInternalServerError, false, "升级失败"} |
| | | FailedQuery = &Code{http.StatusInternalServerError, false, "查询失败"} |
| | | ) |
| | |
| | | basic.com/fileServer/WeedFSClient.git v0.0.0-20190919054037-0182b6c3f5cb |
| | | basic.com/gb28181api.git v0.0.0-20191028082253-472438a8407b |
| | | basic.com/pubsub/cache.git v0.0.0-20190718093725-6a413e1d7d48 |
| | | basic.com/pubsub/esutil.git v0.0.0-20200114073900-ad9de8362777 |
| | | basic.com/pubsub/esutil.git v0.0.0-20200820115648-7b6d324ced5d |
| | | basic.com/pubsub/protomsg.git v0.0.0-20200605082339-fe3f28d45337 |
| | | basic.com/valib/capture.git v0.0.0-20191204103802-89c923cf2abe |
| | | basic.com/valib/deliver.git v0.0.0-20190531095353-25d8c3b20051 |
| | |
| | | basic.com/valib/goffmpeg.git v0.0.0-20200525032638-bc3239dc0121 // indirect |
| | | basic.com/valib/gogpu.git v0.0.0-20190711044327-62043b070865 |
| | | basic.com/valib/gopherdiscovery.git v0.0.0-20190605034340-15d89d8b4e28 |
| | | basic.com/valib/licence.git v2.0.2+incompatible // indirect |
| | | basic.com/valib/licence.git v2.0.2+incompatible |
| | | basic.com/valib/logger.git v0.0.0-20190928113028-4907b08c4159 |
| | | github.com/Microsoft/go-winio v0.4.12 // indirect |
| | | github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect |
| | |
| | | github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc |
| | | github.com/dgrijalva/jwt-go v3.2.0+incompatible |
| | | github.com/disintegration/imaging v1.6.2 // indirect |
| | | github.com/dustin/go-humanize v1.0.0 // indirect |
| | | github.com/dustin/go-humanize v1.0.0 |
| | | github.com/gin-gonic/gin v1.4.0 |
| | | github.com/go-ole/go-ole v1.2.4 // indirect |
| | | github.com/gogo/protobuf v1.2.1 |
| | |
| | | basic.com/gb28181api.git v0.0.0-20191028082253-472438a8407b/go.mod h1:iKnzuRRqUEgt17894pX3oYcOG2fLYFVcXiZbPoMK7+4= |
| | | basic.com/pubsub/cache.git v0.0.0-20190718093725-6a413e1d7d48 h1:BBA30Rgljn6MRieC4gUncETJDyna3ObyubTo9HEQ2M0= |
| | | basic.com/pubsub/cache.git v0.0.0-20190718093725-6a413e1d7d48/go.mod h1:gHLJZz2ee1cGL0X0ae69fs56bAxkDgEQwDhhXZJNUcY= |
| | | basic.com/pubsub/esutil.git v0.0.0-20191120125514-865efa73a9ae h1:/j1dIDLxzEp51N+ZHZIq1xeYVK9zz8epWEAfw01uWe8= |
| | | basic.com/pubsub/esutil.git v0.0.0-20191120125514-865efa73a9ae/go.mod h1:yIvppFPFGC61DOdm71ujnsxZBMFUu2yKjr5O43bMWCw= |
| | | basic.com/pubsub/esutil.git v0.0.0-20200114073900-ad9de8362777 h1:gTeuhepfLgOchD6bqydsGGV6KCj/UaseQQgo4DFyhGQ= |
| | | basic.com/pubsub/esutil.git v0.0.0-20200114073900-ad9de8362777/go.mod h1:yIvppFPFGC61DOdm71ujnsxZBMFUu2yKjr5O43bMWCw= |
| | | basic.com/pubsub/esutil.git v0.0.0-20200820114117-66d9e889d745/go.mod h1:yIvppFPFGC61DOdm71ujnsxZBMFUu2yKjr5O43bMWCw= |
| | | basic.com/pubsub/esutil.git v0.0.0-20200820115648-7b6d324ced5d h1:8Q4LZypFfm1SD79yxueXxrM5HmGlQBo3KvwOb1vdJ+Y= |
| | | basic.com/pubsub/esutil.git v0.0.0-20200820115648-7b6d324ced5d/go.mod h1:yIvppFPFGC61DOdm71ujnsxZBMFUu2yKjr5O43bMWCw= |
| | | basic.com/pubsub/protomsg.git v0.0.0-20200605082339-fe3f28d45337 h1:6LTdIfHUZkfemhkuQnXXaeXRdnm4459PyxMd36AXV20= |
| | | basic.com/pubsub/protomsg.git v0.0.0-20200605082339-fe3f28d45337/go.mod h1:un5NV5VWQoblVLZfx1Rt5vyLgwR0jI92d3VJhfrJhWU= |
| | | basic.com/valib/capture.git v0.0.0-20191204103802-89c923cf2abe h1:uh3u7DuSOw6AwzvPC1EM19sw1Skks1EUJddcbHDKI9M= |
| | |
| | | cloud.google.com/go v0.37.4/go.mod h1:NHPJ89PdicEuT9hdPXMROBD91xc5uRDxsMtSB16k7hw= |
| | | code.cloudfoundry.org/bytefmt v0.0.0-20180906201452-2aa6f33b730c/go.mod h1:wN/zk7mhREp/oviagqUXY3EwuHhWyOvAdsn5Y4CzOrc= |
| | | github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= |
| | | github.com/Microsoft/go-winio v0.4.12 h1:xAfWHN1IrQ0NJ9TBC0KBZoqLjzDTr1ML+4MywiUOryc= |
| | | github.com/Microsoft/go-winio v0.4.12/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA= |
| | | github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= |
| | | github.com/PuerkitoBio/purell v1.1.0 h1:rmGxhojJlM0tuKtfdvliR84CFHljx9ag64t2xmVkjK4= |
| | |
| | | dbPersonCont := new(controllers.DbPersonController) |
| | | ssController := new(controllers.SysSetController) |
| | | sdkController := new(controllers.SdkController) |
| | | bucketsController := new(controllers.Buckers) |
| | | esSearchController := new(controllers.EsSearchController) |
| | | esManagementController := new(controllers.EsManagementController) |
| | | realTimeController := new(controllers.RealTimeController) |
| | |
| | | es.POST("/addCluster", esManagementController.AddCluster) |
| | | es.POST("/createNode", esManagementController.CreateNode) |
| | | es.POST("/updateEsHosts", esManagementController.UpdateEsHosts) |
| | | es.POST("/getBuckets", bucketsController.GetBuckets) |
| | | } |
| | | |
| | | //实时被调数据 |