package com.tmerclub.cloud.order.feign;

import com.tmerclub.cloud.api.order.feign.OrderSelfStationFeignClient;
import com.tmerclub.cloud.common.exception.LuckException;
import com.tmerclub.cloud.common.order.vo.OrderSelfStationVO;
import com.tmerclub.cloud.common.order.vo.OrderVO;
import com.tmerclub.cloud.common.response.ServerResponseEntity;
import com.tmerclub.cloud.order.service.OrderSelfStationService;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;
/**
 * @author lanhai
 */
@DubboService
public class OrderSelfStationFeignController implements OrderSelfStationFeignClient {

    @Autowired
    private OrderSelfStationService orderSelfStationService;

    @Override
    public ServerResponseEntity<OrderVO> getOrderByStationCode(Long stationId, String code) throws LuckException {
        return ServerResponseEntity.success(orderSelfStationService.getOrderByStationCode(stationId, code));
    }

    @Override
    public ServerResponseEntity<List<OrderSelfStationVO>> getUserStation(Long userId) {
        return ServerResponseEntity.success(orderSelfStationService.getUserStation(userId));
    }


}
