mirror of
https://github.com/ctripcorp/zeus.git
synced 2024-11-10 09:02:49 +08:00
fulfill vs if exists
# Conflicts: # src/main/java/com/ctrip/zeus/restful/resource/ArchiveResource.java
This commit is contained in:
parent
653c007e63
commit
265e3f0c1e
1 changed files with 7 additions and 0 deletions
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue