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

import com.xunhong.erp.turbo.api.rbac.dto.qry.RoleShowQry;
import com.xunhong.erp.turbo.api.rbac.dto.vo.RoleVO;
import com.xunhong.erp.turbo.rbac.app.assembler.RoleAssembler;
import com.xunhong.erp.turbo.rbac.domain.entity.Role;
import com.xunhong.erp.turbo.rbac.domain.gateway.RoleGateway;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

@Component
@RequiredArgsConstructor
public class RoleShowQryExe {

	private final RoleGateway roleGateway;
	private final RoleAssembler roleAssembler;

	public RoleVO execute(RoleShowQry roleShowQry) {
		Role role = roleGateway.show(roleShowQry);
		return roleAssembler.toRoleVO(role);
	}
}
