fix: default pay country pagination
This commit is contained in:
parent
78cf72f660
commit
5a6cebc0ba
@ -39,6 +39,7 @@ public class SysPayOpenCountryController extends BaseController {
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
public PageResult<PayCountryDTO> page(SysPayCountryQryCmd query) {
|
||||
query.setPageQuery(getPage());
|
||||
return sysPayCountryService.pageOpenPayCountry(query);
|
||||
}
|
||||
|
||||
|
||||
@ -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()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user