xingzai 2 жил өмнө
parent
commit
c953d67426

+ 2 - 0
controllers/home.go

@@ -395,6 +395,7 @@ func (this *HomeController) ListHomeArtAndChart() {
 	}
 	for k, _ := range chartList {
 		chartList[k].IsNeedJump = true
+		chartList[k].Source = 2
 	}
 	resp.ChartList = chartList
 
@@ -509,6 +510,7 @@ func (this *HomeController) ListHomeArtAndChart() {
 				list[k].HttpUrl = utils.StrategyPlatform + strconv.Itoa(v.ArticleId)
 				list[k].IsNeedJump = true
 			}
+			list[k].Source = 1
 		}
 		resp.List = list
 	}

+ 1 - 0
models/article.go

@@ -99,6 +99,7 @@ type HomeArticle struct {
 	CategoryId       string `description:"文章分类"`
 	HttpUrl          string `description:"文章链接跳转地址"`
 	IsNeedJump       bool   `description:"是否需要跳转链接地址"`
+	Source           int    `description:"来源  1:文章, 2:图表"`
 }
 
 type ArticleDetail struct {

+ 1 - 0
models/chart.go

@@ -133,6 +133,7 @@ type HomeChartListResp struct {
 	ImgUrlPc   string `orm:"column(cover)";description:"图片链接"`
 	HttpUrl    string `orm:"column(iframe)";description:"文章链接跳转地址"`
 	IsNeedJump bool   `description:"是否需要跳转链接地址"`
+	Source     int    `description:"来源  1:文章, 2:图表"`
 }
 
 type HomeChartListItem struct {

+ 1 - 1
services/chart.go

@@ -51,7 +51,7 @@ func GetChartListByApi(cont context.Context) (err error) {
 			go utils.SendEmail(utils.APPNAME+"【"+utils.RunMode+"】"+"失败提醒", "GetArticleListByApi ErrMsg:"+err.Error(), utils.EmailSendToUsers)
 		}
 	}()
-	url := utils.ApiUrl + "charts/mp?take=4000&skip=0"
+	url := utils.ApiUrl + "charts/mp?take=100&skip=0"
 	authorization := utils.ApiAuthorization
 	body, err := PublicGetDate(url, authorization)
 	if err != nil {