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