24 lines
417 B
Go
24 lines
417 B
Go
package domain
|
|
|
|
import "strings"
|
|
|
|
type RedisKey string
|
|
|
|
const (
|
|
SendCodeRedisKey RedisKey = "vc"
|
|
)
|
|
|
|
func (key RedisKey) ToString() string {
|
|
return "biz-member-gw:" + string(key)
|
|
}
|
|
|
|
func (key RedisKey) With(s ...string) RedisKey {
|
|
parts := append([]string{string(key)}, s...)
|
|
|
|
return RedisKey(strings.Join(parts, ":"))
|
|
}
|
|
|
|
func GetSendCodeRedisKey(id string) string {
|
|
return SendCodeRedisKey.With(id).ToString()
|
|
}
|