...
|
...
|
@@ -10,9 +10,11 @@ import ( |
|
|
"gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/interanl/pkg/domain"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/interanl/pkg/gateway"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/interanl/pkg/gateway/authlib"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/interanl/pkg/gateway/smslib"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/pkg/cache"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/pkg/database"
|
|
|
"gorm.io/gorm"
|
|
|
"time"
|
|
|
)
|
|
|
|
|
|
type ServiceContext struct {
|
...
|
...
|
@@ -39,6 +41,7 @@ type ServiceContext struct { |
|
|
UserRepository domain.UserRepository
|
|
|
|
|
|
ApiAuthService authlib.ApiAuthService
|
|
|
SmsService smslib.SMSService
|
|
|
|
|
|
LoginStatusCheck rest.Middleware
|
|
|
}
|
...
|
...
|
@@ -57,6 +60,7 @@ func NewServiceContext(c config.Config) *ServiceContext { |
|
|
DB: db,
|
|
|
Redis: redis,
|
|
|
ApiAuthService: apiAuth,
|
|
|
SmsService: smslib.SMSService{Service: gateway.NewService("短信服务", "https://sms.fjmaimaimai.com:9897", time.Second*5)},
|
|
|
LoginStatusCheck: middleware.NewLoginStatusCheckMiddleware(apiAuth).Handle,
|
|
|
|
|
|
ArticleBackupRepository: repository.NewArticleBackupRepository(cache.NewCachedRepository(mlCache)),
|
...
|
...
|
|