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

import com.xunhong.erp.turbo.api.user.dto.qry.UserShowQry;
import com.xunhong.erp.turbo.api.user.dto.vo.UserVO;
import com.xunhong.erp.turbo.user.app.assembler.UserAssembler;
import com.xunhong.erp.turbo.user.domain.entity.User;
import com.xunhong.erp.turbo.user.domain.gateway.UserGateway;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

/**
 * @author shenyifei
 */
@Component
@RequiredArgsConstructor
public class UserShowQryExe {

	private final UserGateway userGateway;
	private final UserAssembler userAssembler;

	public UserVO execute(UserShowQry userShowQry) {
		User user = userGateway.show(userShowQry);
		return userAssembler.toUserVO(user);
	}
}
