|
@@ -21,7 +21,7 @@ type MicroRoadShowController struct {
|
|
// @Param PageSize query int true "每页数据条数"
|
|
// @Param PageSize query int true "每页数据条数"
|
|
// @Param CurrentIndex query int true "当前页页码,从1开始"
|
|
// @Param CurrentIndex query int true "当前页页码,从1开始"
|
|
// @Param KeyWord query string false "搜索关键词"
|
|
// @Param KeyWord query string false "搜索关键词"
|
|
-// @Param Filter query string false "筛选条件 为空:全部 1:视频 2:音频 3:逻辑解析 4:路演回放 多个用 , 隔开"
|
|
|
|
|
|
+// @Param Filter query string false "筛选条件 为空:全部 1:视频 2:音频 多个用 , 隔开"
|
|
// @Param ChartPermissionIds query string false "行业id 多个用 , 隔开"
|
|
// @Param ChartPermissionIds query string false "行业id 多个用 , 隔开"
|
|
// @Param SourceId query int true "资源ID"
|
|
// @Param SourceId query int true "资源ID"
|
|
// @Param SourceType query int true " 1:活动音频 2:活动视频 3:产业视频 4:问答系列"
|
|
// @Param SourceType query int true " 1:活动音频 2:活动视频 3:产业视频 4:问答系列"
|
|
@@ -93,6 +93,7 @@ func (this *MicroRoadShowController) List() {
|
|
mapaudioIds := make(map[int]int) //活动音频
|
|
mapaudioIds := make(map[int]int) //活动音频
|
|
mapvideoIds := make(map[int]int) // 微路演视频
|
|
mapvideoIds := make(map[int]int) // 微路演视频
|
|
mapactivityVideoIds := make(map[int]int) // 活动视频
|
|
mapactivityVideoIds := make(map[int]int) // 活动视频
|
|
|
|
+ mapAskserieVideoIds := make(map[int]int) // 活动视频
|
|
for _, item := range listMycollect {
|
|
for _, item := range listMycollect {
|
|
if item.ActivityVoiceId > 0 {
|
|
if item.ActivityVoiceId > 0 {
|
|
mapaudioIds[item.ActivityVoiceId] = item.ActivityVoiceId
|
|
mapaudioIds[item.ActivityVoiceId] = item.ActivityVoiceId
|
|
@@ -102,6 +103,20 @@ func (this *MicroRoadShowController) List() {
|
|
mapactivityVideoIds[item.ActivityVoiceId] = item.ActivityVoiceId
|
|
mapactivityVideoIds[item.ActivityVoiceId] = item.ActivityVoiceId
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ listAskserieVideoCollect, err := models.GetUserCygxAskserieVideoCollectList(userId)
|
|
|
|
+ if err != nil {
|
|
|
|
+ br.Msg = "获取数据失败"
|
|
|
|
+ br.ErrMsg = "获取数据失败,Err:" + err.Error()
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ for _, v := range listAskserieVideoCollect {
|
|
|
|
+ if v.AskserieVideoId > 0 {
|
|
|
|
+ mapAskserieVideoIds[v.AskserieVideoId] = v.AskserieVideoId
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
for _, item := range list {
|
|
for _, item := range list {
|
|
if item.Type == 1 {
|
|
if item.Type == 1 {
|
|
//音频
|
|
//音频
|
|
@@ -118,6 +133,11 @@ func (this *MicroRoadShowController) List() {
|
|
if mapvideoIds[item.Id] > 0 {
|
|
if mapvideoIds[item.Id] > 0 {
|
|
item.IsCollect = true
|
|
item.IsCollect = true
|
|
}
|
|
}
|
|
|
|
+ } else if item.Type == 4 {
|
|
|
|
+ //系列问答视频
|
|
|
|
+ if mapAskserieVideoIds[item.SourceId] > 0 {
|
|
|
|
+ item.IsCollect = true
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// 用户权限
|
|
// 用户权限
|
|
@@ -222,7 +242,7 @@ func (this *MicroRoadShowController) VideoHistoryAdd() {
|
|
br.ErrMsg = "参数解析失败,Err:" + err.Error()
|
|
br.ErrMsg = "参数解析失败,Err:" + err.Error()
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- videoId := req.VideoId
|
|
|
|
|
|
+ sourceId := req.SourceId
|
|
playSeconds := req.PlaySeconds
|
|
playSeconds := req.PlaySeconds
|
|
sourceType := req.SourceType
|
|
sourceType := req.SourceType
|
|
if sourceType == 0 {
|
|
if sourceType == 0 {
|
|
@@ -237,10 +257,10 @@ func (this *MicroRoadShowController) VideoHistoryAdd() {
|
|
}
|
|
}
|
|
if sourceType == 1 {
|
|
if sourceType == 1 {
|
|
//添加活动音频的播放记录
|
|
//添加活动音频的播放记录
|
|
- go services.AddActivityVoiceHistory(user, videoId, playSeconds)
|
|
|
|
|
|
+ go services.AddActivityVoiceHistory(user, sourceId, playSeconds)
|
|
} else if sourceType == 2 {
|
|
} else if sourceType == 2 {
|
|
//添加活动视频的播放记录
|
|
//添加活动视频的播放记录
|
|
- go services.AddActivityVideoHistory(user, videoId, playSeconds)
|
|
|
|
|
|
+ go services.AddActivityVideoHistory(user, sourceId, playSeconds)
|
|
//if err != nil {
|
|
//if err != nil {
|
|
// br.Msg = "更新失败"
|
|
// br.Msg = "更新失败"
|
|
// br.ErrMsg = "更新失败,AddActivityVideoHistory Err:" + err.Error()
|
|
// br.ErrMsg = "更新失败,AddActivityVideoHistory Err:" + err.Error()
|
|
@@ -248,7 +268,7 @@ func (this *MicroRoadShowController) VideoHistoryAdd() {
|
|
//}
|
|
//}
|
|
} else if sourceType == 3 {
|
|
} else if sourceType == 3 {
|
|
item := models.CygxMicroRoadshowVideoHistory{
|
|
item := models.CygxMicroRoadshowVideoHistory{
|
|
- VideoId: videoId,
|
|
|
|
|
|
+ VideoId: sourceId,
|
|
UserId: uid,
|
|
UserId: uid,
|
|
Mobile: user.Mobile,
|
|
Mobile: user.Mobile,
|
|
Email: user.Email,
|
|
Email: user.Email,
|
|
@@ -261,7 +281,7 @@ func (this *MicroRoadShowController) VideoHistoryAdd() {
|
|
ModifyTime: time.Now(),
|
|
ModifyTime: time.Now(),
|
|
}
|
|
}
|
|
if playSeconds != 0 {
|
|
if playSeconds != 0 {
|
|
- lastItem, err := models.GetLastCygxMicroRoadshowVideoHistory(videoId, user.UserId)
|
|
|
|
|
|
+ lastItem, err := models.GetLastCygxMicroRoadshowVideoHistory(sourceId, user.UserId)
|
|
if err != nil {
|
|
if err != nil {
|
|
br.Msg = "操作失败"
|
|
br.Msg = "操作失败"
|
|
br.ErrMsg = "操作失败,GetLastCygxMicroRoadshowVideoHistory Err:" + err.Error()
|
|
br.ErrMsg = "操作失败,GetLastCygxMicroRoadshowVideoHistory Err:" + err.Error()
|
|
@@ -280,16 +300,16 @@ func (this *MicroRoadShowController) VideoHistoryAdd() {
|
|
br.ErrMsg = "操作失败,Err:" + err.Error()
|
|
br.ErrMsg = "操作失败,Err:" + err.Error()
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- err = models.UpdateCygxActivityVideoCounts(videoId)
|
|
|
|
|
|
+ err = models.UpdateCygxActivityVideoCounts(sourceId)
|
|
if err != nil {
|
|
if err != nil {
|
|
br.Msg = "更新失败"
|
|
br.Msg = "更新失败"
|
|
br.ErrMsg = "更新失败,Err:" + err.Error()
|
|
br.ErrMsg = "更新失败,Err:" + err.Error()
|
|
return
|
|
return
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- go services.MicroRoadshowVideoUserRmind(user, videoId)
|
|
|
|
|
|
+ go services.MicroRoadshowVideoUserRmind(user, sourceId)
|
|
} else if sourceType == 4 {
|
|
} else if sourceType == 4 {
|
|
- go services.AddAskserieVideoHistoryRecord(user, videoId, playSeconds)
|
|
|
|
|
|
+ go services.AddAskserieVideoHistoryRecord(user, sourceId, playSeconds)
|
|
}
|
|
}
|
|
br.Ret = 200
|
|
br.Ret = 200
|
|
br.Success = true
|
|
br.Success = true
|
|
@@ -340,49 +360,49 @@ func (this *MicroRoadShowController) CommentAdd() {
|
|
Content: req.Content,
|
|
Content: req.Content,
|
|
Title: req.Title,
|
|
Title: req.Title,
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ sourceId := req.SourceId
|
|
//var resourceId int
|
|
//var resourceId int
|
|
if sourceType == 1 {
|
|
if sourceType == 1 {
|
|
- activityVoiceInfo, _ := models.GetCygxActivityVoiceByActivityId(req.Id)
|
|
|
|
|
|
+ activityVoiceInfo, _ := models.GetCygxActivityVoiceByActivityId(sourceId)
|
|
if activityVoiceInfo == nil {
|
|
if activityVoiceInfo == nil {
|
|
br.Msg = "操作失败"
|
|
br.Msg = "操作失败"
|
|
- br.ErrMsg = "活动ID错误,不存在activityId:" + strconv.Itoa(req.Id)
|
|
|
|
|
|
+ br.ErrMsg = "活动ID错误,不存在activityId:" + strconv.Itoa(sourceId)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- item.ActivityId = req.Id
|
|
|
|
|
|
+ item.ActivityId = sourceId
|
|
item.ActivityVoiceId = activityVoiceInfo.ActivityVoiceId
|
|
item.ActivityVoiceId = activityVoiceInfo.ActivityVoiceId
|
|
//resourceId = activityVoiceInfo.ActivityId
|
|
//resourceId = activityVoiceInfo.ActivityId
|
|
} else if sourceType == 2 {
|
|
} else if sourceType == 2 {
|
|
- activityInfo, _ := models.GetCygxActivityVideoByActivityId(req.Id)
|
|
|
|
|
|
+ activityInfo, _ := models.GetCygxActivityVideoByActivityId(sourceId)
|
|
if activityInfo == nil {
|
|
if activityInfo == nil {
|
|
br.Msg = "操作失败"
|
|
br.Msg = "操作失败"
|
|
- br.ErrMsg = "活动ID错误,不存在activityId:" + strconv.Itoa(req.Id)
|
|
|
|
|
|
+ br.ErrMsg = "活动ID错误,不存在activityId:" + strconv.Itoa(sourceId)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
item.VideoId = activityInfo.VideoId
|
|
item.VideoId = activityInfo.VideoId
|
|
- item.ActivityId = req.Id
|
|
|
|
|
|
+ item.ActivityId = sourceId
|
|
//resourceId = activityInfo.ActivityId
|
|
//resourceId = activityInfo.ActivityId
|
|
} else if sourceType == 3 {
|
|
} else if sourceType == 3 {
|
|
- item.VideoId = req.Id
|
|
|
|
- microVideo, e := models.GetMicroRoadshowVideoById(req.Id)
|
|
|
|
|
|
+ item.VideoId = sourceId
|
|
|
|
+ microVideo, e := models.GetMicroRoadshowVideoById(sourceId)
|
|
if e != nil {
|
|
if e != nil {
|
|
br.Msg = "操作失败"
|
|
br.Msg = "操作失败"
|
|
- br.ErrMsg = "微路演视频信息有误, 不存在的VideoId: " + strconv.Itoa(req.Id)
|
|
|
|
|
|
+ br.ErrMsg = "微路演视频信息有误, 不存在的VideoId: " + strconv.Itoa(sourceId)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
item.IndustryId = microVideo.IndustryId
|
|
item.IndustryId = microVideo.IndustryId
|
|
//resourceId = microVideo.IndustryId
|
|
//resourceId = microVideo.IndustryId
|
|
} else if sourceType == 4 {
|
|
} else if sourceType == 4 {
|
|
- item.AskserieVideoId = req.Id
|
|
|
|
|
|
+ item.AskserieVideoId = sourceId
|
|
|
|
|
|
go services.AddCygxAskserieVideoCollection(user, item.AskserieVideoId, req.Content)
|
|
go services.AddCygxAskserieVideoCollection(user, item.AskserieVideoId, req.Content)
|
|
}
|
|
}
|
|
|
|
|
|
if sourceType == 2 || sourceType == 3 {
|
|
if sourceType == 2 || sourceType == 3 {
|
|
- detail, err := models.GetAddActivityInfoById(req.Id)
|
|
|
|
|
|
+ detail, err := models.GetAddActivityInfoById(sourceId)
|
|
if err != nil {
|
|
if err != nil {
|
|
br.Msg = "操作失败"
|
|
br.Msg = "操作失败"
|
|
- br.ErrMsg = "活动ID错误,不存在activityId:" + strconv.Itoa(req.Id)
|
|
|
|
|
|
+ br.ErrMsg = "活动ID错误,不存在activityId:" + strconv.Itoa(sourceId)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
if strings.Contains(detail.ChartPermissionName, utils.CHART_PERMISSION_NAME_YANXUAN) {
|
|
if strings.Contains(detail.ChartPermissionName, utils.CHART_PERMISSION_NAME_YANXUAN) {
|
|
@@ -428,15 +448,15 @@ func (this *MicroRoadShowController) Collect() {
|
|
br.ErrMsg = "参数解析失败,Err:" + err.Error()
|
|
br.ErrMsg = "参数解析失败,Err:" + err.Error()
|
|
return
|
|
return
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ sourceId := req.SourceId
|
|
if req.SourceType == 1 {
|
|
if req.SourceType == 1 {
|
|
- _, err := models.GetCygxActivityVoiceById(req.Id)
|
|
|
|
|
|
+ _, err := models.GetCygxActivityVoiceById(sourceId)
|
|
if err != nil {
|
|
if err != nil {
|
|
br.Msg = "获取信息失败"
|
|
br.Msg = "获取信息失败"
|
|
br.ErrMsg = "获取信息失败,Err:" + err.Error()
|
|
br.ErrMsg = "获取信息失败,Err:" + err.Error()
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- count, err := models.GetVoiceCollectCount(uid, req.Id)
|
|
|
|
|
|
+ count, err := models.GetVoiceCollectCount(uid, sourceId)
|
|
if err != nil {
|
|
if err != nil {
|
|
br.Msg = "获取数据失败!"
|
|
br.Msg = "获取数据失败!"
|
|
br.ErrMsg = "获取数据失败,Err:" + err.Error()
|
|
br.ErrMsg = "获取数据失败,Err:" + err.Error()
|
|
@@ -445,7 +465,7 @@ func (this *MicroRoadShowController) Collect() {
|
|
resp := new(models.ArticleCollectResp)
|
|
resp := new(models.ArticleCollectResp)
|
|
if count <= 0 {
|
|
if count <= 0 {
|
|
item := new(models.CygxArticleCollect)
|
|
item := new(models.CygxArticleCollect)
|
|
- item.ActivityVoiceId = req.Id
|
|
|
|
|
|
+ item.ActivityVoiceId = sourceId
|
|
item.UserId = uid
|
|
item.UserId = uid
|
|
item.CreateTime = time.Now()
|
|
item.CreateTime = time.Now()
|
|
item.Mobile = user.Mobile
|
|
item.Mobile = user.Mobile
|
|
@@ -464,7 +484,7 @@ func (this *MicroRoadShowController) Collect() {
|
|
// 文章收藏消息发送
|
|
// 文章收藏消息发送
|
|
//go services.ArticleUserRemind(user, detail, 2)
|
|
//go services.ArticleUserRemind(user, detail, 2)
|
|
} else {
|
|
} else {
|
|
- err = models.RemoveVoiceCollect(uid, req.Id)
|
|
|
|
|
|
+ err = models.RemoveVoiceCollect(uid, sourceId)
|
|
if err != nil {
|
|
if err != nil {
|
|
br.Msg = "取消收藏失败"
|
|
br.Msg = "取消收藏失败"
|
|
br.ErrMsg = "取消收藏失败,Err:" + err.Error()
|
|
br.ErrMsg = "取消收藏失败,Err:" + err.Error()
|
|
@@ -473,7 +493,7 @@ func (this *MicroRoadShowController) Collect() {
|
|
br.Msg = "已取消收藏"
|
|
br.Msg = "已取消收藏"
|
|
resp.Status = 2
|
|
resp.Status = 2
|
|
}
|
|
}
|
|
- collectTotal, err := models.GetVoiceCollectUsersCount(req.Id)
|
|
|
|
|
|
+ collectTotal, err := models.GetVoiceCollectUsersCount(sourceId)
|
|
if err != nil {
|
|
if err != nil {
|
|
br.Msg = "获取数据失败"
|
|
br.Msg = "获取数据失败"
|
|
br.ErrMsg = "获取数据失败,Err:" + err.Error()
|
|
br.ErrMsg = "获取数据失败,Err:" + err.Error()
|
|
@@ -484,13 +504,13 @@ func (this *MicroRoadShowController) Collect() {
|
|
br.Success = true
|
|
br.Success = true
|
|
br.Data = resp
|
|
br.Data = resp
|
|
} else if req.SourceType == 2 {
|
|
} else if req.SourceType == 2 {
|
|
- _, err := models.GetCygxActivityVideoById(req.Id)
|
|
|
|
|
|
+ _, err := models.GetCygxActivityVideoById(sourceId)
|
|
if err != nil {
|
|
if err != nil {
|
|
br.Msg = "获取信息失败"
|
|
br.Msg = "获取信息失败"
|
|
br.ErrMsg = "获取信息失败,Err:" + err.Error()
|
|
br.ErrMsg = "获取信息失败,Err:" + err.Error()
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- count, err := models.GetActivityVideoCollectCount(uid, req.Id)
|
|
|
|
|
|
+ count, err := models.GetActivityVideoCollectCount(uid, sourceId)
|
|
if err != nil {
|
|
if err != nil {
|
|
br.Msg = "获取数据失败!"
|
|
br.Msg = "获取数据失败!"
|
|
br.ErrMsg = "获取数据失败,Err:" + err.Error()
|
|
br.ErrMsg = "获取数据失败,Err:" + err.Error()
|
|
@@ -499,7 +519,7 @@ func (this *MicroRoadShowController) Collect() {
|
|
resp := new(models.ArticleCollectResp)
|
|
resp := new(models.ArticleCollectResp)
|
|
if count <= 0 {
|
|
if count <= 0 {
|
|
item := new(models.CygxArticleCollect)
|
|
item := new(models.CygxArticleCollect)
|
|
- item.ActivityVideoId = req.Id
|
|
|
|
|
|
+ item.ActivityVideoId = sourceId
|
|
item.UserId = uid
|
|
item.UserId = uid
|
|
item.CreateTime = time.Now()
|
|
item.CreateTime = time.Now()
|
|
item.ModifyTime = time.Now()
|
|
item.ModifyTime = time.Now()
|
|
@@ -519,7 +539,7 @@ func (this *MicroRoadShowController) Collect() {
|
|
// 文章收藏消息发送
|
|
// 文章收藏消息发送
|
|
//go services.ArticleUserRemind(user, detail, 2)
|
|
//go services.ArticleUserRemind(user, detail, 2)
|
|
} else {
|
|
} else {
|
|
- err = models.RemoveActivityVideoCollect(uid, req.Id)
|
|
|
|
|
|
+ err = models.RemoveActivityVideoCollect(uid, sourceId)
|
|
if err != nil {
|
|
if err != nil {
|
|
br.Msg = "取消收藏失败"
|
|
br.Msg = "取消收藏失败"
|
|
br.ErrMsg = "取消收藏失败,Err:" + err.Error()
|
|
br.ErrMsg = "取消收藏失败,Err:" + err.Error()
|
|
@@ -528,7 +548,7 @@ func (this *MicroRoadShowController) Collect() {
|
|
br.Msg = "已取消收藏"
|
|
br.Msg = "已取消收藏"
|
|
resp.Status = 2
|
|
resp.Status = 2
|
|
}
|
|
}
|
|
- collectTotal, err := models.GetActivityVideoCollectUsersCount(req.Id)
|
|
|
|
|
|
+ collectTotal, err := models.GetActivityVideoCollectUsersCount(sourceId)
|
|
if err != nil {
|
|
if err != nil {
|
|
br.Msg = "获取数据失败"
|
|
br.Msg = "获取数据失败"
|
|
br.ErrMsg = "获取数据失败,Err:" + err.Error()
|
|
br.ErrMsg = "获取数据失败,Err:" + err.Error()
|
|
@@ -539,13 +559,13 @@ func (this *MicroRoadShowController) Collect() {
|
|
br.Success = true
|
|
br.Success = true
|
|
br.Data = resp
|
|
br.Data = resp
|
|
} else if req.SourceType == 3 {
|
|
} else if req.SourceType == 3 {
|
|
- _, err := models.GetMicroRoadshowVideoById(req.Id)
|
|
|
|
|
|
+ _, err := models.GetMicroRoadshowVideoById(sourceId)
|
|
if err != nil {
|
|
if err != nil {
|
|
br.Msg = "获取信息失败"
|
|
br.Msg = "获取信息失败"
|
|
br.ErrMsg = "获取信息失败,Err:" + err.Error()
|
|
br.ErrMsg = "获取信息失败,Err:" + err.Error()
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- count, err := models.GetVideoCollectCount(uid, req.Id)
|
|
|
|
|
|
+ count, err := models.GetVideoCollectCount(uid, sourceId)
|
|
if err != nil {
|
|
if err != nil {
|
|
br.Msg = "获取数据失败!"
|
|
br.Msg = "获取数据失败!"
|
|
br.ErrMsg = "获取数据失败,Err:" + err.Error()
|
|
br.ErrMsg = "获取数据失败,Err:" + err.Error()
|
|
@@ -554,7 +574,7 @@ func (this *MicroRoadShowController) Collect() {
|
|
resp := new(models.ArticleCollectResp)
|
|
resp := new(models.ArticleCollectResp)
|
|
if count <= 0 {
|
|
if count <= 0 {
|
|
item := new(models.CygxArticleCollect)
|
|
item := new(models.CygxArticleCollect)
|
|
- item.VideoId = req.Id
|
|
|
|
|
|
+ item.VideoId = sourceId
|
|
item.UserId = uid
|
|
item.UserId = uid
|
|
item.CreateTime = time.Now()
|
|
item.CreateTime = time.Now()
|
|
item.Mobile = user.Mobile
|
|
item.Mobile = user.Mobile
|
|
@@ -573,7 +593,7 @@ func (this *MicroRoadShowController) Collect() {
|
|
// 文章收藏消息发送
|
|
// 文章收藏消息发送
|
|
//go services.ArticleUserRemind(user, detail, 2)
|
|
//go services.ArticleUserRemind(user, detail, 2)
|
|
} else {
|
|
} else {
|
|
- err = models.RemoveVideoCollect(uid, req.Id)
|
|
|
|
|
|
+ err = models.RemoveVideoCollect(uid, sourceId)
|
|
if err != nil {
|
|
if err != nil {
|
|
br.Msg = "取消收藏失败"
|
|
br.Msg = "取消收藏失败"
|
|
br.ErrMsg = "取消收藏失败,Err:" + err.Error()
|
|
br.ErrMsg = "取消收藏失败,Err:" + err.Error()
|
|
@@ -582,7 +602,7 @@ func (this *MicroRoadShowController) Collect() {
|
|
br.Msg = "已取消收藏"
|
|
br.Msg = "已取消收藏"
|
|
resp.Status = 2
|
|
resp.Status = 2
|
|
}
|
|
}
|
|
- collectTotal, err := models.GetVideoCollectUsersCount(req.Id)
|
|
|
|
|
|
+ collectTotal, err := models.GetVideoCollectUsersCount(sourceId)
|
|
if err != nil {
|
|
if err != nil {
|
|
br.Msg = "获取数据失败"
|
|
br.Msg = "获取数据失败"
|
|
br.ErrMsg = "获取数据失败,Err:" + err.Error()
|
|
br.ErrMsg = "获取数据失败,Err:" + err.Error()
|
|
@@ -594,7 +614,7 @@ func (this *MicroRoadShowController) Collect() {
|
|
br.Data = resp
|
|
br.Data = resp
|
|
} else if req.SourceType == 4 {
|
|
} else if req.SourceType == 4 {
|
|
// 系列问答视频收藏
|
|
// 系列问答视频收藏
|
|
- count, err := models.GetAskserieVideoCount(uid, req.Id)
|
|
|
|
|
|
+ count, err := models.GetAskserieVideoCount(uid, sourceId)
|
|
if err != nil {
|
|
if err != nil {
|
|
br.Msg = "获取数据失败!"
|
|
br.Msg = "获取数据失败!"
|
|
br.ErrMsg = "获取数据失败,Err:" + err.Error()
|
|
br.ErrMsg = "获取数据失败,Err:" + err.Error()
|
|
@@ -603,7 +623,7 @@ func (this *MicroRoadShowController) Collect() {
|
|
resp := new(models.ArticleCollectResp)
|
|
resp := new(models.ArticleCollectResp)
|
|
if count <= 0 {
|
|
if count <= 0 {
|
|
item := new(models.CygxAskserieVideoCollect)
|
|
item := new(models.CygxAskserieVideoCollect)
|
|
- item.AskserieVideoId = req.Id
|
|
|
|
|
|
+ item.AskserieVideoId = sourceId
|
|
item.UserId = uid
|
|
item.UserId = uid
|
|
item.CreateTime = time.Now()
|
|
item.CreateTime = time.Now()
|
|
item.Mobile = user.Mobile
|
|
item.Mobile = user.Mobile
|
|
@@ -623,7 +643,7 @@ func (this *MicroRoadShowController) Collect() {
|
|
// 文章收藏消息发送
|
|
// 文章收藏消息发送
|
|
//go services.ArticleUserRemind(user, detail, 2)
|
|
//go services.ArticleUserRemind(user, detail, 2)
|
|
} else {
|
|
} else {
|
|
- err = models.RemoveAskserieVideoCollect(uid, req.Id)
|
|
|
|
|
|
+ err = models.RemoveAskserieVideoCollect(uid, sourceId)
|
|
if err != nil {
|
|
if err != nil {
|
|
br.Msg = "取消收藏失败"
|
|
br.Msg = "取消收藏失败"
|
|
br.ErrMsg = "取消收藏失败,Err:" + err.Error()
|
|
br.ErrMsg = "取消收藏失败,Err:" + err.Error()
|