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

import com.xunhong.erp.turbo.api.biz.api.OrderCostServiceI;
import com.xunhong.erp.turbo.api.biz.dto.cmd.OrderCostCreateCmd;
import com.xunhong.erp.turbo.api.biz.dto.qry.OrderCostPageQry;
import com.xunhong.erp.turbo.api.biz.dto.vo.OrderCostVO;
import com.xunhong.erp.turbo.base.dto.PageDTO;
import com.xunhong.erp.turbo.biz.app.executor.cmd.OrderCostCreateCmdExe;
import com.xunhong.erp.turbo.biz.app.executor.query.OrderCostPageQryExe;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Service;

/**
 * @author shenyifei
 */
@Slf4j
@Service
@DubboService(interfaceClass = OrderCostServiceI.class, version = "1.0.0")
@RequiredArgsConstructor
public class OrderCostServiceImpl implements OrderCostServiceI {

	private final OrderCostPageQryExe orderCostPageQryExe;
	private final OrderCostCreateCmdExe orderCostCreateCmdExe;

	@Override
	public PageDTO<OrderCostVO> page(OrderCostPageQry orderCostPageQry) {
		return PageDTO.of(orderCostPageQryExe.execute(orderCostPageQry));
	}

	@Override
	public OrderCostVO create(OrderCostCreateCmd orderCostCreateCmd) {
		return orderCostCreateCmdExe.execute(orderCostCreateCmd);
	}
}

