package com.sqx.modules.oss.service.impl;

import cn.hutool.core.map.MapProxy;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sqx.common.utils.Constant;
import com.sqx.common.utils.PageUtils;
import com.sqx.modules.oss.dao.SysOssDao;
import com.sqx.modules.oss.entity.SysOssEntity;
import com.sqx.modules.oss.service.SysOssService;
import org.springframework.stereotype.Service;

import java.util.Map;


@Service("sysOssService")
public class SysOssServiceImpl extends ServiceImpl<SysOssDao, SysOssEntity> implements SysOssService {

	@Override
	public PageUtils queryPage(Map<String, Object> params) {
		MapProxy proxy = MapProxy.create(params);
		long pageNum = proxy.getLong(Constant.PAGE, 1L);
		long pageSize = proxy.getLong(Constant.LIMIT, 10L);
		PageHelper.startPage((int) pageNum, (int) pageSize);
		return PageUtils.page(new PageInfo<>(this.list()));
	}

}
