You've already forked openaccounting-server
mirror of
https://github.com/openaccounting/oa-server.git
synced 2025-12-09 00:50:59 +13:00
24 lines
488 B
Go
24 lines
488 B
Go
|
|
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)
|
||
|
|
}
|