コード例 #1
0
  protected String buildSuccessResponse(String message) {
    String response = null;

    RedirectAuthResponse redirectAuthResponse = new RedirectAuthResponse();
    ResponseHeader responseHeader = new ResponseHeader();
    responseHeader.setCode(HttpStatus.OK.toString());
    responseHeader.setStatus(HttpServletResponse.SC_OK);
    responseHeader.setMessage(message);
    redirectAuthResponse.setHeader(responseHeader);

    Gson gson = new GsonFactory().createGson();
    response = gson.toJson(redirectAuthResponse);

    return response;
  }
コード例 #2
0
  protected String buildErrorResponse(String message) {
    String response = null;

    RedirectAuthResponse redirectAuthResponse = new RedirectAuthResponse();
    ResponseHeader responseHeader = new ResponseHeader();
    responseHeader.setCode(HttpStatus.METHOD_FAILURE.toString());
    responseHeader.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
    responseHeader.setMessage(message);
    redirectAuthResponse.setHeader(responseHeader);

    Gson gson = new GsonFactory().createGson();

    response = gson.toJson(redirectAuthResponse);
    return response;
  }