Compare commits

..

2 Commits

Author SHA1 Message Date
lijun 4384af04fa 循环引用问题 2025-01-14 15:47:28 +08:00
lijun 125f4c6660 循环引用问题 2025-01-14 15:44:04 +08:00
3 changed files with 9 additions and 7 deletions

View File

@ -1,7 +1,6 @@
package handler
import (
"VideoStream/dao"
"VideoStream/proto"
"VideoStream/service"
"VideoStream/worker"
@ -69,7 +68,7 @@ func GetVideoStream(c *gin.Context) {
id, _ := c.Get("id")
id1 := id.(int)
//校验权限
device := dao.FindDeviceByID(req.ID, id1)
device := service.GetDevice(req.ID, id1)
if device.ID == 0 {
c.JSON(400, gin.H{"error": "device not exist"})
return

View File

@ -1,7 +1,6 @@
package proto
import (
"VideoStream/worker"
"encoding/json"
"fmt"
"os"
@ -80,10 +79,9 @@ func ReadConfig(path string) error {
if err2 != nil {
fmt.Println("ReadConfigToSetSystem Error encoding config,err :", err2)
}
worker.SetRedis("vp_stream_config", string(jsonData))
SigningKey = []byte(Config.TOKEN_SECRET)
//if Config.TOKEN_SECRET == "" {
// err = fmt.Errorf("token secret is empty: %s", string(jsonData))
//}
if Config.TOKEN_SECRET == "" {
err = fmt.Errorf("token secret is empty: %s", string(jsonData))
}
return err
}

View File

@ -3,6 +3,7 @@ package service
import (
"VideoStream/dao"
"VideoStream/proto"
"VideoStream/worker"
"fmt"
"gocv.io/x/gocv"
"image"
@ -146,3 +147,7 @@ func DoGetVideoStream() {
func GetDevice(id, auth_id int) dao.Device {
return dao.FindDeviceByID(id, auth_id)
}
func SetConfigRedis(key, config string) {
worker.SetRedis(key, config)
}