1
0
mirror of https://github.com/aclindsa/moneygo.git synced 2025-07-03 12:48:38 -04:00

Begin splitting models from handlers with User

This commit is contained in:
2017-12-02 06:14:47 -05:00
parent 382d6ad434
commit e70be1647c
11 changed files with 82 additions and 66 deletions

View File

@ -3,6 +3,7 @@ package handlers
import (
"context"
"errors"
"github.com/aclindsa/moneygo/internal/models"
"github.com/yuin/gopher-lua"
"math/big"
"strings"
@ -22,7 +23,7 @@ func luaContextGetAccounts(L *lua.LState) (map[int64]*Account, error) {
account_map, ok = ctx.Value(accountsContextKey).(map[int64]*Account)
if !ok {
user, ok := ctx.Value(userContextKey).(*User)
user, ok := ctx.Value(userContextKey).(*models.User)
if !ok {
return nil, errors.New("Couldn't find User in lua's Context")
}
@ -153,7 +154,7 @@ func luaAccountBalance(L *lua.LState) int {
if !ok {
panic("Couldn't find tx in lua's Context")
}
user, ok := ctx.Value(userContextKey).(*User)
user, ok := ctx.Value(userContextKey).(*models.User)
if !ok {
panic("Couldn't find User in lua's Context")
}