Browse Source

no message

xingzai 1 year ago
parent
commit
cc201ad495
2 changed files with 5 additions and 1 deletions
  1. 1 1
      models/banner.go
  2. 4 0
      services/banner.go

+ 1 - 1
models/banner.go

@@ -67,7 +67,7 @@ type CygxBannerImgResp struct {
 type BannerUrlResp struct {
 	ChartPermissionId int    `description:"行业id"`
 	SourceId          int    `description:"资源ID"`
-	Type              int    `description:"类型:1普通文本,2:文章、3:活动、4:产业、5:关于我们"`
+	Type              int    `description:"类型:1普通文本,2:文章、3:活动、4:产业、5:关于我们、6:产品内测"`
 	Body              string `description:"内容"`
 }
 

+ 4 - 0
services/banner.go

@@ -14,10 +14,12 @@ func GetBannerUrlBody(url string) (itemResp *models.BannerUrlResp) {
 	//3:活动详情  https://web.hzinsights.com/activity/detail/2701
 	//4:产业详情  https://web.hzinsights.com/indepth/info/20/79
 	//5:关于我们  https://clpttest.hzinsights.com/about
+	//6:产品内测 https://clpttest.hzinsights.com/internal/article/29
 	material := "material/info"
 	activity := "activity/detail"
 	indepth := "indepth/info"
 	about := "/about"
+	internal := "internal/article"
 	item := new(models.BannerUrlResp)
 	item.Body = url
 	urlSlice := strings.Split(url, "/")
@@ -36,6 +38,8 @@ func GetBannerUrlBody(url string) (itemResp *models.BannerUrlResp) {
 		item.Type = 4
 	} else if strings.Contains(url, about) {
 		item.Type = 5
+	} else if strings.Contains(url, internal) {
+		item.Type = 6
 	} else {
 		item.Type = 1
 	}