diff --git a/interfaces/model_spider.go b/interfaces/model_spider.go index b80e849..c6cfe41 100644 --- a/interfaces/model_spider.go +++ b/interfaces/model_spider.go @@ -19,4 +19,6 @@ type Spider interface { SetColId(id primitive.ObjectID) GetIncrementalSync() (incrementalSync bool) SetIncrementalSync(incrementalSync bool) + GetAutoInstall() (autoInstall bool) + SetAutoInstall(autoInstall bool) } diff --git a/models/models/spider.go b/models/models/spider.go index efa2e4a..bbdc2db 100644 --- a/models/models/spider.go +++ b/models/models/spider.go @@ -25,9 +25,10 @@ type Spider struct { Stat *SpiderStat `json:"stat,omitempty" bson:"-"` // execution - Cmd string `json:"cmd" bson:"cmd"` // execute command - Param string `json:"param" bson:"param"` // default task param - Priority int `json:"priority" bson:"priority"` + Cmd string `json:"cmd" bson:"cmd"` // execute command + Param string `json:"param" bson:"param"` // default task param + Priority int `json:"priority" bson:"priority"` + AutoInstall bool `json:"auto_install" bson:"auto_install"` // settings IncrementalSync bool `json:"incremental_sync" bson:"incremental_sync"` // whether to incrementally sync files @@ -117,6 +118,14 @@ func (s *Spider) SetIncrementalSync(incrementalSync bool) { s.IncrementalSync = incrementalSync } +func (s *Spider) GetAutoInstall() (autoInstall bool) { + return s.AutoInstall +} + +func (s *Spider) SetAutoInstall(autoInstall bool) { + s.AutoInstall = autoInstall +} + type SpiderList []Spider func (l *SpiderList) GetModels() (res []interfaces.Model) {