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

import com.xunhong.erp.turbo.api.biz.dto.qry.CompanyShowQry;
import com.xunhong.erp.turbo.api.biz.dto.vo.CompanyVO;
import com.xunhong.erp.turbo.biz.app.assembler.CompanyAssembler;
import com.xunhong.erp.turbo.biz.domain.entity.Company;
import com.xunhong.erp.turbo.biz.domain.gateway.CompanyGateway;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

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

	private final CompanyAssembler companyAssembler;
	private final CompanyGateway companyGateway;

	public CompanyVO execute(CompanyShowQry companyShowQry) {
		Company company = companyGateway.show(companyShowQry);

		return companyAssembler.toCompanyVO(company);
	}
}

