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

import com.xunhong.erp.turbo.api.rbac.dto.qry.MenuShowQry;
import com.xunhong.erp.turbo.api.rbac.dto.vo.MenuVO;
import com.xunhong.erp.turbo.rbac.app.assembler.MenuAssembler;
import com.xunhong.erp.turbo.rbac.domain.entity.Menu;
import com.xunhong.erp.turbo.rbac.domain.gateway.MenuGateway;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

/**
 * @author shenyifei
 */
@Component
@RequiredArgsConstructor
public class MenuShowQryExe {
	private final MenuGateway menuGateway;
	private final MenuAssembler menuAssembler;

	public MenuVO execute(MenuShowQry menuShowQry) {
		Menu menu = menuGateway.show(menuShowQry);
		return menuAssembler.toMenuVO(menu);
	}
}
