Przeglądaj źródła

分页获取社区图表

xyxie 6 dni temu
rodzic
commit
dd55cee6ed

+ 3 - 1
controllers/eta_forum/eta_forum.go

@@ -33,6 +33,8 @@ func (this *EtaForumController) UserChartList() {
 		return
 	}
 	keyword := this.GetString("keyword")
+	pageSize, _ := this.GetInt("PageSize")
+	currentIndex, _ := this.GetInt("CurrentIndex")
 	businessCode := utils.BusinessCode
 	userMobile := sysUser.Mobile
 	telAreaCode := sysUser.TelAreaCode
@@ -49,7 +51,7 @@ func (this *EtaForumController) UserChartList() {
 		telAreaCode = utils.TelAreaCodeHome
 	}
 
-	resp, err, errMsg := eta_forum.GetUserChartList(businessCode, userMobile, telAreaCode, keyword)
+	resp, err, errMsg := eta_forum.GetUserChartList(businessCode, userMobile, telAreaCode, keyword, currentIndex, pageSize)
 	if err != nil {
 		br.Msg = errMsg
 		br.ErrMsg = err.Error()

+ 2 - 2
services/eta_forum/chart_collect.go

@@ -110,7 +110,7 @@ type ChartFromUniqueCodeRespItem struct {
 }
 
 // GetUserChartList 查询社区中对用户可见的图表列表
-func GetUserChartList(businessCode, userMobile, telAreaCode, keyword string) (resp UserChartListRespItem, err error, errMsg string) {
+func GetUserChartList(businessCode, userMobile, telAreaCode, keyword string, currentIndex, pageSize int) (resp UserChartListRespItem, err error, errMsg string) {
 	defer func() {
 		if err != nil {
 			msg := fmt.Sprintf("查询社区中对用户可见的图表列表 GetUserChartList:Err:%v,ErrMsg:%s", err, errMsg)
@@ -118,7 +118,7 @@ func GetUserChartList(businessCode, userMobile, telAreaCode, keyword string) (re
 			go alarm_msg.SendAlarmMsg(msg, 3)
 		}
 	}()
-	urlQuery := fmt.Sprintf("BusinessCode=%s&UserMobile=%s&UserTelAreaCode=%s&Keyword=%s", businessCode, userMobile, telAreaCode, keyword)
+	urlQuery := fmt.Sprintf("BusinessCode=%s&UserMobile=%s&UserTelAreaCode=%s&Keyword=%s&CurrentIndex=%d&PageSize=%d", businessCode, userMobile, telAreaCode, keyword, currentIndex, pageSize)
 	result, err := GetUserChartListLib(urlQuery)
 	if err != nil {
 		errMsg = "查询失败"