|
@@ -22,7 +22,8 @@ type MicroRoadShowController struct {
|
|
|
// @Param KeyWord query string false "搜索关键词"
|
|
|
// @Param AudioId query int false "音频ID"
|
|
|
// @Param VideoId query int false "视频ID"
|
|
|
-// @Param AudioIds query string false "音频IDs"
|
|
|
+// @Param AudioIds query string false "活动音频IDs"
|
|
|
+// @Param ActivityVideoIds query string false "活动视频IDs"
|
|
|
// @Param VideoIds query string false "视频IDs"
|
|
|
// @Param ActivityVideoId query int false "活动视频ID"
|
|
|
// @Param Filter query int false "筛选条件 0:全部 1:视频 2:音频"
|
|
@@ -48,6 +49,7 @@ func (this *MicroRoadShowController) List() {
|
|
|
videoId, _ := this.GetInt("VideoId")
|
|
|
audioIds := this.GetString("AudioIds")
|
|
|
videoIds := this.GetString("VideoIds")
|
|
|
+ activityVideoIds := this.GetString("ActivityVideoIds")
|
|
|
activityVideoId, _ := this.GetInt("ActivityVideoId")
|
|
|
filter, _ := this.GetInt("Filter", 0)
|
|
|
|
|
@@ -59,7 +61,7 @@ func (this *MicroRoadShowController) List() {
|
|
|
}
|
|
|
|
|
|
// 微路演列表
|
|
|
- list, total, e := services.GetMicroRoadShowPageListV8(pageSize, currentIndex, audioId, videoId, activityVideoId, filter, keywords, audioIds, videoIds)
|
|
|
+ list, total, e := services.GetMicroRoadShowPageListV8(pageSize, currentIndex, audioId, videoId, activityVideoId, filter, keywords, audioIds, videoIds, activityVideoIds)
|
|
|
if e != nil {
|
|
|
br.Msg = "获取失败"
|
|
|
br.ErrMsg = "获取微路演列表失败, Err: " + e.Error()
|
|
@@ -295,7 +297,7 @@ func (this *MicroRoadShowController) CommentAdd() {
|
|
|
if sourceType == 1 {
|
|
|
item.IndustryId = req.Id
|
|
|
} else if sourceType == 2 {
|
|
|
- item.ActivityId = req.Id
|
|
|
+ item.ActivityId = req.Id
|
|
|
}
|
|
|
_, err = models.AddArticleComment(&item)
|
|
|
if err != nil {
|
|
@@ -309,8 +311,8 @@ func (this *MicroRoadShowController) CommentAdd() {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-// @Title 收藏
|
|
|
-// @Description 收藏
|
|
|
+// @Title 微路演收藏
|
|
|
+// @Description 微路演收藏
|
|
|
// @Param request body models.MicroRoadshowCollectReq true "type json string"
|
|
|
// @Success 200 {object} models.FontsCollectResp
|
|
|
// @router /collect [post]
|
|
@@ -351,7 +353,7 @@ func (this *MicroRoadShowController) Collect() {
|
|
|
resp := new(models.ArticleCollectResp)
|
|
|
if count <= 0 {
|
|
|
item := new(models.CygxArticleCollect)
|
|
|
- item.ArticleId = req.Id
|
|
|
+ item.ActivityVoiceId = req.Id
|
|
|
item.UserId = uid
|
|
|
item.CreateTime = time.Now()
|
|
|
item.Mobile = user.Mobile
|
|
@@ -390,6 +392,60 @@ func (this *MicroRoadShowController) Collect() {
|
|
|
br.Success = true
|
|
|
br.Data = resp
|
|
|
} else if req.SourceType == 2 {
|
|
|
+ _, err := models.GetCygxActivityVideoById(req.Id)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "获取信息失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ count, err := models.GetActivityVideoCollectCount(uid, req.Id)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取数据失败!"
|
|
|
+ br.ErrMsg = "获取数据失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ resp := new(models.ArticleCollectResp)
|
|
|
+ if count <= 0 {
|
|
|
+ item := new(models.CygxArticleCollect)
|
|
|
+ item.ActivityVideoId = 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
|
|
|
+ _, err = models.AddCygxArticleCollect(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.RemoveActivityVideoCollect(uid, req.Id)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "取消收藏失败"
|
|
|
+ br.ErrMsg = "取消收藏失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ br.Msg = "已取消收藏"
|
|
|
+ resp.Status = 2
|
|
|
+ }
|
|
|
+ collectTotal, err := models.GetActivityVideoCollectUsersCount(req.Id)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取数据失败"
|
|
|
+ br.ErrMsg = "获取数据失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ resp.CollectCount = collectTotal
|
|
|
+ br.Ret = 200
|
|
|
+ br.Success = true
|
|
|
+ br.Data = resp
|
|
|
+ } else if req.SourceType == 3 {
|
|
|
_, err := models.GetMicroRoadshowVideoById(req.Id)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取信息失败"
|