use of com.ds.retl.rest.vo.server.ServerInfoVO in project main by JohnPeng739.
the class ServerManageResource method deleteServerInfo.
@Path("server/{machineName}")
@DELETE
public DataVO<ServerInfoVO> deleteServerInfo(@QueryParam("userCode") String userCode, @PathParam("machineName") String machineName) {
sessionDataStore.setCurrentUserCode(userCode);
try {
JSONObject json = serverManageService.deleteServerInfo(machineName);
sessionDataStore.removeCurrentUserCode();
return new DataVO<>(new ServerInfoVO(json));
} catch (UserInterfaceErrorException ex) {
return new DataVO<>(ex);
}
}
use of com.ds.retl.rest.vo.server.ServerInfoVO in project main by JohnPeng739.
the class ServerManageResource method getServers.
@Path("servers")
@POST
public PaginationDataVO<List<ServerInfoVO>> getServers(Pagination pagination) {
if (pagination == null) {
pagination = new Pagination();
}
try {
Map<String, JSONObject> map = serverManageService.getServerInfos(pagination);
List<ServerInfoVO> list = new ArrayList<>();
map.values().forEach(json -> list.add(new ServerInfoVO(json)));
return new PaginationDataVO<>(pagination, list);
} catch (UserInterfaceErrorException ex) {
return new PaginationDataVO<>(ex);
}
}
use of com.ds.retl.rest.vo.server.ServerInfoVO in project main by JohnPeng739.
the class ServerManageResource method saveServerInfo.
@Path("server")
@POST
public DataVO<ServerInfoVO> saveServerInfo(@QueryParam("userCode") String userCode, String info) {
sessionDataStore.setCurrentUserCode(userCode);
try {
JSONObject json = serverManageService.saveServerInfo(info);
sessionDataStore.removeCurrentUserCode();
return new DataVO<>(new ServerInfoVO(json));
} catch (UserInterfaceErrorException ex) {
return new DataVO<>(ex);
}
}
Aggregations