mirror of
https://github.com/Floriansylvain/RenewCMS.git
synced 2026-08-19 11:43:22 +02:00
feat: users & authentication implementation
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
package useCases
|
||||
|
||||
import (
|
||||
. "GohCMS2/adapters/secondary/gateways"
|
||||
. "GohCMS2/domain/user"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type GetUserUseCase struct {
|
||||
userRepository UserRepository
|
||||
}
|
||||
|
||||
func NewGetUserUseCase(db *gorm.DB) *GetUserUseCase {
|
||||
return &GetUserUseCase{
|
||||
userRepository: *NewUserRepository(db),
|
||||
}
|
||||
}
|
||||
|
||||
func (g *GetUserUseCase) GetUser(id uint32) (User, error) {
|
||||
return g.userRepository.Get(id)
|
||||
}
|
||||
Reference in New Issue
Block a user