소스 검색

分页获取社区图表

xyxie 6 일 전
부모
커밋
dd55cee6ed
2개의 변경된 파일5개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 1
      controllers/eta_forum/eta_forum.go
  2. 2 2
      services/eta_forum/chart_collect.go

+ 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 = "查询失败"