12345678910111213141516171819202122232425262728293031323334353637 |
- package models
- import (
- "github.com/beego/beego/v2/client/orm"
- "time"
- )
- type GraphicVerifyCode struct {
- Id int `orm:"column(id);pk"`
- VerifyId string
- VerifyCode string
- CreateTime time.Time
- }
- //添加用户session信息
- func AddGraphicVerifyCode(item *GraphicVerifyCode) (err error) {
- o := orm.NewOrm()
- _, err = o.Insert(item)
- return
- }
- type GraphicVerifyCodeResp struct {
- VerifyId string
- VerifyCode string
- }
- type CheckGraphicVerifyCodeReq struct {
- VerifyId string
- VerifyCode string
- }
- func GetGraphicVerifyById(verifyId string) (item *GraphicVerifyCode, err error) {
- o := orm.NewOrm()
- sql := `SELECT * FROM graphic_verify_code WHERE verify_id=? `
- err = o.Raw(sql, verifyId).QueryRow(&item)
- return
- }
|