mirror of
https://git.rwth-aachen.de/acs/public/villas/web-backend-go/
synced 2025-03-30 00:00:12 +01:00
20 lines
487 B
Go
20 lines
487 B
Go
package simulator
|
|
|
|
import (
|
|
"git.rwth-aachen.de/acs/public/villas/villasweb-backend-go/common"
|
|
)
|
|
|
|
func FindAllSimulators() ([]common.Simulator, int, error) {
|
|
db := common.GetDB()
|
|
var simulators []common.Simulator
|
|
err := db.Find(&simulators).Error
|
|
return simulators, len(simulators), err
|
|
}
|
|
|
|
func FindSimulator(simulatorID int) (common.Simulator, error) {
|
|
db := common.GetDB()
|
|
var simulator common.Simulator
|
|
err := db.First(&simulator, simulatorID).Error
|
|
return simulator, err
|
|
}
|
|
|