feat: add services and separate further
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"orbits-server/internal/server/database"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type CtlService struct {
|
||||
db *gorm.DB
|
||||
}
|
||||
|
||||
func NewControlService(db *gorm.DB) *CtlService {
|
||||
return &CtlService{
|
||||
db: db,
|
||||
}
|
||||
}
|
||||
|
||||
func (s *CtlService) ListLatestCommand() (database.Command, error) {
|
||||
return database.LatestCommand(s.db)
|
||||
}
|
||||
Reference in New Issue
Block a user