22 lines
399 B
Go
22 lines
399 B
Go
package repository
|
|
|
|
import (
|
|
"fmt"
|
|
"git.hlsq.asia/mmorpg/service-common/db/mysql"
|
|
)
|
|
|
|
var dbName mysql.DBName = "user_db"
|
|
|
|
var (
|
|
cacheBySn = "c:%v:s:%v"
|
|
userCacheByPhone = "c:user:p:%v"
|
|
)
|
|
|
|
func keyCacheBySn(sn string, tableName string) string {
|
|
return fmt.Sprintf(cacheBySn, tableName, sn)
|
|
}
|
|
|
|
func keyUserCacheByPhone(phone string) string {
|
|
return fmt.Sprintf(userCacheByPhone, phone)
|
|
}
|