开源 企业版 高校版 私有云 模力方舟 AI 队友
代码拉取完成,页面将自动刷新
捐赠
捐赠前请先登录
扫描微信二维码支付
取消
支付完成
支付提示
将跳转至支付宝完成支付
确定
取消
1 Star 1 Fork 0

APIJSON/APIJSONdocs

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
已有帐号? 立即登录
文件
master
分支 (1)
master
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
项目仓库所选许可证以仓库主分支所使用许可证为准
master
分支 (1)
master
克隆/下载
克隆/下载
提示
下载代码请复制以下命令到终端执行
为确保你提交的代码身份被 Gitee 正确识别,请执行以下命令完成配置
初次使用 SSH 协议进行代码克隆、推送等操作时,需按下述提示完成 SSH 配置
1 生成 RSA 密钥
2 获取 RSA 公钥内容,并配置到 SSH公钥
在 Gitee 上使用 SVN,请访问 使用指南
使用 HTTPS 协议时,命令行会出现如下账号密码验证步骤。基于安全考虑,Gitee 建议 配置并使用私人令牌 替代登录密码进行克隆、推送等操作
Username for 'https://gitee.com': userName
Password for 'https://userName@gitee.com': # 私人令牌
master
分支 (1)
master
APIJSONdocs
/
build
/
server_deployment
/
server_deployment.html
APIJSONdocs
/
build
/
server_deployment
/
server_deployment.html
server_deployment.html 12.46 KB
一键复制 编辑 原始数据 按行查看 历史
Ruoran Wang 提交于 2019年10月26日 08:12 +08:00 . First commit
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>Server-side Development &#8212; APIJSON Doc 1.0.0 documentation</title>
<link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<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>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Client-side Development" href="../client_deployment/client_deployment.html" />
<link rel="prev" title="Features" href="../introduction/introduction.html" />
<link rel="stylesheet" href="../_static/custom.css" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
</head><body>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="server-side-development">
<h1>Server-side Development<a class="headerlink" href="#server-side-development" title="Permalink to this headline"></a></h1>
<p>You can either use Eclipse for JavaEE or IntelllJ IDEA Ultimate to make installation. For both, first download the project and save it in a directory.</p>
<div class="section" id="installing-with-eclipse">
<h2>1. Installing with Eclipse<a class="headerlink" href="#installing-with-eclipse" title="Permalink to this headline"></a></h2>
<p><strong>Prerequisites</strong></p>
<ul class="simple">
<li><p>Java Development Kit(JDK): 1.8+</p></li>
<li><p><a class="reference external" href="https://maven.apache.org/download.cgi">MAVEN</a>: 3.0</p></li>
<li><p>Mysql / Oracle</p></li>
<li><p><a class="reference external" href="https://www.eclipse.org/downloads/">Eclipse Java EE IDE</a> for Web Developers.Version: Mars.1 Release (4.5.1)</p></li>
</ul>
<p><strong>Opening the project with Eclipse</strong></p>
<blockquote>
<div><p>Open Eclipse, then select <strong>File &gt; Import &gt; Maven &gt; Existing Maven Projects &gt; Next &gt; Browse &gt; Select the path of the project &gt; APIJSON-Java-Server &gt; APIJSONBoot &gt; check pom.xml...apijson-demo &gt; Finish</strong></p>
</div></blockquote>
<p><strong>Preparing the library used in demo</strong></p>
<p>In the menu at the right, click <strong>libs</strong>, then right click <strong>apijson-orm.jar</strong>, click <strong>add as library</strong>. Apply the same to the rest .jar files in libs.</p>
<p><strong>Configuration</strong></p>
<p>Open apijson.demo.server.DemoSQLConfig. In line 40-61, change return values of <cite>getDBUri</cite>,`getDBAccount`,`getDBPassword`,`getSchema` to your own database.</p>
<div class="highlight-java notranslate"><div class="highlight"><pre><span></span><span class="nd">@Override</span>
<span class="kd">public</span> <span class="n">String</span> <span class="nf">getDBUri</span><span class="o">()</span> <span class="o">{</span>
<span class="c1">//TODO: Change the return value to your own</span>
<span class="k">return</span> <span class="n">DATABASE_POSTGRESQL</span><span class="o">.</span><span class="na">equalsIgnoreCase</span><span class="o">(</span><span class="n">getDatabase</span><span class="o">())</span> <span class="o">?</span> <span class="s">&quot;jdbc:postgresql://localhost:5432/postgres&quot;</span> <span class="o">:</span> <span class="s">&quot;jdbc:mysql://192.168.71.146:3306/&quot;</span><span class="o">;</span>
<span class="o">}</span>
<span class="nd">@Override</span>
<span class="kd">public</span> <span class="n">String</span> <span class="nf">getDBAccount</span><span class="o">()</span> <span class="o">{</span>
<span class="c1">//TODO: Change the return value to your own</span>
<span class="k">return</span> <span class="n">DATABASE_POSTGRESQL</span><span class="o">.</span><span class="na">equalsIgnoreCase</span><span class="o">(</span><span class="n">getDatabase</span><span class="o">())</span> <span class="o">?</span> <span class="s">&quot;postgres&quot;</span> <span class="o">:</span> <span class="s">&quot;root&quot;</span><span class="o">;</span>
<span class="o">}</span>
<span class="nd">@Override</span>
<span class="kd">public</span> <span class="n">String</span> <span class="nf">getDBPassword</span><span class="o">()</span> <span class="o">{</span>
<span class="c1">//TODO: Change the return value to your own</span>
<span class="k">return</span> <span class="n">DATABASE_POSTGRESQL</span><span class="o">.</span><span class="na">equalsIgnoreCase</span><span class="o">(</span><span class="n">getDatabase</span><span class="o">())</span> <span class="o">?</span> <span class="kc">null</span> <span class="o">:</span> <span class="s">&quot;root&quot;</span><span class="o">;</span>
<span class="o">}</span>
<span class="nd">@Override</span>
<span class="kd">public</span> <span class="n">String</span> <span class="nf">getSchema</span><span class="o">()</span> <span class="o">{</span>
<span class="n">String</span> <span class="n">s</span> <span class="o">=</span> <span class="kd">super</span><span class="o">.</span><span class="na">getSchema</span><span class="o">();</span>
<span class="k">return</span> <span class="n">StringUtil</span><span class="o">.</span><span class="na">isEmpty</span><span class="o">(</span><span class="n">s</span><span class="o">,</span> <span class="kc">true</span><span class="o">)</span> <span class="o">?</span> <span class="s">&quot;thea&quot;</span> <span class="o">:</span> <span class="n">s</span><span class="o">;</span> <span class="c1">//TODO: Change the return value to your own. For here,change &quot;thea&quot; to &quot;your database&#39;s name&quot;</span>
<span class="o">}</span>
</pre></div>
</div>
<p><strong>Note</strong>: Instead of this step, you can also import your database.</p>
<p><strong>Running the application</strong></p>
<p>In Eclipse, in the menu on the top, click <strong>Run &gt; Run As &gt; Java Application &gt;choose APIJSONApplication &gt; OK</strong></p>
</div>
<div class="section" id="importing-database">
<h2>2. Importing database<a class="headerlink" href="#importing-database" title="Permalink to this headline"></a></h2>
<p>This project needs <a class="reference external" href="https://dev.mysql.com/downloads/mysql/">MySQL Server</a> and <a class="reference external" href="https://www.mysql.com/products/workbench/">MySQLWorkbench</a>. Please make sure that both of them are installed.</p>
<p>My configuration:</p>
<ul class="simple">
<li><p>Windows 7 + MySQL Community Server 5.7.16 + MySQLWorkbench 6.3.7</p></li>
<li><p>OSX EI Capitan + MySQL Community Server 5.7.16 + MySQLWorkbench 6.3.8</p></li>
<li><p>Systems and softwares are all 64 bit.</p></li>
</ul>
<p>Select <strong>MySQLWorkbench &gt; Enter a connection &gt; Click Server menu &gt; Data Import &gt; Select the path of your .sql file &gt; Start Import &gt; Refresh SCHEMAS</strong>. Now you should see tables are added successfully.</p>
<p>You can also import demo sql tables in <em>APIJSON-Master/MySQL</em> to test the app.</p>
<img alt="https://vincentcheng.github.io/apijson-doc/assets/img/use1.708387e0.png" src="https://vincentcheng.github.io/apijson-doc/assets/img/use1.708387e0.png" />
</div>
<div class="section" id="installing-with-intellij-idea-ultimate">
<h2>3. Installing with IntellIJ IDEA Ultimate<a class="headerlink" href="#installing-with-intellij-idea-ultimate" title="Permalink to this headline"></a></h2>
<div class="section" id="opening-the-project">
<h3>Opening the project<a class="headerlink" href="#opening-the-project" title="Permalink to this headline"></a></h3>
<p><strong>Open &gt; Select the path of the project/APIJSON-Java-Server/APIJSONBoot &gt; OK</strong></p>
</div>
<div class="section" id="preparing-the-library-used-in-demo">
<h3>Preparing the library used in demo<a class="headerlink" href="#preparing-the-library-used-in-demo" title="Permalink to this headline"></a></h3>
<p>In libs, right-click <strong>apijson-orm.jar &gt; Add as Library &gt; OK</strong>. Apply this to all <em>.jar</em> files in libs.</p>
</div>
<div class="section" id="running-the-application">
<h3>Running the application<a class="headerlink" href="#running-the-application" title="Permalink to this headline"></a></h3>
<p>In the menu on the top: <strong>Run &gt; Run &gt; Edit Configurations &gt; + &gt; Application &gt; Configuration</strong></p>
<p>In <strong>Main class</strong>, choose <strong>APIJSON Application</strong>.</p>
<p>In <strong>Use classpath of module</strong> , choose <strong>apijson-demo</strong>.</p>
<p>Click <strong>Run</strong> in the bottom.</p>
<p><strong>Note</strong>: After running, you should see APIJSON test logs and finally, it would show ‘APIJSON已启动’ (APIJSON has launched). If it shows error message‘address already in use’, that means port 8080 has been used. You need to change the port. See <a class="reference external" href="https://stackoverflow.com/questions/21083170/how-to-configure-port-for-a-spring-boot-application">how to change ports for a Spring Boot Application</a></p>
<p>Then copy and paste link <cite>http://localhost:8080/get/{}</cite> to your browser.</p>
<p>If it returns with:</p>
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="nt">&quot;code&quot;</span><span class="p">:</span> <span class="mi">200</span><span class="p">,</span>
<span class="nt">&quot;msg&quot;</span><span class="p">:</span> <span class="s2">&quot;success&quot;</span>
<span class="p">}</span>
</pre></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h1 class="logo"><a href="../index.html">APIJSON Doc</a></h1>
<h3>Navigation</h3>
<p class="caption"><span class="caption-text">Quick Start</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../introduction/introduction.html">Features</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Server-side Development</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#installing-with-eclipse">1. Installing with Eclipse</a></li>
<li class="toctree-l2"><a class="reference internal" href="#importing-database">2. Importing database</a></li>
<li class="toctree-l2"><a class="reference internal" href="#installing-with-intellij-idea-ultimate">3. Installing with IntellIJ IDEA Ultimate</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../client_deployment/client_deployment.html">Client-side Development</a></li>
</ul>
<p class="caption"><span class="caption-text">Documentation</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../documentation/design_rules.html">API design style guide</a></li>
</ul>
<div class="relations">
<h3>Related Topics</h3>
<ul>
<li><a href="../index.html">Documentation overview</a><ul>
<li>Previous: <a href="../introduction/introduction.html" title="previous chapter">Features</a></li>
<li>Next: <a href="../client_deployment/client_deployment.html" title="next chapter">Client-side Development</a></li>
</ul></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy;2019, Ruoran Wang.
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 2.1.2</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|
<a href="../_sources/server_deployment/server_deployment.rst.txt"
rel="nofollow">Page source</a>
</div>
</body>
</html>
Loading...
举报
举报成功
我们将于2个工作日内通过站内信反馈结果给你!
请认真填写举报原因,尽可能描述详细。
请选择举报类型
取消
发送
误判申诉

此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。

如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。

取消
提交

简介

The English APIJSON documentation. Forked from the original Repositry:
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
编辑仓库简介
简介内容
主页
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/APIJSON/APIJSONdocs.git
git@gitee.com:APIJSON/APIJSONdocs.git
APIJSON
APIJSONdocs
APIJSONdocs
master
点此查找更多帮助

搜索帮助

仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册

AltStyle によって変換されたページ (->オリジナル) /