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

import com.xunhong.erp.turbo.api.user.dto.qry.EmployeeShowQry;
import com.xunhong.erp.turbo.api.user.dto.vo.EmployeeVO;
import com.xunhong.erp.turbo.user.app.assembler.EmployeeAssembler;
import com.xunhong.erp.turbo.user.domain.entity.Employee;
import com.xunhong.erp.turbo.user.domain.gateway.EmployeeGateway;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

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

	private final EmployeeAssembler employeeAssembler;
	private final EmployeeGateway employeeGateway;

	public EmployeeVO execute(EmployeeShowQry employeeShowQry) {
		Employee employee = employeeGateway.show(employeeShowQry);

		return employeeAssembler.toEmployeeVO(employee);
	}
}
