diff --git a/bridge-history-api/internal/logic/history_logic.go b/bridge-history-api/internal/logic/history_logic.go index 2cac9dc3b1..665039cd02 100644 --- a/bridge-history-api/internal/logic/history_logic.go +++ b/bridge-history-api/internal/logic/history_logic.go @@ -286,8 +286,8 @@ func getTxHistoryInfo(message *orm.CrossMessage) *types.TxHistoryInfo { } func (h *HistoryLogic) getCachedTxsInfo(ctx context.Context, cacheKey string, pageNum, pageSize uint64) ([]*types.TxHistoryInfo, uint64, bool, error) { - start := int64(pageNum * pageSize) - end := int64((pageNum+1)*pageSize - 1) + start := int64((pageNum - 1) * pageSize) + end := int64(pageNum*pageSize - 1) total, err := h.redis.ZCard(ctx, cacheKey).Result() if err != nil { diff --git a/bridge-history-api/internal/types/types.go b/bridge-history-api/internal/types/types.go index 48032d1ab6..dc19fc99cc 100644 --- a/bridge-history-api/internal/types/types.go +++ b/bridge-history-api/internal/types/types.go @@ -27,7 +27,7 @@ const ( // QueryByAddressRequest the request parameter of address api type QueryByAddressRequest struct { Address string `form:"address" binding:"required"` - Page uint64 `form:"page" binding:"required"` + Page uint64 `form:"page" binding:"required,min=1"` PageSize uint64 `form:"page_size" binding:"required,min=1,max=100"` }