Пример #1
0
  /**
   * 功能描述:generate curl for API
   *
   * @return
   * @author <a href="mailto:[email protected]">李伟光 </a> created on: 2016-1-11
   */
  public String generateCURL() {
    long curUserId = getCurUserId();
    if (curUserId <= 0) {
      setIsOk(false);
      setErrMsg(LOGIN_WARN_MSG);
      return JSON_ERROR;
    }

    boolean isOk = false;
    // System.out.println("ActionId():" + this.actionId);
    validationMgr.saveCURL(this.actionId, validationMgr.generateCURL(this.actionId));
    isOk = true;

    if (isOk) {
      setJson("{\"isOk\":true}");
    }
    return SUCCESS;
  }
Пример #2
0
  /**
   * 功能描述:保存修改好的curl内容
   *
   * @return
   * @author <a href="mailto:[email protected]">李伟光 </a> created on: 2016-1-11
   */
  public String saveCURL() {
    long curUserId = getCurUserId();
    if (curUserId <= 0) {
      setIsOk(false);
      setErrMsg(LOGIN_WARN_MSG);
      return JSON_ERROR;
    }

    boolean isOk = false;
    // System.out.println("actionId:" + actionId);
    // System.out.println("newCURL:" + newCURL);
    validationMgr.saveCURL(actionId, newCURL);
    isOk = true;

    if (isOk) {
      setJson("{\"isOk\":true}");
    }
    return SUCCESS;
  }
Пример #3
0
  /**
   * 功能描述:保存修改好的cURL内容
   *
   * @return
   * @author <a href="mailto:[email protected]">李伟光 </a> created on: 2016-1-11
   */
  public String getCURL() {
    long curUserId = getCurUserId();
    if (curUserId <= 0) {
      setIsOk(false);
      setErrMsg(LOGIN_WARN_MSG);
      return JSON_ERROR;
    }

    boolean isOk = false;
    // 先生成最新的CURL
    validationMgr.saveCURL(this.actionId, validationMgr.generateCURL(this.actionId));

    String cURL = validationMgr.getCURLByActionId(actionId);
    isOk = true;

    if (isOk) {
      setJson("{\"isOk\":true,\"cURL\":\"" + string2Json(cURL) + "\"}");
    }
    return SUCCESS;
  }