|
|
@@ -51,15 +51,12 @@ func (s *publishLibrariesService) Audit(req model.ReqProgramAudit) error {
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
|
- update := PublishLibrariesService.Create(&program, req)
|
|
|
- fmt.Printf("update = %v", update)
|
|
|
-
|
|
|
+ PublishLibrariesService.Create(&program, req)
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
// SaveOrUpdate 保存
|
|
|
func (s *publishLibrariesService) Create(program *dao.Program, req model.ReqProgramAudit) *common.Errors {
|
|
|
- fmt.Printf("program = %v", program)
|
|
|
remarks := "多媒体系统"
|
|
|
if program.SysType == 1 {
|
|
|
remarks = "广播系统"
|
|
|
@@ -99,7 +96,6 @@ func (s *publishLibrariesService) Create(program *dao.Program, req model.ReqProg
|
|
|
logger.Logger.Errorf("Create err = %s \n", err.Error())
|
|
|
return common.FailResponse(err.Error(), nil)
|
|
|
}
|
|
|
- fmt.Printf("libraries = %v", libraries)
|
|
|
//TODO: 日志保存
|
|
|
return common.SuccessResponse(common.Succeeded, nil)
|
|
|
}
|
|
|
@@ -178,7 +174,6 @@ func (s *publishLibrariesService) LedPaying(ledId int, playing string) string {
|
|
|
return ""
|
|
|
}
|
|
|
|
|
|
- //fmt.Printf("librarie = %v \n", librarie)
|
|
|
program, _ := s.GetProgram(int(librarie.ID))
|
|
|
relation := &dao.ProgramRelation{
|
|
|
ProgramId: program,
|
|
|
@@ -196,7 +191,6 @@ func (s *publishLibrariesService) LedPaying(ledId int, playing string) string {
|
|
|
for _, relation := range relations {
|
|
|
libraryIds = append(libraryIds, relation.LibraryId)
|
|
|
}
|
|
|
- //fmt.Printf("libraryIds = %v \n", libraryIds)
|
|
|
library := &dao.Library{TenantId: librarie.TenantId}
|
|
|
getLibrariesByIds, _ := library.GetLibrariesByIds(libraryIds)
|
|
|
if len(getLibrariesByIds) < 1 {
|
|
|
@@ -222,16 +216,12 @@ func (s *publishLibrariesService) LedPaying(ledId int, playing string) string {
|
|
|
cltLedLibraries.Imageinfo.InEffect.Type = "2"
|
|
|
//cltLedLibraries.Imageinfo.InEffect.Time = strconv.Itoa(relations[0].Duration)
|
|
|
cltLedLibraries.Imageinfo.InEffect.Time = "1500"
|
|
|
- fmt.Printf("cltLedLibraries = %v \n", cltLedLibraries)
|
|
|
marshal, err := json.Marshal(cltLedLibraries)
|
|
|
if err != nil {
|
|
|
- fmt.Printf("LedPaying err = %v \n", err)
|
|
|
return ""
|
|
|
}
|
|
|
- fmt.Printf("cltLedLibraries = %v \n", string(marshal))
|
|
|
|
|
|
str := string(marshal)
|
|
|
- //fmt.Printf("str = %v \n", str)
|
|
|
return str
|
|
|
}
|
|
|
|
|
|
@@ -261,7 +251,6 @@ func (s *publishLibrariesService) IPCastPaying(id int) (string, int) {
|
|
|
//没有新节目不更新
|
|
|
return "", 0
|
|
|
}
|
|
|
- //fmt.Printf("libraries = %v \n", libraries)
|
|
|
var librarie dao.PublishLibraries
|
|
|
//判断当前到底要放哪个节目
|
|
|
for _, library := range libraries {
|
|
|
@@ -273,7 +262,6 @@ func (s *publishLibrariesService) IPCastPaying(id int) (string, int) {
|
|
|
currTime := time.Now()
|
|
|
parse, err := time.Parse("2006-01-02 15:04", fmt.Sprintf("%v %v", time.Now().Format("2006-01-02"), library.JsTime))
|
|
|
if err != nil {
|
|
|
- fmt.Printf("IPCastPaying parse err = %v \n", err)
|
|
|
logger.Logger.Errorf("IPCastPaying parse err = %v \n", err)
|
|
|
continue
|
|
|
}
|
|
|
@@ -285,7 +273,6 @@ func (s *publishLibrariesService) IPCastPaying(id int) (string, int) {
|
|
|
cTime := time.Now()
|
|
|
kTime, err := time.Parse("2006-01-02 15:04", fmt.Sprintf("%v %v", time.Now().Format("2006-01-02"), library.KsTime))
|
|
|
if err != nil {
|
|
|
- fmt.Printf("IPCastPaying kTime err = %v \n", err)
|
|
|
logger.Logger.Errorf("IPCastPaying kTime err = %v \n", err)
|
|
|
}
|
|
|
//这里要作限制 ,只有是当前时分 才操作
|
|
|
@@ -295,7 +282,6 @@ func (s *publishLibrariesService) IPCastPaying(id int) (string, int) {
|
|
|
}
|
|
|
librarie = library
|
|
|
}
|
|
|
- //fmt.Printf("librarie = %v \n", librarie)
|
|
|
program, _ := s.GetProgram(int(librarie.ID))
|
|
|
relation := &dao.ProgramRelation{
|
|
|
ProgramId: program,
|
|
|
@@ -316,7 +302,6 @@ func (s *publishLibrariesService) IPCastPaying(id int) (string, int) {
|
|
|
logger.Logger.Errorf("无素材")
|
|
|
return "", 0
|
|
|
}
|
|
|
- //fmt.Printf("getLibrariesByIds = %v \n", getLibrariesByIds)
|
|
|
// 音频播放
|
|
|
if librarie.Ptype == 1 {
|
|
|
paytime := diffTime(librarie.KsTime, librarie.JsTime)
|