refactor: 迁移 service 代码逻辑

This commit is contained in:
2024-08-26 14:50:46 +08:00
parent de3667f957
commit 219116c961
5 changed files with 37 additions and 27 deletions

View File

@ -9,6 +9,8 @@ type Session struct {
Device *onvif.Device `json:"device"`
}
var Sessions = make(map[string]*Session)
func NewSession(xaddr string, username string, password string) (*Session, error) {
// 规范化连接地址
if !strings.Contains(xaddr, ":") {