Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 
 

25 linhas
614 B

  1. package net.phalapi.sdk;
  2. import org.json.JSONObject;
  3. /**
  4. * JSON解析
  5. */
  6. public class PhalApiClientParserJson implements PhalApiClientParser {
  7. public PhalApiClientResponse parse(String apiResult) {
  8. if (apiResult == null) {
  9. return new PhalApiClientResponse(408, "", "Request Timeout");
  10. }
  11. try {
  12. JSONObject jsonObj = new JSONObject(apiResult);
  13. return new PhalApiClientResponse(
  14. jsonObj.getInt("ret"), jsonObj.getString("data"), jsonObj.getString("msg"));
  15. } catch (Exception ex) {
  16. return new PhalApiClientResponse(500, "", "Internal Server Error Or " + ex.getMessage());
  17. }
  18. }
  19. }