Demo entry 6638264

json-style

   

Submitted by anonymous on Sep 07, 2017 at 08:32
Language: JSON. Code size: 18.3 kB.

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link rel="stylesheet" type="text/css" href="prism.css" />
    <!-- <script type="text/javascript" src="prism.js"/> -->
</head>
<body>

<h3 id="_1">请求头</h3>
<ol>
<li><strong>X-Device-Type:</strong> <em>[android | ios]</em></li>
<li><strong>X-App-Version:</strong> <em>1.0.2</em></li>
<li><strong>X-Request-Token:</strong> <em>f2599fbe-65b5-41e6-b135-346fc1c36b4f</em></li>
<li><strong>X-Request-Data:</strong> <em>eyJwaG9uZSI6ICIxODk4MDA1MjgzNSIsInRpbWVzdGFtcCI6IDE1MDIyMDEyNTYsInNpZ24iOiAiZjI1OTlmYmUtNjViNS00MWU2LWIxMzUtMzQ2ZmMxYzM2YjRmIn0=</em></li>
</ol>
<p><strong>X-Request-Data:</strong> 
请求必要信息</p>
<div class="codehilite"><pre><span></span><span class="p">{</span>
    <span class="nt">&quot;phone&quot;</span><span class="p">:</span> <span class="s2">&quot;189****2835&quot;</span><span class="p">,</span>
    <span class="nt">&quot;timestamp&quot;</span><span class="p">:</span> <span class="mi">1502201256</span><span class="p">,</span>
    <span class="nt">&quot;token&quot;</span><span class="p">:</span> <span class="s2">&quot;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&quot;</span><span class="p">,</span>
    <span class="nt">&quot;sign&quot;</span><span class="p">:</span> <span class="s2">&quot;f2599fbe-65b5-41e6-b135-346fc1c36b4f&quot;</span>
<span class="p">}</span>
</pre></div>


<h3 id="_2">[] 获取验证码</h3>
<p>POST: <code>/verify/get</code></p>
<p><strong>verify_type:</strong></p>
<ul>
<li>1 : 创建帐号</li>
<li>2 : 找回密码</li>
</ul>
<div class="codehilite"><pre><span></span><span class="p">{</span>
    <span class="nt">&quot;phone&quot;</span><span class="p">:</span> <span class="s2">&quot;1xxxxxxxx&quot;</span><span class="p">,</span>
    <span class="nt">&quot;verify_type&quot;</span><span class="p">:</span> <span class="mi">1</span>
<span class="p">}</span>
</pre></div>


<p>sucess:</p>
<div class="codehilite"><pre><span></span><span class="p">{</span>
    <span class="nt">&quot;verify_code&quot;</span><span class="p">:</span> <span class="s2">&quot;123456&quot;</span><span class="p">,</span>
    <span class="nt">&quot;verify_type&quot;</span><span class="p">:</span> <span class="mi">1</span>
<span class="p">}</span>
</pre></div>


<h3 id="_3">[ ] 创建帐号</h3>
<p>POST: <code>/account/create</code></p>
<div class="codehilite"><pre><span></span><span class="p">{</span>
    <span class="nt">&quot;phone&quot;</span><span class="p">:</span> <span class="s2">&quot;1xxxxxxxx&quot;</span><span class="p">,</span>
    <span class="nt">&quot;passoword&quot;</span><span class="p">:</span> <span class="s2">&quot;******&quot;</span><span class="p">,</span>
    <span class="nt">&quot;verify_code&quot;</span><span class="p">:</span> <span class="s2">&quot;123456&quot;</span>
<span class="p">}</span>
</pre></div>


<h3 id="_4">[ ] 登录</h3>
<p>POST: <code>/account/login</code></p>
<div class="codehilite"><pre><span></span><span class="p">{</span>
    <span class="nt">&quot;phone&quot;</span><span class="p">:</span> <span class="s2">&quot;1xxxxxxxx&quot;</span><span class="p">,</span>
    <span class="nt">&quot;passoword&quot;</span><span class="p">:</span> <span class="s2">&quot;******&quot;</span>
<span class="p">}</span>
</pre></div>


<p>sucess:</p>
<div class="codehilite"><pre><span></span><span class="p">{</span>
    <span class="nt">&quot;token&quot;</span><span class="p">:</span> <span class="s2">&quot;xxxxxx-xxxx-xxxx-xxxxxxxx&quot;</span>
<span class="p">}</span>
</pre></div>


<h3 id="_5">[ ] 找回密码</h3>
<p>POST: <code>/account/alter</code></p>
<div class="codehilite"><pre><span></span><span class="p">{</span>
    <span class="nt">&quot;phone&quot;</span><span class="p">:</span> <span class="s2">&quot;1xxxxxxxx&quot;</span><span class="p">,</span>
    <span class="nt">&quot;passoword&quot;</span><span class="p">:</span> <span class="s2">&quot;******&quot;</span><span class="p">,</span>
    <span class="nt">&quot;verify_code&quot;</span><span class="p">:</span> <span class="s2">&quot;000000&quot;</span>
<span class="p">}</span>
</pre></div>


<h3 id="_6">[ ] 修改用户信息</h3>
<p>POST: <code>/account/xxxxxx-xxxx-xxxx-xxxxxxxx/alter</code></p>
<div class="codehilite"><pre><span></span><span class="p">{</span>
    <span class="nt">&quot;nick_name&quot;</span><span class="p">:</span> <span class="s2">&quot;1xxxxxxxx&quot;</span><span class="p">,</span>
    <span class="nt">&quot;province&quot;</span><span class="p">:</span> <span class="s2">&quot;******&quot;</span><span class="p">,</span>
    <span class="err">...</span>
    <span class="nt">&quot;old_passworld&quot;</span><span class="p">:</span> <span class="s2">&quot;xxx&quot;</span><span class="p">,</span>
    <span class="nt">&quot;new_passworld&quot;</span><span class="p">:</span> <span class="s2">&quot;xxxxx&quot;</span>
<span class="p">}</span>
</pre></div>


<h1 id="_7">用户相关</h1>
<h3 id="_8">[ ] 更新用户数据</h3>
<p>GET: <code>/xxxxxx-xxxx-xxxx-xxxxxxxx/beat</code></p>
<p>success:</p>
<div class="codehilite"><pre><span></span><span class="p">{</span>
    <span class="nt">&quot;nick_name&quot;</span><span class="p">:</span> <span class="s2">&quot;1xxxxxxxx&quot;</span><span class="p">,</span>
    <span class="nt">&quot;province&quot;</span><span class="p">:</span> <span class="s2">&quot;******&quot;</span><span class="p">,</span>
    <span class="nt">&quot;point&quot;</span><span class="p">:</span> <span class="mi">10</span>
<span class="p">}</span>
</pre></div>


<h3 id="_9">[ ] 创建考试</h3>
<p>POST: <code>/xxxxxx-xxxx-xxxx-xxxxxxxx/exam/create</code></p>
<div class="codehilite"><pre><span></span><span class="p">{</span>
    <span class="nt">&quot;subject_id&quot;</span><span class="p">:</span> <span class="mi">12</span>
<span class="p">}</span>
</pre></div>


<p>success:</p>
<div class="codehilite"><pre><span></span><span class="p">{</span>
    <span class="nt">&quot;exam_info&quot;</span><span class="p">:</span> 
    <span class="p">{</span>
        <span class="nt">&quot;time&quot;</span><span class="p">:</span> <span class="mi">120</span><span class="p">,</span>
        <span class="nt">&quot;exam_id&quot;</span><span class="p">:</span> <span class="mi">12</span>
    <span class="p">},</span>
    <span class="nt">&quot;exam_paper&quot;</span><span class="p">:</span>
    <span class="p">[</span>
    <span class="p">]</span>
<span class="p">}</span>
</pre></div>


<h3 id="_10">[ ] 提交答案</h3>
<p>POST: <code>/xxxxxx-xxxx-xxxx-xxxxxxxx/exam/submit</code></p>
<div class="codehilite"><pre><span></span><span class="p">{</span>
    <span class="nt">&quot;answers&quot;</span><span class="p">:</span> 
    <span class="p">[</span><span class="mi">1</span><span class="p">,</span><span class="mi">2</span><span class="p">,</span><span class="mi">3</span><span class="p">,</span><span class="mi">4</span><span class="p">,</span><span class="mi">5</span><span class="p">,</span><span class="mi">6</span><span class="p">]</span>
<span class="p">}</span>
</pre></div>


<p>success:</p>
<div class="codehilite"><pre><span></span><span class="p">{</span>
    <span class="nt">&quot;exam_score&quot;</span><span class="p">:</span> <span class="mi">100</span>
<span class="p">}</span>
</pre></div>


<h3 id="_11">[ ] 考试历史</h3>
<p>GET: <code>/xxxxxx-xxxx-xxxx-xxxxxxxx/exam/history/[after|before]/10/1232131231</code></p>
<p>success:</p>
<div class="codehilite"><pre><span></span><span class="p">[</span>
    <span class="p">{</span>
        <span class="nt">&quot;exam_id&quot;</span><span class="p">:</span> <span class="mi">12</span><span class="p">,</span>
        <span class="nt">&quot;exam_score&quot;</span><span class="p">:</span> <span class="mi">100</span><span class="p">,</span>
        <span class="nt">&quot;exam_create_time&quot;</span><span class="p">:</span> <span class="mi">12212121212</span><span class="p">,</span>
        <span class="nt">&quot;exam_total_time&quot;</span><span class="p">:</span> <span class="mi">120</span><span class="p">,</span>
        <span class="nt">&quot;exam_subject_name&quot;</span><span class="p">:</span> <span class="s2">&quot;xxxxx&quot;</span><span class="p">,</span>
        <span class="nt">&quot;exam_finish_time&quot;</span><span class="p">:</span> <span class="mi">15000342010</span><span class="p">,</span>
        <span class="nt">&quot;exam_display_cost_time&quot;</span><span class="p">:</span> <span class="mi">120</span>
    <span class="p">}</span>
<span class="p">]</span>
</pre></div>


<h3 id="_12">[ ] 考试详情</h3>
<p>GET: <code>/xxxxxx-xxxx-xxxx-xxxxxxxx/exam/detail/[exam_id]</code></p>
<p>success:</p>
<div class="codehilite"><pre><span></span><span class="p">{</span>
    <span class="nt">&quot;exam_id&quot;</span><span class="p">:</span> <span class="mi">12</span><span class="p">,</span>
    <span class="nt">&quot;exam_score&quot;</span><span class="p">:</span> <span class="mi">100</span><span class="p">,</span>
    <span class="nt">&quot;exam_create_time&quot;</span><span class="p">:</span> <span class="mi">12212121212</span><span class="p">,</span>
    <span class="nt">&quot;exam_total_time&quot;</span><span class="p">:</span> <span class="mi">120</span><span class="p">,</span>
    <span class="nt">&quot;exam_subject_name&quot;</span><span class="p">:</span> <span class="s2">&quot;xxxxx&quot;</span><span class="p">,</span>
    <span class="nt">&quot;exam_finish_time&quot;</span><span class="p">:</span> <span class="mi">15000342010</span><span class="p">,</span>
    <span class="nt">&quot;exam_display_cost_time&quot;</span><span class="p">:</span> <span class="mi">120</span><span class="p">,</span>
    <span class="nt">&quot;exam_paper&quot;</span><span class="p">:</span>
    <span class="p">[</span>
        <span class="err">...</span>
    <span class="p">]</span>
<span class="p">}</span>
</pre></div>


<h1 id="_13">支付</h1>
<h3 id="_14">[ ] 获取支付产品</h3>
<p>GET: <code>/xxxxxx-xxxx-xxxx-xxxxxxxx/payment/products</code></p>
<p>success:</p>
<div class="codehilite"><pre><span></span><span class="p">[</span>
    <span class="p">{</span>
        <span class="nt">&quot;product_name&quot;</span><span class="p">:</span> <span class="s2">&quot;xxxxxx&quot;</span><span class="p">,</span>
        <span class="nt">&quot;product_description&quot;</span><span class="p">:</span> <span class="s2">&quot;xxxxxxxxx&quot;</span><span class="p">,</span>
        <span class="nt">&quot;product_id&quot;</span><span class="p">:</span> <span class="mi">12</span><span class="p">,</span>
        <span class="nt">&quot;product_price&quot;</span><span class="p">:</span> <span class="mi">1</span>
    <span class="p">},</span>
    <span class="err">...</span>
<span class="p">]</span>
</pre></div>


<h3 id="_15">[ ] 创建订单</h3>
<p>POST: <code>/xxxxxx-xxxx-xxxx-xxxxxxxx/payment/create</code></p>
<div class="codehilite"><pre><span></span><span class="p">{</span>
    <span class="nt">&quot;product_id&quot;</span><span class="p">:</span> <span class="mi">12</span><span class="p">,</span>
    <span class="nt">&quot;payment_type&quot;</span><span class="p">:</span> <span class="mi">12</span><span class="p">,</span>
    <span class="nt">&quot;payment_type_name&quot;</span><span class="p">:</span> <span class="s2">&quot;微信&quot;</span>
<span class="p">}</span>
</pre></div>


<p>success:</p>
<div class="codehilite"><pre><span></span><span class="p">{</span>
    <span class="nt">&quot;product_id&quot;</span><span class="p">:</span> <span class="mi">12</span><span class="p">,</span>
    <span class="nt">&quot;payment_type&quot;</span><span class="p">:</span> <span class="mi">12</span><span class="p">,</span>
    <span class="nt">&quot;payment_type_name&quot;</span><span class="p">:</span> <span class="s2">&quot;微信&quot;</span><span class="p">,</span>
    <span class="nt">&quot;payment_id&quot;</span><span class="p">:</span> <span class="err">xxxx</span>
    <span class="s2">&quot;payment_info&quot;</span><span class="p">:</span>
    <span class="p">{</span>
        <span class="err">...</span>
    <span class="p">}</span>
<span class="p">}</span>
</pre></div>


<h3 id="_16">[ ] 检查支付</h3>
<p>POST: <code>/xxxxxx-xxxx-xxxx-xxxxxxxx/payment/check</code></p>
<div class="codehilite"><pre><span></span><span class="p">{</span>
    <span class="nt">&quot;payment_type&quot;</span><span class="p">:</span> <span class="mi">12</span><span class="p">,</span>
    <span class="nt">&quot;payment_id&quot;</span><span class="p">:</span> <span class="err">xxxx</span><span class="p">,</span>
    <span class="nt">&quot;payment_data&quot;</span><span class="p">:</span>
    <span class="p">{</span>
    <span class="p">}</span>
<span class="p">}</span>
</pre></div>


<h3 id="_17">[ ] 支付历史</h3>
<p>POST: <code>/xxxxxx-xxxx-xxxx-xxxxxxxx/payment/history/[after|before]/[num]/[timestamp]</code></p>
<div class="codehilite"><pre><span></span><span class="p">[</span>
    <span class="p">{</span>
        <span class="nt">&quot;product_name&quot;</span><span class="p">:</span> <span class="s2">&quot;xxxxxx&quot;</span><span class="p">,</span>
        <span class="nt">&quot;product_description&quot;</span><span class="p">:</span> <span class="s2">&quot;xxxxxxxxx&quot;</span><span class="p">,</span>
        <span class="nt">&quot;product_id&quot;</span><span class="p">:</span> <span class="mi">12</span><span class="p">,</span>
        <span class="nt">&quot;product_price&quot;</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span>
        <span class="nt">&quot;payment_type_name&quot;</span><span class="p">:</span> <span class="s2">&quot;微信&quot;</span><span class="p">,</span>
        <span class="nt">&quot;payment_create_time&quot;</span><span class="p">:</span> <span class="mi">15321321423143</span><span class="p">,</span>
        <span class="nt">&quot;payment_finish_time&quot;</span><span class="p">:</span> <span class="mi">15321321423143</span>
    <span class="p">},</span>
    <span class="err">...</span>
<span class="p">]</span>
</pre></div>


<h1 id="_18">题库科目</h1>
<h3 id="_19">[ ] 获取分类</h3>
<p>GET: <code>/exam/categories</code></p>
<div class="codehilite"><pre><span></span><span class="p">[</span>
    <span class="p">{</span>
        <span class="nt">&quot;catgory_id&quot;</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span>
        <span class="nt">&quot;catgory_name&quot;</span><span class="p">:</span> <span class="s2">&quot;xxxxxx&quot;</span><span class="p">,</span>
    <span class="p">},</span>
    <span class="p">{</span>
        <span class="nt">&quot;catgory_id&quot;</span><span class="p">:</span> <span class="mi">2</span><span class="p">,</span>
        <span class="nt">&quot;catgory_name&quot;</span><span class="p">:</span> <span class="s2">&quot;xxxxxx&quot;</span>
    <span class="p">},</span>
    <span class="err">...</span>
<span class="p">]</span>
</pre></div>


<h3 id="_20">[ ] 获取科目</h3>
<p>GET: <code>/exam/category/[catgory_id]/subjects</code></p>
<div class="codehilite"><pre><span></span><span class="p">[</span>
    <span class="p">{</span>
        <span class="nt">&quot;subject_id&quot;</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span>
        <span class="nt">&quot;subject_name&quot;</span><span class="p">:</span> <span class="s2">&quot;xxxxxx&quot;</span>
    <span class="p">},</span>
    <span class="p">{</span>
        <span class="nt">&quot;subject_id&quot;</span><span class="p">:</span> <span class="mi">2</span><span class="p">,</span>
        <span class="nt">&quot;subject_name&quot;</span><span class="p">:</span> <span class="s2">&quot;xxxxxx&quot;</span>
    <span class="p">},</span>
    <span class="err">...</span>
<span class="p">]</span>
</pre></div>


<h1 id="app">APP相关</h1>
<h3 id="_21">[ ] 检查更新</h3>
<p>GET: <code>/app/update/check</code></p>
<div class="codehilite"><pre><span></span><span class="p">{</span>
<span class="p">}</span>
</pre></div>


<h3 id="_22">[ ] 公告</h3>
<p>GET: <code>/app/notice</code></p>
<div class="codehilite"><pre><span></span><span class="p">{</span>
<span class="p">}</span>
</pre></div>


<h3 id="_23">[ ] 推送消息</h3>
<p>GET: <code>/app/messages</code></p>
<div class="codehilite"><pre><span></span><span class="p">{</span>
<span class="p">}</span>
</pre></div>


<h1 id="_24">数据结构</h1>
<div class="codehilite"><pre><span></span><span class="p">{</span>
    <span class="nt">&quot;status&quot;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
    <span class="nt">&quot;message&quot;</span><span class="p">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
    <span class="nt">&quot;data&quot;</span><span class="p">:[</span><span class="err">...</span><span class="p">],</span>
    <span class="nt">&quot;app&quot;</span><span class="p">:</span> <span class="p">{</span>
            <span class="nt">&quot;version&quot;</span><span class="p">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
            <span class="nt">&quot;url&quot;</span><span class="p">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
            <span class="nt">&quot;force&quot;</span><span class="p">:</span> <span class="kc">false</span>
        <span class="p">},</span>
    <span class="nt">&quot;notices&quot;</span><span class="p">:</span>  <span class="p">[</span>
            <span class="p">{</span>
                <span class="nt">&quot;id&quot;</span><span class="p">:</span> <span class="mi">11111</span>
                <span class="s2">&quot;title&quot;</span><span class="p">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
                <span class="nt">&quot;message&quot;</span><span class="p">:</span> <span class="s2">&quot;&quot;</span>
            <span class="p">},</span>
            <span class="p">{</span>
                <span class="nt">&quot;id&quot;</span><span class="p">:</span> <span class="mi">1111</span><span class="p">,</span>
                <span class="err">...</span>
            <span class="p">}</span>
        <span class="p">],</span>
<span class="p">}</span>
</pre></div>
</body>
</html>

This snippet took 0.05 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).