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


import com.xunhong.erp.turbo.api.infra.dto.qry.MaterialShowQry;
import com.xunhong.erp.turbo.api.infra.dto.vo.MaterialVO;
import com.xunhong.erp.turbo.infra.app.assembler.MaterialAssembler;
import com.xunhong.erp.turbo.infra.domain.entity.Material;
import com.xunhong.erp.turbo.infra.domain.gateway.MaterialGateway;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Slf4j
@Component
@RequiredArgsConstructor
public class MaterialShowQryExe {
	private final MaterialGateway materialGateway;
	private final MaterialAssembler materialAssembler;

	public MaterialVO execute(MaterialShowQry materialShowQry) {
		Material material = materialGateway.show(materialShowQry);
		return materialAssembler.toMaterialVO(material);
	}
}
