mirror of
https://github.com/getAlby/lndhub.go.git
synced 2026-02-23 13:54:25 +01:00
Add method to fetch user by login
This commit is contained in:
@@ -65,6 +65,16 @@ func (svc *LndhubService) FindUser(ctx context.Context, userId int64) (*models.U
|
||||
return &user, nil
|
||||
}
|
||||
|
||||
func (svc *LndhubService) FindUserByLogin(ctx context.Context, login string) (*models.User, error) {
|
||||
var user models.User
|
||||
|
||||
err := svc.DB.NewSelect().Model(&user).Where("login = ?", login).Limit(1).Scan(ctx)
|
||||
if err != nil {
|
||||
return &user, err
|
||||
}
|
||||
return &user, nil
|
||||
}
|
||||
|
||||
func (svc *LndhubService) CurrentUserBalance(ctx context.Context, userId int64) (int64, error) {
|
||||
var balance int64
|
||||
|
||||
|
||||
Reference in New Issue
Block a user