客户端错误日志上报接口
<p>[toc]</p>
<h1>连调环境</h1>
<table>
<thead>
<tr>
<th>环境</th>
<th>地址</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>连调</td>
<td>192.168.10.32:8000</td>
<td>我本机</td>
</tr>
<tr>
<td>测试</td>
<td>192.168.1.191:8000</td>
<td>191</td>
</tr>
</tbody>
</table>
<h1>上报错误日志</h1>
<p><strong>以下两个接口均可使用,日志上报成功后可以到日志管理平台中进行查询分析.</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">接口名</th>
<th style="text-align: left;">调用方法</th>
<th style="text-align: left;">请求头(Content-Type)</th>
<th style="text-align: left;">备注</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">/clienterr</td>
<td style="text-align: left;">GET</td>
<td style="text-align: left;">application/x-www-form-urlencoded;charset=utf-8</td>
<td style="text-align: left;">无</td>
</tr>
<tr>
<td style="text-align: left;">/clienterr</td>
<td style="text-align: left;">POST</td>
<td style="text-align: left;">application/json;charset=utf-8</td>
<td style="text-align: left;">无</td>
</tr>
</tbody>
</table>
<h1>请求参数</h1>
<p><strong>查看字段注释,<a href="https://docs.google.com/spreadsheets/d/19cypzUJcBfB10iWIDOByi6o5I8oz5WsjEwEe95YbCI0/edit#gid=1727641524" title="点击这里">点击这里</a></strong></p>
<pre><code>// 客户端同学在提交参数的时候, 注意使用下面 'json:' 里面的字段名称(具体可参考示例).
struct {
DeviceModel string `form:"device_model" json:"device_model" binding:"required"`
DeviceOS string `form:"device_os" json:"device_os" binding:"required"`
AppPlatform string `form:"app_platform" json:"app_platform" binding:"required"`
AppVersion string `form:"app_version" json:"app_version" binding:"required"`
IPAddress string `form:"ip_address" json:"ip_address" binding:"omitempty"`
Country string `form:"country" json:"country" binding:"required"`
Language string `form:"language" json:"language" binding:"required"`
ClientID string `form:"clientid" json:"clientid" binding:"required"`
PlayerSN string `form:"playersn" json:"playersn" binding:"omitempty"`
ThirdPlatform string `form:"third_platform" json:"third_platform" binding:"omitempty"`
ThirdOpenID string `form:"third_open_id" json:"third_open_id" binding:"omitempty"`
Module string `form:"module" json:"module" binding:"required"`
SubMod string `form:"submod" json:"submod" binding:"required"`
Error string `form:"error" json:"error" binding:"required"`
}</code></pre>
<h1>应答数据</h1>
<p>原生HTTP错误码+错误信息</p>
<h1>示例(GET)</h1>
<pre><code>http://192.168.10.32:8000/clienterr?device_model=小米11&third_open_id=&app_platform=android&country=USA&language=en&error=第三方登陆失败错误码:1101&device_os=xiaomi_os_ui_1&app_version=2.3.11&third_platform=&submod=third&ip_address=ip&clientid=weoriuiwer813984&playersn=soidjfw_sldkjfkdj_23&module=login</code></pre>
<h1>示例(POST)</h1>
<pre><code>// body:
{
"device_model": "小米11",
"device_os": "xiaomi_os_ui_1",
"app_platform": "android",
"app_version": "2.3.11",
"ip_address": "ip",
"country": "USA",
"language": "en",
"clientid": "weoriuiwer813984",
"playersn": "soidjfw_sldkjfkdj_23",
"third_platform": "",
"third_open_id": "",
"module": "login",
"submod": "third",
"error": "第三方登陆失败错误码:1101"
}</code></pre>