package tech.glinfo.enbao.modules.sh.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import tech.glinfo.enbao.common.utils.Constant;
import tech.glinfo.enbao.common.utils.PageUtils;
import tech.glinfo.enbao.modules.sh.dao.SecondaryKeywordsDao;
import tech.glinfo.enbao.modules.sh.entity.ShSpeakerSecondaryKeywordsEntity;
import tech.glinfo.enbao.modules.sh.service.SecondaryKeywordsService;

import java.util.Map;


@Service("secondaryKeywordsService")
public class SecondaryKeywordsServiceImpl extends ServiceImpl<SecondaryKeywordsDao, ShSpeakerSecondaryKeywordsEntity> implements SecondaryKeywordsService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        int current = Integer.parseInt((String)params.get(Constant.PAGE));
        int size = Integer.parseInt((String)params.get(Constant.LIMIT));
        Page<Map<String, Object>> page = new Page<Map<String, Object>>(current, size);
        page.setRecords(this.baseMapper.list(page, params));
        return new PageUtils(page);
    }

}