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

import com.xunhong.erp.turbo.api.biz.api.BoxProductServiceI;
import com.xunhong.erp.turbo.api.biz.dto.cmd.BoxProductCreateCmd;
import com.xunhong.erp.turbo.api.biz.dto.cmd.BoxProductDestroyCmd;
import com.xunhong.erp.turbo.api.biz.dto.cmd.BoxProductDragCmd;
import com.xunhong.erp.turbo.api.biz.dto.cmd.BoxProductUpdateCmd;
import com.xunhong.erp.turbo.api.biz.dto.qry.BoxProductListQry;
import com.xunhong.erp.turbo.api.biz.dto.qry.BoxProductPageQry;
import com.xunhong.erp.turbo.api.biz.dto.qry.BoxProductShowQry;
import com.xunhong.erp.turbo.api.biz.dto.vo.BoxProductVO;
import com.xunhong.erp.turbo.base.dto.PageDTO;
import com.xunhong.erp.turbo.biz.app.executor.cmd.BoxProductCreateCmdExe;
import com.xunhong.erp.turbo.biz.app.executor.cmd.BoxProductDestroyCmdExe;
import com.xunhong.erp.turbo.biz.app.executor.cmd.BoxProductUpdateCmdExe;
import com.xunhong.erp.turbo.biz.app.executor.query.BoxProductDragCmdExe;
import com.xunhong.erp.turbo.biz.app.executor.query.BoxProductListQryExe;
import com.xunhong.erp.turbo.biz.app.executor.query.BoxProductPageQryExe;
import com.xunhong.erp.turbo.biz.app.executor.query.BoxProductShowQryExe;
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 = BoxProductServiceI.class, version = "1.0.0")
@RequiredArgsConstructor
public class BoxProductServiceImpl implements BoxProductServiceI {

	private final BoxProductCreateCmdExe boxProductCreateCmdExe;
	private final BoxProductUpdateCmdExe boxProductUpdateCmdExe;
	private final BoxProductShowQryExe boxProductShowQryExe;
	private final BoxProductDestroyCmdExe boxProductDestroyCmdExe;
	private final BoxProductPageQryExe boxProductPageQryExe;
	private final BoxProductListQryExe boxProductListQryExe;
	private final BoxProductDragCmdExe boxProductDragCmdExe;

	@Override
	public BoxProductVO create(BoxProductCreateCmd boxProductCreateCmd) {
		return boxProductCreateCmdExe.execute(boxProductCreateCmd);
	}

	@Override
	public PageDTO<BoxProductVO> page(BoxProductPageQry boxProductPageQry) {
		return PageDTO.of(boxProductPageQryExe.execute(boxProductPageQry));
	}

	@Override
	public List<BoxProductVO> list(BoxProductListQry boxProductListQry) {
		return boxProductListQryExe.execute(boxProductListQry);
	}

	@Override
	public BoxProductVO update(BoxProductUpdateCmd boxProductUpdateCmd) {
		return boxProductUpdateCmdExe.execute(boxProductUpdateCmd);
	}

	@Override
	public BoxProductVO show(BoxProductShowQry boxProductShowQry) {
		return boxProductShowQryExe.execute(boxProductShowQry);
	}

	@Override
	public void destroy(BoxProductDestroyCmd boxProductDestroyCmd) {
		boxProductDestroyCmdExe.execute(boxProductDestroyCmd);
	}

	@Override
	public void drag(BoxProductDragCmd boxProductDragCmd) {
		boxProductDragCmdExe.execute(boxProductDragCmd);
	}
}