|
@@ -135,3 +135,151 @@ func init12() {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+// 修改分享图片脚本
|
|
|
+func initpy() {
|
|
|
+
|
|
|
+ //python3 main.py
|
|
|
+ var condition string
|
|
|
+ var pars []interface{}
|
|
|
+ listVoice, err := cygx.GetActivityVoiceList(condition, pars)
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ fmt.Println(err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ for _, v := range listVoice {
|
|
|
+ shareImg, _ := MakeCygxMp3HtmlImg(v.VoicePlaySeconds) //生成分享图片
|
|
|
+ v.ShareImg = shareImg
|
|
|
+ err = cygx.UpdateCygxActivityVoice(v)
|
|
|
+ if err != nil {
|
|
|
+ err = errors.New("UpdateCygxActivityVoice" + err.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ fmt.Println(err)
|
|
|
+ }
|
|
|
+
|
|
|
+ listVideo, err := cygx.GetCygxActivityVideoList(condition, pars)
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ fmt.Println(err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ for _, v := range listVideo {
|
|
|
+ shareImg, _ := MakeCygxMp4HtmlImg(v.VideoDuration) //生成分享图片
|
|
|
+ v.ShareImg = shareImg
|
|
|
+ err = cygx.UpdateCygxActivityVideo(v)
|
|
|
+ if err != nil {
|
|
|
+ err = errors.New("UpdateCygxActivityVideo" + err.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ fmt.Println(err)
|
|
|
+ }
|
|
|
+
|
|
|
+ listVideoRoadshow, err := cygx.GetCygxMicroRoadshowVideoList(condition, pars, 0, 1000)
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ fmt.Println(err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ for _, v := range listVideoRoadshow {
|
|
|
+ shareImg, _ := MakeCygxMp4HtmlImg(v.VideoDuration) //生成分享图片
|
|
|
+ v.ShareImgUrl = shareImg
|
|
|
+ err = cygx.UpdateCygxMicroRoadshowVideo(v)
|
|
|
+ if err != nil {
|
|
|
+ err = errors.New("UpdateCygxMicroRoadshowVideo" + err.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ fmt.Println(err)
|
|
|
+ }
|
|
|
+
|
|
|
+ listAskserVoice, err := cygx.GetCygxAskserieVideoList(condition, pars, 0, 1000)
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ fmt.Println(err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ for _, v := range listAskserVoice {
|
|
|
+ shareImg, _ := MakeCygxMp3HtmlImg(v.VideoDuration) //生成分享图片
|
|
|
+ v.ShareImg = shareImg
|
|
|
+ err = cygx.EditCygxAskserieVideoShareImg(shareImg, v.AskserieVideoId)
|
|
|
+ if err != nil {
|
|
|
+ err = errors.New("EditCygxAskserieVideoShareImg" + err.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ fmt.Println(err)
|
|
|
+ }
|
|
|
+
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
+// 去掉后缀名脚本
|
|
|
+func initFileName() {
|
|
|
+ var condition string
|
|
|
+ var pars []interface{}
|
|
|
+ listVoice, err := cygx.GetActivityVoiceList(condition, pars)
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ fmt.Println(err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ for _, v := range listVoice {
|
|
|
+ v.VoiceName = utils.RemoveFileSuffixName(v.VoiceName) //去掉后缀名称
|
|
|
+ err = cygx.UpdateCygxActivityVoice(v)
|
|
|
+ if err != nil {
|
|
|
+ err = errors.New("UpdateCygxActivityVoice" + err.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ fmt.Println(err)
|
|
|
+ }
|
|
|
+
|
|
|
+ listVideo, err := cygx.GetCygxActivityVideoList(condition, pars)
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ fmt.Println(err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ for _, v := range listVideo {
|
|
|
+ v.VideoName = utils.RemoveFileSuffixName(v.VideoName) //去掉后缀名称
|
|
|
+ err = cygx.UpdateCygxActivityVideo(v)
|
|
|
+ if err != nil {
|
|
|
+ err = errors.New("UpdateCygxActivityVideo" + err.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ fmt.Println(err)
|
|
|
+ }
|
|
|
+
|
|
|
+ listVideoRoadshow, err := cygx.GetCygxMicroRoadshowVideoList(condition, pars, 0, 1000)
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ fmt.Println(err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ for _, v := range listVideoRoadshow {
|
|
|
+ v.VideoName = utils.RemoveFileSuffixName(v.VideoName) //去掉后缀名称
|
|
|
+ err = cygx.UpdateCygxMicroRoadshowVideo(v)
|
|
|
+ if err != nil {
|
|
|
+ err = errors.New("UpdateCygxMicroRoadshowVideo" + err.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ fmt.Println(err)
|
|
|
+ }
|
|
|
+
|
|
|
+ listAskserVoice, err := cygx.GetCygxAskserieVideoList(condition, pars, 0, 1000)
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ fmt.Println(err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ for _, v := range listAskserVoice {
|
|
|
+ v.VideoName = utils.RemoveFileSuffixName(v.VideoName) //去掉后缀名称
|
|
|
+ err = cygx.EditCygxAskserieVideoVideoName(v.VideoName, v.AskserieVideoId)
|
|
|
+ if err != nil {
|
|
|
+ err = errors.New("EditCygxAskserieVideoShareImg" + err.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ fmt.Println(err)
|
|
|
+ }
|
|
|
+
|
|
|
+ return
|
|
|
+}
|