campaign
This commit is contained in:
@@ -44,7 +44,9 @@ type Router struct {
|
||||
rewardHandler *handler.RewardHandler
|
||||
campaignHandler *handler.CampaignHandler
|
||||
customerAuthHandler *handler.CustomerAuthHandler
|
||||
customerPointsHandler *handler.CustomerPointsHandler
|
||||
authMiddleware *middleware.AuthMiddleware
|
||||
customerAuthMiddleware *middleware.CustomerAuthMiddleware
|
||||
}
|
||||
|
||||
func NewRouter(cfg *config.Config,
|
||||
@@ -102,7 +104,9 @@ func NewRouter(cfg *config.Config,
|
||||
campaignService service.CampaignService,
|
||||
campaignValidator validator.CampaignValidator,
|
||||
customerAuthService service.CustomerAuthService,
|
||||
customerAuthValidator validator.CustomerAuthValidator) *Router {
|
||||
customerAuthValidator validator.CustomerAuthValidator,
|
||||
customerPointsService service.CustomerPointsService,
|
||||
customerAuthMiddleware *middleware.CustomerAuthMiddleware) *Router {
|
||||
|
||||
return &Router{
|
||||
config: cfg,
|
||||
@@ -136,7 +140,9 @@ func NewRouter(cfg *config.Config,
|
||||
rewardHandler: handler.NewRewardHandler(rewardService, rewardValidator),
|
||||
campaignHandler: handler.NewCampaignHandler(campaignService, campaignValidator),
|
||||
customerAuthHandler: handler.NewCustomerAuthHandler(customerAuthService, customerAuthValidator),
|
||||
customerPointsHandler: handler.NewCustomerPointsHandler(customerPointsService),
|
||||
authMiddleware: authMiddleware,
|
||||
customerAuthMiddleware: customerAuthMiddleware,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -181,6 +187,15 @@ func (r *Router) addAppRoutes(rg *gin.Engine) {
|
||||
customerAuth.POST("/resend-otp", r.customerAuthHandler.ResendOtp)
|
||||
}
|
||||
|
||||
// Customer authenticated routes
|
||||
customer := v1.Group("/customer")
|
||||
customer.Use(r.customerAuthMiddleware.ValidateCustomerToken())
|
||||
{
|
||||
customer.GET("/points", r.customerPointsHandler.GetCustomerPoints)
|
||||
customer.GET("/tokens", r.customerPointsHandler.GetCustomerTokens)
|
||||
customer.GET("/wallet", r.customerPointsHandler.GetCustomerWallet)
|
||||
}
|
||||
|
||||
organizations := v1.Group("/organizations")
|
||||
{
|
||||
organizations.POST("", r.organizationHandler.CreateOrganization)
|
||||
|
||||
Reference in New Issue
Block a user