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

import com.xunhong.erp.turbo.api.biz.dto.qry.AuditShowQry;
import com.xunhong.erp.turbo.api.biz.dto.vo.AuditVO;
import com.xunhong.erp.turbo.biz.app.assembler.AuditAssembler;
import com.xunhong.erp.turbo.biz.domain.entity.Audit;
import com.xunhong.erp.turbo.biz.domain.gateway.AuditGateway;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

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

    private final AuditAssembler auditAssembler;
    private final AuditGateway auditGateway;

    public AuditVO execute(AuditShowQry auditShowQry) {
        Audit audit = auditGateway.show(auditShowQry);

        return auditAssembler.toAuditVO(audit);
    }
}

