You've already forked openaccounting-server
mirror of
https://github.com/openaccounting/oa-server.git
synced 2025-12-09 00:50:59 +13:00
initial commit
This commit is contained in:
31
core/model/model.go
Normal file
31
core/model/model.go
Normal file
@@ -0,0 +1,31 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/openaccounting/oa-server/core/model/db"
|
||||
"github.com/openaccounting/oa-server/core/model/types"
|
||||
"github.com/openaccounting/oa-server/core/util"
|
||||
)
|
||||
|
||||
var Instance Interface
|
||||
|
||||
type Model struct {
|
||||
db db.Datastore
|
||||
bcrypt util.Bcrypt
|
||||
config types.Config
|
||||
}
|
||||
|
||||
type Interface interface {
|
||||
UserInterface
|
||||
OrgInterface
|
||||
AccountInterface
|
||||
TransactionInterface
|
||||
PriceInterface
|
||||
SessionInterface
|
||||
ApiKeyInterface
|
||||
}
|
||||
|
||||
func NewModel(db db.Datastore, bcrypt util.Bcrypt, config types.Config) *Model {
|
||||
model := &Model{db: db, bcrypt: bcrypt, config: config}
|
||||
Instance = model
|
||||
return model
|
||||
}
|
||||
Reference in New Issue
Block a user