hotime/common/context_base.go

19 lines
247 B
Go
Raw Permalink Normal View History

2021-05-23 23:27:41 +00:00
package common
2017-08-23 02:05:47 +00:00
import (
"time"
)
2017-08-23 02:05:47 +00:00
2021-05-23 23:27:41 +00:00
type ContextBase struct {
tag string
2017-08-23 02:05:47 +00:00
}
//唯一标志
func (this *ContextBase) GetTag() string {
2017-08-23 02:05:47 +00:00
if this.tag == "" {
this.tag = ObjToStr(time.Now().Unix()) + ":" + ObjToStr(Random())
2017-08-23 02:05:47 +00:00
}
return this.tag
}