Procházet zdrojové kódy

backend: add httpclient

Yi před 4 dny
rodič
revize
3f3e6040b9
1 změnil soubory, kde provedl 11 přidání a 7 odebrání
  1. 11 7
      module/backend/interface.go

+ 11 - 7
module/backend/interface.go

@@ -5,6 +5,7 @@ import (
 	"kpt-pasture/config"
 	"kpt-pasture/model"
 	"kpt-pasture/service/asynqsvc"
+	"kpt-pasture/service/httpclient"
 	"kpt-pasture/service/wechat"
 	"kpt-pasture/store/kptstore"
 	"mime/multipart"
@@ -24,10 +25,11 @@ type Hub struct {
 type StoreEntry struct {
 	dig.In
 
-	Cfg         *config.AppConfig
-	DB          *kptstore.DB
-	HttpClient  *wechat.ClientService
-	AsynqClient asynqsvc.Client
+	Cfg          *config.AppConfig
+	DB           *kptstore.DB
+	WeChatClient *wechat.ClientService
+	AsynqClient  asynqsvc.Client
+	HttpClient   *httpclient.Service
 }
 
 func NewStore(store StoreEntry) KptService {
@@ -36,9 +38,11 @@ func NewStore(store StoreEntry) KptService {
 
 func NewStoreEntry(cfg *config.AppConfig, Db *kptstore.DB) *StoreEntry {
 	return &StoreEntry{
-		Cfg:        cfg,
-		DB:         Db,
-		HttpClient: nil,
+		Cfg:          cfg,
+		DB:           Db,
+		WeChatClient: nil,
+		AsynqClient:  nil,
+		HttpClient:   nil,
 	}
 }