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

import com.red.circle.console.app.convertor.SourceAppConvertor;
import com.red.circle.console.app.dto.clienobject.admin.ResourceCO;
import com.red.circle.console.infra.database.rds.service.admin.ResourceService;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

/**
 * 获取资源所有列表.
 *
 * @author pengliang on 2023/5/12
 */
@Component
@RequiredArgsConstructor
public class ResourceQryExe {

  private final ResourceService resourceService;
  private final SourceAppConvertor sourceAppConvertor;

  public List<ResourceCO> execute() {
    return sourceAppConvertor.toListResourceCO(resourceService.list());
  }

}
