Example #1
0
  public void join(User user, String pwd, OnCompleteJoinListener ocjl) {
    if (doingJoin) return;

    doingJoin = true;

    onCompleteJoinListener = ocjl;

    String url = SERVER + "mode=m_join";
    Uri.Builder builder = Uri.parse(url).buildUpon();
    builder.appendQueryParameter("userid", user.id);
    builder.appendQueryParameter("userpwd", pwd);
    builder.appendQueryParameter("name", user.name);
    builder.appendQueryParameter("email", user.email);
    builder.appendQueryParameter("tel", user.phone1);
    builder.appendQueryParameter("tel2", user.phone2);
    builder.appendQueryParameter("address1", user.addressDefault);
    builder.appendQueryParameter("address2", user.addressDetail);
    builder.appendQueryParameter("zipcode", user.postCode1 + "-" + user.postCode2);

    GsonRequest<ResponseDefault> joinGsonRequest =
        new GsonRequest<ResponseDefault>(
            Request.Method.POST,
            builder.toString(),
            ResponseDefault.class,
            null,
            joinSuccessListener,
            joinErrorListener);
    RestClient.client().getRequestQueue().add(joinGsonRequest);
  }
Example #2
0
  public void editUserToServer(User user, String pwd, OnCompleteEditUserListener ocel) {
    if (doingEditUser) return;

    doingEditUser = true;

    onCompleteEditUserListener = ocel;

    String url = SERVER + "mode=m_infochg";
    Uri.Builder builder = Uri.parse(url).buildUpon();
    builder.appendQueryParameter("ukey", userKey);
    builder.appendQueryParameter("userpwd", pwd);
    builder.appendQueryParameter("name", user.name);
    builder.appendQueryParameter("email", user.email);
    builder.appendQueryParameter("tel", user.phone1);
    builder.appendQueryParameter("tel2", user.phone2);
    builder.appendQueryParameter("address1", user.addressDefault);
    builder.appendQueryParameter("address2", user.addressDetail);
    builder.appendQueryParameter("zipcode", user.postCode1 + "-" + user.postCode2);

    GsonRequest<ResponseDefault> joinGsonRequest =
        new GsonRequest<ResponseDefault>(
            Request.Method.POST,
            builder.toString(),
            ResponseDefault.class,
            null,
            editUserSuccessListener,
            edituUserErrorListener);
    RestClient.client().getRequestQueue().add(joinGsonRequest);
  }
Example #3
0
  public void getNotice(OnCompleteGetNoticeListener ocgnl) {
    if (doingGetNotice) return;

    doingGetNotice = true;

    onCompleteGetNoticeListener = ocgnl;

    String url = SERVER + "mode=n_list";
    Uri.Builder builder = Uri.parse(url).buildUpon();

    GsonRequest<ResponseNoticeList> checkIDGsonRequest =
        new GsonRequest<ResponseNoticeList>(
            Request.Method.GET,
            builder.toString(),
            ResponseNoticeList.class,
            null,
            getNoticeSuccessListener,
            getNoticeErrorListener);
    RestClient.client().getRequestQueue().add(checkIDGsonRequest);
  }
Example #4
0
  public void getQnaList(String userKey, OnCompleteGetQnaListListener ocgql) {
    if (doingGetQnaList) return;

    doingGetQnaList = true;

    onCompleteGetQnaListListener = ocgql;

    String url = SERVER + "mode=b_list";
    Uri.Builder builder = Uri.parse(url).buildUpon();
    builder.appendQueryParameter("ukey", userKey);

    GsonRequest<ResponseQnaList> checkIDGsonRequest =
        new GsonRequest<ResponseQnaList>(
            Request.Method.GET,
            builder.toString(),
            ResponseQnaList.class,
            null,
            getQnaListSuccessListener,
            getQnaListErrorListener);
    RestClient.client().getRequestQueue().add(checkIDGsonRequest);
  }
Example #5
0
  public void getLastDeliveryInfo(String userKey, OnCompleteGetLastDeliveryInfoListener ocgdi) {
    if (doingGetLastDeliveryInfo) return;

    doingGetLastDeliveryInfo = true;

    onCompleteGetLastDeliveryInfoListener = ocgdi;

    String url = SERVER + "mode=m_lastaddr";
    Uri.Builder builder = Uri.parse(url).buildUpon();
    builder.appendQueryParameter("ukey", userKey);

    GsonRequest<ResponseDeliveryInfo> pointListGsonRequest =
        new GsonRequest<ResponseDeliveryInfo>(
            Request.Method.GET,
            builder.toString(),
            ResponseDeliveryInfo.class,
            null,
            getLastDeliveryInfoSuccessListener,
            getLastDeliveryInfoErrorListener);
    RestClient.client().getRequestQueue().add(pointListGsonRequest);
  }
Example #6
0
  public void getPurchase(String idx, OnCompleteGetPurchaseListener ocgpl) {
    if (doingGetPurchase) return;

    doingGetPurchase = true;

    onCompleteGetPurchaseListener = ocgpl;

    String url = SERVER + "mode=t_detail";
    Uri.Builder builder = Uri.parse(url).buildUpon();
    builder.appendQueryParameter("idx", idx);

    GsonRequest<ResponsePurchase> pointListGsonRequest =
        new GsonRequest<ResponsePurchase>(
            Request.Method.GET,
            builder.toString(),
            ResponsePurchase.class,
            null,
            getPurchaseSuccessListener,
            getPurchaseErrorListener);
    RestClient.client().getRequestQueue().add(pointListGsonRequest);
  }
Example #7
0
  public void checkID(String id, OnCompleteCheckIDListener occidl) {
    if (doingCheckID) return;

    doingCheckID = true;

    onCompleteCheckIDListener = occidl;

    String url = SERVER + "mode=m_iddup";
    Uri.Builder builder = Uri.parse(url).buildUpon();
    builder.appendQueryParameter("userid", id);

    GsonRequest<ResponseDefault> checkIDGsonRequest =
        new GsonRequest<ResponseDefault>(
            Request.Method.GET,
            builder.toString(),
            ResponseDefault.class,
            null,
            checkIDSuccessListener,
            CheckIDErrorListener);
    RestClient.client().getRequestQueue().add(checkIDGsonRequest);
  }
Example #8
0
  public void syncUserFromServer(OnCompleteSyncUserListener csuListener) {
    if (doingSyncUser) return;

    doingSyncUser = true;

    this.onCompleteSyncUserListener = csuListener;

    String url = SERVER + "mode=m_info";
    Uri.Builder builder = Uri.parse(url).buildUpon();
    builder.appendQueryParameter("ukey", this.userKey);

    GsonRequest<ResponseUser> userGsonRequest =
        new GsonRequest<ResponseUser>(
            Request.Method.GET,
            builder.toString(),
            ResponseUser.class,
            null,
            syncSuccessListener,
            syncErrorListener);
    RestClient.client().getRequestQueue().add(userGsonRequest);
  }
Example #9
0
  public void loginFromServer(String id, String pwd, OnCompleteLoginListener lfsListener) {
    if (doingLogin) return;
    doingLogin = true;

    this.onCompleteLoginListener = lfsListener;

    String url = SERVER + "mode=m_login";
    Uri.Builder builder = Uri.parse(url).buildUpon();
    builder.appendQueryParameter("userid", id);
    builder.appendQueryParameter("userpwd", pwd);

    GsonRequest<ResponseLogin> userGsonRequest =
        new GsonRequest<ResponseLogin>(
            Request.Method.GET,
            builder.toString(),
            ResponseLogin.class,
            null,
            loginSuccessListener,
            loginErrorListener);
    RestClient.client().getRequestQueue().add(userGsonRequest);
  }
Example #10
0
  public void chargePoint(String userKey, String point, OnCompleteChargePointListener occpl) {
    if (doingChargePoint) return;

    doingChargePoint = true;

    onCompleteChargePointListener = occpl;

    String url = SERVER + "mode=m_coin";
    Uri.Builder builder = Uri.parse(url).buildUpon();
    builder.appendQueryParameter("ukey", userKey);
    builder.appendQueryParameter("goldcoin", point);

    GsonRequest<ResponseDefault> pointListGsonRequest =
        new GsonRequest<ResponseDefault>(
            Request.Method.GET,
            builder.toString(),
            ResponseDefault.class,
            null,
            chargePointSuccessListener,
            chargePointErrorListener);
    RestClient.client().getRequestQueue().add(pointListGsonRequest);
  }
Example #11
0
  public void getChargeList(String userKey, String lastIdx, OnCompleteGetChargeListListener ocgpl) {
    if (doingGetChargeList) return;

    doingGetChargeList = true;

    onCompleteGetChargeListListener = ocgpl;

    String url = SERVER + "mode=m_coinlist";
    Uri.Builder builder = Uri.parse(url).buildUpon();
    builder.appendQueryParameter("ukey", userKey);
    builder.appendQueryParameter("lastidx", lastIdx);

    GsonRequest<ResponseChargeList> pointListGsonRequest =
        new GsonRequest<ResponseChargeList>(
            Request.Method.GET,
            builder.toString(),
            ResponseChargeList.class,
            null,
            getChargeListSuccessListener,
            getChargeListErrorListener);
    RestClient.client().getRequestQueue().add(pointListGsonRequest);
  }
Example #12
0
  public void searchPostCode(String dong, int page, OnCompleteSearchPostCodeListener occidl) {
    if (doingSearchPostCode) return;

    doingSearchPostCode = true;

    onCompleteSearchPostCodeListener = occidl;

    String url = SERVER + "mode=m_zipcode";
    Uri.Builder builder = Uri.parse(url).buildUpon();
    builder.appendQueryParameter("dong", dong);
    builder.appendQueryParameter("page", page + "");

    GsonRequest<ResponseZipcodeList> postcodeGsonRequest =
        new GsonRequest<ResponseZipcodeList>(
            Request.Method.GET,
            builder.toString(),
            ResponseZipcodeList.class,
            null,
            searchPostCodeSuccessListener,
            searchPostCodeErrorListener);
    RestClient.client().getRequestQueue().add(postcodeGsonRequest);
  }
Example #13
0
  public void question(String userKey, RequestQuestion question, OnCompleteQuestionListener ocql) {
    if (doingQuestion) return;

    doingQuestion = true;

    onCompleteQuestionListener = ocql;

    String url = SERVER + "mode=b_proc";
    Uri.Builder builder = Uri.parse(url).buildUpon();
    builder.appendQueryParameter("ukey", userKey);
    String json = new Gson().toJson(question);
    builder.appendQueryParameter("boardInfo", json);

    GsonRequest<ResponseQuestion> checkIDGsonRequest =
        new GsonRequest<ResponseQuestion>(
            Request.Method.GET,
            builder.toString(),
            ResponseQuestion.class,
            null,
            questionSuccessListener,
            questionErrorListener);
    RestClient.client().getRequestQueue().add(checkIDGsonRequest);
  }