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:
23
core/model/session.go
Normal file
23
core/model/session.go
Normal 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)
|
||||
}
|
||||
Reference in New Issue
Block a user