25 lines
402 B
Go
25 lines
402 B
Go
package repository
|
|
|
|
import (
|
|
"git.ostiwe.com/ostiwe-com/status/model"
|
|
"git.ostiwe.com/ostiwe-com/status/modules/db"
|
|
)
|
|
|
|
type Status interface {
|
|
Add(status model.Status) error
|
|
}
|
|
|
|
type status struct {
|
|
repository
|
|
}
|
|
|
|
func NewStatusRepository() Status {
|
|
return &status{
|
|
repository: repository{db: db.Global},
|
|
}
|
|
}
|
|
|
|
func (s status) Add(status model.Status) error {
|
|
return s.db.Create(&status).Error
|
|
}
|