Last active
March 2, 2020 22:39
-
-
Save victorsteven/9443bae123072b47cc2723a61a946adc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package application | |
import ( | |
"food-app/domain/entity" | |
"food-app/domain/repository" | |
) | |
type userApp struct { | |
us repository.UserRepository | |
} | |
//UserApp implements the UserAppInterface | |
var _ UserAppInterface = &userApp{} | |
type UserAppInterface interface { | |
SaveUser(*entity.User) (*entity.User, map[string]string) | |
GetUsers() ([]entity.User, error) | |
GetUser(uint64) (*entity.User, error) | |
GetUserByEmailAndPassword(*entity.User) (*entity.User, map[string]string) | |
} | |
func (u *userApp) SaveUser(user *entity.User) (*entity.User, map[string]string) { | |
return u.us.SaveUser(user) | |
} | |
func (u *userApp) GetUser(userId uint64) (*entity.User, error) { | |
return u.us.GetUser(userId) | |
} | |
func (u *userApp) GetUsers() ([]entity.User, error) { | |
return u.us.GetUsers() | |
} | |
func (u *userApp) GetUserByEmailAndPassword(user *entity.User) (*entity.User, map[string]string) { | |
return u.us.GetUserByEmailAndPassword(user) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment