diff --git a/config.dev.toml b/config.dev.toml index 77cbd91..9a901e7 100644 --- a/config.dev.toml +++ b/config.dev.toml @@ -37,7 +37,6 @@ db = 0 pass = "3rdaP3KL2x%V" prefix = "nemt-portal-api-dev" default-expiration = "5m" -master-name = "devmaster01" [log] log-to-file = false diff --git a/config.prd.toml b/config.prd.toml index dacdcc8..b341a3e 100644 --- a/config.prd.toml +++ b/config.prd.toml @@ -37,7 +37,6 @@ db = 0 pass = "3rdaP3KL2x%V" prefix = "portal-api-prod" default-expiration = "5m" -master-name = "master01" [log] log-to-file = false diff --git a/config.stg.toml b/config.stg.toml index 4ca8fb6..66ef0eb 100644 --- a/config.stg.toml +++ b/config.stg.toml @@ -37,7 +37,6 @@ db = 0 pass = "3rdaP3KL2x%V" prefix = "portal-api-test" default-expiration = "5m" -master-name = "devmaster01" [log] log-to-file = false diff --git a/data/datamysql/notification.go b/data/datamysql/notification.go index c6b9166..3d5f834 100644 --- a/data/datamysql/notification.go +++ b/data/datamysql/notification.go @@ -80,9 +80,7 @@ func (c *notificationRepo) getQuery() string { INNER JOIN tab_login e ON c.user_id = e.user_id INNER JOIN tab_login f - ON d.user_id = f.user_id - INNER JOIN tab_ride g - ON g.ride_id = a.ride_id ` + ON d.user_id = f.user_id` } func (c *notificationRepo) GetLastNotificationFromPhoneNumber(notificationType string, phoneNumber string, status string) (entity.Notification, error) { diff --git a/infra/cache/cache.go b/infra/cache/cache.go index 8c4eb11..d7c4f31 100644 --- a/infra/cache/cache.go +++ b/infra/cache/cache.go @@ -31,11 +31,10 @@ type RedisCache struct { func Instance(cfg *config.Config) contract.CacheManager { once.Do(func() { client := redis.NewFailoverClient(&redis.FailoverOptions{ - MasterName: cfg.Cache.Master, + MasterName: "master01", SentinelAddrs: []string{fmt.Sprintf("%s:%v", cfg.Cache.Server, cfg.Cache.Port)}, Password: cfg.Cache.Pass, DB: cfg.Cache.DB, - MaxRetries: 10, }) instance = &RedisCache{cfg, client} diff --git a/infra/config/config.go b/infra/config/config.go index d17cdb8..402805a 100644 --- a/infra/config/config.go +++ b/infra/config/config.go @@ -120,7 +120,6 @@ type CacheConfig struct { Pass string Prefix string DefaultExpiration time.Duration - Master string } // CacheConfig represents the configuration values about the documentation config. @@ -200,7 +199,6 @@ func Read() (*Config, error) { Pass: viper.GetString("cache.pass"), Prefix: viper.GetString("cache.prefix"), DefaultExpiration: viper.GetDuration("cache.default-expiration"), - Master: viper.GetString("cache.master-name"), }, Lyft: LyftConfig{ Client: viper.GetString("lyft.key"), diff --git a/server/serverconfig/serverconfig.go b/server/serverconfig/serverconfig.go index 04687a3..6b34b93 100644 --- a/server/serverconfig/serverconfig.go +++ b/server/serverconfig/serverconfig.go @@ -18,7 +18,7 @@ func SetMiddlewares(server *echo.Echo, cfg *config.Config, log *logger.Logger, s setCORSMiddleware(server, cfg) setBodyLimitMiddleware(server) setRateLimitMiddleware(server) - //setAuthorizationMiddleware(server, log, cfg, appsvc) + setAuthorizationMiddleware(server, log, cfg, appsvc) err := setJWTMiddleware(server, cfg) if err != nil {