Browse Source

添加策略平台跳转链接

xingzai 3 years ago
parent
commit
295c75036a
2 changed files with 3 additions and 0 deletions
  1. 2 0
      controllers/home.go
  2. 1 0
      models/article.go

+ 2 - 0
controllers/home.go

@@ -6,6 +6,7 @@ import (
 	"hongze/hongze_cygx/services"
 	"hongze/hongze_cygx/utils"
 	"html"
+	"strconv"
 	"strings"
 )
 
@@ -159,6 +160,7 @@ func (this *HomeController) ListHome() {
 		} else {
 			list[k].ImgUrlPc = mapCategoryUrl[v.CategoryId]
 		}
+		list[k].HttpUrl = "https://vmp.hzinsights.com/v2/articles/" + strconv.Itoa(v.ArticleId)
 	}
 	resp.List = list
 	resp.Paging = page

+ 1 - 0
models/article.go

@@ -95,6 +95,7 @@ type HomeArticle struct {
 	Pv               int    `description:"PV"`
 	ImgUrlPc         string `description:"图片链接"`
 	CategoryId       string `description:"文章分类"`
+	HttpUrl          string `description:"文章链接跳转地址"`
 }
 
 type ArticleDetail struct {