interface.go 422 B

12345678910111213141516171819
  1. package wechat
  2. import (
  3. "kpt-tmr-group/config"
  4. "kpt-tmr-group/pkg/di"
  5. "net/http"
  6. )
  7. type Service interface {
  8. doRequest(req *http.Request) ([]byte, error)
  9. DoGet(url string) ([]byte, error)
  10. DoPost(url string, body interface{}) ([]byte, error)
  11. }
  12. var Module = di.Provide(NewService)
  13. func NewService(cfg *config.AppConfig) *ClientService {
  14. return NewClientService(cfg.WechatSetting.Appid, cfg.WechatSetting.Secret)
  15. }