use of org.apache.dubbo.admin.model.dto.ServiceDTO in project incubator-dubbo-ops by apache.
the class ProviderServiceImpl method convertProviders2DTO.
/**
* Convert provider list to ServiceDTO list
*
* @param providers list of providers
* @return ServiceDTO list of front page
*/
public Set<ServiceDTO> convertProviders2DTO(List<Provider> providers) {
Set<ServiceDTO> result = new TreeSet<>();
for (Provider provider : providers) {
String app = provider.getApplication();
String service = provider.getService();
String group = Tool.getGroup(service);
String version = Tool.getVersion(service);
String interfaze = Tool.getInterface(service);
ServiceDTO s = new ServiceDTO();
s.setAppName(app);
s.setService(interfaze);
s.setGroup(group);
s.setVersion(version);
s.setRegistrySource(provider.getRegistrySource());
result.add(s);
}
return result;
}
Aggregations