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

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sqx.common.utils.PageUtils;
import com.sqx.common.utils.Result;
import com.sqx.modules.coupon.dao.TbCouponLogDao;
import com.sqx.modules.coupon.entity.TbCoupon;
import com.sqx.modules.coupon.entity.TbCouponLog;
import com.sqx.modules.coupon.service.TbCouponLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class TbCouponLogServiceImpl extends ServiceImpl<TbCouponLogDao,TbCouponLog> implements TbCouponLogService {

    @Autowired
    private TbCouponLogDao tbCouponLogDao;

    @Override
    public Result selectCouponLog(Integer page, Integer limit) {
        Page<TbCouponLog> pages = new Page<>(page, limit);
        PageUtils pageUtils = new PageUtils(tbCouponLogDao.selectCouponLogPage(pages));
        return Result.success().put("data", pageUtils);

    }
}
