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

import com.xunhong.erp.turbo.api.biz.api.BoxBrandServiceI;
import com.xunhong.erp.turbo.api.biz.dto.cmd.BoxBrandCreateCmd;
import com.xunhong.erp.turbo.api.biz.dto.cmd.BoxBrandDestroyCmd;
import com.xunhong.erp.turbo.api.biz.dto.cmd.BoxBrandDragCmd;
import com.xunhong.erp.turbo.api.biz.dto.cmd.BoxBrandUpdateCmd;
import com.xunhong.erp.turbo.api.biz.dto.qry.BoxBrandListQry;
import com.xunhong.erp.turbo.api.biz.dto.qry.BoxBrandPageQry;
import com.xunhong.erp.turbo.api.biz.dto.qry.BoxBrandShowQry;
import com.xunhong.erp.turbo.api.biz.dto.vo.BoxBrandVO;
import com.xunhong.erp.turbo.base.dto.PageDTO;
import com.xunhong.erp.turbo.biz.app.executor.cmd.BoxBrandCreateCmdExe;
import com.xunhong.erp.turbo.biz.app.executor.cmd.BoxBrandDestroyCmdExe;
import com.xunhong.erp.turbo.biz.app.executor.cmd.BoxBrandUpdateCmdExe;
import com.xunhong.erp.turbo.biz.app.executor.query.BoxBrandDragCmdExe;
import com.xunhong.erp.turbo.biz.app.executor.query.BoxBrandListQryExe;
import com.xunhong.erp.turbo.biz.app.executor.query.BoxBrandPageQryExe;
import com.xunhong.erp.turbo.biz.app.executor.query.BoxBrandShowQryExe;
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 = BoxBrandServiceI.class, version = "1.0.0")
@RequiredArgsConstructor
public class BoxBrandServiceImpl implements BoxBrandServiceI {

	private final BoxBrandCreateCmdExe boxBrandCreateCmdExe;
	private final BoxBrandUpdateCmdExe boxBrandUpdateCmdExe;
	private final BoxBrandShowQryExe boxBrandShowQryExe;
	private final BoxBrandDestroyCmdExe boxBrandDestroyCmdExe;
	private final BoxBrandPageQryExe boxBrandPageQryExe;
	private final BoxBrandListQryExe boxBrandListQryExe;
	private final BoxBrandDragCmdExe boxBrandDragCmdExe;

	@Override
	public BoxBrandVO create(BoxBrandCreateCmd boxBrandCreateCmd) {
		return boxBrandCreateCmdExe.execute(boxBrandCreateCmd);
	}

	@Override
	public PageDTO<BoxBrandVO> page(BoxBrandPageQry boxBrandPageQry) {
		return PageDTO.of(boxBrandPageQryExe.execute(boxBrandPageQry));
	}

	@Override
	public List<BoxBrandVO> list(BoxBrandListQry boxBrandListQry) {
		return boxBrandListQryExe.execute(boxBrandListQry);
	}

	@Override
	public BoxBrandVO update(BoxBrandUpdateCmd boxBrandUpdateCmd) {
		return boxBrandUpdateCmdExe.execute(boxBrandUpdateCmd);
	}

	@Override
	public BoxBrandVO show(BoxBrandShowQry boxBrandShowQry) {
		return boxBrandShowQryExe.execute(boxBrandShowQry);
	}

	@Override
	public void destroy(BoxBrandDestroyCmd boxBrandDestroyCmd) {
		boxBrandDestroyCmdExe.execute(boxBrandDestroyCmd);
	}

	@Override
	public void drag(BoxBrandDragCmd boxBrandDragCmd) {
		boxBrandDragCmdExe.execute(boxBrandDragCmd);
	}
}