|
@@ -36,7 +36,9 @@ func GetBannerUrlBody(url string) (itemResp *models.BannerUrlResp) {
|
|
|
|
|
|
material := "material/info" //2:文章详情
|
|
|
activity := "activity/detail" //3:活动详情
|
|
|
+ activityVideo := "activity/video" //3:活动视频页,调活动详情
|
|
|
indepth := "indepth/info" //4:产业详情
|
|
|
+ indepthVideo := "indepth/video" //4:产业视频页,调详情
|
|
|
about := "/about" //5:关于我们
|
|
|
internal := "internal/article" //6:产品内测
|
|
|
thisWeek := "summary/2/" //7:本周研究汇总
|
|
@@ -50,17 +52,31 @@ func GetBannerUrlBody(url string) (itemResp *models.BannerUrlResp) {
|
|
|
urlSlice := strings.Split(url, "/")
|
|
|
lenurlSlice := len(urlSlice)
|
|
|
sourceId, _ := strconv.Atoi(urlSlice[lenurlSlice-1])
|
|
|
- item.SourceId = sourceId
|
|
|
+
|
|
|
if strings.Contains(url, material) {
|
|
|
item.Type = 2
|
|
|
} else if strings.Contains(url, activity) {
|
|
|
item.Type = 3
|
|
|
+ } else if strings.Contains(url, activityVideo) {
|
|
|
+ activityVideo, err := models.GetCygxActivityVideoById(sourceId)
|
|
|
+ if err != nil {
|
|
|
+ go utils.SendAlarmMsg("banner链接解析失败"+err.Error()+url, 2)
|
|
|
+ }
|
|
|
+ if activityVideo != nil {
|
|
|
+ sourceId = activityVideo.ActivityId
|
|
|
+ item.Type = 3
|
|
|
+ }
|
|
|
} else if strings.Contains(url, indepth) {
|
|
|
if lenurlSlice >= 2 {
|
|
|
chartPermissionId, _ := strconv.Atoi(urlSlice[lenurlSlice-2])
|
|
|
item.ChartPermissionId = chartPermissionId
|
|
|
}
|
|
|
item.Type = 4
|
|
|
+ } else if strings.Contains(url, indepthVideo) {
|
|
|
+ if lenurlSlice >= 2 {
|
|
|
+ sourceId, _ = strconv.Atoi(urlSlice[lenurlSlice-2])
|
|
|
+ }
|
|
|
+ item.Type = 4
|
|
|
} else if strings.Contains(url, about) {
|
|
|
item.Type = 5
|
|
|
} else if strings.Contains(url, internal) {
|
|
@@ -83,6 +99,7 @@ func GetBannerUrlBody(url string) (itemResp *models.BannerUrlResp) {
|
|
|
if mapPath[item.Type] != "" {
|
|
|
item.Path = "/" + mapPath[item.Type]
|
|
|
}
|
|
|
+ item.SourceId = sourceId
|
|
|
itemResp = item
|
|
|
return
|
|
|
}
|