package com.red.circle.console.app.command.admin;

import com.red.circle.console.app.dto.cmd.admin.MenuStatusCmd;
import com.red.circle.console.infra.database.rds.enums.StatusEnum;
import com.red.circle.console.infra.database.rds.service.admin.MenuService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

/**
 * 修改菜单状态.
 *
 * @author pengliang on 2023/5/12
 */
@Component
@RequiredArgsConstructor
public class MenuStatusUpdateCmdExe {

  private final MenuService menuService;

  public void execute(MenuStatusCmd cmd) {
    menuService.updateStatus(cmd.getId(), StatusEnum.toEnum(cmd.getStatus()));
  }

}
