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

import com.xunhong.erp.turbo.api.biz.api.BoxSpecServiceI;
import com.xunhong.erp.turbo.api.biz.dto.cmd.BoxSpecCreateCmd;
import com.xunhong.erp.turbo.api.biz.dto.cmd.BoxSpecDestroyCmd;
import com.xunhong.erp.turbo.api.biz.dto.cmd.BoxSpecUpdateCmd;
import com.xunhong.erp.turbo.api.biz.dto.qry.BoxSpecListQry;
import com.xunhong.erp.turbo.api.biz.dto.qry.BoxSpecPageQry;
import com.xunhong.erp.turbo.api.biz.dto.qry.BoxSpecShowQry;
import com.xunhong.erp.turbo.api.biz.dto.vo.BoxSpecVO;
import com.xunhong.erp.turbo.base.dto.PageDTO;
import com.xunhong.erp.turbo.biz.app.executor.cmd.BoxSpecCreateCmdExe;
import com.xunhong.erp.turbo.biz.app.executor.cmd.BoxSpecDestroyCmdExe;
import com.xunhong.erp.turbo.biz.app.executor.cmd.BoxSpecUpdateCmdExe;
import com.xunhong.erp.turbo.biz.app.executor.query.BoxSpecListQryExe;
import com.xunhong.erp.turbo.biz.app.executor.query.BoxSpecPageQryExe;
import com.xunhong.erp.turbo.biz.app.executor.query.BoxSpecShowQryExe;
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 = BoxSpecServiceI.class, version = "1.0.0")
@RequiredArgsConstructor
public class BoxSpecServiceImpl implements BoxSpecServiceI {

    private final BoxSpecCreateCmdExe boxSpecCreateCmdExe;
    private final BoxSpecUpdateCmdExe boxSpecUpdateCmdExe;
    private final BoxSpecPageQryExe boxSpecPageQryExe;
    private final BoxSpecListQryExe boxSpecListQryExe;
    private final BoxSpecShowQryExe boxSpecShowQryExe;
    private final BoxSpecDestroyCmdExe boxSpecDestroyCmdExe;

    @Override
    public BoxSpecVO create(BoxSpecCreateCmd boxSpecCreateCmd) {
        return boxSpecCreateCmdExe.execute(boxSpecCreateCmd);
    }

    @Override
    public PageDTO<BoxSpecVO> page(BoxSpecPageQry boxSpecPageQry) {
        return PageDTO.of(boxSpecPageQryExe.execute(boxSpecPageQry));
    }

    @Override
    public List<BoxSpecVO> list(BoxSpecListQry boxSpecListQry) {
        return boxSpecListQryExe.execute(boxSpecListQry);
    }

    @Override
    public BoxSpecVO update(BoxSpecUpdateCmd boxSpecUpdateCmd) {
        return boxSpecUpdateCmdExe.execute(boxSpecUpdateCmd);
    }

    @Override
    public BoxSpecVO show(BoxSpecShowQry boxSpecShowQry) {
        return boxSpecShowQryExe.execute(boxSpecShowQry);
    }

    @Override
    public void destroy(BoxSpecDestroyCmd boxSpecDestroyCmd) {
        boxSpecDestroyCmdExe.execute(boxSpecDestroyCmd);
    }
}

