Compare commits
No commits in common. "4384af04fa0ec6ee7938d4f751f186a0fab19b98" and "52effbde93ba532c6d4f8473ab24bdba39bf9277" have entirely different histories.
4384af04fa
...
52effbde93
|
|
@ -1,6 +1,7 @@
|
||||||
package handler
|
package handler
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"VideoStream/dao"
|
||||||
"VideoStream/proto"
|
"VideoStream/proto"
|
||||||
"VideoStream/service"
|
"VideoStream/service"
|
||||||
"VideoStream/worker"
|
"VideoStream/worker"
|
||||||
|
|
@ -68,7 +69,7 @@ func GetVideoStream(c *gin.Context) {
|
||||||
id, _ := c.Get("id")
|
id, _ := c.Get("id")
|
||||||
id1 := id.(int)
|
id1 := id.(int)
|
||||||
//校验权限
|
//校验权限
|
||||||
device := service.GetDevice(req.ID, id1)
|
device := dao.FindDeviceByID(req.ID, id1)
|
||||||
if device.ID == 0 {
|
if device.ID == 0 {
|
||||||
c.JSON(400, gin.H{"error": "device not exist"})
|
c.JSON(400, gin.H{"error": "device not exist"})
|
||||||
return
|
return
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package proto
|
package proto
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"VideoStream/worker"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
@ -79,9 +80,10 @@ func ReadConfig(path string) error {
|
||||||
if err2 != nil {
|
if err2 != nil {
|
||||||
fmt.Println("ReadConfigToSetSystem Error encoding config,err :", err2)
|
fmt.Println("ReadConfigToSetSystem Error encoding config,err :", err2)
|
||||||
}
|
}
|
||||||
|
worker.SetRedis("vp_stream_config", string(jsonData))
|
||||||
SigningKey = []byte(Config.TOKEN_SECRET)
|
SigningKey = []byte(Config.TOKEN_SECRET)
|
||||||
if Config.TOKEN_SECRET == "" {
|
//if Config.TOKEN_SECRET == "" {
|
||||||
err = fmt.Errorf("token secret is empty: %s", string(jsonData))
|
// err = fmt.Errorf("token secret is empty: %s", string(jsonData))
|
||||||
}
|
//}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ package service
|
||||||
import (
|
import (
|
||||||
"VideoStream/dao"
|
"VideoStream/dao"
|
||||||
"VideoStream/proto"
|
"VideoStream/proto"
|
||||||
"VideoStream/worker"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"gocv.io/x/gocv"
|
"gocv.io/x/gocv"
|
||||||
"image"
|
"image"
|
||||||
|
|
@ -147,7 +146,3 @@ func DoGetVideoStream() {
|
||||||
func GetDevice(id, auth_id int) dao.Device {
|
func GetDevice(id, auth_id int) dao.Device {
|
||||||
return dao.FindDeviceByID(id, auth_id)
|
return dao.FindDeviceByID(id, auth_id)
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetConfigRedis(key, config string) {
|
|
||||||
worker.SetRedis(key, config)
|
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue