mirror of
https://github.com/Floriansylvain/RenewCMS.git
synced 2026-08-19 19:53:21 +02:00
clean: removed use of "." in imports
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
package useCases
|
||||
|
||||
import (
|
||||
. "GohCMS2/adapters/secondary/gateways"
|
||||
. "GohCMS2/domain/user"
|
||||
"GohCMS2/adapters/secondary/gateways"
|
||||
"GohCMS2/domain/user"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type CreateUserUseCase struct {
|
||||
userRepository UserRepository
|
||||
userRepository gateways.UserRepository
|
||||
}
|
||||
|
||||
type CreateUserCommand struct {
|
||||
@@ -18,10 +18,14 @@ type CreateUserCommand struct {
|
||||
|
||||
func NewCreateUserUseCase(db *gorm.DB) *CreateUserUseCase {
|
||||
return &CreateUserUseCase{
|
||||
userRepository: *NewUserRepository(db),
|
||||
userRepository: *gateways.NewUserRepository(db),
|
||||
}
|
||||
}
|
||||
|
||||
func (g *CreateUserUseCase) CreateUser(user CreateUserCommand) (User, error) {
|
||||
return g.userRepository.Create(FromApi(user.Username, user.Password, user.Email))
|
||||
func (g *CreateUserUseCase) CreateUser(createUser CreateUserCommand) (user.User, error) {
|
||||
return g.userRepository.Create(user.FromApi(
|
||||
createUser.Username,
|
||||
createUser.Password,
|
||||
createUser.Email,
|
||||
))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user