fulfill vs if exists

# Conflicts:
#	src/main/java/com/ctrip/zeus/restful/resource/ArchiveResource.java
This commit is contained in:
Mengyi Zhou 2016-11-08 11:48:17 +08:00
parent 653c007e63
commit 265e3f0c1e

View file

@ -3,6 +3,7 @@ package com.ctrip.zeus.restful.resource;
import com.ctrip.zeus.auth.Authorize;
import com.ctrip.zeus.exceptions.ValidationException;
import com.ctrip.zeus.model.entity.Group;
import com.ctrip.zeus.model.entity.GroupVirtualServer;
import com.ctrip.zeus.model.entity.Slb;
import com.ctrip.zeus.model.entity.VirtualServer;
import com.ctrip.zeus.restful.message.ResponseHandler;
@ -54,6 +55,12 @@ public class ArchiveResource {
if (archive == null) {
return responseHandler.handle("Group archive of id " + groupId + " cannot be found.", hh.getMediaType());
} else {
for (GroupVirtualServer e : archive.getGroupVirtualServers()) {
VirtualServer v = archiveRepository.getVsArchive(e.getVirtualServer().getId(), e.getVirtualServer().getVersion());
if (v != null) {
e.setVirtualServer(v);
}
}
return responseHandler.handle(new ExtendedView.ExtendedGroup(archive), hh.getMediaType());
}
}