FindByPhone 通过电话查询用户
(ctx context.Context, phone string)
| 102 | |
| 103 | // FindByPhone 通过电话查询用户 |
| 104 | func (ur *userRepository) FindByPhone(ctx context.Context, phone string) (domain.User, error) { |
| 105 | u, err := ur.dao.FindByPhone(ctx, phone) |
| 106 | if err != nil { |
| 107 | return domain.User{}, err |
| 108 | } |
| 109 | |
| 110 | return toDomainUser(u), nil |
| 111 | } |
| 112 | |
| 113 | // FindByUsername 通过用户名查询用户 |
| 114 | func (ur *userRepository) FindByUsername(ctx context.Context, username string) (domain.User, error) { |
nothing calls this directly
no test coverage detected