-
Notifications
You must be signed in to change notification settings - Fork 0
Implement get user by email and name #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
proto/user.proto
Outdated
|
|
||
| message GetUserByNameRequest { string name = 1; } | ||
|
|
||
| message GetUserByNameResponse { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the difference between ListUsers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ListUsers is for user list, GetUserByName/Email is for user search.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, search should be an optional choice inside ListUsers.
If we consider some situation that normal users need user search feature, it can be other service like ListUserInfo etc. It'll only provide limited information.
internal/repository/user.go
Outdated
| List(ctx context.Context, offset, limit int, name, email *string, role *model.UserRole) ([]*model.UserModel, error) | ||
| Count(ctx context.Context, name, email *string, role *model.UserRole) (int64, error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Squash these input parameters into a struct to improve readability, there are too many of them now.
For me using userpb.ListUsersRequest is also okay.
Related Issue
Close #22