1 Star 1 Fork 0

APIJSON/APIJSONdocs

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
why.html 8.14 KB
一键复制 编辑 原始数据 按行查看 历史
Ruoran Wang 提交于 2020-01-17 13:48 +08:00 . edit on how.rst
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>How does APIJSON works? &mdash; APIJSON Docs 1.0.0 documentation</title>
<script type="text/javascript" src="../_static/js/modernizr.min.js"></script>
<script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<script type="text/javascript" src="../_static/language_data.js"></script>
<script type="text/javascript" src="../_static/contentui.js"></script>
<script type="text/javascript" src="../_static/js/theme.js"></script>
<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/css/custom.css" type="text/css" />
<link rel="stylesheet" href="../_static/contentui.css" type="text/css" />
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="What APIJSON has achieved?" href="what_achieved.html" />
<link rel="prev" title="API design style guide" href="design_rules.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../index.html" class="icon icon-home"> APIJSON Docs
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">Quick Start</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../quick_start/introduction.html">About APIJSON</a></li>
<li class="toctree-l1"><a class="reference internal" href="../quick_start/features.html">Features</a></li>
<li class="toctree-l1"><a class="reference internal" href="../quick_start/server_deployment/server_deployment.html">Server-side Deployment</a></li>
<li class="toctree-l1"><a class="reference internal" href="../quick_start/client_deployment/client_deployment.html">Client-side Deployment</a></li>
</ul>
<p class="caption"><span class="caption-text">Documentation</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="design_rules.html">API design style guide</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">How does APIJSON works?</a></li>
<li class="toctree-l1"><a class="reference internal" href="what_achieved.html">What APIJSON has achieved?</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">APIJSON Docs</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html">Docs</a> &raquo;</li>
<li>How does APIJSON works?</li>
<li class="wy-breadcrumbs-aside">
<a href="../_sources/documentation/why.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="how-does-apijson-works">
<h1>How does APIJSON works?<a class="headerlink" href="#how-does-apijson-works" title="Permalink to this headline"></a></h1>
<p>APIJSON-Server will turn JSON formatted requests to SQL statements. Then as the database has been connected, those SQL statements will be executed. The server will return specified resources in JSON. During the whole process, APIJSON automatically verify the user’s role and permissions, which will prevent malicious SQL injection.</p>
<p>You can also set restrictions on the request content by set rules in the database beforehand. For instance, to verify if the value of <code class="code docutils literal notranslate"><span class="pre">type{}</span></code> would be one of <code class="code docutils literal notranslate"><span class="pre">[0,1,2]</span></code>, you just need to add the following in the database:</p>
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span>&quot;VERIFY&quot;:{
&quot;type{}&quot;:[0,1,2]
}
</pre></div>
</div>
<p>Others that are used to verify requests include:</p>
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span>&quot;VERIFY&quot;: { &quot;money&amp;{}&quot;:&quot;&gt;0,&lt;=10000&quot; } //To verify if the value if money is between 0 and 10000.
&quot;TYPE&quot;: { &quot;balance&quot;: &quot;Double&quot; } //To verify if the data type of the &quot;balance&quot; is &quot;Double&quot;.
&quot;UNIQUE&quot;: &quot;phone&quot; //The value of &quot;phone&quot; must be unique.
&quot;NECESSARY&quot;: &quot;id,name&quot; //&quot;id&quot; and &quot;name&quot; must be included in the request body.
&quot;DISALLOW&quot;: &quot;balance&quot; //&quot;Balance&quot; is not allowed to be included in the request body.
&quot;INSERT&quot;: { &quot;@role&quot;: &quot;OWNER&quot; } //If the &quot;role&quot; is not included in the request, the system will assign one by default.
&quot;UPDATE&quot;: { &quot;id@&quot;: &quot;User/id&quot; } //To force to insert a key-value pair.
</pre></div>
</div>
<p>To see a full list of key words that used to set constraints on requests or verify requests, <a class="reference external" href="https://github.com/APIJSON/APIJSON/blob/master/APIJSON-Java-Server/APIJSONORM/src/main/java/zuo/biao/apijson/server/Operation.java">click here</a>.</p>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="what_achieved.html" class="btn btn-neutral float-right" title="What APIJSON has achieved?" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="design_rules.html" class="btn btn-neutral float-left" title="API design style guide" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2019, Ruoran Wang
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/APIJSON/APIJSONdocs.git
git@gitee.com:APIJSON/APIJSONdocs.git
APIJSON
APIJSONdocs
APIJSONdocs
master

搜索帮助