示例#1
0
  public boolean unsubcribe(int id) throws WH_DMException, UnKnownException, IOException {

    HttpPost httPost =
        mHttpApi.createHttpPost(
            URL_DOMAIN + URL_API_MAGAZINE,
            new BasicNameValuePair("act", "orderc"),
            new BasicNameValuePair("mid", "" + id));
    String content = mHttpApi.doHttpRequest(httPost);
    PostResult result = gson.fromJson(content, PostResult.class);
    return result.getResult();
  }
示例#2
0
  public boolean delFav(int nid, int type) throws WH_DMException, UnKnownException, IOException {

    HttpPost httpPost =
        mHttpApi.createHttpPost(
            URL_DOMAIN + URL_API_FAV,
            new BasicNameValuePair("act", "del"),
            new BasicNameValuePair("nid", String.valueOf(nid)),
            new BasicNameValuePair("type", String.valueOf(type)));
    String content = mHttpApi.doHttpRequest(httpPost);
    PostResult result = gson.fromJson(content, PostResult.class);
    return result.getResult();
  }
示例#3
0
  public boolean login(String logemail, String logpassword, String machine)
      throws WH_DMException, UnKnownException, IOException {

    HttpPost httPost =
        mHttpApi.createHttpPost(
            URL_DOMAIN + URL_API_MEM,
            new BasicNameValuePair("act", "login"),
            new BasicNameValuePair("mail", logemail),
            new BasicNameValuePair("pass", logpassword),
            new BasicNameValuePair("machine", machine));
    String content = mHttpApi.doHttpRequest(httPost);
    PostResult result = gson.fromJson(content, PostResult.class);
    return result.getResult();
  }
示例#4
0
  public boolean addReply(String rcontent, String fid)
      throws WH_DMException, UnKnownException, IOException {

    HttpPost httPost =
        mHttpApi.createHttpPost(
            URL_DOMAIN + URL_API_NEWS,
            new BasicNameValuePair("act", "Reply"),
            new BasicNameValuePair("fid", fid),
            new BasicNameValuePair("rcontent", rcontent));
    String content = mHttpApi.doHttpRequest(httPost);
    PostResult result = gson.fromJson(content, PostResult.class);
    Log.d("review", content);
    return result.getResult();
  }
示例#5
0
  public boolean addPhotoReview(String _content, int id)
      throws WH_DMException, UnKnownException, IOException {

    HttpPost httPost =
        mHttpApi.createHttpPost(
            URL_DOMAIN + URL_API_NEWS,
            new BasicNameValuePair("act", "addtfb"),
            new BasicNameValuePair("id", String.valueOf(id)),
            new BasicNameValuePair("fcontent", _content));
    String content = mHttpApi.doHttpRequest(httPost);

    PostResult result = gson.fromJson(content, PostResult.class);
    Log.d("review", content);
    return result.getResult();
  }
示例#6
0
  public Cover subcribe(int id) throws WH_DMException, UnKnownException, IOException {

    HttpPost httPost =
        mHttpApi.createHttpPost(
            URL_DOMAIN + URL_API_MAGAZINE,
            new BasicNameValuePair("act", "order"),
            new BasicNameValuePair("mid", "" + id));
    String content = mHttpApi.doHttpRequest(httPost);
    PostResult result = gson.fromJson(content, PostResult.class);
    if (result.getResult()) {
      Cover cover = new Cover();
      String[] msg = (result.getMsg()).split(",", 3);
      cover.setId(Integer.parseInt(msg[0]));
      cover.setMagazineName(msg[1]);
      cover.setMagazinePic(msg[2]);
      return cover;
    } else {
      return null;
    }
  }