01 - 首页(已测试)
<p>[TOC]</p>
<h5>简要描述:</h5>
<ul>
<li>小程序 - 首页</li>
</ul>
<h5>请求URL:</h5>
<ul>
<li><code>https://xx.com/api/home</code></li>
</ul>
<h5>请求方式</h5>
<ul>
<li>GET </li>
</ul>
<h5>请求参数</h5>
<table>
<thead>
<tr>
<th style="text-align: left;">参数名</th>
<th style="text-align: left;">必选</th>
<th style="text-align: left;">类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">satoken</td>
<td style="text-align: left;">否</td>
<td style="text-align: left;">String</td>
<td>授权码</td>
</tr>
</tbody>
</table>
<ul>
<li>说明:未登录时 satoken 可以是空字符串</li>
</ul>
<h5>请求示例</h5>
<p>url?userId=1</p>
<h5>返回示例(已登录)</h5>
<pre><code>{
&quot;code&quot;: 200,
&quot;desc&quot;: &quot;成功&quot;,
&quot;data&quot;: {
&quot;userId&quot;: 1,
&quot;name&quot;: &quot;大师兄-时光&quot;,
&quot;userImgUrl&quot;: &quot;https://example.com/article1.jpg&quot;,
&quot;customerServiceWX&quot;: &quot;tuibianba168&quot;,
&quot;isNormal&quot;:1,
&quot;userInfo&quot;: {
&quot;selectPositionId&quot;: 1,
&quot;positionName&quot;: &quot;Java后端开发&quot;,
&quot;myClockIn&quot;: 0,
&quot;myAnswer&quot;: 0,
&quot;myScore&quot;: 0
},
&quot;positionInfo&quot;: {
&quot;name&quot;: &quot;Java后端开发&quot;,
&quot;type&quot;: 1,
&quot;progress&quot;: 0,
&quot;questionTotal&quot;: 350,
&quot;popularity&quot;: 1000
}
}
}</code></pre>
<h5>字段来源</h5>
<ul>
<li>customerServiceWX(客服微信号)-> t_user_config</li>
<li>isNormal(状态)-> t_user_config</li>
<li>selectPositionId(已登录) -> t_user_config</li>
<li>myClockIn(打卡次数)-> t_user_config</li>
<li>myAnswer(答题次数)-> t_user_config</li>
<li>
<p>myScore(我的积分)-> t_user_config</p>
</li>
<li>[点我看 progress 与 questionTotal 字段来源实现逻辑](<a href="https://tuibianba.yuque.com/en6o2n/visxx4/wg6fggdlb971mldp">https://tuibianba.yuque.com/en6o2n/visxx4/wg6fggdlb971mldp</a> "progress 与 questionTotal")</li>
</ul>
<h5>返回示例(未登录)</h5>
<pre><code>{
&quot;code&quot;: 200,
&quot;desc&quot;: &quot;成功&quot;,
&quot;data&quot;: {
&quot;userId&quot;: 1,
&quot;name&quot;: &quot;&quot;,
&quot;userImgUrl&quot;: &quot;https://example.com/article1.jpg&quot;,
&quot;customerServiceWX&quot;: &quot;&quot;,
&quot;isNormal&quot;:0,
&quot;userInfo&quot;: {
&quot;selectPositionId&quot;: 1,
&quot;positionName&quot;: &quot;Java后端开发&quot;,
&quot;myClockIn&quot;: 0,
&quot;myAnswer&quot;: 0,
&quot;myScore&quot;: 0
},
&quot;positionInfo&quot;: {
&quot;name&quot;: &quot;Java后端开发&quot;,
&quot;type&quot;: 1,
&quot;progress&quot;: 0,
&quot;questionTotal&quot;: 350,
&quot;popularity&quot;: 1000
}
}
}</code></pre>
<h5>返回参数说明</h5>
<table>
<thead>
<tr>
<th style="text-align: left;">参数名</th>
<th style="text-align: left;">类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">userId</td>
<td style="text-align: left;">String</td>
<td>用户的唯一标识符</td>
</tr>
<tr>
<td style="text-align: left;">name</td>
<td style="text-align: left;">String</td>
<td>用户的昵称</td>
</tr>
<tr>
<td style="text-align: left;">userImgUrl</td>
<td style="text-align: left;">String</td>
<td>头像图片URL地址。</td>
</tr>
<tr>
<td style="text-align: left;">isNormal</td>
<td style="text-align: left;">int</td>
<td>0表示不正常,1表示正常</td>
</tr>
<tr>
<td style="text-align: left;">---------------</td>
</tr>
<tr>
<td style="text-align: left;">userInfo.selectPositionId</td>
<td style="text-align: left;">String</td>
<td>用户岗位类型</td>
</tr>
<tr>
<td style="text-align: left;">userInfo.positionName</td>
<td style="text-align: left;">String</td>
<td>用户岗位类型名称</td>
</tr>
<tr>
<td style="text-align: left;">userInfo.myClockIn</td>
<td style="text-align: left;">int</td>
<td>用户打卡次数</td>
</tr>
<tr>
<td style="text-align: left;">userInfo.myAnswer</td>
<td style="text-align: left;">int</td>
<td>用户答题次数</td>
</tr>
<tr>
<td style="text-align: left;">userInfo.myScore</td>
<td style="text-align: left;">int</td>
<td>用户的积分</td>
</tr>
<tr>
<td style="text-align: left;">---------------</td>
</tr>
<tr>
<td style="text-align: left;">positionInfo.name</td>
<td style="text-align: left;">String</td>
<td>岗位名称</td>
</tr>
<tr>
<td style="text-align: left;">positionInfo.type</td>
<td style="text-align: left;">int</td>
<td>岗位类型</td>
</tr>
<tr>
<td style="text-align: left;">positionInfo.progress</td>
<td style="text-align: left;">int</td>
<td>刷题进度</td>
</tr>
<tr>
<td style="text-align: left;">positionInfo.questionTotal</td>
<td style="text-align: left;">int</td>
<td>刷题总数</td>
</tr>
<tr>
<td style="text-align: left;">positionInfo.popularity</td>
<td style="text-align: left;">int</td>
<td>人气</td>
</tr>
</tbody>
</table>
<h5>状态码</h5>
<table>
<thead>
<tr>
<th style="text-align: left;">状态码</th>
<th style="text-align: left;">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">200</td>
<td style="text-align: left;">成功</td>
</tr>
</tbody>
</table>
<h5>重要说明</h5>
<p>><strong> isNormal = 1(正常)</strong></p>
<ol>
<li>已付费用户(未过期)</li>
<li>已激活用户(赠送在有效期内)</li>
</ol>
<p>><strong> isNormal = 0(不正常)</strong></p>
<ol>
<li>未登录用户</li>
<li>已过期用户</li>
</ol>
<p>><strong> selectPositionId(用户自己选中)</strong></p>
<ol>
<li>从用户配置表中获取</li>
</ol>
<p>><strong> selectPositionId(未登录)</strong></p>
<ol>
<li>默认岗位 ID 根据人气(popularity)排序</li>
</ol>