篮球协会小程序接口文档


球队管理接口ApiTeamController

<p>**</p> <h1>API Team 接口文档</h1> <h2>接口概述</h2> <ul> <li><strong>基础路径</strong>: <code>/api/team</code></li> <li><strong>控制器</strong>: <code>ApiTeamController</code></li> <li><strong>用途</strong>: 小程序球队管理相关接口</li> <li><strong>认证</strong>: 所有接口均支持匿名访问(<code>@Anonymous</code>)</li> </ul> <hr /> <h2>1. 获取球队列表</h2> <h3>接口信息</h3> <ul> <li><strong>请求方式</strong>: <code>GET</code></li> <li><strong>接口路径</strong>: <code>/api/team/list</code></li> <li><strong>功能描述</strong>: 分页获取球队列表,支持按名称和状态筛选</li> </ul> <h3>请求参数</h3> <table> <thead> <tr> <th>参数名</th> <th>类型</th> <th>必填</th> <th>默认值</th> <th>说明</th> </tr> </thead> <tbody> <tr> <td>teamName</td> <td>String</td> <td>否</td> <td>-</td> <td>球队名称(模糊查询)</td> </tr> <tr> <td>status</td> <td>String</td> <td>否</td> <td>-</td> <td>球队状态</td> </tr> <tr> <td>pageNum</td> <td>Integer</td> <td>否</td> <td>1</td> <td>页码</td> </tr> <tr> <td>pageSize</td> <td>Integer</td> <td>否</td> <td>10</td> <td>每页大小</td> </tr> </tbody> </table> <h3>响应示例</h3> <pre><code class="language-json">{ &amp;quot;code&amp;quot;: 200, &amp;quot;msg&amp;quot;: &amp;quot;操作成功&amp;quot;, &amp;quot;data&amp;quot;: { &amp;quot;list&amp;quot;: [ { &amp;quot;teamId&amp;quot;: 1, &amp;quot;teamName&amp;quot;: &amp;quot;示例球队&amp;quot;, &amp;quot;status&amp;quot;: &amp;quot;1&amp;quot;, &amp;quot;createTime&amp;quot;: &amp;quot;2025-01-27 10:00:00&amp;quot; } ], &amp;quot;total&amp;quot;: 1, &amp;quot;pageNum&amp;quot;: 1, &amp;quot;pageSize&amp;quot;: 10 } }</code></pre> <hr /> <h2>2. 获取球队详情</h2> <h3>接口信息</h3> <ul> <li><strong>请求方式</strong>: <code>GET</code></li> <li><strong>接口路径</strong>: <code>/api/team/detail/{teamId}</code></li> <li><strong>功能描述</strong>: 根据球队ID获取球队详细信息</li> </ul> <h3>路径参数</h3> <table> <thead> <tr> <th>参数名</th> <th>类型</th> <th>必填</th> <th>说明</th> </tr> </thead> <tbody> <tr> <td>teamId</td> <td>Long</td> <td>是</td> <td>球队ID</td> </tr> </tbody> </table> <h3>响应示例</h3> <pre><code class="language-json">{ &amp;quot;code&amp;quot;: 200, &amp;quot;msg&amp;quot;: &amp;quot;操作成功&amp;quot;, &amp;quot;data&amp;quot;: { &amp;quot;teamId&amp;quot;: 1, &amp;quot;teamName&amp;quot;: &amp;quot;示例球队&amp;quot;, &amp;quot;leaderName&amp;quot;: &amp;quot;张三&amp;quot;, &amp;quot;leaderPhone&amp;quot;: &amp;quot;13800138000&amp;quot;, &amp;quot;headCoachName&amp;quot;: &amp;quot;李四&amp;quot;, &amp;quot;headCoachPhone&amp;quot;: &amp;quot;13900139000&amp;quot;, &amp;quot;province&amp;quot;: &amp;quot;广东省&amp;quot;, &amp;quot;city&amp;quot;: &amp;quot;深圳市&amp;quot;, &amp;quot;address&amp;quot;: &amp;quot;南山区科技园&amp;quot; } }</code></pre> <hr /> <h2>3. 获取球队详情(包含成员)</h2> <h3>接口信息</h3> <ul> <li><strong>请求方式</strong>: <code>GET</code></li> <li><strong>接口路径</strong>: <code>/api/team/detailWithMembers/{teamId}</code></li> <li><strong>功能描述</strong>: 获取球队详情并包含成员列表</li> </ul> <h3>路径参数</h3> <table> <thead> <tr> <th>参数名</th> <th>类型</th> <th>必填</th> <th>说明</th> </tr> </thead> <tbody> <tr> <td>teamId</td> <td>Long</td> <td>是</td> <td>球队ID</td> </tr> </tbody> </table> <h3>响应示例</h3> <pre><code class="language-json">{ &amp;quot;code&amp;quot;: 200, &amp;quot;msg&amp;quot;: &amp;quot;操作成功&amp;quot;, &amp;quot;data&amp;quot;: { &amp;quot;teamId&amp;quot;: 1, &amp;quot;teamName&amp;quot;: &amp;quot;示例球队&amp;quot;, &amp;quot;wmTeamMemberList&amp;quot;: [ { &amp;quot;memberId&amp;quot;: 1, &amp;quot;memberName&amp;quot;: &amp;quot;王五&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;前锋&amp;quot;, &amp;quot;jerseyNumber&amp;quot;: &amp;quot;10&amp;quot; } ] } }</code></pre> <hr /> <h2>4. 获取球队成员列表</h2> <h3>接口信息</h3> <ul> <li><strong>请求方式</strong>: <code>GET</code></li> <li><strong>接口路径</strong>: <code>/api/team/members/{teamId}</code></li> <li><strong>功能描述</strong>: 获取指定球队的成员列表</li> </ul> <h3>路径参数</h3> <table> <thead> <tr> <th>参数名</th> <th>类型</th> <th>必填</th> <th>说明</th> </tr> </thead> <tbody> <tr> <td>teamId</td> <td>Long</td> <td>是</td> <td>球队ID</td> </tr> </tbody> </table> <h3>响应示例</h3> <pre><code class="language-json">{ &amp;quot;code&amp;quot;: 200, &amp;quot;msg&amp;quot;: &amp;quot;操作成功&amp;quot;, &amp;quot;data&amp;quot;: { &amp;quot;teamId&amp;quot;: 1, &amp;quot;teamName&amp;quot;: &amp;quot;示例球队&amp;quot;, &amp;quot;members&amp;quot;: [ { &amp;quot;memberId&amp;quot;: 1, &amp;quot;memberName&amp;quot;: &amp;quot;王五&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;前锋&amp;quot; } ], &amp;quot;total&amp;quot;: 1 } }</code></pre> <hr /> <h2>5. 获取球队参赛记录</h2> <h3>接口信息</h3> <ul> <li><strong>请求方式</strong>: <code>GET</code></li> <li><strong>接口路径</strong>: <code>/api/team/matchRecords/{teamId}</code></li> <li><strong>功能描述</strong>: 获取球队的参赛记录</li> </ul> <h3>路径参数</h3> <table> <thead> <tr> <th>参数名</th> <th>类型</th> <th>必填</th> <th>说明</th> </tr> </thead> <tbody> <tr> <td>teamId</td> <td>Long</td> <td>是</td> <td>球队ID</td> </tr> </tbody> </table> <h3>响应示例</h3> <pre><code class="language-json">{ &amp;quot;code&amp;quot;: 200, &amp;quot;msg&amp;quot;: &amp;quot;操作成功&amp;quot;, &amp;quot;data&amp;quot;: { &amp;quot;teamId&amp;quot;: 1, &amp;quot;teamName&amp;quot;: &amp;quot;示例球队&amp;quot;, &amp;quot;records&amp;quot;: [ { &amp;quot;matchId&amp;quot;: 1, &amp;quot;matchDate&amp;quot;: &amp;quot;2025-01-20&amp;quot;, &amp;quot;opponent&amp;quot;: &amp;quot;对手球队&amp;quot;, &amp;quot;result&amp;quot;: &amp;quot;胜&amp;quot; } ], &amp;quot;total&amp;quot;: 1 } }</code></pre> <hr /> <h2>6. 搜索球队</h2> <h3>接口信息</h3> <ul> <li><strong>请求方式</strong>: <code>GET</code></li> <li><strong>接口路径</strong>: <code>/api/team/search</code></li> <li><strong>功能描述</strong>: 根据关键词搜索球队</li> </ul> <h3>请求参数</h3> <table> <thead> <tr> <th>参数名</th> <th>类型</th> <th>必填</th> <th>说明</th> </tr> </thead> <tbody> <tr> <td>keyword</td> <td>String</td> <td>是</td> <td>搜索关键词(球队名称)</td> </tr> </tbody> </table> <h3>响应示例</h3> <pre><code class="language-json">{ &amp;quot;code&amp;quot;: 200, &amp;quot;msg&amp;quot;: &amp;quot;操作成功&amp;quot;, &amp;quot;data&amp;quot;: { &amp;quot;list&amp;quot;: [ { &amp;quot;teamId&amp;quot;: 1, &amp;quot;teamName&amp;quot;: &amp;quot;示例球队&amp;quot; } ], &amp;quot;total&amp;quot;: 1 } }</code></pre> <hr /> <h2>7. 更新球队信息</h2> <h3>接口信息</h3> <ul> <li><strong>请求方式</strong>: <code>PUT</code></li> <li><strong>接口路径</strong>: <code>/api/team/update</code></li> <li><strong>功能描述</strong>: 更新球队信息</li> </ul> <h3>请求参数</h3> <table> <thead> <tr> <th>参数名</th> <th>类型</th> <th>必填</th> <th>说明</th> </tr> </thead> <tbody> <tr> <td>teamId</td> <td>Long</td> <td>是</td> <td>球队ID</td> </tr> <tr> <td>teamName</td> <td>String</td> <td>是</td> <td>球队名称</td> </tr> <tr> <td>leaderName</td> <td>String</td> <td>是</td> <td>领队姓名</td> </tr> <tr> <td>leaderPhone</td> <td>String</td> <td>是</td> <td>领队联系方式</td> </tr> <tr> <td>headCoachName</td> <td>String</td> <td>是</td> <td>主教练姓名</td> </tr> <tr> <td>headCoachPhone</td> <td>String</td> <td>是</td> <td>主教练联系方式</td> </tr> <tr> <td>province</td> <td>String</td> <td>是</td> <td>所在省份</td> </tr> <tr> <td>city</td> <td>String</td> <td>是</td> <td>所在城市</td> </tr> <tr> <td>address</td> <td>String</td> <td>是</td> <td>详细地址</td> </tr> </tbody> </table> <h3>请求示例</h3> <pre><code class="language-json">{ &amp;quot;teamId&amp;quot;: 1, &amp;quot;teamName&amp;quot;: &amp;quot;更新后的球队名称&amp;quot;, &amp;quot;leaderName&amp;quot;: &amp;quot;新领队&amp;quot;, &amp;quot;leaderPhone&amp;quot;: &amp;quot;13800138000&amp;quot;, &amp;quot;headCoachName&amp;quot;: &amp;quot;新教练&amp;quot;, &amp;quot;headCoachPhone&amp;quot;: &amp;quot;13900139000&amp;quot;, &amp;quot;province&amp;quot;: &amp;quot;广东省&amp;quot;, &amp;quot;city&amp;quot;: &amp;quot;深圳市&amp;quot;, &amp;quot;address&amp;quot;: &amp;quot;新地址&amp;quot; }</code></pre> <h3>响应示例</h3> <pre><code class="language-json">{ &amp;quot;code&amp;quot;: 200, &amp;quot;msg&amp;quot;: &amp;quot;球队信息更新成功&amp;quot;, &amp;quot;data&amp;quot;: null }</code></pre> <hr /> <h2>通用响应格式</h2> <h3>成功响应</h3> <pre><code class="language-json">{ &amp;quot;code&amp;quot;: 200, &amp;quot;msg&amp;quot;: &amp;quot;操作成功&amp;quot;, &amp;quot;data&amp;quot;: {} }</code></pre> <h3>错误响应</h3> <pre><code class="language-json">{ &amp;quot;code&amp;quot;: 500, &amp;quot;msg&amp;quot;: &amp;quot;错误信息&amp;quot;, &amp;quot;data&amp;quot;: null }</code></pre> <hr /> <h2>注意事项</h2> <ol> <li><strong>分页处理</strong>: 列表接口使用 PageHelper 进行分页,自动处理 LIMIT 子句</li> <li><strong>参数验证</strong>: 所有接口都包含完整的参数验证</li> <li><strong>异常处理</strong>: 统一的异常捕获和错误信息返回</li> <li><strong>日志记录</strong>: 关键操作都有详细的日志记录</li> <li><strong>匿名访问</strong>: 所有接口都支持匿名访问,无需认证</li> </ol> <hr /> <h2>错误码说明</h2> <table> <thead> <tr> <th>错误码</th> <th>说明</th> </tr> </thead> <tbody> <tr> <td>200</td> <td>操作成功</td> </tr> <tr> <td>500</td> <td>系统错误</td> </tr> <tr> <td>400</td> <td>参数错误</td> </tr> </tbody> </table> <p>**</p>

页面列表

ITEM_HTML