
package com.tmerclub.cloud.order.feign;

import com.tmerclub.cloud.api.order.bo.EsOrderInvoiceBO;
import com.tmerclub.cloud.api.order.feign.OrderInvoiceFeignClient;
import com.tmerclub.cloud.common.response.ServerResponseEntity;
import com.tmerclub.cloud.order.mapper.OrderInvoiceMapper;
import org.apache.dubbo.config.annotation.DubboService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @author tmerclub
 * @date 2020/12/25
 */
@DubboService
public class OrderInvoiceFeignController implements OrderInvoiceFeignClient {

    private static final Logger logger = LoggerFactory.getLogger(OrderInvoiceFeignController.class);

    @Autowired
    private OrderInvoiceMapper orderInvoiceMapper;

    @Override
    public ServerResponseEntity<EsOrderInvoiceBO> getEsOrderInvoice(Long orderInvoiceId) {
        return ServerResponseEntity.success(orderInvoiceMapper.getEsOrderInvoice(orderInvoiceId));
    }

    @Override
    public ServerResponseEntity<List<EsOrderInvoiceBO>> listEsOrderInvoiceByOrderId(Long orderId) {
        return ServerResponseEntity.success(orderInvoiceMapper.listEsOrderInvoiceByOrderId(orderId));
    }
}
