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

import cn.superdesk.uniorder.common.exception.UnifiedOrderRuntimeException;
import cn.superdesk.uniorder.common.rest.response.R;
import cn.superdesk.uniorder.dao.entity.fund.SysFundGrant;
import cn.superdesk.uniorder.dto.vo.fund.SysFundGrantVoEx;
import cn.superdesk.uniorder.dubbo.facade.fund.DubboSysFundGrantService;
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 SysFundGrantDubboConsumerService {

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

	public void create(String token, SysFundGrant sysFundGrant) throws UnifiedOrderRuntimeException {
		dubboSysFundGrantService.create(token, sysFundGrant);
	}

	public R<List<SysFundGrantVoEx>> findAllViewPage(Map<String, Object> params, int pageNum, int pageSize) {
		return dubboSysFundGrantService.findAllViewPage(params, pageNum, pageSize);
	}

	public void importExcel(String token, Map<String, List<Map<String, Object>>> map) throws UnifiedOrderRuntimeException {
		dubboSysFundGrantService.importExcel(token, map);
	}
}
