package cn.superdesk.uniorder.dubbo.consumer.operationCenter.business;

import cn.superdesk.uniorder.common.rest.response.R;
import cn.superdesk.uniorder.dto.param.operationCenter.business.BusinessDeleteParam;
import cn.superdesk.uniorder.dto.param.operationCenter.business.BusinessQueryParam;
import cn.superdesk.uniorder.dto.param.operationCenter.business.BusinessSaveParam;
import cn.superdesk.uniorder.dto.vo.operationCenter.base.OperationCenterVo;
import cn.superdesk.uniorder.dto.vo.operationCenter.business.BusinessCustomerVo;
import cn.superdesk.uniorder.dto.vo.operationCenter.business.BusinessVo;
import cn.superdesk.uniorder.dto.vo.sys.SysSelectVo;
import cn.superdesk.uniorder.dubbo.facade.operationCenter.business.DubboOperationCenterBusinessService;
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 OperationCenterBusinessDubboService {
    @Reference(version = "1.0.1", timeout = 30000, retries = -1)
    private DubboOperationCenterBusinessService dubboOperationCenterBusinessService;

    public R<String> saveBusiness(BusinessSaveParam param) {
        return dubboOperationCenterBusinessService.saveBusiness(param);
    }

    public R<String> delete(BusinessDeleteParam param) {
        return dubboOperationCenterBusinessService.delete(param);
    }

    public R<BusinessVo> getById(Long id){
        return dubboOperationCenterBusinessService.getById(id);
    }

    public R<List<BusinessVo>> getListByParams(BusinessQueryParam param){
        return dubboOperationCenterBusinessService.getListByParams(param);
    }

    public R<List<BusinessCustomerVo>> getByBusinessId(BusinessQueryParam param){
        return dubboOperationCenterBusinessService.getByBusinessId(param);
    }

    public R<List<OperationCenterVo>> selectAll() {
        return dubboOperationCenterBusinessService.selectAll();
    }

    public List<SysSelectVo> selectList(Map<String,Object> params){
        return dubboOperationCenterBusinessService.selectList(params);
    }
}
