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

import com.tmerclub.cloud.biz.mapper.QrcodeTicketMapper;
import com.tmerclub.cloud.biz.model.QrcodeTicket;
import com.tmerclub.cloud.biz.service.QrcodeTicketService;
import com.tmerclub.cloud.biz.vo.QrcodeTicketVO;
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 org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 二维码数据信息
 *
 * @author cl
 * @date 2021-08-13 15:32:12
 */
@Service
public class QrcodeTicketServiceImpl implements QrcodeTicketService {

    @Autowired
    private QrcodeTicketMapper qrcodeTicketMapper;

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

    @Override
    public QrcodeTicket getByTicketId(Long ticketId) {
        return qrcodeTicketMapper.getByTicketId(ticketId);
    }

    @Override
    public void save(QrcodeTicket qrcodeTicket) {
        qrcodeTicketMapper.save(qrcodeTicket);
    }

    @Override
    public void update(QrcodeTicket qrcodeTicket) {
        qrcodeTicketMapper.update(qrcodeTicket);
    }

    @Override
    public void deleteById(Long ticketId) {
        qrcodeTicketMapper.deleteById(ticketId);
    }

    @Override
    public QrcodeTicketVO getByTicket(String ticket) {
        return qrcodeTicketMapper.getByTicket(ticket);
    }

}
