graphic_verify_code.go 733 B

12345678910111213141516171819202122232425262728293031323334353637
  1. package models
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. type GraphicVerifyCode struct {
  7. Id int `orm:"column(id);pk"`
  8. VerifyId string
  9. VerifyCode string
  10. CreateTime time.Time
  11. }
  12. //添加用户session信息
  13. func AddGraphicVerifyCode(item *GraphicVerifyCode) (err error) {
  14. o := orm.NewOrm()
  15. _, err = o.Insert(item)
  16. return
  17. }
  18. type GraphicVerifyCodeResp struct {
  19. VerifyId string
  20. VerifyCode string
  21. }
  22. type CheckGraphicVerifyCodeReq struct {
  23. VerifyId string
  24. VerifyCode string
  25. }
  26. func GetGraphicVerifyById(verifyId string) (item *GraphicVerifyCode, err error) {
  27. o := orm.NewOrm()
  28. sql := `SELECT * FROM graphic_verify_code WHERE verify_id=? `
  29. err = o.Raw(sql, verifyId).QueryRow(&item)
  30. return
  31. }