This commit is contained in:
Fran Jurmanović
2021-05-06 20:09:29 +02:00
parent 3a5138eb83
commit 20894ee42e
18 changed files with 197 additions and 28 deletions

21
pkg/controllers/api.go Normal file
View File

@@ -0,0 +1,21 @@
package controllers
import (
"wallet-api/pkg/services"
"github.com/gin-gonic/gin"
)
type ApiController struct {
ApiService *services.ApiService
}
func (ac *ApiController) Init(s *gin.Engine) {
apiGroup := s.Group("/api")
apiGroup.GET("", ac.getFirst)
}
func (ac *ApiController) getFirst(c *gin.Context) {
apiModel := ac.ApiService.GetFirst()
c.JSON(200, apiModel)
}