package com.xunhong.erp.turbo.biz.app.executor.query;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.xunhong.erp.turbo.api.biz.dto.qry.ShipOrderPageQry;
import com.xunhong.erp.turbo.api.biz.dto.vo.ShipOrderVO;
import com.xunhong.erp.turbo.biz.app.assembler.ShipOrderAssembler;
import com.xunhong.erp.turbo.biz.domain.entity.ShipOrder;
import com.xunhong.erp.turbo.biz.domain.gateway.ShipOrderGateway;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @author shenyifei
 */
@Slf4j
@Component
@RequiredArgsConstructor
public class ShipOrderPageQryExe {

	private final ShipOrderGateway shipOrderGateway;
	private final ShipOrderAssembler shipOrderAssembler;

	public IPage<ShipOrderVO> execute(ShipOrderPageQry shipOrderPageQry) {
		IPage<ShipOrder> page = shipOrderGateway.page(shipOrderPageQry);
		return page.convert(shipOrderAssembler::toShipOrderVO);
	}
}

