|
|
@@ -2,7 +2,9 @@ package service
|
|
|
|
|
|
import (
|
|
|
"encoding/json"
|
|
|
+ "errors"
|
|
|
"fmt"
|
|
|
+ "gorm.io/gorm"
|
|
|
"iot_manager_service/app/multimedia/dao"
|
|
|
"iot_manager_service/app/multimedia/model"
|
|
|
"iot_manager_service/app/system/service"
|
|
|
@@ -164,6 +166,9 @@ type Imageinfo struct {
|
|
|
func (s *publishLibrariesService) LedPaying(ledId int, playing string) string {
|
|
|
libraries := dao.PublishLibraries{}
|
|
|
librarie, err := libraries.GetProgramByLedId(ledId)
|
|
|
+ if errors.Is(err, gorm.ErrRecordNotFound) {
|
|
|
+ return ""
|
|
|
+ }
|
|
|
if err != nil {
|
|
|
logger.Logger.Errorf("LedPaying err = %v \n", err)
|
|
|
return ""
|
|
|
@@ -180,6 +185,9 @@ func (s *publishLibrariesService) LedPaying(ledId int, playing string) string {
|
|
|
TenantId: librarie.TenantId,
|
|
|
}
|
|
|
relations, err := relation.GetByProgram()
|
|
|
+ if errors.Is(err, gorm.ErrRecordNotFound) {
|
|
|
+ return ""
|
|
|
+ }
|
|
|
if err != nil {
|
|
|
logger.Logger.Errorf("LedPaying err = %s \n", err.Error())
|
|
|
return ""
|