mirror of
https://github.com/FJurmanovic/wallet-go-api.git
synced 2026-02-06 06:08:16 +00:00
restructured controllers
This commit is contained in:
@@ -3,18 +3,21 @@ package api
|
||||
import (
|
||||
"wallet-api/pkg/controllers"
|
||||
"wallet-api/pkg/services"
|
||||
"wallet-api/pkg/utl/configs"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/go-pg/pg/v10"
|
||||
)
|
||||
|
||||
func Routes(s *gin.Engine, db *pg.DB) {
|
||||
ver := s.Group(configs.Prefix)
|
||||
|
||||
api := ver.Group("api")
|
||||
register := ver.Group("register")
|
||||
|
||||
apiService := services.ApiService{Db: db}
|
||||
registerService := services.RegisterService{Db: db}
|
||||
|
||||
apiController := controllers.ApiController{ApiService: &apiService}
|
||||
registerController := controllers.RegisterController{RegisterService: ®isterService}
|
||||
|
||||
apiController.Init(s)
|
||||
registerController.Init(s)
|
||||
controllers.NewApiController(&apiService, api)
|
||||
controllers.NewRegisterController(®isterService, register)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user