go-common/app/job/main/member/model/base.go
2019-04-22 18:49:16 +08:00

31 lines
598 B
Go

package model
import (
"fmt"
"math/rand"
)
const (
//CacheKeyBase is.
CacheKeyBase = "bs_%d" // key of baseInfo
//CacheKeyMoral is.
CacheKeyMoral = "moral_%d" // key of detail
//CacheKeyInfo is.
CacheKeyInfo = "i_"
//URLNoFace is.
URLNoFace = "http://static.hdslb.com/images/member/noface.gif"
//TableExpLog is.
TableExpLog = "ugc:ExpLog"
//TableMoralLog is.
TableMoralLog = "ugc:MoralLog"
)
// RandFaceURL get face URL
func (b *BaseInfo) RandFaceURL() {
if b.Face == "" {
b.Face = URLNoFace
return
}
b.Face = fmt.Sprintf("http://i%d.hdslb.com%s", rand.Int63n(3), b.Face)
}