mirror of
https://github.com/didi/KnowStreaming.git
synced 2025-12-24 11:52:08 +08:00
版本列表增加排序
This commit is contained in:
@@ -73,5 +73,5 @@ public interface ClusterPhyService {
|
|||||||
* 获取系统已存在的kafka版本列表
|
* 获取系统已存在的kafka版本列表
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Set<String> getClusterVersionSet();
|
List<String> getClusterVersionList();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,8 +24,9 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.dao.DuplicateKeyException;
|
import org.springframework.dao.DuplicateKeyException;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -205,9 +206,12 @@ public class ClusterPhyServiceImpl implements ClusterPhyService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Set<String> getClusterVersionSet() {
|
public List<String> getClusterVersionList() {
|
||||||
List<ClusterPhy> clusterPhyList = listAllClusters();
|
List<ClusterPhy> clusterPhyList = this.listAllClusters();
|
||||||
Set<String> versionSet = clusterPhyList.stream().map(elem -> elem.getKafkaVersion()).collect(Collectors.toSet());
|
|
||||||
return versionSet;
|
List<String> versionList = new ArrayList<>(clusterPhyList.stream().map(elem -> elem.getKafkaVersion()).collect(Collectors.toSet()));
|
||||||
|
Collections.sort(versionList);
|
||||||
|
|
||||||
|
return versionList;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -49,7 +49,7 @@ public class MultiClusterPhyController {
|
|||||||
|
|
||||||
@ApiOperation(value = "多物理集群-已存在kafka版本", notes = "")
|
@ApiOperation(value = "多物理集群-已存在kafka版本", notes = "")
|
||||||
@GetMapping(value = "physical-clusters/exist-version")
|
@GetMapping(value = "physical-clusters/exist-version")
|
||||||
public Result<Set<String>> getClusterPhysVersion() {
|
public Result<List<String>> getClusterPhysVersion() {
|
||||||
return Result.buildSuc(clusterPhyService.getClusterVersionSet());
|
return Result.buildSuc(clusterPhyService.getClusterVersionList());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user