private void getInfor(int current_page, String description) {
    HashMap<String, String> params = new HashMap<String, String>();
    params.put("token", SysCache.getUser().getToken());
    params.put("page", String.valueOf(current_page));

    RequestInformation information = RequestInformation.GET_ACCOUNT_LIST;
    getDataFromServer(
        new XtomNetTask(information.getTaskID(), information.getUrlPath(), params, description) {

          @Override
          public Object parse(JSONObject jsonObject) throws DataParseException {
            return new MResult<AccountListInfor>(jsonObject) {
              @Override
              public AccountListInfor parse(JSONObject jsonObject) throws DataParseException {
                return new AccountListInfor(jsonObject);
              }
            };
          }
        });
  }
  // 获取项目账户的详情
  private void getDetailInfor() {
    HashMap<String, String> params = new HashMap<String, String>();
    params.put("token", SysCache.getUser().getToken());
    params.put("pid", pid);

    RequestInformation information = RequestInformation.GET_ACCOUNT_DETAIL;
    getDataFromServer(
        new XtomNetTask(information.getTaskID(), information.getUrlPath(), params) {

          @Override
          public Object parse(JSONObject jsonObject) throws DataParseException {
            return new MResult<AccountDetailInfor>(jsonObject) {

              @Override
              public AccountDetailInfor parse(JSONObject jsonObject) throws DataParseException {
                return new AccountDetailInfor(jsonObject);
              }
            };
          }
        });
  }
Exemplo n.º 3
0
  private void save() {
    String suggestion = editText.getText().toString();
    String value = suggestion.replace(" ", "");
    if (isNull(value)) {
      XtomToastUtil.showShortToast(mContext, "反馈意见不能为空,请重新填写");
      return;
    }

    HashMap<String, String> params = new HashMap<String, String>();
    params.put("token", SysCache.getUser().getToken());
    params.put("nickname", SysCache.getUser().getNickname());
    params.put("content", suggestion);

    RequestInformation infor = RequestInformation.ADD_SUGGESTION;
    getDataFromServer(
        new XtomNetTask(infor.getTaskID(), infor.getUrlPath(), params) {

          @Override
          public Object parse(JSONObject jsonObject) throws DataParseException {
            return new BaseResult(jsonObject);
          }
        });
  }