Refactoring get account by id and by login to queries
This commit is contained in:
+10
-5
@@ -5,11 +5,6 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
var (
|
||||
GetAccountByLogin func(emailOrName string) (*Account, error)
|
||||
GetAccount func(accountId int64) (*Account, error)
|
||||
)
|
||||
|
||||
// Typed errors
|
||||
var (
|
||||
ErrAccountNotFound = errors.New("Account not found")
|
||||
@@ -80,3 +75,13 @@ type GetOtherAccountsQuery struct {
|
||||
AccountId int64
|
||||
Result []*OtherAccountDTO
|
||||
}
|
||||
|
||||
type GetAccountByIdQuery struct {
|
||||
Id int64
|
||||
Result *Account
|
||||
}
|
||||
|
||||
type GetAccountByLoginQuery struct {
|
||||
Login string
|
||||
Result *Account
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user