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

import com.xunhong.erp.turbo.api.biz.api.GiftBoxServiceI;
import com.xunhong.erp.turbo.api.biz.dto.cmd.GiftBoxCreateCmd;
import com.xunhong.erp.turbo.api.biz.dto.cmd.GiftBoxDestroyCmd;
import com.xunhong.erp.turbo.api.biz.dto.cmd.GiftBoxUpdateCmd;
import com.xunhong.erp.turbo.api.biz.dto.qry.GiftBoxListQry;
import com.xunhong.erp.turbo.api.biz.dto.qry.GiftBoxPageQry;
import com.xunhong.erp.turbo.api.biz.dto.qry.GiftBoxShowQry;
import com.xunhong.erp.turbo.api.biz.dto.vo.GiftBoxVO;
import com.xunhong.erp.turbo.base.dto.PageDTO;
import com.xunhong.erp.turbo.biz.app.executor.cmd.GiftBoxCreateCmdExe;
import com.xunhong.erp.turbo.biz.app.executor.cmd.GiftBoxDestroyCmdExe;
import com.xunhong.erp.turbo.biz.app.executor.cmd.GiftBoxUpdateCmdExe;
import com.xunhong.erp.turbo.biz.app.executor.query.GiftBoxListQryExe;
import com.xunhong.erp.turbo.biz.app.executor.query.GiftBoxPageQryExe;
import com.xunhong.erp.turbo.biz.app.executor.query.GiftBoxShowQryExe;
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 = GiftBoxServiceI.class, version = "1.0.0")
@RequiredArgsConstructor
public class GiftBoxServiceImpl implements GiftBoxServiceI {

	private final GiftBoxCreateCmdExe giftBoxCreateCmdExe;
	private final GiftBoxUpdateCmdExe giftBoxUpdateCmdExe;
	private final GiftBoxPageQryExe giftBoxPageQryExe;
	private final GiftBoxListQryExe giftBoxListQryExe;
	private final GiftBoxShowQryExe giftBoxShowQryExe;
	private final GiftBoxDestroyCmdExe giftBoxDestroyCmdExe;

	@Override
	public GiftBoxVO create(GiftBoxCreateCmd giftBoxCreateCmd) {
		return giftBoxCreateCmdExe.execute(giftBoxCreateCmd);
	}

	@Override
	public PageDTO<GiftBoxVO> page(GiftBoxPageQry giftBoxPageQry) {
		return PageDTO.of(giftBoxPageQryExe.execute(giftBoxPageQry));
	}

	@Override
	public List<GiftBoxVO> list(GiftBoxListQry giftBoxListQry) {
		return giftBoxListQryExe.execute(giftBoxListQry);
	}

	@Override
	public GiftBoxVO update(GiftBoxUpdateCmd giftBoxUpdateCmd) {
		return giftBoxUpdateCmdExe.execute(giftBoxUpdateCmd);
	}

	@Override
	public GiftBoxVO show(GiftBoxShowQry giftBoxShowQry) {
		return giftBoxShowQryExe.execute(giftBoxShowQry);
	}

	@Override
	public void destroy(GiftBoxDestroyCmd giftBoxDestroyCmd) {
		giftBoxDestroyCmdExe.execute(giftBoxDestroyCmd);
	}
}

