StoreVCode 存储短信验证码
(ctx context.Context, smsID string, number string, vCode string)
| 61 | |
| 62 | // StoreVCode 存储短信验证码 |
| 63 | func (s *smsCache) StoreVCode(ctx context.Context, smsID string, number string, vCode string) error { |
| 64 | key := getVCodeKey(smsID, number) |
| 65 | return s.client.Set(ctx, key, vCode, time.Minute*10).Err() |
| 66 | } |
| 67 | |
| 68 | // SetNX 设置一个不存在的key |
| 69 | func (s *smsCache) SetNX(ctx context.Context, number string, value interface{}, expiration time.Duration) (*redis.BoolCmd, error) { |
nothing calls this directly
no test coverage detected