|
@@ -21,14 +21,11 @@ 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 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 string false "筛选条件 为空:全部 1:视频 2:音频 3:逻辑解析 4:路演回放 多个用 , 隔开"
|
|
|
// @Param ChartPermissionIds query string false "行业id 多个用 , 隔开"
|
|
|
+// @Param SourceId query int true "资源ID"
|
|
|
+// @Param SourceType query int true " 1:活动音频 2:活动视频 3:产业视频 4:问答系列"
|
|
|
+// @Param SearchType string int true "搜索类型: 1-路演回放; 2-问答系列; 3-调研反馈 多个用 , 隔开"
|
|
|
// @Success 200 {object} models.HomeListResp
|
|
|
// @router /list [get]
|
|
|
func (this *MicroRoadShowController) List() {
|
|
@@ -47,14 +44,17 @@ func (this *MicroRoadShowController) List() {
|
|
|
pageSize, _ := this.GetInt("PageSize")
|
|
|
currentIndex, _ := this.GetInt("CurrentIndex")
|
|
|
keywords := this.GetString("KeyWord")
|
|
|
- audioId, _ := this.GetInt("AudioId")
|
|
|
- videoId, _ := this.GetInt("VideoId")
|
|
|
- audioIds := this.GetString("AudioIds")
|
|
|
- videoIds := this.GetString("VideoIds")
|
|
|
- activityVideoIds := this.GetString("ActivityVideoIds")
|
|
|
- activityVideoId, _ := this.GetInt("ActivityVideoId")
|
|
|
+ //audioId, _ := this.GetInt("AudioId")
|
|
|
+ //videoId, _ := this.GetInt("VideoId")
|
|
|
+ //audioIds := this.GetString("AudioIds")
|
|
|
+ //videoIds := this.GetString("VideoIds")
|
|
|
+ //activityVideoIds := this.GetString("ActivityVideoIds")
|
|
|
+ //activityVideoId, _ := this.GetInt("ActivityVideoId")
|
|
|
filter := this.GetString("Filter")
|
|
|
chartPermissionIds := this.GetString("ChartPermissionIds")
|
|
|
+ sourceId, _ := this.GetInt("SourceId")
|
|
|
+ sourceType, _ := this.GetInt("SourceType")
|
|
|
+ searchType := this.GetString("SearchType")
|
|
|
if pageSize <= 0 {
|
|
|
pageSize = utils.PageSize20
|
|
|
}
|
|
@@ -76,41 +76,13 @@ func (this *MicroRoadShowController) List() {
|
|
|
var total int
|
|
|
var e error
|
|
|
// 微路演列表
|
|
|
- list, total, e = services.GetMicroRoadShowPageListV8(pageSize, currentIndex, audioId, videoId, activityVideoId, filter, keywords, audioIds, videoIds, activityVideoIds, chartPermissionIds)
|
|
|
+ list, total, e = services.GetMicroRoadShowPageListV12(pageSize, currentIndex, sourceId, sourceType, filter, keywords, searchType, chartPermissionIds)
|
|
|
if e != nil {
|
|
|
br.Msg = "获取失败"
|
|
|
br.ErrMsg = "获取微路演列表失败, Err: " + e.Error()
|
|
|
return
|
|
|
}
|
|
|
- if keywords != "" {
|
|
|
- var pageSizeIk int
|
|
|
- //获取总的数量
|
|
|
- totalIk, e := services.CountMicroRoadShowPageListIkWord(audioId, videoId, activityVideoId, keyWordArr, filter, audioIds, videoIds, activityVideoIds)
|
|
|
- if e != nil {
|
|
|
- br.Msg = "获取失败"
|
|
|
- br.ErrMsg = "获取微路演联想词列表失败, Err: " + e.Error()
|
|
|
- return
|
|
|
- }
|
|
|
- pageSizeIk = totalIk - len(list)
|
|
|
- //处理IK分词部分的分页获取条数
|
|
|
- startSizeIk := utils.StartIndex(currentIndex, pageSize)
|
|
|
- startSizeIk = startSizeIk - total
|
|
|
- if startSizeIk < 0 {
|
|
|
- startSizeIk = 0
|
|
|
- }
|
|
|
- if pageSizeIk > 0 {
|
|
|
- lisIk, e := services.GetMicroRoadShowPageListIkWord(startSizeIk, pageSizeIk, audioId, videoId, activityVideoId, keyWordArr, filter, audioIds, videoIds, activityVideoIds, keywords)
|
|
|
- if e != nil {
|
|
|
- br.Msg = "获取失败"
|
|
|
- br.ErrMsg = "获取微路演列表失败, Err: " + e.Error()
|
|
|
- return
|
|
|
- }
|
|
|
- for _, item := range lisIk {
|
|
|
- list = append(list, item)
|
|
|
- }
|
|
|
- }
|
|
|
- total = totalIk
|
|
|
- }
|
|
|
+
|
|
|
userId := user.UserId
|
|
|
listMycollect, err := models.GetUserMicroRoadshowCollectList(userId)
|
|
|
if err != nil {
|
|
@@ -250,11 +222,9 @@ func (this *MicroRoadShowController) VideoHistoryAdd() {
|
|
|
br.ErrMsg = "参数解析失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
videoId := req.VideoId
|
|
|
playSeconds := req.PlaySeconds
|
|
|
sourceType := req.SourceType
|
|
|
-
|
|
|
if sourceType == 0 {
|
|
|
sourceType = 1
|
|
|
}
|
|
@@ -266,6 +236,17 @@ func (this *MicroRoadShowController) VideoHistoryAdd() {
|
|
|
return
|
|
|
}
|
|
|
if sourceType == 1 {
|
|
|
+ //添加活动音频的播放记录
|
|
|
+ go services.AddActivityVoiceHistory(user, videoId, playSeconds)
|
|
|
+ } else if sourceType == 2 {
|
|
|
+ //添加活动视频的播放记录
|
|
|
+ go services.AddActivityVideoHistory(user, videoId, playSeconds)
|
|
|
+ //if err != nil {
|
|
|
+ // br.Msg = "更新失败"
|
|
|
+ // br.ErrMsg = "更新失败,AddActivityVideoHistory Err:" + err.Error()
|
|
|
+ // return
|
|
|
+ //}
|
|
|
+ } else if sourceType == 3 {
|
|
|
item := models.CygxMicroRoadshowVideoHistory{
|
|
|
VideoId: videoId,
|
|
|
UserId: uid,
|
|
@@ -307,13 +288,8 @@ func (this *MicroRoadShowController) VideoHistoryAdd() {
|
|
|
}
|
|
|
}
|
|
|
go services.MicroRoadshowVideoUserRmind(user, videoId)
|
|
|
- } else if sourceType == 2 {
|
|
|
- err = services.AddActivityVideoHistory(user, videoId)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "更新失败"
|
|
|
- br.ErrMsg = "更新失败,AddActivityVideoHistory Err:" + err.Error()
|
|
|
- return
|
|
|
- }
|
|
|
+ } else if sourceType == 4 {
|
|
|
+ go services.AddAskserieVideoHistoryRecord(user, videoId, playSeconds)
|
|
|
}
|
|
|
br.Ret = 200
|
|
|
br.Success = true
|