initial commit

This commit is contained in:
Patrick Nagurny
2018-10-19 15:31:41 -04:00
commit e2dd29259f
203 changed files with 44839 additions and 0 deletions

23
core/model/session.go Normal file
View File

@@ -0,0 +1,23 @@
package model
import (
"errors"
"github.com/openaccounting/oa-server/core/model/types"
)
type SessionInterface interface {
CreateSession(*types.Session) error
DeleteSession(string, string) error
}
func (model *Model) CreateSession(session *types.Session) error {
if session.Id == "" {
return errors.New("id required")
}
return model.db.InsertSession(session)
}
func (model *Model) DeleteSession(id string, userId string) error {
return model.db.DeleteSession(id, userId)
}