vfCode.go 692 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /**
  2. * @ File:
  3. * @ Date: 2020/8/28 18:29
  4. * @ Author: JYQ
  5. * @ Description:
  6. */
  7. package model
  8. import (
  9. "fmt"
  10. "time"
  11. "video_course/errors"
  12. )
  13. type VFCodeCodeTypeEnum int
  14. const (
  15. _ VFCodeCodeTypeEnum = iota
  16. VFCodeCodeTypeLogin
  17. )
  18. func VFCodeCodeTypeFromInt(VFCodeCodeTypeInt int) VFCodeCodeTypeEnum {
  19. VFCodeCodeType := VFCodeCodeTypeEnum(VFCodeCodeTypeInt)
  20. switch VFCodeCodeType {
  21. case VFCodeCodeTypeLogin:
  22. default:
  23. panic(errors.NewParamErr(fmt.Errorf("vfCode")))
  24. }
  25. return VFCodeCodeType
  26. }
  27. type VfCode struct {
  28. Id int
  29. Name string
  30. SendType int
  31. CodeType VFCodeCodeTypeEnum
  32. Code string
  33. Ip string
  34. CreateTime time.Time
  35. ExpireAt time.Time
  36. }