key_generator.go 338 B

1234567891011121314151617181920
  1. package redis
  2. import "fmt"
  3. const (
  4. SmsKeyPrefix = "sms_code:"
  5. LoginTokenPrefix = "login:token:"
  6. )
  7. const (
  8. ValidAreaCode = "areaCode:valid:list"
  9. )
  10. func GenerateSmsKey(mobile string) string {
  11. return fmt.Sprint(SmsKeyPrefix, mobile)
  12. }
  13. func GenerateTokenKey(mobile string) string {
  14. return fmt.Sprint(LoginTokenPrefix, mobile)
  15. }