fixed
CreateAll model name
This commit is contained in:
parent
c17df5786a
commit
73addbda91
@ -26,7 +26,7 @@ func NewSensorItemService() *SensorItemService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (sis *SensorItemService) Create(si *SensorItem) (string, error) {
|
func (sis *SensorItemService) Create(si *SensorItem) (string, error) {
|
||||||
out, err := utils.InvokeDB("sensorItem", "create", si)
|
out, err := utils.InvokeDBByModel("sensorItem", "create", si, "com.loafle.overflow.sensor.model.SensorItem")
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
|
@ -21,7 +21,7 @@ func NewSensorItemCategoryService() *SensorItemCategoryService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (sics *SensorItemCategoryService) Create(sic *SensorItemCategory) (string, error) {
|
func (sics *SensorItemCategoryService) Create(sic *SensorItemCategory) (string, error) {
|
||||||
out, err := utils.InvokeDB("sensorItemCategory", "create", sic)
|
out, err := utils.InvokeDBByModel("sensorItemCategory", "create", sic, "com.loafle.overflow.sensor.model.SensorItemCategory")
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
|
@ -23,7 +23,7 @@ func NewSensorItemMappingService() *SensorItemMappingService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (sims *SensorItemMappingService) Create(sim *SensorItemMapping) (string, error) {
|
func (sims *SensorItemMappingService) Create(sim *SensorItemMapping) (string, error) {
|
||||||
out, err := utils.InvokeDB("sensorItemMapping", "create", sim)
|
out, err := utils.InvokeDBByModel("sensorItemMapping", "create", sim, "com.loafle.overflow.sensor.model.SensorItemMapping")
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
@ -31,6 +31,27 @@ func (sims *SensorItemMappingService) Create(sim *SensorItemMapping) (string, er
|
|||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (sims *SensorItemMappingService) CreateAll(siml *[]*SensorItemMapping) (string, error) {
|
||||||
|
|
||||||
|
outlist := make([]string, 0)
|
||||||
|
for _, sim := range *siml {
|
||||||
|
out,err := sims.Create(sim)
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
outlist = append(outlist, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
bytes,err := json.Marshal(outlist)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
|
||||||
|
return string(bytes), nil
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
func (ss *SensorItemMappingService) List(s *sensor.Sensor) (string, error) {
|
func (ss *SensorItemMappingService) List(s *sensor.Sensor) (string, error) {
|
||||||
|
|
||||||
out, err := utils.InvokeDBByModel("sensorItemMapping", "findAllBySensorId", s, "com.loafle.overflow.sensor.model.Sensor")
|
out, err := utils.InvokeDBByModel("sensorItemMapping", "findAllBySensorId", s, "com.loafle.overflow.sensor.model.Sensor")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user