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

import com.xunhong.erp.turbo.api.biz.api.CostServiceI;
import com.xunhong.erp.turbo.api.biz.dto.cmd.CostCreateCmd;
import com.xunhong.erp.turbo.api.biz.dto.cmd.CostDestroyCmd;
import com.xunhong.erp.turbo.api.biz.dto.cmd.CostDragCmd;
import com.xunhong.erp.turbo.api.biz.dto.cmd.CostUpdateCmd;
import com.xunhong.erp.turbo.api.biz.dto.qry.CostListQry;
import com.xunhong.erp.turbo.api.biz.dto.qry.CostPageQry;
import com.xunhong.erp.turbo.api.biz.dto.qry.CostShowQry;
import com.xunhong.erp.turbo.api.biz.dto.vo.CostVO;
import com.xunhong.erp.turbo.base.dto.PageDTO;
import com.xunhong.erp.turbo.biz.app.executor.cmd.CostCreateCmdExe;
import com.xunhong.erp.turbo.biz.app.executor.cmd.CostDestroyCmdExe;
import com.xunhong.erp.turbo.biz.app.executor.cmd.CostUpdateCmdExe;
import com.xunhong.erp.turbo.biz.app.executor.query.CostDragCmdExe;
import com.xunhong.erp.turbo.biz.app.executor.query.CostListQryExe;
import com.xunhong.erp.turbo.biz.app.executor.query.CostPageQryExe;
import com.xunhong.erp.turbo.biz.app.executor.query.CostShowQryExe;
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 = CostServiceI.class, version = "1.0.0")
@RequiredArgsConstructor
public class CostServiceImpl implements CostServiceI {

    private final CostCreateCmdExe costCreateCmdExe;
    private final CostUpdateCmdExe costUpdateCmdExe;
    private final CostPageQryExe costPageQryExe;
    private final CostListQryExe costListQryExe;
    private final CostShowQryExe costShowQryExe;
    private final CostDestroyCmdExe costDestroyCmdExe;
	private final CostDragCmdExe costDragCmdExe;

    @Override
    public CostVO create(CostCreateCmd costCreateCmd) {
        return costCreateCmdExe.execute(costCreateCmd);
    }

    @Override
    public PageDTO<CostVO> page(CostPageQry costPageQry) {
        return PageDTO.of(costPageQryExe.execute(costPageQry));
    }

    @Override
    public List<CostVO> list(CostListQry costListQry) {
        return costListQryExe.execute(costListQry);
    }

    @Override
    public CostVO update(CostUpdateCmd costUpdateCmd) {
        return costUpdateCmdExe.execute(costUpdateCmd);
    }

    @Override
    public CostVO show(CostShowQry costShowQry) {
        return costShowQryExe.execute(costShowQry);
    }

    @Override
    public void destroy(CostDestroyCmd costDestroyCmd) {
        costDestroyCmdExe.execute(costDestroyCmd);
    }

	@Override
	public void drag(CostDragCmd costDragCmd) {
		costDragCmdExe.execute(costDragCmd);
	}
}

