Skip to content

Conversation

@KeepingRunning
Copy link
Member

Related Issue

Close #22

@KeepingRunning KeepingRunning requested a review from slhmy July 21, 2025 05:48
proto/user.proto Outdated

message GetUserByNameRequest { string name = 1; }

message GetUserByNameResponse {
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

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.

Comment on lines 18 to 19
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)
Copy link
Member

@slhmy slhmy Jul 24, 2025

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.

@slhmy slhmy changed the title implement get user by email and name Implement get user by email and name Jul 25, 2025
@slhmy slhmy merged commit 4111abf into main Jul 25, 2025
1 check passed
@KeepingRunning KeepingRunning deleted the ft/search-user branch July 25, 2025 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

need GetUserByEmail and GetUserByName rpc function

3 participants