This commit is contained in:
@@ -2,10 +2,12 @@ package handlers
|
||||
|
||||
import (
|
||||
"kontor-api-gin/internal/models"
|
||||
"kontor-api-gin/internal/repository"
|
||||
"kontor-api-gin/internal/service"
|
||||
"net/http"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type PositionHandler struct {
|
||||
@@ -31,3 +33,8 @@ func (handler *PositionHandler) Get(c *gin.Context) {
|
||||
}
|
||||
c.JSON(http.StatusOK, position)
|
||||
}
|
||||
|
||||
func NewPositionHandler(db *gorm.DB) *PositionHandler {
|
||||
handler := &PositionHandler{Service: service.NewPositionService(repository.NewPositionRepository(db))}
|
||||
return handler
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user