sensor etc added

This commit is contained in:
geek 2017-06-09 16:28:21 +09:00
parent aefe450b95
commit 674c5dcedb
4 changed files with 35 additions and 48 deletions

View File

@ -30,17 +30,14 @@ func (ss *SensorService) Create(s *Sensor) (string, error) {
return out, nil
}
func (ss *SensorService) List(t *target.Target) (string, error) {
out, err := utils.InvokeDBByModel("sensor", "findAllByTargetId", t, "com.loafle.overflow.target.model.Target")
if err != nil {
return "", err
}
return out, nil;
return out, nil
}

View File

@ -2,11 +2,11 @@ package sensorItem
import (
"encoding/json"
"github.com/golang/protobuf/ptypes/timestamp"
"git.loafle.net/overflow/crawler_go"
"git.loafle.net/overflow/overflow_proxy_service/proxy/sensorItemCategory"
"git.loafle.net/overflow/overflow_proxy_service/proxy/utils"
"git.loafle.net/overflow/overflow_proxy_service/proxy/target"
"git.loafle.net/overflow/overflow_proxy_service/proxy/utils"
"github.com/golang/protobuf/ptypes/timestamp"
)
type SensorItem struct {
@ -20,10 +20,9 @@ type SensorItem struct {
}
type SensorItemService struct {
}
func NewSensorItemService() (*SensorItemService) {
func NewSensorItemService() *SensorItemService {
return &SensorItemService{}
}
@ -36,17 +35,14 @@ func (sis *SensorItemService) Create(si *SensorItem) (string, error){
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;
return out, nil
}

View File

@ -14,14 +14,12 @@ type SensorItemCategory struct {
}
type SensorItemCategoryService struct {
}
func NewSensorItemCategoryService () (*SensorItemCategoryService ) {
func NewSensorItemCategoryService() *SensorItemCategoryService {
return &SensorItemCategoryService{}
}
func (sics *SensorItemCategoryService) Create(sic *SensorItemCategory) (string, error) {
out, err := utils.InvokeDB("sensorItemCategory", "create", sic)

View File

@ -16,10 +16,9 @@ type SensorItemMapping struct {
}
type SensorItemMappingService struct {
}
func NewSensorItemMappingService() (*SensorItemMappingService) {
func NewSensorItemMappingService() *SensorItemMappingService {
return &SensorItemMappingService{}
}
@ -32,17 +31,14 @@ func (sims *SensorItemMappingService) Create(sim *SensorItemMapping) (string, er
return out, nil
}
func (ss *SensorItemMappingService) List(s *sensor.Sensor) (string, error) {
out, err := utils.InvokeDBByModel("sensorItemMapping", "findAllBySensorId", s, "com.loafle.overflow.sensor.model.Sensor")
if err != nil {
return "", err
}
return out, nil;
return out, nil
}