package sensorItem import ( "encoding/json" "git.loafle.net/overflow/commons_go/model/timestamp" "git.loafle.net/overflow/overflow_service/proxy/crawler" "git.loafle.net/overflow/overflow_service/proxy/sensorItemCategory" "git.loafle.net/overflow/overflow_service/proxy/utils" ) type SensorItem struct { Id json.Number `json:"id,Number,omitempty"` Crawler crawler.Crawler `json:"crawler,omitempty"` SensorItemCategory sensorItemCategory.SensorItemCategory `json:"sensorItemCategory,omitempty"` Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` DataType string `json:"dataType,omitempty"` CreateDate timestamp.Timestamp `json:"createDate,omitempty"` } type SensorItemService struct { } func NewSensorItemService() *SensorItemService { return &SensorItemService{} } func (sis *SensorItemService) Create(si *SensorItem) (string, error) { out, err := utils.InvokeDBByModel("sensorItem", "create", si, "com.loafle.overflow.sensor.model.SensorItem") if err != nil { return "", err } return out, nil } func (ss *SensorItemService) List(cr *crawler.Crawler) (string, error) { out, err := utils.InvokeDBByModel("sensorItem", "findAllByCrawlerId", cr, "com.loafle.overflow.crawler.model.Crawler") if err != nil { return "", err } return out, nil }