diff --git a/bridge-history-api/internal/controller/api/history_controller.go b/bridge-history-api/internal/controller/api/history_controller.go index d1e5c02a6..521d63549 100644 --- a/bridge-history-api/internal/controller/api/history_controller.go +++ b/bridge-history-api/internal/controller/api/history_controller.go @@ -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 @@ -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 @@ -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 diff --git a/bridge-history-api/internal/types/types.go b/bridge-history-api/internal/types/types.go index abd1aac67..48032d1ab 100644 --- a/bridge-history-api/internal/types/types.go +++ b/bridge-history-api/internal/types/types.go @@ -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