
package com.tmerclub.cloud.coupon.service.impl;

import com.tmerclub.cloud.common.database.dto.PageDTO;
import com.tmerclub.cloud.common.database.util.PageUtil;
import com.tmerclub.cloud.common.database.vo.PageVO;
import com.tmerclub.cloud.coupon.mapper.CouponGiveLogMapper;
import com.tmerclub.cloud.coupon.model.CouponGiveLog;
import com.tmerclub.cloud.coupon.service.CouponGiveLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 优惠券赠送记录
 *
 * @author tmerclub
 * @date 2021-04-28 16:25:05
 */
@Service
public class CouponGiveLogServiceImpl implements CouponGiveLogService {

    @Autowired
    private CouponGiveLogMapper couponGiveLogMapper;

    @Override
    public PageVO<CouponGiveLog> page(PageDTO pageDTO) {
        return PageUtil.doPage(pageDTO, () -> couponGiveLogMapper.list());
    }

    @Override
    public CouponGiveLog getByBizType(Long bizType) {
        return couponGiveLogMapper.getByBizType(bizType);
    }

    @Override
    public void save(CouponGiveLog couponGiveLog) {
        couponGiveLogMapper.save(couponGiveLog);
    }

    @Override
    public void update(CouponGiveLog couponGiveLog) {
        couponGiveLogMapper.update(couponGiveLog);
    }

    @Override
    public void deleteById(Long bizType) {
        couponGiveLogMapper.deleteById(bizType);
    }
}
