package com.xunhong.erp.turbo.biz.app.service;

import com.xunhong.erp.turbo.api.biz.api.DealerWarehouseServiceI;
import com.xunhong.erp.turbo.api.biz.dto.cmd.DealerWarehouseCreateCmd;
import com.xunhong.erp.turbo.api.biz.dto.cmd.DealerWarehouseDestroyCmd;
import com.xunhong.erp.turbo.api.biz.dto.cmd.DealerWarehouseUpdateCmd;
import com.xunhong.erp.turbo.api.biz.dto.qry.DealerWarehouseListQry;
import com.xunhong.erp.turbo.api.biz.dto.qry.DealerWarehousePageQry;
import com.xunhong.erp.turbo.api.biz.dto.qry.DealerWarehouseShowQry;
import com.xunhong.erp.turbo.api.biz.dto.vo.DealerWarehouseVO;
import com.xunhong.erp.turbo.base.dto.PageDTO;
import com.xunhong.erp.turbo.biz.app.executor.cmd.DealerWarehouseCreateCmdExe;
import com.xunhong.erp.turbo.biz.app.executor.cmd.DealerWarehouseDestroyCmdExe;
import com.xunhong.erp.turbo.biz.app.executor.cmd.DealerWarehouseUpdateCmdExe;
import com.xunhong.erp.turbo.biz.app.executor.query.DealerWarehouseListQryExe;
import com.xunhong.erp.turbo.biz.app.executor.query.DealerWarehousePageQryExe;
import com.xunhong.erp.turbo.biz.app.executor.query.DealerWarehouseShowQryExe;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author shenyifei
 */
@Slf4j
@Service
@DubboService(interfaceClass = DealerWarehouseServiceI.class, version = "1.0.0")
@RequiredArgsConstructor
public class DealerWarehouseServiceImpl implements DealerWarehouseServiceI {

	private final DealerWarehouseCreateCmdExe dealerWarehouseCreateCmdExe;
	private final DealerWarehouseUpdateCmdExe dealerWarehouseUpdateCmdExe;
	private final DealerWarehousePageQryExe dealerWarehousePageQryExe;
	private final DealerWarehouseListQryExe dealerWarehouseListQryExe;
	private final DealerWarehouseShowQryExe dealerWarehouseShowQryExe;
	private final DealerWarehouseDestroyCmdExe dealerWarehouseDestroyCmdExe;

	@Override
	public DealerWarehouseVO create(DealerWarehouseCreateCmd dealerWarehouseCreateCmd) {
		return dealerWarehouseCreateCmdExe.execute(dealerWarehouseCreateCmd);
	}

	@Override
	public PageDTO<DealerWarehouseVO> page(DealerWarehousePageQry dealerWarehousePageQry) {
		return PageDTO.of(dealerWarehousePageQryExe.execute(dealerWarehousePageQry));
	}

	@Override
	public List<DealerWarehouseVO> list(DealerWarehouseListQry dealerWarehouseListQry) {
		return dealerWarehouseListQryExe.execute(dealerWarehouseListQry);
	}

	@Override
	public DealerWarehouseVO update(DealerWarehouseUpdateCmd dealerWarehouseUpdateCmd) {
		return dealerWarehouseUpdateCmdExe.execute(dealerWarehouseUpdateCmd);
	}

	@Override
	public DealerWarehouseVO show(DealerWarehouseShowQry dealerWarehouseShowQry) {
		return dealerWarehouseShowQryExe.execute(dealerWarehouseShowQry);
	}

	@Override
	public void destroy(DealerWarehouseDestroyCmd dealerWarehouseDestroyCmd) {
		dealerWarehouseDestroyCmdExe.execute(dealerWarehouseDestroyCmd);
	}
}

