mirror of
https://github.com/FJurmanovic/wallet-go-api.git
synced 2026-02-06 06:08:16 +00:00
starter
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/go-pg/pg/v10"
|
||||
)
|
||||
|
||||
func Init(s *gin.Engine, db *pg.DB) {
|
||||
Routes(s, db)
|
||||
}
|
||||
|
||||
type API struct {
|
||||
Api string `json:"api"`
|
||||
}
|
||||
|
||||
15
pkg/api/routes.go
Normal file
15
pkg/api/routes.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"wallet-api/pkg/controllers"
|
||||
"wallet-api/pkg/services"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/go-pg/pg/v10"
|
||||
)
|
||||
|
||||
func Routes(s *gin.Engine, db *pg.DB) {
|
||||
apiService := services.ApiService{Db: db}
|
||||
apiController := controllers.ApiController{ApiService: &apiService}
|
||||
apiController.Init(s)
|
||||
}
|
||||
Reference in New Issue
Block a user