verify_code.go 377 B

1234567891011121314151617
  1. package services
  2. import (
  3. "context"
  4. _ "embed"
  5. "eta/eta_mini_api/utils"
  6. )
  7. //go:embed lua\verify_code.lua
  8. var luaVerifyCacheIncr string
  9. type VerifyCacheIncrService struct {
  10. }
  11. func (v *VerifyCacheIncrService) VerifyCacheIncr(key string, expireInSeconds int) error {
  12. return utils.Redis.Eval(context.Background(), luaVerifyCacheIncr, []string{key}, expireInSeconds).Err()
  13. }