Browse Source

策略报告平台文章跳转详情

xingzai 3 years ago
parent
commit
457b2721eb
4 changed files with 12 additions and 2 deletions
  1. 4 1
      controllers/article.go
  2. 4 1
      controllers/home.go
  3. 2 0
      models/article.go
  4. 2 0
      utils/config.go

+ 4 - 1
controllers/article.go

@@ -313,7 +313,10 @@ Loop:
 			detail.SellerName = sellerItemQy.RealName
 		}
 	}
-	detail.HttpUrl = "https://vmp.hzinsights.com/v2/articles/" + strconv.Itoa(articleId)
+	if detail.ArticleId < utils.SummaryArticleId {
+		detail.HttpUrl = utils.StrategyPlatform + strconv.Itoa(articleId)
+		detail.IsNeedJump = true
+	}
 	resp := new(models.ArticleDetailResp)
 	resp.HasPermission = hasPermission
 	resp.HaveResearch = haveResearch

+ 4 - 1
controllers/home.go

@@ -156,7 +156,10 @@ func (this *HomeController) ListHome() {
 		} else {
 			list[k].ImgUrlPc = mapCategoryUrl[v.CategoryId]
 		}
-		list[k].HttpUrl = "https://vmp.hzinsights.com/v2/articles/" + strconv.Itoa(v.ArticleId)
+		if list[k].ArticleId < utils.SummaryArticleId {
+			list[k].HttpUrl = utils.StrategyPlatform + strconv.Itoa(v.ArticleId)
+			list[k].IsNeedJump = true
+		}
 	}
 	resp.List = list
 	resp.Paging = page

+ 2 - 0
models/article.go

@@ -96,6 +96,7 @@ type HomeArticle struct {
 	ImgUrlPc         string `description:"图片链接"`
 	CategoryId       string `description:"文章分类"`
 	HttpUrl          string `description:"文章链接跳转地址"`
+	IsNeedJump       bool   `description:"是否需要跳转链接地址"`
 }
 
 type ArticleDetail struct {
@@ -138,6 +139,7 @@ type ArticleDetail struct {
 	IndustrialManagementId  int    `description:"文章关联产业ID"`
 	SellerList              []*SellerRep
 	HttpUrl                 string `description:"文章链接跳转地址"`
+	IsNeedJump              bool   `description:"是否需要跳转链接地址"`
 }
 
 type ArticleDetailFileLink struct {

+ 2 - 0
utils/config.go

@@ -64,6 +64,7 @@ var (
 	EmaiWhiteUserList         string //白名单邮箱
 	IsTask                    bool   //是否执行定时任务
 	ActSendMsgMobile          string //活动带问发送模板消息接收者的手机号
+	StrategyPlatform          string //策略品台跳转链接地址
 )
 
 func init() {
@@ -109,6 +110,7 @@ func init() {
 	YanxSummaryPermissionId = 1001     //研选纪要分类ID
 	YanxViewpointPermissionId = 1002   //研选观点分类ID
 	WxMsgTemplateIdAskMsgMobileAll = "15557270714,18767183922,18621268829"
+	StrategyPlatform = "https://vmp.hzinsights.com/v2/articles/"
 	if RunMode == "release" {
 		WxAppId = "wxcc32b61f96720d2f"
 		WxAppSecret = "06894933fafb24dafead7eaae09c08e0"