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