|
@@ -21,10 +21,7 @@ type MicroRoadShowController struct {
|
|
|
// @Param PageSize query int true "每页数据条数"
|
|
|
// @Param CurrentIndex query int true "当前页页码,从1开始"
|
|
|
// @Param KeyWord query string false "搜索关键词"
|
|
|
-// @Param AudioId query int false "音频ID"
|
|
|
-// @Param VideoId query int false "视频ID"
|
|
|
-// @Param ActivityVideoId query int false "活动视频ID"
|
|
|
-// @Param Filter query string false "筛选条件 为空:全部 1:视频 2:音频 3:逻辑解析 4:路演回放 多个用 , 隔开"
|
|
|
+// @Param Filter query string false "筛选条件 为空:全部 1:视频 2:音频 "
|
|
|
// @Param ChartPermissionIds query string false "行业id 多个用 , 隔开"
|
|
|
// @Param SourceId query int true "资源ID"
|
|
|
// @Param SourceType query int true " 1:活动音频 2:活动视频 3:产业视频 4:问答系列"
|
|
@@ -286,7 +283,7 @@ func (this *MicroRoadShowController) VideoHistoryAdd() {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- videoId := req.VideoId
|
|
|
+ sourceId := req.SourceId
|
|
|
playSeconds := req.PlaySeconds
|
|
|
sourceType := req.SourceType
|
|
|
|
|
@@ -302,10 +299,10 @@ func (this *MicroRoadShowController) VideoHistoryAdd() {
|
|
|
}
|
|
|
if sourceType == 1 {
|
|
|
//添加活动音频的播放记录
|
|
|
- go services.AddActivityVoiceHistory(user, videoId, playSeconds)
|
|
|
+ go services.AddActivityVoiceHistory(user, sourceId, playSeconds)
|
|
|
} else if sourceType == 2 {
|
|
|
//添加活动视频的播放记录
|
|
|
- go services.AddActivityVideoHistory(user, videoId, playSeconds)
|
|
|
+ go services.AddActivityVideoHistory(user, sourceId, playSeconds)
|
|
|
//if err != nil {
|
|
|
// br.Msg = "更新失败"
|
|
|
// br.ErrMsg = "更新失败,AddActivityVideoHistory Err:" + err.Error()
|
|
@@ -313,7 +310,7 @@ func (this *MicroRoadShowController) VideoHistoryAdd() {
|
|
|
//}
|
|
|
} else if sourceType == 3 {
|
|
|
item := models.CygxMicroRoadshowVideoHistory{
|
|
|
- VideoId: videoId,
|
|
|
+ VideoId: sourceId,
|
|
|
UserId: uid,
|
|
|
Mobile: user.Mobile,
|
|
|
Email: user.Email,
|
|
@@ -326,7 +323,7 @@ func (this *MicroRoadShowController) VideoHistoryAdd() {
|
|
|
ModifyTime: time.Now(),
|
|
|
}
|
|
|
if playSeconds != 0 {
|
|
|
- lastItem, err := models.GetLastCygxMicroRoadshowVideoHistory(videoId, user.UserId)
|
|
|
+ lastItem, err := models.GetLastCygxMicroRoadshowVideoHistory(sourceId, user.UserId)
|
|
|
if err != nil {
|
|
|
br.Msg = "操作失败"
|
|
|
br.ErrMsg = "操作失败,GetLastCygxMicroRoadshowVideoHistory Err:" + err.Error()
|
|
@@ -345,16 +342,16 @@ func (this *MicroRoadShowController) VideoHistoryAdd() {
|
|
|
br.ErrMsg = "操作失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
- err = models.UpdateCygxActivityVideoCounts(videoId)
|
|
|
+ err = models.UpdateCygxActivityVideoCounts(sourceId)
|
|
|
if err != nil {
|
|
|
br.Msg = "更新失败"
|
|
|
br.ErrMsg = "更新失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
- go services.MicroRoadshowVideoUserRmind(user, videoId)
|
|
|
+ go services.MicroRoadshowVideoUserRmind(user, sourceId)
|
|
|
} else if sourceType == 4 {
|
|
|
- go services.AddAskserieVideoHistoryRecord(user, videoId, playSeconds)
|
|
|
+ go services.AddAskserieVideoHistoryRecord(user, sourceId, playSeconds)
|
|
|
}
|
|
|
br.Ret = 200
|
|
|
br.Success = true
|
|
@@ -394,6 +391,7 @@ func (this *MicroRoadShowController) CommentAdd() {
|
|
|
return
|
|
|
}
|
|
|
sourceType := req.SourceType
|
|
|
+ sourceId := req.SourceId
|
|
|
title := req.Title
|
|
|
if sourceType == 0 {
|
|
|
sourceType = 1
|
|
@@ -411,10 +409,10 @@ func (this *MicroRoadShowController) CommentAdd() {
|
|
|
}
|
|
|
//var resourceId int
|
|
|
if sourceType == 1 {
|
|
|
- activityVoiceInfo, _ := models.GetCygxActivityVoiceById(req.Id)
|
|
|
+ activityVoiceInfo, _ := models.GetCygxActivityVoiceById(sourceId)
|
|
|
if activityVoiceInfo == nil {
|
|
|
br.Msg = "操作失败"
|
|
|
- br.ErrMsg = "活动ID错误,不存在activityId:" + strconv.Itoa(req.Id)
|
|
|
+ br.ErrMsg = "活动ID错误,不存在activityId:" + strconv.Itoa(sourceId)
|
|
|
return
|
|
|
}
|
|
|
item.ActivityId = activityVoiceInfo.ActivityId
|
|
@@ -423,10 +421,10 @@ func (this *MicroRoadShowController) CommentAdd() {
|
|
|
title = activityVoiceInfo.VoiceName
|
|
|
//resourceId = activityVoiceInfo.ActivityId
|
|
|
} else if sourceType == 2 {
|
|
|
- activityInfo, _ := models.GetCygxActivityVideoById(req.Id)
|
|
|
+ activityInfo, _ := models.GetCygxActivityVideoById(sourceId)
|
|
|
if activityInfo == nil {
|
|
|
br.Msg = "操作失败"
|
|
|
- br.ErrMsg = "活动ID错误,不存在activityId:" + strconv.Itoa(req.Id)
|
|
|
+ br.ErrMsg = "活动ID错误,不存在activityId:" + strconv.Itoa(sourceId)
|
|
|
return
|
|
|
}
|
|
|
item.Title = activityInfo.Title
|
|
@@ -435,11 +433,11 @@ func (this *MicroRoadShowController) CommentAdd() {
|
|
|
title = activityInfo.Title
|
|
|
//resourceId = activityInfo.ActivityId
|
|
|
} 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 {
|
|
|
br.Msg = "操作失败"
|
|
|
- br.ErrMsg = "微路演视频信息有误, 不存在的VideoId: " + strconv.Itoa(req.Id)
|
|
|
+ br.ErrMsg = "微路演视频信息有误, 不存在的VideoId: " + strconv.Itoa(sourceId)
|
|
|
return
|
|
|
}
|
|
|
item.Title = microVideo.VideoName
|
|
@@ -447,16 +445,16 @@ func (this *MicroRoadShowController) CommentAdd() {
|
|
|
title = microVideo.VideoName
|
|
|
//resourceId = microVideo.IndustryId
|
|
|
} else if sourceType == 4 {
|
|
|
- item.AskserieVideoId = req.Id
|
|
|
+ item.AskserieVideoId = sourceId
|
|
|
|
|
|
go services.AddCygxAskserieVideoCollection(user, item.AskserieVideoId, req.Content)
|
|
|
}
|
|
|
var isResearch bool // 是否属于研选
|
|
|
if sourceType == 2 || sourceType == 3 {
|
|
|
- detail, err := models.GetAddActivityInfoById(req.Id)
|
|
|
+ detail, err := models.GetAddActivityInfoById(sourceId)
|
|
|
if err != nil {
|
|
|
br.Msg = "操作失败"
|
|
|
- br.ErrMsg = "活动ID错误,不存在activityId:" + strconv.Itoa(req.Id)
|
|
|
+ br.ErrMsg = "活动ID错误,不存在activityId:" + strconv.Itoa(sourceId)
|
|
|
return
|
|
|
}
|
|
|
if strings.Contains(detail.ChartPermissionName, utils.CHART_PERMISSION_NAME_YANXUAN) {
|
|
@@ -501,15 +499,15 @@ func (this *MicroRoadShowController) Collect() {
|
|
|
br.ErrMsg = "参数解析失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
+ sourceId := req.SourceId
|
|
|
if req.SourceType == 1 {
|
|
|
- _, err := models.GetCygxActivityVoiceById(req.Id)
|
|
|
+ _, err := models.GetCygxActivityVoiceById(sourceId)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取信息失败"
|
|
|
br.ErrMsg = "获取信息失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
- count, err := models.GetVoiceCollectCount(uid, req.Id)
|
|
|
+ count, err := models.GetVoiceCollectCount(uid, sourceId)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取数据失败!"
|
|
|
br.ErrMsg = "获取数据失败,Err:" + err.Error()
|
|
@@ -518,7 +516,7 @@ func (this *MicroRoadShowController) Collect() {
|
|
|
resp := new(models.ArticleCollectResp)
|
|
|
if count <= 0 {
|
|
|
item := new(models.CygxArticleCollect)
|
|
|
- item.ActivityVoiceId = req.Id
|
|
|
+ item.ActivityVoiceId = sourceId
|
|
|
item.UserId = uid
|
|
|
item.CreateTime = time.Now()
|
|
|
item.Mobile = user.Mobile
|
|
@@ -537,7 +535,7 @@ func (this *MicroRoadShowController) Collect() {
|
|
|
// 文章收藏消息发送
|
|
|
//go services.ArticleUserRemind(user, detail, 2)
|
|
|
} else {
|
|
|
- err = models.RemoveVoiceCollect(uid, req.Id)
|
|
|
+ err = models.RemoveVoiceCollect(uid, sourceId)
|
|
|
if err != nil {
|
|
|
br.Msg = "取消收藏失败"
|
|
|
br.ErrMsg = "取消收藏失败,Err:" + err.Error()
|
|
@@ -546,7 +544,7 @@ func (this *MicroRoadShowController) Collect() {
|
|
|
br.Msg = "已取消收藏"
|
|
|
resp.Status = 2
|
|
|
}
|
|
|
- collectTotal, err := models.GetVoiceCollectUsersCount(req.Id)
|
|
|
+ collectTotal, err := models.GetVoiceCollectUsersCount(sourceId)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取数据失败"
|
|
|
br.ErrMsg = "获取数据失败,Err:" + err.Error()
|
|
@@ -557,13 +555,13 @@ func (this *MicroRoadShowController) Collect() {
|
|
|
br.Success = true
|
|
|
br.Data = resp
|
|
|
} else if req.SourceType == 2 {
|
|
|
- _, err := models.GetCygxActivityVideoById(req.Id)
|
|
|
+ _, err := models.GetCygxActivityVideoById(sourceId)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取信息失败"
|
|
|
br.ErrMsg = "获取信息失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
- count, err := models.GetActivityVideoCollectCount(uid, req.Id)
|
|
|
+ count, err := models.GetActivityVideoCollectCount(uid, sourceId)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取数据失败!"
|
|
|
br.ErrMsg = "获取数据失败,Err:" + err.Error()
|
|
@@ -572,7 +570,7 @@ func (this *MicroRoadShowController) Collect() {
|
|
|
resp := new(models.ArticleCollectResp)
|
|
|
if count <= 0 {
|
|
|
item := new(models.CygxArticleCollect)
|
|
|
- item.ActivityVideoId = req.Id
|
|
|
+ item.ActivityVideoId = sourceId
|
|
|
item.UserId = uid
|
|
|
item.CreateTime = time.Now()
|
|
|
item.Mobile = user.Mobile
|
|
@@ -591,7 +589,7 @@ func (this *MicroRoadShowController) Collect() {
|
|
|
// 文章收藏消息发送
|
|
|
//go services.ArticleUserRemind(user, detail, 2)
|
|
|
} else {
|
|
|
- err = models.RemoveActivityVideoCollect(uid, req.Id)
|
|
|
+ err = models.RemoveActivityVideoCollect(uid, sourceId)
|
|
|
if err != nil {
|
|
|
br.Msg = "取消收藏失败"
|
|
|
br.ErrMsg = "取消收藏失败,Err:" + err.Error()
|
|
@@ -600,7 +598,7 @@ func (this *MicroRoadShowController) Collect() {
|
|
|
br.Msg = "已取消收藏"
|
|
|
resp.Status = 2
|
|
|
}
|
|
|
- collectTotal, err := models.GetActivityVideoCollectUsersCount(req.Id)
|
|
|
+ collectTotal, err := models.GetActivityVideoCollectUsersCount(sourceId)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取数据失败"
|
|
|
br.ErrMsg = "获取数据失败,Err:" + err.Error()
|
|
@@ -611,13 +609,13 @@ func (this *MicroRoadShowController) Collect() {
|
|
|
br.Success = true
|
|
|
br.Data = resp
|
|
|
} else if req.SourceType == 3 {
|
|
|
- _, err := models.GetMicroRoadshowVideoById(req.Id)
|
|
|
+ _, err := models.GetMicroRoadshowVideoById(sourceId)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取信息失败"
|
|
|
br.ErrMsg = "获取信息失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
- count, err := models.GetVideoCollectCount(uid, req.Id)
|
|
|
+ count, err := models.GetVideoCollectCount(uid, sourceId)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取数据失败!"
|
|
|
br.ErrMsg = "获取数据失败,Err:" + err.Error()
|
|
@@ -626,7 +624,7 @@ func (this *MicroRoadShowController) Collect() {
|
|
|
resp := new(models.ArticleCollectResp)
|
|
|
if count <= 0 {
|
|
|
item := new(models.CygxArticleCollect)
|
|
|
- item.VideoId = req.Id
|
|
|
+ item.VideoId = sourceId
|
|
|
item.UserId = uid
|
|
|
item.CreateTime = time.Now()
|
|
|
item.Mobile = user.Mobile
|
|
@@ -645,7 +643,7 @@ func (this *MicroRoadShowController) Collect() {
|
|
|
// 文章收藏消息发送
|
|
|
//go services.ArticleUserRemind(user, detail, 2)
|
|
|
} else {
|
|
|
- err = models.RemoveVideoCollect(uid, req.Id)
|
|
|
+ err = models.RemoveVideoCollect(uid, sourceId)
|
|
|
if err != nil {
|
|
|
br.Msg = "取消收藏失败"
|
|
|
br.ErrMsg = "取消收藏失败,Err:" + err.Error()
|
|
@@ -654,7 +652,7 @@ func (this *MicroRoadShowController) Collect() {
|
|
|
br.Msg = "已取消收藏"
|
|
|
resp.Status = 2
|
|
|
}
|
|
|
- collectTotal, err := models.GetVideoCollectUsersCount(req.Id)
|
|
|
+ collectTotal, err := models.GetVideoCollectUsersCount(sourceId)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取数据失败"
|
|
|
br.ErrMsg = "获取数据失败,Err:" + err.Error()
|
|
@@ -666,7 +664,7 @@ func (this *MicroRoadShowController) Collect() {
|
|
|
br.Data = resp
|
|
|
} else if req.SourceType == 4 {
|
|
|
// 系列问答视频收藏
|
|
|
- count, err := models.GetAskserieVideoCount(uid, req.Id)
|
|
|
+ count, err := models.GetAskserieVideoCount(uid, sourceId)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取数据失败!"
|
|
|
br.ErrMsg = "获取数据失败,Err:" + err.Error()
|
|
@@ -675,7 +673,7 @@ func (this *MicroRoadShowController) Collect() {
|
|
|
resp := new(models.ArticleCollectResp)
|
|
|
if count <= 0 {
|
|
|
item := new(models.CygxAskserieVideoCollect)
|
|
|
- item.AskserieVideoId = req.Id
|
|
|
+ item.AskserieVideoId = sourceId
|
|
|
item.UserId = uid
|
|
|
item.CreateTime = time.Now()
|
|
|
item.Mobile = user.Mobile
|
|
@@ -695,7 +693,7 @@ func (this *MicroRoadShowController) Collect() {
|
|
|
// 文章收藏消息发送
|
|
|
//go services.ArticleUserRemind(user, detail, 2)
|
|
|
} else {
|
|
|
- err = models.RemoveAskserieVideoCollect(uid, req.Id)
|
|
|
+ err = models.RemoveAskserieVideoCollect(uid, sourceId)
|
|
|
if err != nil {
|
|
|
br.Msg = "取消收藏失败"
|
|
|
br.ErrMsg = "取消收藏失败,Err:" + err.Error()
|