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.SysFundUser;
import cn.superdesk.uniorder.dto.vo.fund.SysFundUserVoEx;
import cn.superdesk.uniorder.dubbo.facade.fund.DubboSysFundUserService;
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 SysFundUserDubboConsumerService {

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

	public void create(String token, SysFundUser sysFundUser) throws UnifiedOrderRuntimeException {
		dubboSysFundUserService.create(token, sysFundUser);
	}

	public void update(String token, SysFundUser sysFundUser) {
		dubboSysFundUserService.update(token, sysFundUser);
	}

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

	public SysFundUserVoEx selectById(Map<String, Object> params) throws UnifiedOrderRuntimeException {
		return dubboSysFundUserService.selectById(params);
	}

}
