feat: login with apple
This commit is contained in:
@@ -2,26 +2,30 @@ package dao
|
||||
|
||||
import (
|
||||
"github.com/nose7en/ToyBoomServer/defs"
|
||||
"github.com/nose7en/ToyBoomServer/storage"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type Query interface {
|
||||
GetUserByAppleUserID(appleUserID string) (defs.UserGettable, error)
|
||||
GetUserByID(userID int64) (defs.UserGettable, error)
|
||||
}
|
||||
|
||||
type Mutation interface {
|
||||
CreateUser(user defs.UserGettable) error
|
||||
FirstOrCreateUser(user defs.UserGettable) (defs.UserGettable, error)
|
||||
}
|
||||
|
||||
var _ Query = (*queryImpl)(nil)
|
||||
var _ Mutation = (*mutationImpl)(nil)
|
||||
|
||||
type queryImpl struct{}
|
||||
type mutationImpl struct{}
|
||||
type queryImpl struct{ db *gorm.DB }
|
||||
|
||||
type mutationImpl struct{ db *gorm.DB }
|
||||
|
||||
func NewQuery() Query {
|
||||
return &queryImpl{}
|
||||
return &queryImpl{db: storage.GetDBManager().GetDefaultDB()}
|
||||
}
|
||||
|
||||
func NewMutation() Mutation {
|
||||
return &mutationImpl{}
|
||||
return &mutationImpl{db: storage.GetDBManager().GetDefaultDB()}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user