Exemplo n.º 1
0
 @Override
 public PagedList<ResourceTypeVO> listResourceTypes(TypeListRequestVO typeRequest) {
   PagedList<ResourceTypeVO> pagedList = null;
   BaseRequest baseRequest = BaseRequestUtils.createBaseRequest();
   if (typeRequest != null) {
     log.debug(JsonHelper.toJson(typeRequest));
     baseRequest.setPayload(JsonHelper.toJson(typeRequest));
     String response =
         httpService.executeBaseRequest(EServiceType.TypeList, JsonHelper.toJson(typeRequest));
     if (response != null) {
       TypeToken<PagedList<ResourceTypeVO>> typetoken =
           new TypeToken<PagedList<ResourceTypeVO>>() {};
       try {
         pagedList = JsonHelper.fromJson(response, typetoken);
       } catch (Exception e) {
         log.error("Exception when executeFromJson", e);
       }
     }
   }
   return pagedList;
 }
Exemplo n.º 2
0
 @Override
 public String updateResourceType(TypeUpdateRequestVO updateRequest) {
   String payload = null;
   BaseResponse response = null;
   BaseRequest baseRequest = BaseRequestUtils.createBaseRequest();
   if (updateRequest != null) {
     log.debug(JsonHelper.toJson(updateRequest));
     baseRequest.setPayload(JsonHelper.toJson(updateRequest));
     String responseStr =
         httpService.executeBaseRequest(EServiceType.TypeUpdate, JsonHelper.toJson(updateRequest));
     if (responseStr != null) {
       try {
         response = JsonHelper.fromJson(responseStr, BaseResponse.class);
       } catch (Exception e) {
         log.error("Exception when executeFromJson", e);
       }
       if (response != null) {
         payload = response.getResDesc();
       }
     }
   }
   return payload;
 }