瀏覽代碼

策略平台跳转链接更换

xingzai 3 年之前
父節點
當前提交
3f62b14879
共有 4 個文件被更改,包括 15 次插入0 次删除
  1. 4 0
      controllers/article.go
  2. 5 0
      controllers/home.go
  3. 4 0
      models/article.go
  4. 2 0
      utils/config.go

+ 4 - 0
controllers/article.go

@@ -313,6 +313,10 @@ Loop:
 			detail.SellerName = sellerItemQy.RealName
 			detail.SellerName = sellerItemQy.RealName
 		}
 		}
 	}
 	}
+	if detail.ArticleId < utils.SummaryArticleId {
+		detail.HttpUrl = utils.StrategyPlatform + strconv.Itoa(articleId)
+		detail.IsNeedJump = true
+	}
 	resp := new(models.ArticleDetailResp)
 	resp := new(models.ArticleDetailResp)
 	resp.HasPermission = hasPermission
 	resp.HasPermission = hasPermission
 	resp.HaveResearch = haveResearch
 	resp.HaveResearch = haveResearch

+ 5 - 0
controllers/home.go

@@ -6,6 +6,7 @@ import (
 	"hongze/hongze_cygx/services"
 	"hongze/hongze_cygx/services"
 	"hongze/hongze_cygx/utils"
 	"hongze/hongze_cygx/utils"
 	"html"
 	"html"
+	"strconv"
 	"strings"
 	"strings"
 )
 )
 
 
@@ -155,6 +156,10 @@ func (this *HomeController) ListHome() {
 		} else {
 		} else {
 			list[k].ImgUrlPc = mapCategoryUrl[v.CategoryId]
 			list[k].ImgUrlPc = mapCategoryUrl[v.CategoryId]
 		}
 		}
+		if list[k].ArticleId < utils.SummaryArticleId {
+			list[k].HttpUrl = utils.StrategyPlatform + strconv.Itoa(v.ArticleId)
+			list[k].IsNeedJump = true
+		}
 	}
 	}
 	resp.List = list
 	resp.List = list
 	resp.Paging = page
 	resp.Paging = page

+ 4 - 0
models/article.go

@@ -95,6 +95,8 @@ type HomeArticle struct {
 	Pv               int    `description:"PV"`
 	Pv               int    `description:"PV"`
 	ImgUrlPc         string `description:"图片链接"`
 	ImgUrlPc         string `description:"图片链接"`
 	CategoryId       string `description:"文章分类"`
 	CategoryId       string `description:"文章分类"`
+	HttpUrl          string `description:"文章链接跳转地址"`
+	IsNeedJump       bool   `description:"是否需要跳转链接地址"`
 }
 }
 
 
 type ArticleDetail struct {
 type ArticleDetail struct {
@@ -136,6 +138,8 @@ type ArticleDetail struct {
 	IndustrialAndSubjectIds string `description:"文章关联产业和标的的ID字符串"`
 	IndustrialAndSubjectIds string `description:"文章关联产业和标的的ID字符串"`
 	IndustrialManagementId  int    `description:"文章关联产业ID"`
 	IndustrialManagementId  int    `description:"文章关联产业ID"`
 	SellerList              []*SellerRep
 	SellerList              []*SellerRep
+	HttpUrl                 string `description:"文章链接跳转地址"`
+	IsNeedJump              bool   `description:"是否需要跳转链接地址"`
 }
 }
 
 
 type ArticleDetailFileLink struct {
 type ArticleDetailFileLink struct {

+ 2 - 0
utils/config.go

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