| | |
| | | import ( |
| | | "basic.com/dbapi.git" |
| | | "basic.com/pubsub/protomsg.git" |
| | | "basic.com/valib/logger.git" |
| | | "encoding/json" |
| | | "errors" |
| | | "fmt" |
| | |
| | | "nanomsg.org/go-mangos/transport/tcp" |
| | | "net" |
| | | "ruleprocess/cache" |
| | | "ruleprocess/logger" |
| | | "ruleprocess/structure" |
| | | "strconv" |
| | | "time" |
| | |
| | | |
| | | |
| | | // 将字符串格式的坐标序列化为Point格式 |
| | | func Json2points(areaPoints string) []structure.Point { |
| | | var pts []structure.Point |
| | | func Json2points(areaPoints string) []Point { |
| | | var pts []Point |
| | | if areaPoints == "[]" || areaPoints == "" { |
| | | logger.Error("=====================此区域为全部区域") |
| | | pts = append(pts, structure.Point{0, 0}) |
| | | pts = append(pts, structure.Point{0, 540}) |
| | | pts = append(pts, structure.Point{960, 540}) |
| | | pts = append(pts, structure.Point{960, 0}) |
| | | pts = append(pts, Point{0, 0}) |
| | | pts = append(pts, Point{0, 540}) |
| | | pts = append(pts, Point{960, 540}) |
| | | pts = append(pts, Point{960, 0}) |
| | | } else { |
| | | err := json.Unmarshal([]byte(areaPoints), &pts) |
| | | if err != nil { |