Add database and post service to app contexts
This commit is contained in:
@@ -1,8 +1,13 @@
|
|||||||
package internal
|
package internal
|
||||||
|
|
||||||
import "gorm.io/gorm"
|
import (
|
||||||
|
"CatsOfMastodonBotGo/internal/services"
|
||||||
|
|
||||||
|
"gorm.io/gorm"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
type AppContext struct {
|
type AppContext struct {
|
||||||
Db *gorm.DB
|
Db *gorm.DB
|
||||||
|
PostService *services.PostService
|
||||||
}
|
}
|
@@ -1,7 +1,12 @@
|
|||||||
package internal
|
package internal
|
||||||
|
|
||||||
import "github.com/gin-gonic/gin"
|
import (
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
"gorm.io/gorm"
|
||||||
|
)
|
||||||
|
|
||||||
type AppWebContext struct {
|
type AppWebContext struct {
|
||||||
|
Db *gorm.DB
|
||||||
GinEngine *gin.Engine
|
GinEngine *gin.Engine
|
||||||
|
|
||||||
}
|
}
|
Reference in New Issue
Block a user