|
@@ -633,6 +633,8 @@ func (this *ActivityCoAntroller) PreserveAndPublish() {
|
|
|
itemVoice.VoiceName = vo.Name
|
|
|
itemVoice.VoiceUrl = vo.Url
|
|
|
itemVoice.VoicePlaySeconds = vo.PlaySeconds
|
|
|
+ itemVoice.BackgroundImg = vo.BackgroundImg
|
|
|
+ itemVoice.ShareImg = vo.ShareImg
|
|
|
itemVoice.CreateTime = time.Now()
|
|
|
}
|
|
|
}
|
|
@@ -643,6 +645,8 @@ func (this *ActivityCoAntroller) PreserveAndPublish() {
|
|
|
itemVideo.ActivityId = activityId
|
|
|
itemVideo.VideoDuration = videoDetail.VideoDuration
|
|
|
itemVideo.VideoUrl = videoDetail.VideoUrl
|
|
|
+ itemVideo.BackgroundImg = videoDetail.BackgroundImg
|
|
|
+ itemVideo.ShareImg = videoDetail.ShareImg
|
|
|
itemVideo.ModifyDate = time.Now().Format(utils.FormatDateTime)
|
|
|
itemVideo.CreateTime = time.Now().Format(utils.FormatDateTime)
|
|
|
}
|
|
@@ -1099,6 +1103,11 @@ func (this *ActivityCoAntroller) Detail() {
|
|
|
}
|
|
|
if len(VoiceReqList) == 0 {
|
|
|
VoiceReqList = make([]*cygx.CygxActivityVoiceReq, 0)
|
|
|
+ } else {
|
|
|
+ for _, v := range VoiceReqList {
|
|
|
+ activityInfo.BackgroundImg = v.BackgroundImg
|
|
|
+ activityInfo.ShareImg = v.ShareImg
|
|
|
+ }
|
|
|
}
|
|
|
VideoDetail, err := cygx.GetCygxActivityVideoReqDetail(activityId)
|
|
|
if err != nil && err.Error() != utils.ErrNoRow() {
|
|
@@ -1106,6 +1115,10 @@ func (this *ActivityCoAntroller) Detail() {
|
|
|
br.ErrMsg = "GetCygxActivityVideoReqDetail,Err:" + err.Error() + "activityId:" + strconv.Itoa(activityId)
|
|
|
return
|
|
|
}
|
|
|
+ if VideoDetail != nil {
|
|
|
+ activityInfo.BackgroundImg = VideoDetail.BackgroundImg
|
|
|
+ activityInfo.ShareImg = VideoDetail.ShareImg
|
|
|
+ }
|
|
|
if activityInfo.CustomerTypeIds != "" {
|
|
|
customerTypeIdslist := strings.Split(activityInfo.CustomerTypeIds, ",")
|
|
|
var permissionValueStr string
|
|
@@ -1148,6 +1161,20 @@ func (this *ActivityCoAntroller) Detail() {
|
|
|
if activityInfo.VisibleRange == 0 {
|
|
|
activityInfo.VisibleRange = 2
|
|
|
}
|
|
|
+
|
|
|
+ ////如果是已结束的活动,而且封面图片为空,那么就给一个默认的图片
|
|
|
+ //if activityInfo.ActiveState == 3 && activityInfo.BackgroundImg == "" {
|
|
|
+ // // 获取默认图配置 目前音频视频用的是同一个封面图,暂时不做区分处理
|
|
|
+ // audioMap, _, audioShareMap, _, err := cygxService.GetMicroRoadShowDefaultImgConfig()
|
|
|
+ // if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ // br.Msg = "获取信息失败"
|
|
|
+ // br.ErrMsg = "GetMicroRoadShowDefaultImgConfig,Err:" + err.Error() + "activityId:" + strconv.Itoa(activityId)
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // activityInfo.BackgroundImg = audioMap[activityInfo.ChartPermissionId]
|
|
|
+ // activityInfo.ShareImg = audioShareMap[activityInfo.ChartPermissionId]
|
|
|
+ //}
|
|
|
+
|
|
|
//activityInfo.CancelDeadlineType = cygxService.ActivityCancelDeadlineType(activityInfo) //处理活动取消报名截止时间类型展示
|
|
|
activityInfo.VoiceList = VoiceReqList
|
|
|
activityInfo.VideoDetail = VideoDetail
|
|
@@ -1474,3 +1501,65 @@ func (this *ActivityCoAntroller) DeadlineSet() {
|
|
|
br.Success = true
|
|
|
br.Data = list
|
|
|
}
|
|
|
+
|
|
|
+// @Title 获取音视频上传之后的封面图
|
|
|
+// @Description 获取音视频上传之后的封面图
|
|
|
+// @Param ActivityId query int true "活动ID"
|
|
|
+// @Param FileType query int true "音视频文件类型 。1:音频。2:视频"
|
|
|
+// @Success 200 {object} cygx.ChartPermissionRepMoreList
|
|
|
+// @router /activity/video_and_voice/img [get]
|
|
|
+func (this *ActivityCoAntroller) VideoAndVoice() {
|
|
|
+ br := new(models.BaseResponse).Init()
|
|
|
+ defer func() {
|
|
|
+ this.Data["json"] = br
|
|
|
+ this.ServeJSON()
|
|
|
+ }()
|
|
|
+ AdminUser := this.SysUser
|
|
|
+ if AdminUser == nil {
|
|
|
+ br.Msg = "请登录"
|
|
|
+ br.ErrMsg = "请登录,用户信息为空"
|
|
|
+ br.Ret = 408
|
|
|
+ return
|
|
|
+ }
|
|
|
+ activityId, _ := this.GetInt("ActivityId")
|
|
|
+ fileType, _ := this.GetInt("FileType")
|
|
|
+ if activityId < 1 {
|
|
|
+ br.Msg = "请输入活动ID"
|
|
|
+ return
|
|
|
+ }
|
|
|
+ activityInfo, err := cygx.GetAddActivityInfoById(activityId)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "活动不存在"
|
|
|
+ br.ErrMsg = "活动ID错误,Err:" + err.Error() + "activityId:" + strconv.Itoa(activityId)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ //key := utils.MicroRoadshowDefaultImgKey
|
|
|
+ conf, err := cygx.GetCygxConfigDetailByCode("activity_video_default_img")
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取微路演默认图配置失败" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ list := new(cygx.ActivityVideoDefaultImgList)
|
|
|
+ if err = json.Unmarshal([]byte(conf.ConfigValue), &list); err != nil {
|
|
|
+ br.Msg = "微路演默认图配置配置值解析失败" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ resp := new(cygx.ActivityVideoDefaultImgListResp)
|
|
|
+ if fileType == 1 {
|
|
|
+ for _, v := range list.Audio {
|
|
|
+ if v.ChartPermissionId == activityInfo.ChartPermissionId {
|
|
|
+ resp.List = v.List
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ for _, v := range list.Audio {
|
|
|
+ if v.ChartPermissionId == activityInfo.ChartPermissionId {
|
|
|
+ resp.List = v.List
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ br.Ret = 200
|
|
|
+ br.Success = true
|
|
|
+ br.Msg = "获取成功"
|
|
|
+ br.Data = resp
|
|
|
+}
|