key.go 476 字节
package redisdata

import "fmt"

const (
	KEY_PREFIX     string = "oppmg_" //统一前缀
	KEY_USER_TOKEN string = "token"  //登录token存储
)

type RedisLoginToken struct {
	AccessToken    string `json:"access_token"`
	RefreshToken   string `json:"refresh_token"`
	CurrentCompany int64  `json:"current_company"`
}

func GetKeyLoginToken(userid int64, companyid int64) string {
	key := fmt.Sprintf("%s%s:%d_%d", KEY_PREFIX, KEY_USER_TOKEN, userid, companyid)
	return key
}