package cn.superdesk.uniorder.dubbo.consumer.unified;

import cn.superdesk.uniorder.common.rest.response.R;
import cn.superdesk.uniorder.dao.entity.unified.UnifiedWarning;
import cn.superdesk.uniorder.dto.vo.unified.UnifiedWarningVo;
import cn.superdesk.uniorder.dto.vo.unified.WarningOrderInvoiceVo;
import cn.superdesk.uniorder.dubbo.facade.unified.DubboUnifiedWarningService;
import com.alibaba.dubbo.config.annotation.Reference;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;


@Slf4j
@Component
public class UnifiedWarningDubboConsumerService {

	@Reference(version = "1.0.0", timeout = 30000, retries = -1)
	private DubboUnifiedWarningService dubboUnifiedWarningService;

	public R<List<UnifiedWarningVo>> getDataByPage(String token, Map<String, Object> params, int pageNum,
	                                               int pageSize) {


		return dubboUnifiedWarningService.getDataByPage(params, pageNum, pageSize);
	}

	public void addObj(UnifiedWarning uw) {

		dubboUnifiedWarningService.addObj(uw);
	}

	public List<WarningOrderInvoiceVo> queryWarningOrderInvoice(Map<String, Object> queryMap) {

		return dubboUnifiedWarningService.getWarningOrderInv(queryMap);
	}
}
