Refactoring get account by id and by login to queries

This commit is contained in:
Torkel Ödegaard
2014-12-19 13:40:02 +01:00
parent 5dcf6ff2d3
commit 22bf20a135
8 changed files with 58 additions and 33 deletions
+10 -5
View File
@@ -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
}