Commit 86cfbd05 authored by szh's avatar szh

add serial cache

parent 8cbc11a0
...@@ -26,7 +26,7 @@ func init() { ...@@ -26,7 +26,7 @@ func init() {
} }
var tlog = log.New("main", "main.go") var tlog = log.New("main", "main.go")
var serial string
// @title Golang Gin API // @title Golang Gin API
// @version 1.0 // @version 1.0
// @description An example of gin // @description An example of gin
...@@ -82,10 +82,16 @@ func main() { ...@@ -82,10 +82,16 @@ func main() {
func broadcast() { func broadcast() {
var pai pai_service.Pai var pai pai_service.Pai
send := "hello world" send := "hello world"
if serial != "" {
send = serial
} else {
ok := pai.GetConfig() ok := pai.GetConfig()
if ok { if ok {
send = pai.Serial send = pai.Serial
serial = pai.Serial
}
} }
//ip 会变化 //ip 会变化
ip,err := util.GetLocalIP() ip,err := util.GetLocalIP()
if err != nil { if err != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment