mirror of
https://git.rwth-aachen.de/acs/public/villas/web-backend-go/
synced 2025-03-30 00:00:12 +01:00
20 lines
No EOL
452 B
Go
20 lines
No EOL
452 B
Go
package queries
|
|
|
|
import (
|
|
"git.rwth-aachen.de/acs/public/villas/villasweb-backend-go/common"
|
|
)
|
|
|
|
func ReplaceSignals(model *common.Model, signals []common.Signal, direction string) error {
|
|
|
|
db := common.GetDB()
|
|
var err error
|
|
|
|
if direction == "in" {
|
|
err = db.Model(model).Select("InputMapping").Update("InputMapping", signals).Error
|
|
} else {
|
|
err = db.Model(model).Select("OutputMapping").Update("OutputMapping", signals).Error
|
|
}
|
|
|
|
return err
|
|
|
|
} |