package com.chuanxia.mcp.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.chuanxia.mcp.bean.dto.DomainCityQueryDto;
import com.chuanxia.mcp.bean.model.CdnDomainCity;
import com.chuanxia.mcp.bean.vo.CdnDomainCityVo;
import com.chuanxia.mcp.bean.vo.Result;
import com.chuanxia.mcp.mapper.CdnDomainCityMapper;
import com.chuanxia.mcp.service.CdnDomainCityService;
import lombok.RequiredArgsConstructor;
import lombok.extern. slf4j.Slf4j;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor
@Slf4j
public class CdnDomainCityServiceImpl extends ServiceImpl<CdnDomainCityMapper, CdnDomainCity> implements CdnDomainCityService {
    private final CdnDomainCityMapper domainCityMapper;

    @Override
    public Result<IPage<CdnDomainCityVo>> listPage(DomainCityQueryDto queryDto) {
        IPage<CdnDomainCityVo> page = new Page<>(queryDto.getPageNum(), queryDto.getPageSize());
        page = domainCityMapper.listPage(page, queryDto);
        return Result.success(page);
    }
}


