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

import com.xunhong.erp.turbo.api.biz.api.CostItemServiceI;
import com.xunhong.erp.turbo.api.biz.dto.cmd.CostItemCreateCmd;
import com.xunhong.erp.turbo.api.biz.dto.cmd.CostItemDestroyCmd;
import com.xunhong.erp.turbo.api.biz.dto.cmd.CostItemDragCmd;
import com.xunhong.erp.turbo.api.biz.dto.cmd.CostItemUpdateCmd;
import com.xunhong.erp.turbo.api.biz.dto.qry.CostItemListQry;
import com.xunhong.erp.turbo.api.biz.dto.qry.CostItemPageQry;
import com.xunhong.erp.turbo.api.biz.dto.qry.CostItemShowQry;
import com.xunhong.erp.turbo.api.biz.dto.vo.CostItemVO;
import com.xunhong.erp.turbo.base.dto.PageDTO;
import com.xunhong.erp.turbo.biz.app.executor.cmd.CostItemCreateCmdExe;
import com.xunhong.erp.turbo.biz.app.executor.cmd.CostItemDestroyCmdExe;
import com.xunhong.erp.turbo.biz.app.executor.cmd.CostItemUpdateCmdExe;
import com.xunhong.erp.turbo.biz.app.executor.query.CostItemDragCmdExe;
import com.xunhong.erp.turbo.biz.app.executor.query.CostItemListQryExe;
import com.xunhong.erp.turbo.biz.app.executor.query.CostItemPageQryExe;
import com.xunhong.erp.turbo.biz.app.executor.query.CostItemShowQryExe;
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 = CostItemServiceI.class, version = "1.0.0")
@RequiredArgsConstructor
public class CostItemServiceImpl implements CostItemServiceI {

	private final CostItemCreateCmdExe costItemCreateCmdExe;
	private final CostItemUpdateCmdExe costItemUpdateCmdExe;
	private final CostItemPageQryExe costItemPageQryExe;
	private final CostItemListQryExe costItemListQryExe;
	private final CostItemShowQryExe costItemShowQryExe;
	private final CostItemDestroyCmdExe costItemDestroyCmdExe;
	private final CostItemDragCmdExe costItemDragCmdExe;

	@Override
	public CostItemVO create(CostItemCreateCmd costItemCreateCmd) {
		return costItemCreateCmdExe.execute(costItemCreateCmd);
	}

	@Override
	public PageDTO<CostItemVO> page(CostItemPageQry costItemPageQry) {
		return PageDTO.of(costItemPageQryExe.execute(costItemPageQry));
	}

	@Override
	public List<CostItemVO> list(CostItemListQry costItemListQry) {
		return costItemListQryExe.execute(costItemListQry);
	}

	@Override
	public CostItemVO update(CostItemUpdateCmd costItemUpdateCmd) {
		return costItemUpdateCmdExe.execute(costItemUpdateCmd);
	}

	@Override
	public CostItemVO show(CostItemShowQry costItemShowQry) {
		return costItemShowQryExe.execute(costItemShowQry);
	}

	@Override
	public void destroy(CostItemDestroyCmd costItemDestroyCmd) {
		costItemDestroyCmdExe.execute(costItemDestroyCmd);
	}

	@Override
	public void drag(CostItemDragCmd costItemDragCmd) {
		costItemDragCmdExe.execute(costItemDragCmd);
	}
}
