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.BoxSpecPageQry;
import com.xunhong.erp.turbo.api.biz.dto.vo.BoxSpecVO;
import com.xunhong.erp.turbo.biz.app.assembler.BoxSpecAssembler;
import com.xunhong.erp.turbo.biz.domain.entity.BoxSpec;
import com.xunhong.erp.turbo.biz.domain.gateway.BoxSpecGateway;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

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

    private final BoxSpecGateway boxSpecGateway;
    private final BoxSpecAssembler boxSpecAssembler;

    public IPage<BoxSpecVO> execute(BoxSpecPageQry boxSpecPageQry) {
        IPage<BoxSpec> page = boxSpecGateway.page(boxSpecPageQry);
        return page.convert(boxSpecAssembler::toBoxSpecVO);
    }
}

