wechat.go 486 B

12345678910111213141516171819
  1. package wechat
  2. import (
  3. "context"
  4. "go-common/app/interface/main/web-goblin/model/wechat"
  5. "go-common/library/log"
  6. )
  7. // Qrcode get qrcode from wechat.
  8. func (s *Service) Qrcode(c context.Context, arg string) (qrcode []byte, err error) {
  9. var accessToken *wechat.AccessToken
  10. if accessToken, err = s.dao.AccessToken(c); err != nil {
  11. log.Error("Qrcode s.dao.AccessToken error(%v) arg(%s)", err, arg)
  12. return
  13. }
  14. qrcode, err = s.dao.Qrcode(c, accessToken.AccessToken, arg)
  15. return
  16. }