package redis import "fmt" const ( SmsKeyPrefix = "sms_code:" PaymentKeyPrefix = "payment:" LoginTokenPrefix = "login:token:" CAPAccessTokenKey = "cap:access_token" ) const ( ValidAreaCode = "areaCode:valid:list" MerchantKey = "merchant:id" ) func GenerateSmsKey(mobile string) string { return fmt.Sprint(SmsKeyPrefix, mobile) } func GenerateTokenKey(openId string) string { return fmt.Sprint(LoginTokenPrefix, openId) } func GenerateCAPAccessTokenKey() string { return fmt.Sprint(CAPAccessTokenKey) } func GenerateReportRefreshKey(source string, id int, modifyTime int64) string { return fmt.Sprintf("%s:%d:%d", source, id, modifyTime) } func GeneratePaymentKey(orderNo string) string { return fmt.Sprint(PaymentKeyPrefix, orderNo) } func GenerateMerchantKey() string { return MerchantKey }