feat: Add database object models and repositories for Activity, Company, Customer, Project, TimeEntry, and User with GORM integration
This commit is contained in:
+13
-1
@@ -7,8 +7,10 @@ import (
|
||||
"github.com/gin-gonic/gin"
|
||||
swaggerFiles "github.com/swaggo/files"
|
||||
ginSwagger "github.com/swaggo/gin-swagger"
|
||||
|
||||
_ "github.com/timetracker/backend/docs" // This line is important for swag to work
|
||||
"github.com/timetracker/backend/internal/infrastructure/persistence/db"
|
||||
_ "gorm.io/driver/postgres"
|
||||
// GORM IMPORTS MARKER
|
||||
)
|
||||
|
||||
// @title Time Tracker API
|
||||
@@ -28,6 +30,16 @@ func helloHandler(c *gin.Context) {
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
||||
db, _ := db.NewDatasourceContainer(db.DatabaseConfig{
|
||||
Host: "localhost",
|
||||
Port: 5432,
|
||||
User: "timetracker",
|
||||
Password: "timetracker",
|
||||
DBName: "timetracker",
|
||||
SSLMode: "disable",
|
||||
})
|
||||
|
||||
r := gin.Default()
|
||||
|
||||
r.GET("/", helloHandler)
|
||||
|
||||
Reference in New Issue
Block a user