
package com.tmerclub.cloud.order.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.order.mapper.OrderRefundAddrMapper;
import com.tmerclub.cloud.order.model.OrderRefundAddr;
import com.tmerclub.cloud.order.service.OrderRefundAddrService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 用户退货物流地址
 *
 * @author tmerclub
 * @date 2021-03-09 13:44:31
 */
@Service
public class OrderRefundAddrServiceImpl implements OrderRefundAddrService {

    @Autowired
    private OrderRefundAddrMapper orderRefundAddrMapper;

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

    @Override
    public OrderRefundAddr getByRefundAddrId(Long refundAddrId) {
        return orderRefundAddrMapper.getByRefundAddrId(refundAddrId);
    }

    @Override
    public void save(OrderRefundAddr orderRefundAddr) {
        orderRefundAddrMapper.save(orderRefundAddr);
    }

    @Override
    public void update(OrderRefundAddr orderRefundAddr) {
        orderRefundAddrMapper.update(orderRefundAddr);
    }

    @Override
    public void deleteById(Long refundAddrId) {
        orderRefundAddrMapper.deleteById(refundAddrId);
    }

    @Override
    public OrderRefundAddr getByRefundId(Long refundId) {
        return orderRefundAddrMapper.getByRefundId(refundId);
    }
}
