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.SysFundActivated;
import cn.superdesk.uniorder.dto.vo.fund.SysFundActivatedVoEx;
import cn.superdesk.uniorder.dubbo.facade.fund.DubboSysFundActivatedService;
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 SysFundActivatedDubboConsumerService {

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

	public void create(String token, SysFundActivated sysFundActivated) throws UnifiedOrderRuntimeException {
		dubboSysFundActivatedService.create(token, sysFundActivated);
	}

	public void update(String token, SysFundActivated sysFundActivated) throws UnifiedOrderRuntimeException {
		dubboSysFundActivatedService.update(token, sysFundActivated);
	}

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

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