Source:
<code>public BaseResponseDto findUserPointsOrders(BaseParamDto baseParamDto) { Integer index = baseParamDto.getIndex(); Integer pageSize = baseParamDto.getPageSize(); <START> if (index == null || pageSize == null || index <= 0 || pageSize <= 0) { <END> return new BaseResponseDto<>(ReturnMessage.REQUEST_PARAM_IS_WRONG.getCode(), ReturnMessage.REQUEST_PARAM_IS_WRONG.getMsg()); } index = (baseParamDto.getIndex() - 1) * pageSize; List<ProductOrderViewDto> productOrderListByLoginName = productOrderMapper.findProductOrderListByLoginName(baseParamDto.getBaseParam().getUserId(), index, pageSize); ProductListOrderResponseDto productListOrderResponseDto = new ProductListOrderResponseDto(); if (CollectionUtils.isNotEmpty(productOrderListByLoginName)) { Iterator<ProductOrderResponseDto> transform = Iterators.transform(productOrderListByLoginName.iterator(), new Function<ProductOrderViewDto, ProductOrderResponseDto>() { @Override public ProductOrderResponseDto apply(ProductOrderViewDto input) { return new ProductOrderResponseDto(input); } }); productListOrderResponseDto.setOrders(Lists.newArrayList(transform)); productListOrderResponseDto.setIndex(baseParamDto.getIndex()); productListOrderResponseDto.setPageSize(baseParamDto.getPageSize()); productListOrderResponseDto.setTotalCount((int) productOrderMapper.findProductOrderListByLoginNameCount(baseParamDto.getBaseParam().getUserId())); } BaseResponseDto baseResponseDto = new BaseResponseDto(); baseResponseDto.setCode(ReturnMessage.SUCCESS.getCode()); baseResponseDto.setData(productListOrderResponseDto); return baseResponseDto; }</code><technical_language>default</technical_language>

Target:
public BaseResponseDto findUserPointsOrders(BaseParamDto baseParamDto) { Integer index = baseParamDto.getIndex(); Integer pageSize = baseParamDto.getPageSize(); if (index == null || pageSize == null || index <= 0 || pageSize <= 0) { index = 0; pageSize = 10; } index = (index - 1) * pageSize; List<ProductOrderViewDto> productOrderListByLoginName = productOrderMapper.findProductOrderListByLoginName(baseParamDto.getBaseParam().getUserId(), index, pageSize); ProductListOrderResponseDto productListOrderResponseDto = new ProductListOrderResponseDto(); if (CollectionUtils.isNotEmpty(productOrderListByLoginName)) { Iterator<ProductOrderResponseDto> transform = Iterators.transform(productOrderListByLoginName.iterator(), new Function<ProductOrderViewDto, ProductOrderResponseDto>() { @Override public ProductOrderResponseDto apply(ProductOrderViewDto input) { return new ProductOrderResponseDto(input); } }); productListOrderResponseDto.setOrders(Lists.newArrayList(transform)); productListOrderResponseDto.setIndex(baseParamDto.getIndex()); productListOrderResponseDto.setPageSize(baseParamDto.getPageSize()); productListOrderResponseDto.setTotalCount(Integer.parseInt(String.valueOf(productOrderMapper.findProductOrderListByLoginNameCount(baseParamDto.getBaseParam().getUserId())))); } BaseResponseDto baseResponseDto = new BaseResponseDto(); baseResponseDto.setCode(ReturnMessage.SUCCESS.getCode()); baseResponseDto.setData(productListOrderResponseDto); baseResponseDto.setMessage(ReturnMessage.SUCCESS.getMsg()); return baseResponseDto; }