From 99e385889a0c52193b6058f9c4c570ad96bdba7e Mon Sep 17 00:00:00 2001 From: Mohammad Mahdi Date: Tue, 13 May 2025 16:45:58 +0330 Subject: [PATCH] Add database and post service to app contexts --- internal/AppContext.go | 7 ++++++- internal/AppWebContext.go | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/internal/AppContext.go b/internal/AppContext.go index 1c77532..a274633 100644 --- a/internal/AppContext.go +++ b/internal/AppContext.go @@ -1,8 +1,13 @@ package internal -import "gorm.io/gorm" +import ( + "CatsOfMastodonBotGo/internal/services" + + "gorm.io/gorm" +) type AppContext struct { Db *gorm.DB + PostService *services.PostService } \ No newline at end of file diff --git a/internal/AppWebContext.go b/internal/AppWebContext.go index 423fc0f..455d6c6 100644 --- a/internal/AppWebContext.go +++ b/internal/AppWebContext.go @@ -1,7 +1,12 @@ package internal -import "github.com/gin-gonic/gin" +import ( + "github.com/gin-gonic/gin" + "gorm.io/gorm" +) type AppWebContext struct { + Db *gorm.DB GinEngine *gin.Engine + } \ No newline at end of file