|
@@ -372,6 +372,10 @@ func (this *MicroRoadShowController) CommentAdd() {
|
|
|
}
|
|
|
item.IndustryId = microVideo.IndustryId
|
|
|
//resourceId = microVideo.IndustryId
|
|
|
+ } else if sourceType == 4 {
|
|
|
+ item.AskserieVideoId = req.Id
|
|
|
+
|
|
|
+ go services.AddCygxAskserieVideoCollection(user, item.AskserieVideoId, req.Content)
|
|
|
}
|
|
|
|
|
|
if sourceType == 2 || sourceType == 3 {
|
|
@@ -498,6 +502,7 @@ func (this *MicroRoadShowController) Collect() {
|
|
|
item.ActivityVideoId = req.Id
|
|
|
item.UserId = uid
|
|
|
item.CreateTime = time.Now()
|
|
|
+ item.ModifyTime = time.Now()
|
|
|
item.Mobile = user.Mobile
|
|
|
item.Email = user.Email
|
|
|
item.CompanyId = user.CompanyId
|
|
@@ -587,6 +592,49 @@ func (this *MicroRoadShowController) Collect() {
|
|
|
br.Ret = 200
|
|
|
br.Success = true
|
|
|
br.Data = resp
|
|
|
+ } else if req.SourceType == 4 {
|
|
|
+ // 系列问答视频收藏
|
|
|
+ count, err := models.GetAskserieVideoCount(uid, req.Id)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取数据失败!"
|
|
|
+ br.ErrMsg = "获取数据失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ resp := new(models.ArticleCollectResp)
|
|
|
+ if count <= 0 {
|
|
|
+ item := new(models.CygxAskserieVideoCollect)
|
|
|
+ item.AskserieVideoId = req.Id
|
|
|
+ item.UserId = uid
|
|
|
+ item.CreateTime = time.Now()
|
|
|
+ item.Mobile = user.Mobile
|
|
|
+ item.Email = user.Email
|
|
|
+ item.CompanyId = user.CompanyId
|
|
|
+ item.CompanyName = user.CompanyName
|
|
|
+ item.RealName = user.RealName
|
|
|
+ item.RegisterPlatform = utils.REGISTER_PLATFORM
|
|
|
+ err = models.AddCygxAskserieVideoCollect(item)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "收藏失败"
|
|
|
+ br.ErrMsg = "收藏失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ br.Msg = "收藏成功"
|
|
|
+ resp.Status = 1
|
|
|
+ // 文章收藏消息发送
|
|
|
+ //go services.ArticleUserRemind(user, detail, 2)
|
|
|
+ } else {
|
|
|
+ err = models.RemoveAskserieVideoCollect(uid, req.Id)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "取消收藏失败"
|
|
|
+ br.ErrMsg = "取消收藏失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ br.Msg = "已取消收藏"
|
|
|
+ resp.Status = 2
|
|
|
+ }
|
|
|
+ br.Ret = 200
|
|
|
+ br.Success = true
|
|
|
+ br.Data = resp
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -626,9 +674,17 @@ func (this *MicroRoadShowController) Mycollect() {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+ listAskserieVideoCollect, err := models.GetUserCygxAskserieVideoCollectList(userId)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取数据失败"
|
|
|
+ br.ErrMsg = "获取数据失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
var audioIds []string
|
|
|
var videoIds []string
|
|
|
var activityVideoIds []string
|
|
|
+ var askserieVideoIds []string //问答系列视频
|
|
|
for _, item := range listMycollect {
|
|
|
if item.ActivityVoiceId > 0 {
|
|
|
audioIds = append(audioIds, strconv.Itoa(item.ActivityVoiceId))
|
|
@@ -638,7 +694,10 @@ func (this *MicroRoadShowController) Mycollect() {
|
|
|
activityVideoIds = append(activityVideoIds, strconv.Itoa(item.ActivityVideoId))
|
|
|
}
|
|
|
}
|
|
|
- if len(audioIds) == 0 && len(videoIds) == 0 && len(activityVideoIds) == 0 {
|
|
|
+ for _, item := range listAskserieVideoCollect {
|
|
|
+ askserieVideoIds = append(askserieVideoIds, strconv.Itoa(item.AskserieVideoId))
|
|
|
+ }
|
|
|
+ if len(audioIds) == 0 && len(videoIds) == 0 && len(activityVideoIds) == 0 && len(askserieVideoIds) == 0 {
|
|
|
resp := new(models.MicroRoadShowListResp)
|
|
|
page := paging.GetPaging(currentIndex, pageSize, 0)
|
|
|
resp.List = make([]*models.MicroRoadShowPageList, 0)
|
|
@@ -653,48 +712,51 @@ func (this *MicroRoadShowController) Mycollect() {
|
|
|
audioIdstr := strings.Join(audioIds, ",")
|
|
|
ideoIdsStr := strings.Join(videoIds, ",")
|
|
|
activityVideoIdsStr := strings.Join(activityVideoIds, ",")
|
|
|
+ askserieVideoIdsStr := strings.Join(askserieVideoIds, ",")
|
|
|
// 微路演列表
|
|
|
- list, total, e := services.GetMicroRoadShowMycollect(pageSize, currentIndex, audioIdstr, ideoIdsStr, activityVideoIdsStr)
|
|
|
+ list, total, e := services.GetMicroRoadShowMycollectV12(pageSize, currentIndex, audioIdstr, activityVideoIdsStr, ideoIdsStr, askserieVideoIdsStr)
|
|
|
if e != nil {
|
|
|
br.Msg = "获取失败"
|
|
|
br.ErrMsg = "获取微路演列表失败, Err: " + e.Error()
|
|
|
return
|
|
|
}
|
|
|
for _, item := range list {
|
|
|
- if item.Type == 1 {
|
|
|
- //音频
|
|
|
- count, err := models.GetVoiceCollectCount(user.UserId, item.Id)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "获取数据失败!"
|
|
|
- br.ErrMsg = "获取数据失败,Err:" + err.Error()
|
|
|
- return
|
|
|
- }
|
|
|
- if count > 0 {
|
|
|
- item.IsCollect = true
|
|
|
- }
|
|
|
- } else if item.Type == 2 {
|
|
|
- //活动视频
|
|
|
- count, err := models.GetActivityVideoCollectCount(user.UserId, item.Id)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "获取数据失败!"
|
|
|
- br.ErrMsg = "获取数据失败,Err:" + err.Error()
|
|
|
- return
|
|
|
- }
|
|
|
- if count > 0 {
|
|
|
- item.IsCollect = true
|
|
|
- }
|
|
|
- } else if item.Type == 3 {
|
|
|
- //微路演视频
|
|
|
- count, err := models.GetVideoCollectCount(user.UserId, item.Id)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "获取数据失败!"
|
|
|
- br.ErrMsg = "获取数据失败,Err:" + err.Error()
|
|
|
- return
|
|
|
- }
|
|
|
- if count > 0 {
|
|
|
- item.IsCollect = true
|
|
|
- }
|
|
|
- }
|
|
|
+ //if item.Type == 1 {
|
|
|
+ // //音频
|
|
|
+ // count, err := models.GetVoiceCollectCount(user.UserId, item.Id)
|
|
|
+ // if err != nil {
|
|
|
+ // br.Msg = "获取数据失败!"
|
|
|
+ // br.ErrMsg = "获取数据失败,Err:" + err.Error()
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // if count > 0 {
|
|
|
+ // item.IsCollect = true
|
|
|
+ // }
|
|
|
+ //} else if item.Type == 2 {
|
|
|
+ // //活动视频
|
|
|
+ // count, err := models.GetActivityVideoCollectCount(user.UserId, item.Id)
|
|
|
+ // if err != nil {
|
|
|
+ // br.Msg = "获取数据失败!"
|
|
|
+ // br.ErrMsg = "获取数据失败,Err:" + err.Error()
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // if count > 0 {
|
|
|
+ // item.IsCollect = true
|
|
|
+ // }
|
|
|
+ //} else if item.Type == 3 {
|
|
|
+ // //微路演视频
|
|
|
+ // count, err := models.GetVideoCollectCount(user.UserId, item.Id)
|
|
|
+ // if err != nil {
|
|
|
+ // br.Msg = "获取数据失败!"
|
|
|
+ // br.ErrMsg = "获取数据失败,Err:" + err.Error()
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // if count > 0 {
|
|
|
+ // item.IsCollect = true
|
|
|
+ // }
|
|
|
+ //}
|
|
|
+
|
|
|
+ item.IsCollect = true
|
|
|
}
|
|
|
// 用户权限
|
|
|
authInfo, permissionArr, e := services.GetUserRaiPermissionInfo(user.UserId, user.CompanyId)
|