Пример #1
0
 private static RequestResult testSearchFreight() {
   NetSearchFreight net =
       new NetSearchFreight() {
         @Override
         protected boolean onSetRequest(Builder req) {
           req.setLimitCount(10);
           req.setLogisticId(Integer.parseInt(UserDao.getInstance().getUser().getId()));
           return true;
         }
       };
   RequestResult result = new RequestResult();
   try {
     FreightResp.Builder resp = net.request();
     if (net.isSuccess(resp)) {
       result.success = true;
       result.log = "成功返回";
     } else {
       if (resp == null) {
         result.log = "resp == null";
       } else {
         result.log = "resp.desc:" + resp.getDesc();
       }
     }
   } catch (NetGetException e) {
     e.printStackTrace();
     result.log = "NetGetException:" + e.getMessage();
   }
   return result;
 }
Пример #2
0
  private static RequestResult addUserRequest(int requestCount, int index, int requestIndex) {
    Resp resultResp = null;
    String accountString2 = "";
    RequestResult result = new RequestResult();

    ApiExecutor api = new ApiExecutor();
    try {
      // User user=UserDao.getInstance().getUser();
      accountString2 =
          "1480000" + String.valueOf(addnum + (index - 1) * requestCount + requestIndex - 1);
      resultResp = null;
      //            resultResp = api.createAccountAndLogisticByPlatformManager(accountString2, 6,
      // "物流园",
      //            		"物流园添加", 3201, "南京", "13659230269",
      //            		SpUtils.getString(SpUtils.KEYS_SYS.STRING_CURR_USER_PWD_ENCODED, null),
      // "111111"
      //            		, Properties.OPERATION_TYPE_CREATE_ACCOUNT_AND_LOGISTIC_BY_PLATFORM_MANAGER,
      //            		Properties.APP_CLIENT_BIG_TYPE_PHONE, "123456");
      // addnum++;
    } catch (Exception e) {
      e.printStackTrace();
      result.log = accountString2 + "NetGetException:" + e.getMessage();
    }

    if (resultResp == null) {
      result.log = accountString2 + "resp == null";
    } else {
      if (resultResp.getResult() == Resp.SUCC) {
        result.success = true;
        result.log = accountString2 + "成功返回";
      } else result.log = accountString2 + "resp.desc:" + resultResp.getDesc();
    }
    return result;
  }