循环引用问题

This commit is contained in:
lijun 2025-01-14 15:47:28 +08:00
parent 125f4c6660
commit 4384af04fa
2 changed files with 5 additions and 2 deletions

View File

@ -1,7 +1,6 @@
package proto package proto
import ( import (
"VideoStream/worker"
"encoding/json" "encoding/json"
"fmt" "fmt"
"os" "os"
@ -80,7 +79,6 @@ 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))

View File

@ -3,6 +3,7 @@ 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"
@ -146,3 +147,7 @@ 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)
}