
package com.tmerclub.cloud.user.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.user.mapper.UserRightsCouponMapper;
import com.tmerclub.cloud.user.model.UserRightsCoupon;
import com.tmerclub.cloud.user.service.UserRightsCouponService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author tmerclub
 * @date 2021-04-25 16:01:58
 */
@Service
public class UserRightsCouponServiceImpl implements UserRightsCouponService {

    @Autowired
    private UserRightsCouponMapper userRightsCouponMapper;

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

    @Override
    public UserRightsCoupon getByRightsCouponId(Long rightsCouponId) {
        return userRightsCouponMapper.getByRightsCouponId(rightsCouponId);
    }

    @Override
    public void save(UserRightsCoupon userRightsCoupon) {
        userRightsCouponMapper.save(userRightsCoupon);
    }

    @Override
    public void update(UserRightsCoupon userRightsCoupon) {
        userRightsCouponMapper.update(userRightsCoupon);
    }

    @Override
    public void deleteById(Long rightsCouponId) {
        userRightsCouponMapper.deleteById(rightsCouponId);
    }
}
