diff --git a/cmd/crossposting-service/di/inject_adapters.go b/cmd/crossposting-service/di/inject_adapters.go index 8e02fa8..ff1a388 100644 --- a/cmd/crossposting-service/di/inject_adapters.go +++ b/cmd/crossposting-service/di/inject_adapters.go @@ -72,8 +72,11 @@ var adaptersSet = wire.NewSet( wire.Bind(new(app.RelayEventDownloader), new(*adapters.RelayEventDownloader)), twitter.NewTwitter, - twitter.NewNoopTwitter, + twitter.NewDevelopmentTwitter, selectTwitterAdapterDependingOnConfig, + + adapters.NewTwitterAccountDetailsCache, + wire.Bind(new(app.TwitterAccountDetailsCache), new(*adapters.TwitterAccountDetailsCache)), ) func newAdaptersFactoryFn(deps buildTransactionSqliteAdaptersDependencies) sqlite.AdaptersFactoryFn { @@ -103,11 +106,11 @@ func newSqliteDB(conf config.Config, logger logging.Logger) (*sql.DB, func(), er func selectTwitterAdapterDependingOnConfig( conf config.Config, - realAdapter *twitter.Twitter, - noopAdapter *twitter.NoopTwitter, + productionAdapter *twitter.Twitter, + developmentAdapter *twitter.DevelopmentTwitter, ) app.Twitter { if conf.Environment() == config.EnvironmentDevelopment { - return noopAdapter + return developmentAdapter } - return realAdapter + return productionAdapter } diff --git a/cmd/crossposting-service/di/inject_application.go b/cmd/crossposting-service/di/inject_application.go index 6d74415..f05f59e 100644 --- a/cmd/crossposting-service/di/inject_application.go +++ b/cmd/crossposting-service/di/inject_application.go @@ -20,4 +20,7 @@ var applicationSet = wire.NewSet( app.NewGetAccountPublicKeysHandler, app.NewLoginOrRegisterHandler, app.NewLinkPublicKeyHandler, + app.NewGetTwitterAccountDetailsHandler, + app.NewLogoutHandler, + app.NewUnlinkPublicKeyHandler, ) diff --git a/cmd/crossposting-service/di/wire_gen.go b/cmd/crossposting-service/di/wire_gen.go index 9634b8c..e9bcc87 100644 --- a/cmd/crossposting-service/di/wire_gen.go +++ b/cmd/crossposting-service/di/wire_gen.go @@ -53,14 +53,24 @@ func BuildService(contextContext context.Context, configConfig config.Config) (S } getSessionAccountHandler := app.NewGetSessionAccountHandler(genericTransactionProvider, logger, prometheusPrometheus) getAccountPublicKeysHandler := app.NewGetAccountPublicKeysHandler(genericTransactionProvider, logger, prometheusPrometheus) + twitterTwitter := twitter.NewTwitter(configConfig, logger, prometheusPrometheus) + developmentTwitter := twitter.NewDevelopmentTwitter(logger) + appTwitter := selectTwitterAdapterDependingOnConfig(configConfig, twitterTwitter, developmentTwitter) + twitterAccountDetailsCache := adapters.NewTwitterAccountDetailsCache() + getTwitterAccountDetailsHandler := app.NewGetTwitterAccountDetailsHandler(genericTransactionProvider, appTwitter, twitterAccountDetailsCache, logger, prometheusPrometheus) idGenerator := adapters.NewIDGenerator() loginOrRegisterHandler := app.NewLoginOrRegisterHandler(genericTransactionProvider, idGenerator, idGenerator, logger, prometheusPrometheus) + logoutHandler := app.NewLogoutHandler(genericTransactionProvider, logger, prometheusPrometheus) linkPublicKeyHandler := app.NewLinkPublicKeyHandler(genericTransactionProvider, logger, prometheusPrometheus) + unlinkPublicKeyHandler := app.NewUnlinkPublicKeyHandler(genericTransactionProvider, logger, prometheusPrometheus) application := app.Application{ - GetSessionAccount: getSessionAccountHandler, - GetAccountPublicKeys: getAccountPublicKeysHandler, - LoginOrRegister: loginOrRegisterHandler, - LinkPublicKey: linkPublicKeyHandler, + GetSessionAccount: getSessionAccountHandler, + GetAccountPublicKeys: getAccountPublicKeysHandler, + GetTwitterAccountDetails: getTwitterAccountDetailsHandler, + LoginOrRegister: loginOrRegisterHandler, + Logout: logoutHandler, + LinkPublicKey: linkPublicKeyHandler, + UnlinkPublicKey: unlinkPublicKeyHandler, } frontendFileSystem, err := frontend.NewFrontendFileSystem() if err != nil { @@ -81,9 +91,6 @@ func BuildService(contextContext context.Context, configConfig config.Config) (S tweetGenerator := domain.NewTweetGenerator() processReceivedEventHandler := app.NewProcessReceivedEventHandler(genericTransactionProvider, tweetGenerator, logger, prometheusPrometheus) receivedEventSubscriber := memorypubsub2.NewReceivedEventSubscriber(receivedEventPubSub, processReceivedEventHandler, logger) - twitterTwitter := twitter.NewTwitter(configConfig, logger, prometheusPrometheus) - noopTwitter := twitter.NewNoopTwitter(logger) - appTwitter := selectTwitterAdapterDependingOnConfig(configConfig, twitterTwitter, noopTwitter) sendTweetHandler := app.NewSendTweetHandler(genericTransactionProvider, appTwitter, logger, prometheusPrometheus) sqliteSchema := sqlite.NewSqliteSchema() offsetsAdapter := sqlite.NewWatermillOffsetsAdapter() diff --git a/frontend/nos-crossposting-service-frontend/package.json b/frontend/nos-crossposting-service-frontend/package.json index 65b1f92..32d19d6 100644 --- a/frontend/nos-crossposting-service-frontend/package.json +++ b/frontend/nos-crossposting-service-frontend/package.json @@ -12,6 +12,7 @@ "core-js": "^3.8.3", "vue": "^3.2.13", "vue-class-component": "^8.0.0-0", + "vue-property-decorator": "^9.1.2", "vue-router": "^4.0.3", "vuex": "^4.0.0" }, diff --git a/frontend/nos-crossposting-service-frontend/public/favicon.ico b/frontend/nos-crossposting-service-frontend/public/favicon.ico index df36fcf..7186e0e 100644 Binary files a/frontend/nos-crossposting-service-frontend/public/favicon.ico and b/frontend/nos-crossposting-service-frontend/public/favicon.ico differ diff --git a/frontend/nos-crossposting-service-frontend/public/index.html b/frontend/nos-crossposting-service-frontend/public/index.html index 3e5a139..fbf2978 100644 --- a/frontend/nos-crossposting-service-frontend/public/index.html +++ b/frontend/nos-crossposting-service-frontend/public/index.html @@ -5,7 +5,7 @@ -