Skip to content

Commit

Permalink
add PageSize limit
Browse files Browse the repository at this point in the history
  • Loading branch information
colinlyguo committed Dec 7, 2023
1 parent 01d35d7 commit a75813e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func (c *HistoryController) GetL2ClaimableWithdrawalsByAddress(ctx *gin.Context)
return
}

pagedTxs, total, err := c.historyLogic.GetL2ClaimableWithdrawalsByAddress(ctx, req.Address, uint64(req.Page), uint64(req.PageSize))
pagedTxs, total, err := c.historyLogic.GetL2ClaimableWithdrawalsByAddress(ctx, req.Address, req.Page, req.PageSize)
if err != nil {
types.RenderFailure(ctx, types.ErrGetL2ClaimableWithdrawalsError, err)
return
Expand All @@ -49,7 +49,7 @@ func (c *HistoryController) GetL2WithdrawalsByAddress(ctx *gin.Context) {
return
}

pagedTxs, total, err := c.historyLogic.GetL2WithdrawalsByAddress(ctx, req.Address, uint64(req.Page), uint64(req.PageSize))
pagedTxs, total, err := c.historyLogic.GetL2WithdrawalsByAddress(ctx, req.Address, req.Page, req.PageSize)
if err != nil {
types.RenderFailure(ctx, types.ErrGetL2WithdrawalsError, err)
return
Expand All @@ -67,7 +67,7 @@ func (c *HistoryController) GetTxsByAddress(ctx *gin.Context) {
return
}

pagedTxs, total, err := c.historyLogic.GetTxsByAddress(ctx, req.Address, uint64(req.Page), uint64(req.PageSize))
pagedTxs, total, err := c.historyLogic.GetTxsByAddress(ctx, req.Address, req.Page, req.PageSize)
if err != nil {
types.RenderFailure(ctx, types.ErrGetTxsError, err)
return
Expand Down
4 changes: 2 additions & 2 deletions bridge-history-api/internal/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ const (
// QueryByAddressRequest the request parameter of address api
type QueryByAddressRequest struct {
Address string `form:"address" binding:"required"`
Page int `form:"page" binding:"required"`
PageSize int `form:"page_size" binding:"required"`
Page uint64 `form:"page" binding:"required"`
PageSize uint64 `form:"page_size" binding:"required,min=1,max=100"`
}

// QueryByHashRequest the request parameter of hash api
Expand Down

0 comments on commit a75813e

Please sign in to comment.