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

import cn.superdesk.uniorder.common.rest.response.R;
import cn.superdesk.uniorder.dao.entity.sys.SysConfig;
import cn.superdesk.uniorder.dto.param.system.SysConfigParam;
import cn.superdesk.uniorder.dubbo.facade.sys.DubboSysConfigService;
import com.alibaba.dubbo.config.annotation.Reference;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

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


@Slf4j
@Component
public class SysConfigDubboConsumerService {

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


	public void addObj(SysConfigParam param) {

		dubboSysConfigService.addObj(param);

	}

	public void updateObj(SysConfigParam param) {

		dubboSysConfigService.updateObj(param);
	}

	public void deleteObj(Long id) {

		dubboSysConfigService.deleteObj(id);
	}

	public SysConfig findById(Long id) {

		return dubboSysConfigService.findById(id);
	}

	public PageInfo<SysConfig> findByPaging(Map<String, Object> conditions, Integer pageNun, Integer pageSize) {

		return dubboSysConfigService.findByPaging(conditions, pageNun, pageSize);
	}

	public List<SysConfig> findAll(Map<String, Object> queryMap) {

		return dubboSysConfigService.findAll(queryMap);
	}

	/****************************************** extends BaseService 部分   end ******************************************/


	public void addSysConfig(SysConfigParam param) {

		dubboSysConfigService.addSysConfig(param);
	}


	public void updateSysConfig(SysConfigParam param) {

		dubboSysConfigService.updateSysConfig(param);
	}


	public void deleteSysConfig(Long id) {
		dubboSysConfigService.deleteSysConfig(id);
	}


	public SysConfig findSysConfigById(Long id) {

		return dubboSysConfigService.findSysConfigById(id);
	}


	public R<List<SysConfig>> pageQuery(Map<String, Object> conditions, int pageNun, int pageSize) {

		return dubboSysConfigService.pageQuery(conditions, pageNun, pageSize);
	}


	/****************************************** 自定义 start ******************************************/

	public SysConfig findByCode(String code) {
		return dubboSysConfigService.findByCode(code);
	}

	/****************************************** 自定义   end ******************************************/
}
