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.OrderShipPageQry;
import com.xunhong.erp.turbo.api.biz.dto.vo.OrderShipVO;
import com.xunhong.erp.turbo.biz.app.assembler.OrderShipAssembler;
import com.xunhong.erp.turbo.biz.domain.entity.OrderShip;
import com.xunhong.erp.turbo.biz.domain.gateway.OrderShipGateway;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

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

	private final OrderShipGateway orderShipGateway;
	private final OrderShipAssembler orderShipAssembler;

	public IPage<OrderShipVO> execute(OrderShipPageQry orderShipPageQry) {
		IPage<OrderShip> page = orderShipGateway.page(orderShipPageQry);
		return page.convert(orderShipAssembler::toOrderShipVO);
	}
}

