fix: default pay country pagination

This commit is contained in:
zhx 2026-06-24 12:27:12 +08:00
parent 78cf72f660
commit 5a6cebc0ba
2 changed files with 21 additions and 0 deletions

View File

@ -39,6 +39,7 @@ public class SysPayOpenCountryController extends BaseController {
*/
@GetMapping("/page")
public PageResult<PayCountryDTO> page(SysPayCountryQryCmd query) {
query.setPageQuery(getPage());
return sysPayCountryService.pageOpenPayCountry(query);
}

View File

@ -4,6 +4,7 @@ import com.alibaba.nacos.shaded.com.google.common.collect.Lists;
import com.google.api.client.util.Maps;
import com.red.circle.framework.core.asserts.ResponseAssert;
import com.red.circle.framework.dto.PageResult;
import com.red.circle.framework.dto.PageQuery;
import com.red.circle.framework.mybatis.constant.PageConstant;
import com.red.circle.order.app.command.pay.web.strategy.PayPlaceAnOrderService;
import com.red.circle.order.infra.database.rds.entity.pay.PayCountry;
@ -190,6 +191,10 @@ public class PayCountryClientServiceImpl implements PayCountryClientService {
@Override
public PageResult<PayCountryDTO> pageOpenPayCountry(SysPayCountryQryCmd query) {
if (Objects.isNull(query)) {
query = new SysPayCountryQryCmd();
}
fillDefaultPageQuery(query);
PageResult<PayCountryDTO> sysPayCountryPage = payCountryService.pageOpenPayCountry(query)
.convert(webPayInnerConvertor::toSysPayCountryDTO);
Map<Long, SysCountryCodeDTO> sysCountryCodeMap = ResponseAssert.requiredSuccess(
@ -205,6 +210,21 @@ public class PayCountryClientServiceImpl implements PayCountryClientService {
});
}
private void fillDefaultPageQuery(SysPayCountryQryCmd query) {
if (Objects.isNull(query.getPageQuery())) {
query.setPageQuery(new PageQuery());
}
if (Objects.isNull(query.getPageQuery().getCursor())) {
query.getPageQuery().setCursor(1);
}
if (Objects.isNull(query.getPageQuery().getLimit())) {
query.getPageQuery().setLimit(20);
}
if (Objects.isNull(query.getPageQuery().getSearchCount())) {
query.getPageQuery().setSearchCount(true);
}
}
@Override
public void addOpenPayCountry(List<SysPayCountryAddCmd> params) {
payCountryService.saveBatch(params.stream()