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

import com.xunhong.erp.turbo.api.rbac.dto.cmd.PermissionUpdateCmd;
import com.xunhong.erp.turbo.api.rbac.dto.vo.PermissionVO;
import com.xunhong.erp.turbo.rbac.app.assembler.PermissionAssembler;
import com.xunhong.erp.turbo.rbac.domain.gateway.PermissionGateway;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

@Component
@RequiredArgsConstructor
public class PermissionUpdateCmdExe {
	private final PermissionGateway permissionGateway;
	private final PermissionAssembler permissionAssembler;

	public PermissionVO execute(PermissionUpdateCmd permissionUpdateCmd) {
		return permissionAssembler.toPermissionVO(permissionGateway.update(permissionUpdateCmd));
	}
}
