コード例 #1
0
  @Get
  public Representation searchPartners() {

    JSONArray response = new JSONArray();

    try {
      int adminId = this.validateAuthentication();
      PartnerSearchRepresentation p_sr = new PartnerSearchRepresentation();
      this.loadRepresentation(p_sr);
      DebugLog.b_d(
          this.moduleId,
          this.apiId,
          this.reqId_get,
          adminId,
          this.getUserAgent(),
          p_sr.toJSON().toString());

      ArrayList<Partner> searchResult = PartnerDaoService.searchPartner(p_sr);
      response = JSONGenerator.toJSON(searchResult);

    } catch (PseudoException e) {
      this.addCORSHeader();
      return this.doPseudoException(e);
    } catch (Exception e) {
      return this.doException(e);
    }

    Representation result = new JsonRepresentation(response);
    this.addCORSHeader();
    return result;
  }