wx_token.go 418 B

123456789101112131415161718192021222324
  1. package models
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. )
  5. type WxToken struct {
  6. id int
  7. AccessToken string
  8. ExpiresIn int64
  9. }
  10. func GetWxTokenById() (token WxToken, err error) {
  11. o := orm.NewOrm()
  12. sql := "select * from wx_token"
  13. err = o.Raw(sql).QueryRow(&token)
  14. return
  15. }
  16. func (w *WxToken) Update(columns []string) (err error) {
  17. o := orm.NewOrm()
  18. _, err = o.Update(w, columns...)
  19. return
  20. }