mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-23 17:31:11 +01:00
32 lines
667 B
Go
32 lines
667 B
Go
package models
|
|
|
|
import (
|
|
"github.com/crawlab-team/crawlab/core/interfaces"
|
|
"go.mongodb.org/mongo-driver/bson/primitive"
|
|
)
|
|
|
|
type Variable struct {
|
|
Id primitive.ObjectID `json:"_id" bson:"_id"`
|
|
Key string `json:"key" bson:"key"`
|
|
Value string `json:"value" bson:"value"`
|
|
Remark string `json:"remark" bson:"remark"`
|
|
}
|
|
|
|
func (v *Variable) GetId() (id primitive.ObjectID) {
|
|
return v.Id
|
|
}
|
|
|
|
func (v *Variable) SetId(id primitive.ObjectID) {
|
|
v.Id = id
|
|
}
|
|
|
|
type VariableList []Variable
|
|
|
|
func (l *VariableList) GetModels() (res []interfaces.Model) {
|
|
for i := range *l {
|
|
d := (*l)[i]
|
|
res = append(res, &d)
|
|
}
|
|
return res
|
|
}
|