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

import com.red.circle.console.app.convertor.RoleAppConvertor;
import com.red.circle.console.app.dto.cmd.admin.RoleCmd;
import com.red.circle.console.infra.database.rds.service.admin.RoleService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

/**
 * 修改角色.
 *
 * @author pengliang on 2023/5/12
 */
@Component
@RequiredArgsConstructor
public class RoleUpdateCmdExe {

  private final RoleService roleService;
  private final RoleAppConvertor roleAppConvertor;

  public void execute(RoleCmd cmd) {
    roleService.updateSelectiveById(roleAppConvertor.toRole(cmd));
  }

}
