|
@@ -0,0 +1,5077 @@
|
|
|
+<!doctype html>
|
|
|
+<html lang="en">
|
|
|
+<head>
|
|
|
+ <meta charset="utf-8">
|
|
|
+ <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
|
|
|
+ <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
|
|
+ <title>Owl Admin API Documentation</title>
|
|
|
+
|
|
|
+ <link href="https://fonts.googleapis.com/css?family=Open+Sans&display=swap" rel="stylesheet">
|
|
|
+
|
|
|
+ <link rel="stylesheet" href="{{ asset("/vendor/scribe/css/theme-default.style.css") }}" media="screen">
|
|
|
+ <link rel="stylesheet" href="{{ asset("/vendor/scribe/css/theme-default.print.css") }}" media="print">
|
|
|
+
|
|
|
+ <script src="https://cdn.jsdelivr.net/npm/lodash@4.17.10/lodash.min.js"></script>
|
|
|
+
|
|
|
+ <link rel="stylesheet"
|
|
|
+ href="https://unpkg.com/@highlightjs/cdn-assets@11.6.0/styles/obsidian.min.css">
|
|
|
+ <script src="https://unpkg.com/@highlightjs/cdn-assets@11.6.0/highlight.min.js"></script>
|
|
|
+
|
|
|
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/jets/0.14.1/jets.min.js"></script>
|
|
|
+
|
|
|
+ <style id="language-style">
|
|
|
+ /* starts out as display none and is replaced with js later */
|
|
|
+ body .content .javascript-example code { display: none; }
|
|
|
+ body .content .bash-example code { display: none; }
|
|
|
+ </style>
|
|
|
+
|
|
|
+ <script>
|
|
|
+ var tryItOutBaseUrl = "http://127.0.0.1";
|
|
|
+ var useCsrf = Boolean();
|
|
|
+ var csrfUrl = "/sanctum/csrf-cookie";
|
|
|
+ </script>
|
|
|
+ <script src="{{ asset("/vendor/scribe/js/tryitout-4.38.0.js") }}"></script>
|
|
|
+
|
|
|
+ <script src="{{ asset("/vendor/scribe/js/theme-default-4.38.0.js") }}"></script>
|
|
|
+
|
|
|
+</head>
|
|
|
+
|
|
|
+<body data-languages="["javascript","bash"]">
|
|
|
+
|
|
|
+<a href="#" id="nav-button">
|
|
|
+ <span>
|
|
|
+ MENU
|
|
|
+ <img src="{{ asset("/vendor/scribe/images/navbar.png") }}" alt="navbar-image"/>
|
|
|
+ </span>
|
|
|
+</a>
|
|
|
+<div class="tocify-wrapper">
|
|
|
+
|
|
|
+ <div class="lang-selector">
|
|
|
+ <button type="button" class="lang-button" data-language-name="javascript">javascript</button>
|
|
|
+ <button type="button" class="lang-button" data-language-name="bash">bash</button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="search">
|
|
|
+ <input type="text" class="search" id="input-search" placeholder="Search">
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div id="toc">
|
|
|
+ <ul id="tocify-header-introduction" class="tocify-header">
|
|
|
+ <li class="tocify-item level-1" data-unique="introduction">
|
|
|
+ <a href="#introduction">Introduction</a>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ <ul id="tocify-header-authenticating-requests" class="tocify-header">
|
|
|
+ <li class="tocify-item level-1" data-unique="authenticating-requests">
|
|
|
+ <a href="#authenticating-requests">Authenticating requests</a>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ <ul id="tocify-header-" class="tocify-header">
|
|
|
+ <li class="tocify-item level-1" data-unique="">
|
|
|
+ <a href="#"></a>
|
|
|
+ </li>
|
|
|
+ <ul id="tocify-subheader-" class="tocify-subheader">
|
|
|
+ <li class="tocify-item level-2" data-unique="-GETapi-scribe-update-token--mobile-">
|
|
|
+ <a href="#-GETapi-scribe-update-token--mobile-">更新API文档的认证Token</a>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </ul>
|
|
|
+ <ul id="tocify-header-" class="tocify-header">
|
|
|
+ <li class="tocify-item level-1" data-unique="">
|
|
|
+ <a href="#">用户端-地址管理</a>
|
|
|
+ </li>
|
|
|
+ <ul id="tocify-subheader-" class="tocify-subheader">
|
|
|
+ <li class="tocify-item level-2" data-unique="-GETapi-address-default">
|
|
|
+ <a href="#-GETapi-address-default">获取默认地址2</a>
|
|
|
+ </li>
|
|
|
+ <li class="tocify-item level-2" data-unique="-POSTapi-address">
|
|
|
+ <a href="#-POSTapi-address">添加地址</a>
|
|
|
+ </li>
|
|
|
+ <li class="tocify-item level-2" data-unique="-PUTapi-address--id-">
|
|
|
+ <a href="#-PUTapi-address--id-">修改地址</a>
|
|
|
+ </li>
|
|
|
+ <li class="tocify-item level-2" data-unique="-DELETEapi-address--id-">
|
|
|
+ <a href="#-DELETEapi-address--id-">删除地址</a>
|
|
|
+ </li>
|
|
|
+ <li class="tocify-item level-2" data-unique="-PUTapi-address--id--default">
|
|
|
+ <a href="#-PUTapi-address--id--default">设置默认地址</a>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </ul>
|
|
|
+ <ul id="tocify-header-" class="tocify-header">
|
|
|
+ <li class="tocify-item level-1" data-unique="">
|
|
|
+ <a href="#">用户端-技师定位管理</a>
|
|
|
+ </li>
|
|
|
+ <ul id="tocify-subheader-" class="tocify-subheader">
|
|
|
+ <li class="tocify-item level-2" data-unique="-GETapi-coach-location">
|
|
|
+ <a href="#-GETapi-coach-location">获取定位列表</a>
|
|
|
+ </li>
|
|
|
+ <li class="tocify-item level-2" data-unique="-POSTapi-coach-location">
|
|
|
+ <a href="#-POSTapi-coach-location">创建定位</a>
|
|
|
+ </li>
|
|
|
+ <li class="tocify-item level-2" data-unique="-DELETEapi-coach-location--id-">
|
|
|
+ <a href="#-DELETEapi-coach-location--id-">删除定位</a>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </ul>
|
|
|
+ <ul id="tocify-header-" class="tocify-header">
|
|
|
+ <li class="tocify-item level-1" data-unique="">
|
|
|
+ <a href="#">用户端-技师管理</a>
|
|
|
+ </li>
|
|
|
+ <ul id="tocify-subheader-" class="tocify-subheader">
|
|
|
+ <li class="tocify-item level-2" data-unique="-GETapi-coach">
|
|
|
+ <a href="#-GETapi-coach">获取技师列表</a>
|
|
|
+ </li>
|
|
|
+ <li class="tocify-item level-2" data-unique="-GETapi-coach--id-">
|
|
|
+ <a href="#-GETapi-coach--id-">获取技师详情</a>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </ul>
|
|
|
+ <ul id="tocify-header-" class="tocify-header">
|
|
|
+ <li class="tocify-item level-1" data-unique="">
|
|
|
+ <a href="#">用户端-用户管理</a>
|
|
|
+ </li>
|
|
|
+ <ul id="tocify-subheader-" class="tocify-subheader">
|
|
|
+ <li class="tocify-item level-2" data-unique="-GETapi-user">
|
|
|
+ <a href="#-GETapi-user">获取用户信息</a>
|
|
|
+ </li>
|
|
|
+ <li class="tocify-item level-2" data-unique="-PUTapi-user">
|
|
|
+ <a href="#-PUTapi-user">修改用户信息</a>
|
|
|
+ </li>
|
|
|
+ <li class="tocify-item level-2" data-unique="-GETapi-user-wallet">
|
|
|
+ <a href="#-GETapi-user-wallet">获取用户钱包</a>
|
|
|
+ </li>
|
|
|
+ <li class="tocify-item level-2" data-unique="-POSTapi-user-withdraw">
|
|
|
+ <a href="#-POSTapi-user-withdraw">用户提现</a>
|
|
|
+ </li>
|
|
|
+ <li class="tocify-item level-2" data-unique="-POSTapi-user-apply-coach">
|
|
|
+ <a href="#-POSTapi-user-apply-coach">申请成为技师</a>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </ul>
|
|
|
+ <ul id="tocify-header-" class="tocify-header">
|
|
|
+ <li class="tocify-item level-1" data-unique="">
|
|
|
+ <a href="#">用户端-订单管理</a>
|
|
|
+ </li>
|
|
|
+ <ul id="tocify-subheader-" class="tocify-subheader">
|
|
|
+ <li class="tocify-item level-2" data-unique="-POSTapi-orders-initialize">
|
|
|
+ <a href="#-POSTapi-orders-initialize">订单初始化</a>
|
|
|
+ </li>
|
|
|
+ <li class="tocify-item level-2" data-unique="-POSTapi-orders-create">
|
|
|
+ <a href="#-POSTapi-orders-create">创建订单</a>
|
|
|
+ </li>
|
|
|
+ <li class="tocify-item level-2" data-unique="-POSTapi-orders-cancel">
|
|
|
+ <a href="#-POSTapi-orders-cancel">取消订单</a>
|
|
|
+ </li>
|
|
|
+ <li class="tocify-item level-2" data-unique="-POSTapi-orders-finish">
|
|
|
+ <a href="#-POSTapi-orders-finish">结束订单</a>
|
|
|
+ </li>
|
|
|
+ <li class="tocify-item level-2" data-unique="-POSTapi-orders-confirm-leave">
|
|
|
+ <a href="#-POSTapi-orders-confirm-leave">确认技师离开</a>
|
|
|
+ </li>
|
|
|
+ <li class="tocify-item level-2" data-unique="-GETapi-orders-list">
|
|
|
+ <a href="#-GETapi-orders-list">获取订单列表</a>
|
|
|
+ </li>
|
|
|
+ <li class="tocify-item level-2" data-unique="-GETapi-orders-detail--id-">
|
|
|
+ <a href="#-GETapi-orders-detail--id-">获取订单详情</a>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </ul>
|
|
|
+ <ul id="tocify-header-" class="tocify-header">
|
|
|
+ <li class="tocify-item level-1" data-unique="">
|
|
|
+ <a href="#">用户端-项目管理</a>
|
|
|
+ </li>
|
|
|
+ <ul id="tocify-subheader-" class="tocify-subheader">
|
|
|
+ <li class="tocify-item level-2" data-unique="-GETapi-project">
|
|
|
+ <a href="#-GETapi-project">获取项目列表</a>
|
|
|
+ </li>
|
|
|
+ <li class="tocify-item level-2" data-unique="-GETapi-project--id--detail">
|
|
|
+ <a href="#-GETapi-project--id--detail">获取项目详情</a>
|
|
|
+ </li>
|
|
|
+ <li class="tocify-item level-2" data-unique="-GETapi-project-coach-list">
|
|
|
+ <a href="#-GETapi-project-coach-list">获取技师项目列表</a>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </ul>
|
|
|
+ <ul id="tocify-header-" class="tocify-header">
|
|
|
+ <li class="tocify-item level-1" data-unique="">
|
|
|
+ <a href="#">账户管理</a>
|
|
|
+ </li>
|
|
|
+ <ul id="tocify-subheader-" class="tocify-subheader">
|
|
|
+ <li class="tocify-item level-2" data-unique="-POSTapi-account-send-code">
|
|
|
+ <a href="#-POSTapi-account-send-code">发送验证码</a>
|
|
|
+ </li>
|
|
|
+ <li class="tocify-item level-2" data-unique="-POSTapi-account-login">
|
|
|
+ <a href="#-POSTapi-account-login">用户登录</a>
|
|
|
+ </li>
|
|
|
+ <li class="tocify-item level-2" data-unique="-POSTapi-account-wx-login">
|
|
|
+ <a href="#-POSTapi-account-wx-login">微信登录</a>
|
|
|
+ </li>
|
|
|
+ <li class="tocify-item level-2" data-unique="-POSTapi-account-logout">
|
|
|
+ <a href="#-POSTapi-account-logout">用户退出</a>
|
|
|
+ </li>
|
|
|
+ <li class="tocify-item level-2" data-unique="-DELETEapi-account">
|
|
|
+ <a href="#-DELETEapi-account">用户注销</a>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <ul class="toc-footer" id="toc-footer">
|
|
|
+ <li style="padding-bottom: 5px;"><a href="{{ route("scribe.postman") }}">View Postman collection</a></li>
|
|
|
+ <li style="padding-bottom: 5px;"><a href="{{ route("scribe.openapi") }}">View OpenAPI spec</a></li>
|
|
|
+ <li><a href="http://github.com/knuckleswtf/scribe">Documentation powered by Scribe ✍</a></li>
|
|
|
+ </ul>
|
|
|
+
|
|
|
+ <ul class="toc-footer" id="last-updated">
|
|
|
+ <li>November 22 2024</li>
|
|
|
+ </ul>
|
|
|
+</div>
|
|
|
+
|
|
|
+<div class="page-wrapper">
|
|
|
+ <div class="dark-box"></div>
|
|
|
+ <div class="content">
|
|
|
+ <h1 id="introduction">Introduction</h1>
|
|
|
+<p>Owl Admin API 接口文档</p>
|
|
|
+<aside>
|
|
|
+ <strong>Base URL</strong>: <code>http://127.0.0.1</code>
|
|
|
+</aside>
|
|
|
+<p>欢迎使用 Owl Admin API 接口文档。</p>
|
|
|
+<p>该文档提供了所有可用的API接口信息。</p>
|
|
|
+
|
|
|
+ <h1 id="authenticating-requests">Authenticating requests</h1>
|
|
|
+<p>To authenticate requests, include an <strong><code>Authorization</code></strong> header with the value <strong><code>"Bearer 171|4wDLRqkRn3A5mQm3b5l9gelKO8BijUZKZrgVugt544296a98"</code></strong>.</p>
|
|
|
+<p>All authenticated endpoints are marked with a <code>requires authentication</code> badge in the documentation below.</p>
|
|
|
+<p>通过登录接口获取 token,格式为 Bearer {token}</p>
|
|
|
+
|
|
|
+ <h1 id=""></h1>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <h2 id="-GETapi-scribe-update-token--mobile-">更新API文档的认证Token</h2>
|
|
|
+
|
|
|
+<p>
|
|
|
+<small class="badge badge-darkred">requires authentication</small>
|
|
|
+</p>
|
|
|
+
|
|
|
+<p>通过手机号获取验证码并登录,然后更新API文档的认证Token</p>
|
|
|
+
|
|
|
+<span id="example-requests-GETapi-scribe-update-token--mobile-">
|
|
|
+<blockquote>Example request:</blockquote>
|
|
|
+
|
|
|
+
|
|
|
+<div class="javascript-example">
|
|
|
+ <pre><code class="language-javascript">const url = new URL(
|
|
|
+ "http://127.0.0.1/api/scribe/update-token/13800138000"
|
|
|
+);
|
|
|
+
|
|
|
+const headers = {
|
|
|
+ "Authorization": "Bearer {YOUR_AUTH_KEY}",
|
|
|
+ "Accept": "application/json",
|
|
|
+};
|
|
|
+
|
|
|
+fetch(url, {
|
|
|
+ method: "GET",
|
|
|
+ headers,
|
|
|
+}).then(response => response.json());</code></pre></div>
|
|
|
+
|
|
|
+
|
|
|
+<div class="bash-example">
|
|
|
+ <pre><code class="language-bash">curl --request GET \
|
|
|
+ --get "http://127.0.0.1/api/scribe/update-token/13800138000" \
|
|
|
+ --header "Authorization: Bearer {YOUR_AUTH_KEY}"</code></pre></div>
|
|
|
+
|
|
|
+</span>
|
|
|
+
|
|
|
+<span id="example-responses-GETapi-scribe-update-token--mobile-">
|
|
|
+ <blockquote>
|
|
|
+ <p>Example response (200):</p>
|
|
|
+ </blockquote>
|
|
|
+ <pre>
|
|
|
+
|
|
|
+<code class="language-json" style="max-height: 300px;">{
|
|
|
+ "code": 200,
|
|
|
+ "message": "Token更新成功",
|
|
|
+ "data": {
|
|
|
+ "token": "your_new_token_here"
|
|
|
+ }
|
|
|
+}</code>
|
|
|
+ </pre>
|
|
|
+ </span>
|
|
|
+<span id="execution-results-GETapi-scribe-update-token--mobile-" hidden>
|
|
|
+ <blockquote>Received response<span
|
|
|
+ id="execution-response-status-GETapi-scribe-update-token--mobile-"></span>:
|
|
|
+ </blockquote>
|
|
|
+ <pre class="json"><code id="execution-response-content-GETapi-scribe-update-token--mobile-"
|
|
|
+ data-empty-response-text="<Empty response>" style="max-height: 400px;"></code></pre>
|
|
|
+</span>
|
|
|
+<span id="execution-error-GETapi-scribe-update-token--mobile-" hidden>
|
|
|
+ <blockquote>Request failed with error:</blockquote>
|
|
|
+ <pre><code id="execution-error-message-GETapi-scribe-update-token--mobile-">
|
|
|
+
|
|
|
+Tip: Check that you're properly connected to the network.
|
|
|
+If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
|
|
|
+You can check the Dev Tools console for debugging information.</code></pre>
|
|
|
+</span>
|
|
|
+<form id="form-GETapi-scribe-update-token--mobile-" data-method="GET"
|
|
|
+ data-path="api/scribe/update-token/{mobile}"
|
|
|
+ data-authed="1"
|
|
|
+ data-hasfiles="0"
|
|
|
+ data-isarraybody="0"
|
|
|
+ autocomplete="off"
|
|
|
+ onsubmit="event.preventDefault(); executeTryOut('GETapi-scribe-update-token--mobile-', this);">
|
|
|
+ <h3>
|
|
|
+ Request
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #8fbcd4; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-tryout-GETapi-scribe-update-token--mobile-"
|
|
|
+ onclick="tryItOut('GETapi-scribe-update-token--mobile-');">Try it out ⚡
|
|
|
+ </button>
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-canceltryout-GETapi-scribe-update-token--mobile-"
|
|
|
+ onclick="cancelTryOut('GETapi-scribe-update-token--mobile-');" hidden>Cancel 🛑
|
|
|
+ </button>
|
|
|
+ <button type="submit"
|
|
|
+ style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-executetryout-GETapi-scribe-update-token--mobile-"
|
|
|
+ data-initial-text="Send Request 💥"
|
|
|
+ data-loading-text="⏱ Sending..."
|
|
|
+ hidden>Send Request 💥
|
|
|
+ </button>
|
|
|
+ </h3>
|
|
|
+ <p>
|
|
|
+ <small class="badge badge-green">GET</small>
|
|
|
+ <b><code>api/scribe/update-token/{mobile}</code></b>
|
|
|
+ </p>
|
|
|
+ <h4 class="fancy-heading-panel"><b>Headers</b></h4>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>Authorization</code></b>
|
|
|
+
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="Authorization" class="auth-value" data-endpoint="GETapi-scribe-update-token--mobile-"
|
|
|
+ value="Bearer {YOUR_AUTH_KEY}"
|
|
|
+ data-component="header">
|
|
|
+ <br>
|
|
|
+<p>Example: <code>Bearer {YOUR_AUTH_KEY}</code></p>
|
|
|
+ </div>
|
|
|
+ <h4 class="fancy-heading-panel"><b>URL Parameters</b></h4>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>mobile</code></b>
|
|
|
+<small>string</small>
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="mobile" data-endpoint="GETapi-scribe-update-token--mobile-"
|
|
|
+ value="13800138000"
|
|
|
+ data-component="url">
|
|
|
+ <br>
|
|
|
+<p>手机号码. Example: <code>13800138000</code></p>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+
|
|
|
+ <h1 id="">用户端-地址管理</h1>
|
|
|
+
|
|
|
+ <p>用户地址相关的API接口</p>
|
|
|
+
|
|
|
+ <h2 id="-GETapi-address-default">获取默认地址2</h2>
|
|
|
+
|
|
|
+<p>
|
|
|
+<small class="badge badge-darkred">requires authentication</small>
|
|
|
+</p>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+<span id="example-requests-GETapi-address-default">
|
|
|
+<blockquote>Example request:</blockquote>
|
|
|
+
|
|
|
+
|
|
|
+<div class="javascript-example">
|
|
|
+ <pre><code class="language-javascript">const url = new URL(
|
|
|
+ "http://127.0.0.1/api/address/default"
|
|
|
+);
|
|
|
+
|
|
|
+const headers = {
|
|
|
+ "Authorization": "Bearer {YOUR_AUTH_KEY}",
|
|
|
+ "Accept": "application/json",
|
|
|
+};
|
|
|
+
|
|
|
+fetch(url, {
|
|
|
+ method: "GET",
|
|
|
+ headers,
|
|
|
+}).then(response => response.json());</code></pre></div>
|
|
|
+
|
|
|
+
|
|
|
+<div class="bash-example">
|
|
|
+ <pre><code class="language-bash">curl --request GET \
|
|
|
+ --get "http://127.0.0.1/api/address/default" \
|
|
|
+ --header "Authorization: Bearer {YOUR_AUTH_KEY}"</code></pre></div>
|
|
|
+
|
|
|
+</span>
|
|
|
+
|
|
|
+<span id="example-responses-GETapi-address-default">
|
|
|
+ <blockquote>
|
|
|
+ <p>Example response (200):</p>
|
|
|
+ </blockquote>
|
|
|
+ <pre>
|
|
|
+
|
|
|
+<code class="language-json" style="max-height: 300px;">{
|
|
|
+ "code": 200,
|
|
|
+ "message": "success",
|
|
|
+ "data": {
|
|
|
+ "id": 1,
|
|
|
+ "user_id": 1,
|
|
|
+ "name": "张三",
|
|
|
+ "phone": "13800138000",
|
|
|
+ "province": "广东省",
|
|
|
+ "city": "深圳市",
|
|
|
+ "district": "南山区",
|
|
|
+ "address": "科技园",
|
|
|
+ "is_default": 1,
|
|
|
+ "created_at": "2024-01-01 00:00:00",
|
|
|
+ "updated_at": "2024-01-01 00:00:00"
|
|
|
+ }
|
|
|
+}</code>
|
|
|
+ </pre>
|
|
|
+ </span>
|
|
|
+<span id="execution-results-GETapi-address-default" hidden>
|
|
|
+ <blockquote>Received response<span
|
|
|
+ id="execution-response-status-GETapi-address-default"></span>:
|
|
|
+ </blockquote>
|
|
|
+ <pre class="json"><code id="execution-response-content-GETapi-address-default"
|
|
|
+ data-empty-response-text="<Empty response>" style="max-height: 400px;"></code></pre>
|
|
|
+</span>
|
|
|
+<span id="execution-error-GETapi-address-default" hidden>
|
|
|
+ <blockquote>Request failed with error:</blockquote>
|
|
|
+ <pre><code id="execution-error-message-GETapi-address-default">
|
|
|
+
|
|
|
+Tip: Check that you're properly connected to the network.
|
|
|
+If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
|
|
|
+You can check the Dev Tools console for debugging information.</code></pre>
|
|
|
+</span>
|
|
|
+<form id="form-GETapi-address-default" data-method="GET"
|
|
|
+ data-path="api/address/default"
|
|
|
+ data-authed="1"
|
|
|
+ data-hasfiles="0"
|
|
|
+ data-isarraybody="0"
|
|
|
+ autocomplete="off"
|
|
|
+ onsubmit="event.preventDefault(); executeTryOut('GETapi-address-default', this);">
|
|
|
+ <h3>
|
|
|
+ Request
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #8fbcd4; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-tryout-GETapi-address-default"
|
|
|
+ onclick="tryItOut('GETapi-address-default');">Try it out ⚡
|
|
|
+ </button>
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-canceltryout-GETapi-address-default"
|
|
|
+ onclick="cancelTryOut('GETapi-address-default');" hidden>Cancel 🛑
|
|
|
+ </button>
|
|
|
+ <button type="submit"
|
|
|
+ style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-executetryout-GETapi-address-default"
|
|
|
+ data-initial-text="Send Request 💥"
|
|
|
+ data-loading-text="⏱ Sending..."
|
|
|
+ hidden>Send Request 💥
|
|
|
+ </button>
|
|
|
+ </h3>
|
|
|
+ <p>
|
|
|
+ <small class="badge badge-green">GET</small>
|
|
|
+ <b><code>api/address/default</code></b>
|
|
|
+ </p>
|
|
|
+ <h4 class="fancy-heading-panel"><b>Headers</b></h4>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>Authorization</code></b>
|
|
|
+
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="Authorization" class="auth-value" data-endpoint="GETapi-address-default"
|
|
|
+ value="Bearer {YOUR_AUTH_KEY}"
|
|
|
+ data-component="header">
|
|
|
+ <br>
|
|
|
+<p>Example: <code>Bearer {YOUR_AUTH_KEY}</code></p>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+
|
|
|
+ <h2 id="-POSTapi-address">添加地址</h2>
|
|
|
+
|
|
|
+<p>
|
|
|
+<small class="badge badge-darkred">requires authentication</small>
|
|
|
+</p>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+<span id="example-requests-POSTapi-address">
|
|
|
+<blockquote>Example request:</blockquote>
|
|
|
+
|
|
|
+
|
|
|
+<div class="javascript-example">
|
|
|
+ <pre><code class="language-javascript">const url = new URL(
|
|
|
+ "http://127.0.0.1/api/address"
|
|
|
+);
|
|
|
+
|
|
|
+const headers = {
|
|
|
+ "Authorization": "Bearer {YOUR_AUTH_KEY}",
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ "Accept": "application/json",
|
|
|
+};
|
|
|
+
|
|
|
+let body = {
|
|
|
+ "phone": "13800138000",
|
|
|
+ "province": "广东省",
|
|
|
+ "city": "深圳市",
|
|
|
+ "district": "南山区",
|
|
|
+ "longitude": "113.93041",
|
|
|
+ "latitude": "22.53332",
|
|
|
+ "area_code": "440305",
|
|
|
+ "is_default": true,
|
|
|
+ "location": "科技园",
|
|
|
+ "detail": "科技园南区"
|
|
|
+};
|
|
|
+
|
|
|
+fetch(url, {
|
|
|
+ method: "POST",
|
|
|
+ headers,
|
|
|
+ body: JSON.stringify(body),
|
|
|
+}).then(response => response.json());</code></pre></div>
|
|
|
+
|
|
|
+
|
|
|
+<div class="bash-example">
|
|
|
+ <pre><code class="language-bash">curl --request POST \
|
|
|
+ "http://127.0.0.1/api/address" \
|
|
|
+ --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
|
|
|
+ --header "Content-Type: application/json" \
|
|
|
+ --data "{
|
|
|
+ \"phone\": \"13800138000\",
|
|
|
+ \"province\": \"广东省\",
|
|
|
+ \"city\": \"深圳市\",
|
|
|
+ \"district\": \"南山区\",
|
|
|
+ \"longitude\": \"113.93041\",
|
|
|
+ \"latitude\": \"22.53332\",
|
|
|
+ \"area_code\": \"440305\",
|
|
|
+ \"is_default\": true,
|
|
|
+ \"location\": \"科技园\",
|
|
|
+ \"detail\": \"科技园南区\"
|
|
|
+}"
|
|
|
+</code></pre></div>
|
|
|
+
|
|
|
+</span>
|
|
|
+
|
|
|
+<span id="example-responses-POSTapi-address">
|
|
|
+ <blockquote>
|
|
|
+ <p>Example response (200):</p>
|
|
|
+ </blockquote>
|
|
|
+ <pre>
|
|
|
+
|
|
|
+<code class="language-json" style="max-height: 300px;">{
|
|
|
+ "code": 200,
|
|
|
+ "message": "添加成功"
|
|
|
+}</code>
|
|
|
+ </pre>
|
|
|
+ </span>
|
|
|
+<span id="execution-results-POSTapi-address" hidden>
|
|
|
+ <blockquote>Received response<span
|
|
|
+ id="execution-response-status-POSTapi-address"></span>:
|
|
|
+ </blockquote>
|
|
|
+ <pre class="json"><code id="execution-response-content-POSTapi-address"
|
|
|
+ data-empty-response-text="<Empty response>" style="max-height: 400px;"></code></pre>
|
|
|
+</span>
|
|
|
+<span id="execution-error-POSTapi-address" hidden>
|
|
|
+ <blockquote>Request failed with error:</blockquote>
|
|
|
+ <pre><code id="execution-error-message-POSTapi-address">
|
|
|
+
|
|
|
+Tip: Check that you're properly connected to the network.
|
|
|
+If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
|
|
|
+You can check the Dev Tools console for debugging information.</code></pre>
|
|
|
+</span>
|
|
|
+<form id="form-POSTapi-address" data-method="POST"
|
|
|
+ data-path="api/address"
|
|
|
+ data-authed="1"
|
|
|
+ data-hasfiles="0"
|
|
|
+ data-isarraybody="0"
|
|
|
+ autocomplete="off"
|
|
|
+ onsubmit="event.preventDefault(); executeTryOut('POSTapi-address', this);">
|
|
|
+ <h3>
|
|
|
+ Request
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #8fbcd4; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-tryout-POSTapi-address"
|
|
|
+ onclick="tryItOut('POSTapi-address');">Try it out ⚡
|
|
|
+ </button>
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-canceltryout-POSTapi-address"
|
|
|
+ onclick="cancelTryOut('POSTapi-address');" hidden>Cancel 🛑
|
|
|
+ </button>
|
|
|
+ <button type="submit"
|
|
|
+ style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-executetryout-POSTapi-address"
|
|
|
+ data-initial-text="Send Request 💥"
|
|
|
+ data-loading-text="⏱ Sending..."
|
|
|
+ hidden>Send Request 💥
|
|
|
+ </button>
|
|
|
+ </h3>
|
|
|
+ <p>
|
|
|
+ <small class="badge badge-black">POST</small>
|
|
|
+ <b><code>api/address</code></b>
|
|
|
+ </p>
|
|
|
+ <h4 class="fancy-heading-panel"><b>Headers</b></h4>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>Authorization</code></b>
|
|
|
+
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="Authorization" class="auth-value" data-endpoint="POSTapi-address"
|
|
|
+ value="Bearer {YOUR_AUTH_KEY}"
|
|
|
+ data-component="header">
|
|
|
+ <br>
|
|
|
+<p>Example: <code>Bearer {YOUR_AUTH_KEY}</code></p>
|
|
|
+ </div>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>Content-Type</code></b>
|
|
|
+
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="Content-Type" data-endpoint="POSTapi-address"
|
|
|
+ value="application/json"
|
|
|
+ data-component="header">
|
|
|
+ <br>
|
|
|
+<p>Example: <code>application/json</code></p>
|
|
|
+ </div>
|
|
|
+ <h4 class="fancy-heading-panel"><b>Body Parameters</b></h4>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>phone</code></b>
|
|
|
+<small>string</small>
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="phone" data-endpoint="POSTapi-address"
|
|
|
+ value="13800138000"
|
|
|
+ data-component="body">
|
|
|
+ <br>
|
|
|
+<p>手机号 Example: <code>13800138000</code></p>
|
|
|
+ </div>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>province</code></b>
|
|
|
+<small>string</small>
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="province" data-endpoint="POSTapi-address"
|
|
|
+ value="广东省"
|
|
|
+ data-component="body">
|
|
|
+ <br>
|
|
|
+<p>省份 Example: <code>广东省</code></p>
|
|
|
+ </div>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>city</code></b>
|
|
|
+<small>string</small>
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="city" data-endpoint="POSTapi-address"
|
|
|
+ value="深圳市"
|
|
|
+ data-component="body">
|
|
|
+ <br>
|
|
|
+<p>城市 Example: <code>深圳市</code></p>
|
|
|
+ </div>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>district</code></b>
|
|
|
+<small>string</small>
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="district" data-endpoint="POSTapi-address"
|
|
|
+ value="南山区"
|
|
|
+ data-component="body">
|
|
|
+ <br>
|
|
|
+<p>区县 Example: <code>南山区</code></p>
|
|
|
+ </div>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>longitude</code></b>
|
|
|
+<small>string</small>
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="longitude" data-endpoint="POSTapi-address"
|
|
|
+ value="113.93041"
|
|
|
+ data-component="body">
|
|
|
+ <br>
|
|
|
+<p>经度 Example: <code>113.93041</code></p>
|
|
|
+ </div>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>latitude</code></b>
|
|
|
+<small>string</small>
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="latitude" data-endpoint="POSTapi-address"
|
|
|
+ value="22.53332"
|
|
|
+ data-component="body">
|
|
|
+ <br>
|
|
|
+<p>纬度 Example: <code>22.53332</code></p>
|
|
|
+ </div>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>area_code</code></b>
|
|
|
+<small>string</small>
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="area_code" data-endpoint="POSTapi-address"
|
|
|
+ value="440305"
|
|
|
+ data-component="body">
|
|
|
+ <br>
|
|
|
+<p>区划代码 Example: <code>440305</code></p>
|
|
|
+ </div>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>is_default</code></b>
|
|
|
+<small>boolean</small>
|
|
|
+
|
|
|
+ <label data-endpoint="POSTapi-address" style="display: none">
|
|
|
+ <input type="radio" name="is_default"
|
|
|
+ value="true"
|
|
|
+ data-endpoint="POSTapi-address"
|
|
|
+ data-component="body" >
|
|
|
+ <code>true</code>
|
|
|
+ </label>
|
|
|
+ <label data-endpoint="POSTapi-address" style="display: none">
|
|
|
+ <input type="radio" name="is_default"
|
|
|
+ value="false"
|
|
|
+ data-endpoint="POSTapi-address"
|
|
|
+ data-component="body" >
|
|
|
+ <code>false</code>
|
|
|
+ </label>
|
|
|
+ <br>
|
|
|
+<p>是否默认地址 Example: <code>true</code></p>
|
|
|
+ </div>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>location</code></b>
|
|
|
+<small>string</small>
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="location" data-endpoint="POSTapi-address"
|
|
|
+ value="科技园"
|
|
|
+ data-component="body">
|
|
|
+ <br>
|
|
|
+<p>定位地址 Example: <code>科技园</code></p>
|
|
|
+ </div>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>detail</code></b>
|
|
|
+<small>string</small>
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="detail" data-endpoint="POSTapi-address"
|
|
|
+ value="科技园南区"
|
|
|
+ data-component="body">
|
|
|
+ <br>
|
|
|
+<p>详细地址 Example: <code>科技园南区</code></p>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+
|
|
|
+ <h2 id="-PUTapi-address--id-">修改地址</h2>
|
|
|
+
|
|
|
+<p>
|
|
|
+<small class="badge badge-darkred">requires authentication</small>
|
|
|
+</p>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+<span id="example-requests-PUTapi-address--id-">
|
|
|
+<blockquote>Example request:</blockquote>
|
|
|
+
|
|
|
+
|
|
|
+<div class="javascript-example">
|
|
|
+ <pre><code class="language-javascript">const url = new URL(
|
|
|
+ "http://127.0.0.1/api/address/1"
|
|
|
+);
|
|
|
+
|
|
|
+const headers = {
|
|
|
+ "Authorization": "Bearer {YOUR_AUTH_KEY}",
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ "Accept": "application/json",
|
|
|
+};
|
|
|
+
|
|
|
+let body = {
|
|
|
+ "phone": "13800138000",
|
|
|
+ "province": "广东省",
|
|
|
+ "city": "深圳市",
|
|
|
+ "district": "南山区",
|
|
|
+ "longitude": "113.93041",
|
|
|
+ "latitude": "22.53332",
|
|
|
+ "area_code": "440305",
|
|
|
+ "is_default": true,
|
|
|
+ "location": "科技园",
|
|
|
+ "detail": "科技园南区"
|
|
|
+};
|
|
|
+
|
|
|
+fetch(url, {
|
|
|
+ method: "PUT",
|
|
|
+ headers,
|
|
|
+ body: JSON.stringify(body),
|
|
|
+}).then(response => response.json());</code></pre></div>
|
|
|
+
|
|
|
+
|
|
|
+<div class="bash-example">
|
|
|
+ <pre><code class="language-bash">curl --request PUT \
|
|
|
+ "http://127.0.0.1/api/address/1" \
|
|
|
+ --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
|
|
|
+ --header "Content-Type: application/json" \
|
|
|
+ --data "{
|
|
|
+ \"phone\": \"13800138000\",
|
|
|
+ \"province\": \"广东省\",
|
|
|
+ \"city\": \"深圳市\",
|
|
|
+ \"district\": \"南山区\",
|
|
|
+ \"longitude\": \"113.93041\",
|
|
|
+ \"latitude\": \"22.53332\",
|
|
|
+ \"area_code\": \"440305\",
|
|
|
+ \"is_default\": true,
|
|
|
+ \"location\": \"科技园\",
|
|
|
+ \"detail\": \"科技园南区\"
|
|
|
+}"
|
|
|
+</code></pre></div>
|
|
|
+
|
|
|
+</span>
|
|
|
+
|
|
|
+<span id="example-responses-PUTapi-address--id-">
|
|
|
+ <blockquote>
|
|
|
+ <p>Example response (200):</p>
|
|
|
+ </blockquote>
|
|
|
+ <pre>
|
|
|
+
|
|
|
+<code class="language-json" style="max-height: 300px;">{
|
|
|
+ "code": 200,
|
|
|
+ "message": "修改成功"
|
|
|
+}</code>
|
|
|
+ </pre>
|
|
|
+ </span>
|
|
|
+<span id="execution-results-PUTapi-address--id-" hidden>
|
|
|
+ <blockquote>Received response<span
|
|
|
+ id="execution-response-status-PUTapi-address--id-"></span>:
|
|
|
+ </blockquote>
|
|
|
+ <pre class="json"><code id="execution-response-content-PUTapi-address--id-"
|
|
|
+ data-empty-response-text="<Empty response>" style="max-height: 400px;"></code></pre>
|
|
|
+</span>
|
|
|
+<span id="execution-error-PUTapi-address--id-" hidden>
|
|
|
+ <blockquote>Request failed with error:</blockquote>
|
|
|
+ <pre><code id="execution-error-message-PUTapi-address--id-">
|
|
|
+
|
|
|
+Tip: Check that you're properly connected to the network.
|
|
|
+If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
|
|
|
+You can check the Dev Tools console for debugging information.</code></pre>
|
|
|
+</span>
|
|
|
+<form id="form-PUTapi-address--id-" data-method="PUT"
|
|
|
+ data-path="api/address/{id}"
|
|
|
+ data-authed="1"
|
|
|
+ data-hasfiles="0"
|
|
|
+ data-isarraybody="0"
|
|
|
+ autocomplete="off"
|
|
|
+ onsubmit="event.preventDefault(); executeTryOut('PUTapi-address--id-', this);">
|
|
|
+ <h3>
|
|
|
+ Request
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #8fbcd4; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-tryout-PUTapi-address--id-"
|
|
|
+ onclick="tryItOut('PUTapi-address--id-');">Try it out ⚡
|
|
|
+ </button>
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-canceltryout-PUTapi-address--id-"
|
|
|
+ onclick="cancelTryOut('PUTapi-address--id-');" hidden>Cancel 🛑
|
|
|
+ </button>
|
|
|
+ <button type="submit"
|
|
|
+ style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-executetryout-PUTapi-address--id-"
|
|
|
+ data-initial-text="Send Request 💥"
|
|
|
+ data-loading-text="⏱ Sending..."
|
|
|
+ hidden>Send Request 💥
|
|
|
+ </button>
|
|
|
+ </h3>
|
|
|
+ <p>
|
|
|
+ <small class="badge badge-darkblue">PUT</small>
|
|
|
+ <b><code>api/address/{id}</code></b>
|
|
|
+ </p>
|
|
|
+ <h4 class="fancy-heading-panel"><b>Headers</b></h4>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>Authorization</code></b>
|
|
|
+
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="Authorization" class="auth-value" data-endpoint="PUTapi-address--id-"
|
|
|
+ value="Bearer {YOUR_AUTH_KEY}"
|
|
|
+ data-component="header">
|
|
|
+ <br>
|
|
|
+<p>Example: <code>Bearer {YOUR_AUTH_KEY}</code></p>
|
|
|
+ </div>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>Content-Type</code></b>
|
|
|
+
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="Content-Type" data-endpoint="PUTapi-address--id-"
|
|
|
+ value="application/json"
|
|
|
+ data-component="header">
|
|
|
+ <br>
|
|
|
+<p>Example: <code>application/json</code></p>
|
|
|
+ </div>
|
|
|
+ <h4 class="fancy-heading-panel"><b>URL Parameters</b></h4>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>id</code></b>
|
|
|
+<small>integer</small>
|
|
|
+
|
|
|
+ <input type="number" style="display: none"
|
|
|
+ step="any" name="id" data-endpoint="PUTapi-address--id-"
|
|
|
+ value="1"
|
|
|
+ data-component="url">
|
|
|
+ <br>
|
|
|
+<p>地址ID Example: <code>1</code></p>
|
|
|
+ </div>
|
|
|
+ <h4 class="fancy-heading-panel"><b>Body Parameters</b></h4>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>phone</code></b>
|
|
|
+<small>string</small>
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="phone" data-endpoint="PUTapi-address--id-"
|
|
|
+ value="13800138000"
|
|
|
+ data-component="body">
|
|
|
+ <br>
|
|
|
+<p>手机号 Example: <code>13800138000</code></p>
|
|
|
+ </div>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>province</code></b>
|
|
|
+<small>string</small>
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="province" data-endpoint="PUTapi-address--id-"
|
|
|
+ value="广东省"
|
|
|
+ data-component="body">
|
|
|
+ <br>
|
|
|
+<p>省份 Example: <code>广东省</code></p>
|
|
|
+ </div>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>city</code></b>
|
|
|
+<small>string</small>
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="city" data-endpoint="PUTapi-address--id-"
|
|
|
+ value="深圳市"
|
|
|
+ data-component="body">
|
|
|
+ <br>
|
|
|
+<p>城市 Example: <code>深圳市</code></p>
|
|
|
+ </div>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>district</code></b>
|
|
|
+<small>string</small>
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="district" data-endpoint="PUTapi-address--id-"
|
|
|
+ value="南山区"
|
|
|
+ data-component="body">
|
|
|
+ <br>
|
|
|
+<p>区县 Example: <code>南山区</code></p>
|
|
|
+ </div>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>longitude</code></b>
|
|
|
+<small>string</small>
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="longitude" data-endpoint="PUTapi-address--id-"
|
|
|
+ value="113.93041"
|
|
|
+ data-component="body">
|
|
|
+ <br>
|
|
|
+<p>经度 Example: <code>113.93041</code></p>
|
|
|
+ </div>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>latitude</code></b>
|
|
|
+<small>string</small>
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="latitude" data-endpoint="PUTapi-address--id-"
|
|
|
+ value="22.53332"
|
|
|
+ data-component="body">
|
|
|
+ <br>
|
|
|
+<p>纬度 Example: <code>22.53332</code></p>
|
|
|
+ </div>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>area_code</code></b>
|
|
|
+<small>string</small>
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="area_code" data-endpoint="PUTapi-address--id-"
|
|
|
+ value="440305"
|
|
|
+ data-component="body">
|
|
|
+ <br>
|
|
|
+<p>区划代码 Example: <code>440305</code></p>
|
|
|
+ </div>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>is_default</code></b>
|
|
|
+<small>boolean</small>
|
|
|
+
|
|
|
+ <label data-endpoint="PUTapi-address--id-" style="display: none">
|
|
|
+ <input type="radio" name="is_default"
|
|
|
+ value="true"
|
|
|
+ data-endpoint="PUTapi-address--id-"
|
|
|
+ data-component="body" >
|
|
|
+ <code>true</code>
|
|
|
+ </label>
|
|
|
+ <label data-endpoint="PUTapi-address--id-" style="display: none">
|
|
|
+ <input type="radio" name="is_default"
|
|
|
+ value="false"
|
|
|
+ data-endpoint="PUTapi-address--id-"
|
|
|
+ data-component="body" >
|
|
|
+ <code>false</code>
|
|
|
+ </label>
|
|
|
+ <br>
|
|
|
+<p>是否默认地址 Example: <code>true</code></p>
|
|
|
+ </div>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>location</code></b>
|
|
|
+<small>string</small>
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="location" data-endpoint="PUTapi-address--id-"
|
|
|
+ value="科技园"
|
|
|
+ data-component="body">
|
|
|
+ <br>
|
|
|
+<p>定位地址 Example: <code>科技园</code></p>
|
|
|
+ </div>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>detail</code></b>
|
|
|
+<small>string</small>
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="detail" data-endpoint="PUTapi-address--id-"
|
|
|
+ value="科技园南区"
|
|
|
+ data-component="body">
|
|
|
+ <br>
|
|
|
+<p>详细地址 Example: <code>科技园南区</code></p>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+
|
|
|
+ <h2 id="-DELETEapi-address--id-">删除地址</h2>
|
|
|
+
|
|
|
+<p>
|
|
|
+<small class="badge badge-darkred">requires authentication</small>
|
|
|
+</p>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+<span id="example-requests-DELETEapi-address--id-">
|
|
|
+<blockquote>Example request:</blockquote>
|
|
|
+
|
|
|
+
|
|
|
+<div class="javascript-example">
|
|
|
+ <pre><code class="language-javascript">const url = new URL(
|
|
|
+ "http://127.0.0.1/api/address/1"
|
|
|
+);
|
|
|
+
|
|
|
+const headers = {
|
|
|
+ "Authorization": "Bearer {YOUR_AUTH_KEY}",
|
|
|
+ "Accept": "application/json",
|
|
|
+};
|
|
|
+
|
|
|
+fetch(url, {
|
|
|
+ method: "DELETE",
|
|
|
+ headers,
|
|
|
+}).then(response => response.json());</code></pre></div>
|
|
|
+
|
|
|
+
|
|
|
+<div class="bash-example">
|
|
|
+ <pre><code class="language-bash">curl --request DELETE \
|
|
|
+ "http://127.0.0.1/api/address/1" \
|
|
|
+ --header "Authorization: Bearer {YOUR_AUTH_KEY}"</code></pre></div>
|
|
|
+
|
|
|
+</span>
|
|
|
+
|
|
|
+<span id="example-responses-DELETEapi-address--id-">
|
|
|
+ <blockquote>
|
|
|
+ <p>Example response (200):</p>
|
|
|
+ </blockquote>
|
|
|
+ <pre>
|
|
|
+
|
|
|
+<code class="language-json" style="max-height: 300px;">{
|
|
|
+ "code": 200,
|
|
|
+ "message": "删除成功"
|
|
|
+}</code>
|
|
|
+ </pre>
|
|
|
+ </span>
|
|
|
+<span id="execution-results-DELETEapi-address--id-" hidden>
|
|
|
+ <blockquote>Received response<span
|
|
|
+ id="execution-response-status-DELETEapi-address--id-"></span>:
|
|
|
+ </blockquote>
|
|
|
+ <pre class="json"><code id="execution-response-content-DELETEapi-address--id-"
|
|
|
+ data-empty-response-text="<Empty response>" style="max-height: 400px;"></code></pre>
|
|
|
+</span>
|
|
|
+<span id="execution-error-DELETEapi-address--id-" hidden>
|
|
|
+ <blockquote>Request failed with error:</blockquote>
|
|
|
+ <pre><code id="execution-error-message-DELETEapi-address--id-">
|
|
|
+
|
|
|
+Tip: Check that you're properly connected to the network.
|
|
|
+If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
|
|
|
+You can check the Dev Tools console for debugging information.</code></pre>
|
|
|
+</span>
|
|
|
+<form id="form-DELETEapi-address--id-" data-method="DELETE"
|
|
|
+ data-path="api/address/{id}"
|
|
|
+ data-authed="1"
|
|
|
+ data-hasfiles="0"
|
|
|
+ data-isarraybody="0"
|
|
|
+ autocomplete="off"
|
|
|
+ onsubmit="event.preventDefault(); executeTryOut('DELETEapi-address--id-', this);">
|
|
|
+ <h3>
|
|
|
+ Request
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #8fbcd4; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-tryout-DELETEapi-address--id-"
|
|
|
+ onclick="tryItOut('DELETEapi-address--id-');">Try it out ⚡
|
|
|
+ </button>
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-canceltryout-DELETEapi-address--id-"
|
|
|
+ onclick="cancelTryOut('DELETEapi-address--id-');" hidden>Cancel 🛑
|
|
|
+ </button>
|
|
|
+ <button type="submit"
|
|
|
+ style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-executetryout-DELETEapi-address--id-"
|
|
|
+ data-initial-text="Send Request 💥"
|
|
|
+ data-loading-text="⏱ Sending..."
|
|
|
+ hidden>Send Request 💥
|
|
|
+ </button>
|
|
|
+ </h3>
|
|
|
+ <p>
|
|
|
+ <small class="badge badge-red">DELETE</small>
|
|
|
+ <b><code>api/address/{id}</code></b>
|
|
|
+ </p>
|
|
|
+ <h4 class="fancy-heading-panel"><b>Headers</b></h4>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>Authorization</code></b>
|
|
|
+
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="Authorization" class="auth-value" data-endpoint="DELETEapi-address--id-"
|
|
|
+ value="Bearer {YOUR_AUTH_KEY}"
|
|
|
+ data-component="header">
|
|
|
+ <br>
|
|
|
+<p>Example: <code>Bearer {YOUR_AUTH_KEY}</code></p>
|
|
|
+ </div>
|
|
|
+ <h4 class="fancy-heading-panel"><b>URL Parameters</b></h4>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>id</code></b>
|
|
|
+<small>integer</small>
|
|
|
+
|
|
|
+ <input type="number" style="display: none"
|
|
|
+ step="any" name="id" data-endpoint="DELETEapi-address--id-"
|
|
|
+ value="1"
|
|
|
+ data-component="url">
|
|
|
+ <br>
|
|
|
+<p>地址ID Example: <code>1</code></p>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+
|
|
|
+ <h2 id="-PUTapi-address--id--default">设置默认地址</h2>
|
|
|
+
|
|
|
+<p>
|
|
|
+<small class="badge badge-darkred">requires authentication</small>
|
|
|
+</p>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+<span id="example-requests-PUTapi-address--id--default">
|
|
|
+<blockquote>Example request:</blockquote>
|
|
|
+
|
|
|
+
|
|
|
+<div class="javascript-example">
|
|
|
+ <pre><code class="language-javascript">const url = new URL(
|
|
|
+ "http://127.0.0.1/api/address/1/default"
|
|
|
+);
|
|
|
+
|
|
|
+const headers = {
|
|
|
+ "Authorization": "Bearer {YOUR_AUTH_KEY}",
|
|
|
+ "Accept": "application/json",
|
|
|
+};
|
|
|
+
|
|
|
+fetch(url, {
|
|
|
+ method: "PUT",
|
|
|
+ headers,
|
|
|
+}).then(response => response.json());</code></pre></div>
|
|
|
+
|
|
|
+
|
|
|
+<div class="bash-example">
|
|
|
+ <pre><code class="language-bash">curl --request PUT \
|
|
|
+ "http://127.0.0.1/api/address/1/default" \
|
|
|
+ --header "Authorization: Bearer {YOUR_AUTH_KEY}"</code></pre></div>
|
|
|
+
|
|
|
+</span>
|
|
|
+
|
|
|
+<span id="example-responses-PUTapi-address--id--default">
|
|
|
+ <blockquote>
|
|
|
+ <p>Example response (200):</p>
|
|
|
+ </blockquote>
|
|
|
+ <pre>
|
|
|
+
|
|
|
+<code class="language-json" style="max-height: 300px;">{
|
|
|
+ "code": 200,
|
|
|
+ "message": "设置成功"
|
|
|
+}</code>
|
|
|
+ </pre>
|
|
|
+ </span>
|
|
|
+<span id="execution-results-PUTapi-address--id--default" hidden>
|
|
|
+ <blockquote>Received response<span
|
|
|
+ id="execution-response-status-PUTapi-address--id--default"></span>:
|
|
|
+ </blockquote>
|
|
|
+ <pre class="json"><code id="execution-response-content-PUTapi-address--id--default"
|
|
|
+ data-empty-response-text="<Empty response>" style="max-height: 400px;"></code></pre>
|
|
|
+</span>
|
|
|
+<span id="execution-error-PUTapi-address--id--default" hidden>
|
|
|
+ <blockquote>Request failed with error:</blockquote>
|
|
|
+ <pre><code id="execution-error-message-PUTapi-address--id--default">
|
|
|
+
|
|
|
+Tip: Check that you're properly connected to the network.
|
|
|
+If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
|
|
|
+You can check the Dev Tools console for debugging information.</code></pre>
|
|
|
+</span>
|
|
|
+<form id="form-PUTapi-address--id--default" data-method="PUT"
|
|
|
+ data-path="api/address/{id}/default"
|
|
|
+ data-authed="1"
|
|
|
+ data-hasfiles="0"
|
|
|
+ data-isarraybody="0"
|
|
|
+ autocomplete="off"
|
|
|
+ onsubmit="event.preventDefault(); executeTryOut('PUTapi-address--id--default', this);">
|
|
|
+ <h3>
|
|
|
+ Request
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #8fbcd4; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-tryout-PUTapi-address--id--default"
|
|
|
+ onclick="tryItOut('PUTapi-address--id--default');">Try it out ⚡
|
|
|
+ </button>
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-canceltryout-PUTapi-address--id--default"
|
|
|
+ onclick="cancelTryOut('PUTapi-address--id--default');" hidden>Cancel 🛑
|
|
|
+ </button>
|
|
|
+ <button type="submit"
|
|
|
+ style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-executetryout-PUTapi-address--id--default"
|
|
|
+ data-initial-text="Send Request 💥"
|
|
|
+ data-loading-text="⏱ Sending..."
|
|
|
+ hidden>Send Request 💥
|
|
|
+ </button>
|
|
|
+ </h3>
|
|
|
+ <p>
|
|
|
+ <small class="badge badge-darkblue">PUT</small>
|
|
|
+ <b><code>api/address/{id}/default</code></b>
|
|
|
+ </p>
|
|
|
+ <h4 class="fancy-heading-panel"><b>Headers</b></h4>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>Authorization</code></b>
|
|
|
+
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="Authorization" class="auth-value" data-endpoint="PUTapi-address--id--default"
|
|
|
+ value="Bearer {YOUR_AUTH_KEY}"
|
|
|
+ data-component="header">
|
|
|
+ <br>
|
|
|
+<p>Example: <code>Bearer {YOUR_AUTH_KEY}</code></p>
|
|
|
+ </div>
|
|
|
+ <h4 class="fancy-heading-panel"><b>URL Parameters</b></h4>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>id</code></b>
|
|
|
+<small>integer</small>
|
|
|
+
|
|
|
+ <input type="number" style="display: none"
|
|
|
+ step="any" name="id" data-endpoint="PUTapi-address--id--default"
|
|
|
+ value="1"
|
|
|
+ data-component="url">
|
|
|
+ <br>
|
|
|
+<p>地址ID Example: <code>1</code></p>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+
|
|
|
+ <h1 id="">用户端-技师定位管理</h1>
|
|
|
+
|
|
|
+ <p>技师定位相关的API接口</p>
|
|
|
+
|
|
|
+ <h2 id="-GETapi-coach-location">获取定位列表</h2>
|
|
|
+
|
|
|
+<p>
|
|
|
+<small class="badge badge-darkred">requires authentication</small>
|
|
|
+</p>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+<span id="example-requests-GETapi-coach-location">
|
|
|
+<blockquote>Example request:</blockquote>
|
|
|
+
|
|
|
+
|
|
|
+<div class="javascript-example">
|
|
|
+ <pre><code class="language-javascript">const url = new URL(
|
|
|
+ "http://127.0.0.1/api/coach/location"
|
|
|
+);
|
|
|
+
|
|
|
+const headers = {
|
|
|
+ "Authorization": "Bearer {YOUR_AUTH_KEY}",
|
|
|
+ "Accept": "application/json",
|
|
|
+};
|
|
|
+
|
|
|
+fetch(url, {
|
|
|
+ method: "GET",
|
|
|
+ headers,
|
|
|
+}).then(response => response.json());</code></pre></div>
|
|
|
+
|
|
|
+
|
|
|
+<div class="bash-example">
|
|
|
+ <pre><code class="language-bash">curl --request GET \
|
|
|
+ --get "http://127.0.0.1/api/coach/location" \
|
|
|
+ --header "Authorization: Bearer {YOUR_AUTH_KEY}"</code></pre></div>
|
|
|
+
|
|
|
+</span>
|
|
|
+
|
|
|
+<span id="example-responses-GETapi-coach-location">
|
|
|
+ <blockquote>
|
|
|
+ <p>Example response (200):</p>
|
|
|
+ </blockquote>
|
|
|
+ <pre>
|
|
|
+
|
|
|
+<code class="language-json" style="max-height: 300px;">{
|
|
|
+ "code": 200,
|
|
|
+ "message": "获取成功",
|
|
|
+ "data": [
|
|
|
+ {
|
|
|
+ "id": 1,
|
|
|
+ "type": "home",
|
|
|
+ "latitude": 34.0522,
|
|
|
+ "longitude": -118.2437,
|
|
|
+ "city": "Los Angeles",
|
|
|
+ "district": "Downtown",
|
|
|
+ "location": "123 Main St",
|
|
|
+ "area_code": "90001"
|
|
|
+ }
|
|
|
+ ]
|
|
|
+}</code>
|
|
|
+ </pre>
|
|
|
+ </span>
|
|
|
+<span id="execution-results-GETapi-coach-location" hidden>
|
|
|
+ <blockquote>Received response<span
|
|
|
+ id="execution-response-status-GETapi-coach-location"></span>:
|
|
|
+ </blockquote>
|
|
|
+ <pre class="json"><code id="execution-response-content-GETapi-coach-location"
|
|
|
+ data-empty-response-text="<Empty response>" style="max-height: 400px;"></code></pre>
|
|
|
+</span>
|
|
|
+<span id="execution-error-GETapi-coach-location" hidden>
|
|
|
+ <blockquote>Request failed with error:</blockquote>
|
|
|
+ <pre><code id="execution-error-message-GETapi-coach-location">
|
|
|
+
|
|
|
+Tip: Check that you're properly connected to the network.
|
|
|
+If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
|
|
|
+You can check the Dev Tools console for debugging information.</code></pre>
|
|
|
+</span>
|
|
|
+<form id="form-GETapi-coach-location" data-method="GET"
|
|
|
+ data-path="api/coach/location"
|
|
|
+ data-authed="1"
|
|
|
+ data-hasfiles="0"
|
|
|
+ data-isarraybody="0"
|
|
|
+ autocomplete="off"
|
|
|
+ onsubmit="event.preventDefault(); executeTryOut('GETapi-coach-location', this);">
|
|
|
+ <h3>
|
|
|
+ Request
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #8fbcd4; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-tryout-GETapi-coach-location"
|
|
|
+ onclick="tryItOut('GETapi-coach-location');">Try it out ⚡
|
|
|
+ </button>
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-canceltryout-GETapi-coach-location"
|
|
|
+ onclick="cancelTryOut('GETapi-coach-location');" hidden>Cancel 🛑
|
|
|
+ </button>
|
|
|
+ <button type="submit"
|
|
|
+ style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-executetryout-GETapi-coach-location"
|
|
|
+ data-initial-text="Send Request 💥"
|
|
|
+ data-loading-text="⏱ Sending..."
|
|
|
+ hidden>Send Request 💥
|
|
|
+ </button>
|
|
|
+ </h3>
|
|
|
+ <p>
|
|
|
+ <small class="badge badge-green">GET</small>
|
|
|
+ <b><code>api/coach/location</code></b>
|
|
|
+ </p>
|
|
|
+ <h4 class="fancy-heading-panel"><b>Headers</b></h4>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>Authorization</code></b>
|
|
|
+
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="Authorization" class="auth-value" data-endpoint="GETapi-coach-location"
|
|
|
+ value="Bearer {YOUR_AUTH_KEY}"
|
|
|
+ data-component="header">
|
|
|
+ <br>
|
|
|
+<p>Example: <code>Bearer {YOUR_AUTH_KEY}</code></p>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+
|
|
|
+ <h2 id="-POSTapi-coach-location">创建定位</h2>
|
|
|
+
|
|
|
+<p>
|
|
|
+<small class="badge badge-darkred">requires authentication</small>
|
|
|
+</p>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+<span id="example-requests-POSTapi-coach-location">
|
|
|
+<blockquote>Example request:</blockquote>
|
|
|
+
|
|
|
+
|
|
|
+<div class="javascript-example">
|
|
|
+ <pre><code class="language-javascript">const url = new URL(
|
|
|
+ "http://127.0.0.1/api/coach/location"
|
|
|
+);
|
|
|
+
|
|
|
+const headers = {
|
|
|
+ "Authorization": "Bearer {YOUR_AUTH_KEY}",
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ "Accept": "application/json",
|
|
|
+};
|
|
|
+
|
|
|
+let body = {
|
|
|
+ "type": "home",
|
|
|
+ "latitude": 34.0522,
|
|
|
+ "longitude": -118.2437,
|
|
|
+ "city": "Los Angeles",
|
|
|
+ "district": "Downtown",
|
|
|
+ "location": "123 Main St",
|
|
|
+ "area_code": "90001"
|
|
|
+};
|
|
|
+
|
|
|
+fetch(url, {
|
|
|
+ method: "POST",
|
|
|
+ headers,
|
|
|
+ body: JSON.stringify(body),
|
|
|
+}).then(response => response.json());</code></pre></div>
|
|
|
+
|
|
|
+
|
|
|
+<div class="bash-example">
|
|
|
+ <pre><code class="language-bash">curl --request POST \
|
|
|
+ "http://127.0.0.1/api/coach/location" \
|
|
|
+ --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
|
|
|
+ --header "Content-Type: application/json" \
|
|
|
+ --data "{
|
|
|
+ \"type\": \"home\",
|
|
|
+ \"latitude\": 34.0522,
|
|
|
+ \"longitude\": -118.2437,
|
|
|
+ \"city\": \"Los Angeles\",
|
|
|
+ \"district\": \"Downtown\",
|
|
|
+ \"location\": \"123 Main St\",
|
|
|
+ \"area_code\": \"90001\"
|
|
|
+}"
|
|
|
+</code></pre></div>
|
|
|
+
|
|
|
+</span>
|
|
|
+
|
|
|
+<span id="example-responses-POSTapi-coach-location">
|
|
|
+ <blockquote>
|
|
|
+ <p>Example response (200):</p>
|
|
|
+ </blockquote>
|
|
|
+ <pre>
|
|
|
+
|
|
|
+<code class="language-json" style="max-height: 300px;">{
|
|
|
+ "code": 200,
|
|
|
+ "message": "创建成功",
|
|
|
+ "data": {
|
|
|
+ "id": 1,
|
|
|
+ "type": "home",
|
|
|
+ "latitude": 34.0522,
|
|
|
+ "longitude": -118.2437,
|
|
|
+ "city": "Los Angeles",
|
|
|
+ "district": "Downtown",
|
|
|
+ "location": "123 Main St",
|
|
|
+ "area_code": "90001"
|
|
|
+ }
|
|
|
+}</code>
|
|
|
+ </pre>
|
|
|
+ </span>
|
|
|
+<span id="execution-results-POSTapi-coach-location" hidden>
|
|
|
+ <blockquote>Received response<span
|
|
|
+ id="execution-response-status-POSTapi-coach-location"></span>:
|
|
|
+ </blockquote>
|
|
|
+ <pre class="json"><code id="execution-response-content-POSTapi-coach-location"
|
|
|
+ data-empty-response-text="<Empty response>" style="max-height: 400px;"></code></pre>
|
|
|
+</span>
|
|
|
+<span id="execution-error-POSTapi-coach-location" hidden>
|
|
|
+ <blockquote>Request failed with error:</blockquote>
|
|
|
+ <pre><code id="execution-error-message-POSTapi-coach-location">
|
|
|
+
|
|
|
+Tip: Check that you're properly connected to the network.
|
|
|
+If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
|
|
|
+You can check the Dev Tools console for debugging information.</code></pre>
|
|
|
+</span>
|
|
|
+<form id="form-POSTapi-coach-location" data-method="POST"
|
|
|
+ data-path="api/coach/location"
|
|
|
+ data-authed="1"
|
|
|
+ data-hasfiles="0"
|
|
|
+ data-isarraybody="0"
|
|
|
+ autocomplete="off"
|
|
|
+ onsubmit="event.preventDefault(); executeTryOut('POSTapi-coach-location', this);">
|
|
|
+ <h3>
|
|
|
+ Request
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #8fbcd4; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-tryout-POSTapi-coach-location"
|
|
|
+ onclick="tryItOut('POSTapi-coach-location');">Try it out ⚡
|
|
|
+ </button>
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-canceltryout-POSTapi-coach-location"
|
|
|
+ onclick="cancelTryOut('POSTapi-coach-location');" hidden>Cancel 🛑
|
|
|
+ </button>
|
|
|
+ <button type="submit"
|
|
|
+ style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-executetryout-POSTapi-coach-location"
|
|
|
+ data-initial-text="Send Request 💥"
|
|
|
+ data-loading-text="⏱ Sending..."
|
|
|
+ hidden>Send Request 💥
|
|
|
+ </button>
|
|
|
+ </h3>
|
|
|
+ <p>
|
|
|
+ <small class="badge badge-black">POST</small>
|
|
|
+ <b><code>api/coach/location</code></b>
|
|
|
+ </p>
|
|
|
+ <h4 class="fancy-heading-panel"><b>Headers</b></h4>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>Authorization</code></b>
|
|
|
+
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="Authorization" class="auth-value" data-endpoint="POSTapi-coach-location"
|
|
|
+ value="Bearer {YOUR_AUTH_KEY}"
|
|
|
+ data-component="header">
|
|
|
+ <br>
|
|
|
+<p>Example: <code>Bearer {YOUR_AUTH_KEY}</code></p>
|
|
|
+ </div>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>Content-Type</code></b>
|
|
|
+
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="Content-Type" data-endpoint="POSTapi-coach-location"
|
|
|
+ value="application/json"
|
|
|
+ data-component="header">
|
|
|
+ <br>
|
|
|
+<p>Example: <code>application/json</code></p>
|
|
|
+ </div>
|
|
|
+ <h4 class="fancy-heading-panel"><b>Body Parameters</b></h4>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>type</code></b>
|
|
|
+<small>string</small>
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="type" data-endpoint="POSTapi-coach-location"
|
|
|
+ value="home"
|
|
|
+ data-component="body">
|
|
|
+ <br>
|
|
|
+<p>类型. Example: <code>home</code></p>
|
|
|
+ </div>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>latitude</code></b>
|
|
|
+<small>number</small>
|
|
|
+
|
|
|
+ <input type="number" style="display: none"
|
|
|
+ step="any" name="latitude" data-endpoint="POSTapi-coach-location"
|
|
|
+ value="34.0522"
|
|
|
+ data-component="body">
|
|
|
+ <br>
|
|
|
+<p>纬度. Example: <code>34.0522</code></p>
|
|
|
+ </div>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>longitude</code></b>
|
|
|
+<small>number</small>
|
|
|
+
|
|
|
+ <input type="number" style="display: none"
|
|
|
+ step="any" name="longitude" data-endpoint="POSTapi-coach-location"
|
|
|
+ value="-118.2437"
|
|
|
+ data-component="body">
|
|
|
+ <br>
|
|
|
+<p>经度. Example: <code>-118.2437</code></p>
|
|
|
+ </div>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>city</code></b>
|
|
|
+<small>string</small>
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="city" data-endpoint="POSTapi-coach-location"
|
|
|
+ value="Los Angeles"
|
|
|
+ data-component="body">
|
|
|
+ <br>
|
|
|
+<p>市. Example: <code>Los Angeles</code></p>
|
|
|
+ </div>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>district</code></b>
|
|
|
+<small>string</small>
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="district" data-endpoint="POSTapi-coach-location"
|
|
|
+ value="Downtown"
|
|
|
+ data-component="body">
|
|
|
+ <br>
|
|
|
+<p>区. Example: <code>Downtown</code></p>
|
|
|
+ </div>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>location</code></b>
|
|
|
+<small>string</small>
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="location" data-endpoint="POSTapi-coach-location"
|
|
|
+ value="123 Main St"
|
|
|
+ data-component="body">
|
|
|
+ <br>
|
|
|
+<p>详细地址. Example: <code>123 Main St</code></p>
|
|
|
+ </div>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>area_code</code></b>
|
|
|
+<small>string</small>
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="area_code" data-endpoint="POSTapi-coach-location"
|
|
|
+ value="90001"
|
|
|
+ data-component="body">
|
|
|
+ <br>
|
|
|
+<p>区域编码. Example: <code>90001</code></p>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+
|
|
|
+ <h2 id="-DELETEapi-coach-location--id-">删除定位</h2>
|
|
|
+
|
|
|
+<p>
|
|
|
+<small class="badge badge-darkred">requires authentication</small>
|
|
|
+</p>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+<span id="example-requests-DELETEapi-coach-location--id-">
|
|
|
+<blockquote>Example request:</blockquote>
|
|
|
+
|
|
|
+
|
|
|
+<div class="javascript-example">
|
|
|
+ <pre><code class="language-javascript">const url = new URL(
|
|
|
+ "http://127.0.0.1/api/coach/location/quis"
|
|
|
+);
|
|
|
+
|
|
|
+const headers = {
|
|
|
+ "Authorization": "Bearer {YOUR_AUTH_KEY}",
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ "Accept": "application/json",
|
|
|
+};
|
|
|
+
|
|
|
+let body = {
|
|
|
+ "coach_id": 1,
|
|
|
+ "type": "home"
|
|
|
+};
|
|
|
+
|
|
|
+fetch(url, {
|
|
|
+ method: "DELETE",
|
|
|
+ headers,
|
|
|
+ body: JSON.stringify(body),
|
|
|
+}).then(response => response.json());</code></pre></div>
|
|
|
+
|
|
|
+
|
|
|
+<div class="bash-example">
|
|
|
+ <pre><code class="language-bash">curl --request DELETE \
|
|
|
+ "http://127.0.0.1/api/coach/location/quis" \
|
|
|
+ --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
|
|
|
+ --header "Content-Type: application/json" \
|
|
|
+ --data "{
|
|
|
+ \"coach_id\": 1,
|
|
|
+ \"type\": \"home\"
|
|
|
+}"
|
|
|
+</code></pre></div>
|
|
|
+
|
|
|
+</span>
|
|
|
+
|
|
|
+<span id="example-responses-DELETEapi-coach-location--id-">
|
|
|
+ <blockquote>
|
|
|
+ <p>Example response (200):</p>
|
|
|
+ </blockquote>
|
|
|
+ <pre>
|
|
|
+
|
|
|
+<code class="language-json" style="max-height: 300px;">{
|
|
|
+ "code": 200,
|
|
|
+ "message": "删除成功",
|
|
|
+ "data": null
|
|
|
+}</code>
|
|
|
+ </pre>
|
|
|
+ </span>
|
|
|
+<span id="execution-results-DELETEapi-coach-location--id-" hidden>
|
|
|
+ <blockquote>Received response<span
|
|
|
+ id="execution-response-status-DELETEapi-coach-location--id-"></span>:
|
|
|
+ </blockquote>
|
|
|
+ <pre class="json"><code id="execution-response-content-DELETEapi-coach-location--id-"
|
|
|
+ data-empty-response-text="<Empty response>" style="max-height: 400px;"></code></pre>
|
|
|
+</span>
|
|
|
+<span id="execution-error-DELETEapi-coach-location--id-" hidden>
|
|
|
+ <blockquote>Request failed with error:</blockquote>
|
|
|
+ <pre><code id="execution-error-message-DELETEapi-coach-location--id-">
|
|
|
+
|
|
|
+Tip: Check that you're properly connected to the network.
|
|
|
+If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
|
|
|
+You can check the Dev Tools console for debugging information.</code></pre>
|
|
|
+</span>
|
|
|
+<form id="form-DELETEapi-coach-location--id-" data-method="DELETE"
|
|
|
+ data-path="api/coach/location/{id}"
|
|
|
+ data-authed="1"
|
|
|
+ data-hasfiles="0"
|
|
|
+ data-isarraybody="0"
|
|
|
+ autocomplete="off"
|
|
|
+ onsubmit="event.preventDefault(); executeTryOut('DELETEapi-coach-location--id-', this);">
|
|
|
+ <h3>
|
|
|
+ Request
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #8fbcd4; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-tryout-DELETEapi-coach-location--id-"
|
|
|
+ onclick="tryItOut('DELETEapi-coach-location--id-');">Try it out ⚡
|
|
|
+ </button>
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-canceltryout-DELETEapi-coach-location--id-"
|
|
|
+ onclick="cancelTryOut('DELETEapi-coach-location--id-');" hidden>Cancel 🛑
|
|
|
+ </button>
|
|
|
+ <button type="submit"
|
|
|
+ style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-executetryout-DELETEapi-coach-location--id-"
|
|
|
+ data-initial-text="Send Request 💥"
|
|
|
+ data-loading-text="⏱ Sending..."
|
|
|
+ hidden>Send Request 💥
|
|
|
+ </button>
|
|
|
+ </h3>
|
|
|
+ <p>
|
|
|
+ <small class="badge badge-red">DELETE</small>
|
|
|
+ <b><code>api/coach/location/{id}</code></b>
|
|
|
+ </p>
|
|
|
+ <h4 class="fancy-heading-panel"><b>Headers</b></h4>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>Authorization</code></b>
|
|
|
+
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="Authorization" class="auth-value" data-endpoint="DELETEapi-coach-location--id-"
|
|
|
+ value="Bearer {YOUR_AUTH_KEY}"
|
|
|
+ data-component="header">
|
|
|
+ <br>
|
|
|
+<p>Example: <code>Bearer {YOUR_AUTH_KEY}</code></p>
|
|
|
+ </div>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>Content-Type</code></b>
|
|
|
+
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="Content-Type" data-endpoint="DELETEapi-coach-location--id-"
|
|
|
+ value="application/json"
|
|
|
+ data-component="header">
|
|
|
+ <br>
|
|
|
+<p>Example: <code>application/json</code></p>
|
|
|
+ </div>
|
|
|
+ <h4 class="fancy-heading-panel"><b>URL Parameters</b></h4>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>id</code></b>
|
|
|
+<small>string</small>
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="id" data-endpoint="DELETEapi-coach-location--id-"
|
|
|
+ value="quis"
|
|
|
+ data-component="url">
|
|
|
+ <br>
|
|
|
+<p>The ID of the location. Example: <code>quis</code></p>
|
|
|
+ </div>
|
|
|
+ <h4 class="fancy-heading-panel"><b>Body Parameters</b></h4>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>coach_id</code></b>
|
|
|
+<small>integer</small>
|
|
|
+
|
|
|
+ <input type="number" style="display: none"
|
|
|
+ step="any" name="coach_id" data-endpoint="DELETEapi-coach-location--id-"
|
|
|
+ value="1"
|
|
|
+ data-component="body">
|
|
|
+ <br>
|
|
|
+<p>技师ID. Example: <code>1</code></p>
|
|
|
+ </div>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>type</code></b>
|
|
|
+<small>string</small>
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="type" data-endpoint="DELETEapi-coach-location--id-"
|
|
|
+ value="home"
|
|
|
+ data-component="body">
|
|
|
+ <br>
|
|
|
+<p>类型. Example: <code>home</code></p>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+
|
|
|
+ <h1 id="">用户端-技师管理</h1>
|
|
|
+
|
|
|
+ <p>技师相关的API接口</p>
|
|
|
+
|
|
|
+ <h2 id="-GETapi-coach">获取技师列表</h2>
|
|
|
+
|
|
|
+<p>
|
|
|
+<small class="badge badge-darkred">requires authentication</small>
|
|
|
+</p>
|
|
|
+
|
|
|
+<p>根据经纬度获取技师列表</p>
|
|
|
+
|
|
|
+<span id="example-requests-GETapi-coach">
|
|
|
+<blockquote>Example request:</blockquote>
|
|
|
+
|
|
|
+
|
|
|
+<div class="javascript-example">
|
|
|
+ <pre><code class="language-javascript">const url = new URL(
|
|
|
+ "http://127.0.0.1/api/coach"
|
|
|
+);
|
|
|
+
|
|
|
+const params = {
|
|
|
+ "latitude": "34.0522",
|
|
|
+ "longitude": "-118.2437",
|
|
|
+};
|
|
|
+Object.keys(params)
|
|
|
+ .forEach(key => url.searchParams.append(key, params[key]));
|
|
|
+
|
|
|
+const headers = {
|
|
|
+ "Authorization": "Bearer {YOUR_AUTH_KEY}",
|
|
|
+ "Accept": "application/json",
|
|
|
+};
|
|
|
+
|
|
|
+fetch(url, {
|
|
|
+ method: "GET",
|
|
|
+ headers,
|
|
|
+}).then(response => response.json());</code></pre></div>
|
|
|
+
|
|
|
+
|
|
|
+<div class="bash-example">
|
|
|
+ <pre><code class="language-bash">curl --request GET \
|
|
|
+ --get "http://127.0.0.1/api/coach?latitude=34.0522&longitude=-118.2437" \
|
|
|
+ --header "Authorization: Bearer {YOUR_AUTH_KEY}"</code></pre></div>
|
|
|
+
|
|
|
+</span>
|
|
|
+
|
|
|
+<span id="example-responses-GETapi-coach">
|
|
|
+ <blockquote>
|
|
|
+ <p>Example response (200):</p>
|
|
|
+ </blockquote>
|
|
|
+ <pre>
|
|
|
+
|
|
|
+<code class="language-json" style="max-height: 300px;">{
|
|
|
+ "code": 200,
|
|
|
+ "message": "获取成功",
|
|
|
+ "data": [
|
|
|
+ {
|
|
|
+ "id": 1,
|
|
|
+ "name": "技师A",
|
|
|
+ "latitude": 34.0522,
|
|
|
+ "longitude": -118.2437
|
|
|
+ }
|
|
|
+ ]
|
|
|
+}</code>
|
|
|
+ </pre>
|
|
|
+ </span>
|
|
|
+<span id="execution-results-GETapi-coach" hidden>
|
|
|
+ <blockquote>Received response<span
|
|
|
+ id="execution-response-status-GETapi-coach"></span>:
|
|
|
+ </blockquote>
|
|
|
+ <pre class="json"><code id="execution-response-content-GETapi-coach"
|
|
|
+ data-empty-response-text="<Empty response>" style="max-height: 400px;"></code></pre>
|
|
|
+</span>
|
|
|
+<span id="execution-error-GETapi-coach" hidden>
|
|
|
+ <blockquote>Request failed with error:</blockquote>
|
|
|
+ <pre><code id="execution-error-message-GETapi-coach">
|
|
|
+
|
|
|
+Tip: Check that you're properly connected to the network.
|
|
|
+If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
|
|
|
+You can check the Dev Tools console for debugging information.</code></pre>
|
|
|
+</span>
|
|
|
+<form id="form-GETapi-coach" data-method="GET"
|
|
|
+ data-path="api/coach"
|
|
|
+ data-authed="1"
|
|
|
+ data-hasfiles="0"
|
|
|
+ data-isarraybody="0"
|
|
|
+ autocomplete="off"
|
|
|
+ onsubmit="event.preventDefault(); executeTryOut('GETapi-coach', this);">
|
|
|
+ <h3>
|
|
|
+ Request
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #8fbcd4; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-tryout-GETapi-coach"
|
|
|
+ onclick="tryItOut('GETapi-coach');">Try it out ⚡
|
|
|
+ </button>
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-canceltryout-GETapi-coach"
|
|
|
+ onclick="cancelTryOut('GETapi-coach');" hidden>Cancel 🛑
|
|
|
+ </button>
|
|
|
+ <button type="submit"
|
|
|
+ style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-executetryout-GETapi-coach"
|
|
|
+ data-initial-text="Send Request 💥"
|
|
|
+ data-loading-text="⏱ Sending..."
|
|
|
+ hidden>Send Request 💥
|
|
|
+ </button>
|
|
|
+ </h3>
|
|
|
+ <p>
|
|
|
+ <small class="badge badge-green">GET</small>
|
|
|
+ <b><code>api/coach</code></b>
|
|
|
+ </p>
|
|
|
+ <h4 class="fancy-heading-panel"><b>Headers</b></h4>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>Authorization</code></b>
|
|
|
+
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="Authorization" class="auth-value" data-endpoint="GETapi-coach"
|
|
|
+ value="Bearer {YOUR_AUTH_KEY}"
|
|
|
+ data-component="header">
|
|
|
+ <br>
|
|
|
+<p>Example: <code>Bearer {YOUR_AUTH_KEY}</code></p>
|
|
|
+ </div>
|
|
|
+ <h4 class="fancy-heading-panel"><b>Query Parameters</b></h4>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>latitude</code></b>
|
|
|
+<small>number</small>
|
|
|
+
|
|
|
+ <input type="number" style="display: none"
|
|
|
+ step="any" name="latitude" data-endpoint="GETapi-coach"
|
|
|
+ value="34.0522"
|
|
|
+ data-component="query">
|
|
|
+ <br>
|
|
|
+<p>纬度. Example: <code>34.0522</code></p>
|
|
|
+ </div>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>longitude</code></b>
|
|
|
+<small>number</small>
|
|
|
+
|
|
|
+ <input type="number" style="display: none"
|
|
|
+ step="any" name="longitude" data-endpoint="GETapi-coach"
|
|
|
+ value="-118.2437"
|
|
|
+ data-component="query">
|
|
|
+ <br>
|
|
|
+<p>经度. Example: <code>-118.2437</code></p>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+
|
|
|
+ <h2 id="-GETapi-coach--id-">获取技师详情</h2>
|
|
|
+
|
|
|
+<p>
|
|
|
+<small class="badge badge-darkred">requires authentication</small>
|
|
|
+</p>
|
|
|
+
|
|
|
+<p>根据ID获取技师的详细信息</p>
|
|
|
+
|
|
|
+<span id="example-requests-GETapi-coach--id-">
|
|
|
+<blockquote>Example request:</blockquote>
|
|
|
+
|
|
|
+
|
|
|
+<div class="javascript-example">
|
|
|
+ <pre><code class="language-javascript">const url = new URL(
|
|
|
+ "http://127.0.0.1/api/coach/1"
|
|
|
+);
|
|
|
+
|
|
|
+const params = {
|
|
|
+ "latitude": "34.0522",
|
|
|
+ "longitude": "-118.2437",
|
|
|
+};
|
|
|
+Object.keys(params)
|
|
|
+ .forEach(key => url.searchParams.append(key, params[key]));
|
|
|
+
|
|
|
+const headers = {
|
|
|
+ "Authorization": "Bearer {YOUR_AUTH_KEY}",
|
|
|
+ "Accept": "application/json",
|
|
|
+};
|
|
|
+
|
|
|
+fetch(url, {
|
|
|
+ method: "GET",
|
|
|
+ headers,
|
|
|
+}).then(response => response.json());</code></pre></div>
|
|
|
+
|
|
|
+
|
|
|
+<div class="bash-example">
|
|
|
+ <pre><code class="language-bash">curl --request GET \
|
|
|
+ --get "http://127.0.0.1/api/coach/1?latitude=34.0522&longitude=-118.2437" \
|
|
|
+ --header "Authorization: Bearer {YOUR_AUTH_KEY}"</code></pre></div>
|
|
|
+
|
|
|
+</span>
|
|
|
+
|
|
|
+<span id="example-responses-GETapi-coach--id-">
|
|
|
+ <blockquote>
|
|
|
+ <p>Example response (200):</p>
|
|
|
+ </blockquote>
|
|
|
+ <pre>
|
|
|
+
|
|
|
+<code class="language-json" style="max-height: 300px;">{
|
|
|
+ "code": 200,
|
|
|
+ "message": "获取成功",
|
|
|
+ "data": {
|
|
|
+ "id": 1,
|
|
|
+ "name": "技师A",
|
|
|
+ "latitude": 34.0522,
|
|
|
+ "longitude": -118.2437,
|
|
|
+ "details": "详细信息"
|
|
|
+ }
|
|
|
+}</code>
|
|
|
+ </pre>
|
|
|
+ </span>
|
|
|
+<span id="execution-results-GETapi-coach--id-" hidden>
|
|
|
+ <blockquote>Received response<span
|
|
|
+ id="execution-response-status-GETapi-coach--id-"></span>:
|
|
|
+ </blockquote>
|
|
|
+ <pre class="json"><code id="execution-response-content-GETapi-coach--id-"
|
|
|
+ data-empty-response-text="<Empty response>" style="max-height: 400px;"></code></pre>
|
|
|
+</span>
|
|
|
+<span id="execution-error-GETapi-coach--id-" hidden>
|
|
|
+ <blockquote>Request failed with error:</blockquote>
|
|
|
+ <pre><code id="execution-error-message-GETapi-coach--id-">
|
|
|
+
|
|
|
+Tip: Check that you're properly connected to the network.
|
|
|
+If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
|
|
|
+You can check the Dev Tools console for debugging information.</code></pre>
|
|
|
+</span>
|
|
|
+<form id="form-GETapi-coach--id-" data-method="GET"
|
|
|
+ data-path="api/coach/{id}"
|
|
|
+ data-authed="1"
|
|
|
+ data-hasfiles="0"
|
|
|
+ data-isarraybody="0"
|
|
|
+ autocomplete="off"
|
|
|
+ onsubmit="event.preventDefault(); executeTryOut('GETapi-coach--id-', this);">
|
|
|
+ <h3>
|
|
|
+ Request
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #8fbcd4; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-tryout-GETapi-coach--id-"
|
|
|
+ onclick="tryItOut('GETapi-coach--id-');">Try it out ⚡
|
|
|
+ </button>
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-canceltryout-GETapi-coach--id-"
|
|
|
+ onclick="cancelTryOut('GETapi-coach--id-');" hidden>Cancel 🛑
|
|
|
+ </button>
|
|
|
+ <button type="submit"
|
|
|
+ style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-executetryout-GETapi-coach--id-"
|
|
|
+ data-initial-text="Send Request 💥"
|
|
|
+ data-loading-text="⏱ Sending..."
|
|
|
+ hidden>Send Request 💥
|
|
|
+ </button>
|
|
|
+ </h3>
|
|
|
+ <p>
|
|
|
+ <small class="badge badge-green">GET</small>
|
|
|
+ <b><code>api/coach/{id}</code></b>
|
|
|
+ </p>
|
|
|
+ <h4 class="fancy-heading-panel"><b>Headers</b></h4>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>Authorization</code></b>
|
|
|
+
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="Authorization" class="auth-value" data-endpoint="GETapi-coach--id-"
|
|
|
+ value="Bearer {YOUR_AUTH_KEY}"
|
|
|
+ data-component="header">
|
|
|
+ <br>
|
|
|
+<p>Example: <code>Bearer {YOUR_AUTH_KEY}</code></p>
|
|
|
+ </div>
|
|
|
+ <h4 class="fancy-heading-panel"><b>URL Parameters</b></h4>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>id</code></b>
|
|
|
+<small>integer</small>
|
|
|
+
|
|
|
+ <input type="number" style="display: none"
|
|
|
+ step="any" name="id" data-endpoint="GETapi-coach--id-"
|
|
|
+ value="1"
|
|
|
+ data-component="url">
|
|
|
+ <br>
|
|
|
+<p>技师ID. Example: <code>1</code></p>
|
|
|
+ </div>
|
|
|
+ <h4 class="fancy-heading-panel"><b>Query Parameters</b></h4>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>latitude</code></b>
|
|
|
+<small>number</small>
|
|
|
+<i>optional</i>
|
|
|
+ <input type="number" style="display: none"
|
|
|
+ step="any" name="latitude" data-endpoint="GETapi-coach--id-"
|
|
|
+ value="34.0522"
|
|
|
+ data-component="query">
|
|
|
+ <br>
|
|
|
+<p>纬度. Example: <code>34.0522</code></p>
|
|
|
+ </div>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>longitude</code></b>
|
|
|
+<small>number</small>
|
|
|
+<i>optional</i>
|
|
|
+ <input type="number" style="display: none"
|
|
|
+ step="any" name="longitude" data-endpoint="GETapi-coach--id-"
|
|
|
+ value="-118.2437"
|
|
|
+ data-component="query">
|
|
|
+ <br>
|
|
|
+<p>经度. Example: <code>-118.2437</code></p>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+
|
|
|
+ <h1 id="">用户端-用户管理</h1>
|
|
|
+
|
|
|
+ <p>用户相关的API接口</p>
|
|
|
+
|
|
|
+ <h2 id="-GETapi-user">获取用户信息</h2>
|
|
|
+
|
|
|
+<p>
|
|
|
+<small class="badge badge-darkred">requires authentication</small>
|
|
|
+</p>
|
|
|
+
|
|
|
+<p>获取当前用户的信息</p>
|
|
|
+
|
|
|
+<span id="example-requests-GETapi-user">
|
|
|
+<blockquote>Example request:</blockquote>
|
|
|
+
|
|
|
+
|
|
|
+<div class="javascript-example">
|
|
|
+ <pre><code class="language-javascript">const url = new URL(
|
|
|
+ "http://127.0.0.1/api/user"
|
|
|
+);
|
|
|
+
|
|
|
+const headers = {
|
|
|
+ "Authorization": "Bearer {YOUR_AUTH_KEY}",
|
|
|
+ "Accept": "application/json",
|
|
|
+};
|
|
|
+
|
|
|
+fetch(url, {
|
|
|
+ method: "GET",
|
|
|
+ headers,
|
|
|
+}).then(response => response.json());</code></pre></div>
|
|
|
+
|
|
|
+
|
|
|
+<div class="bash-example">
|
|
|
+ <pre><code class="language-bash">curl --request GET \
|
|
|
+ --get "http://127.0.0.1/api/user" \
|
|
|
+ --header "Authorization: Bearer {YOUR_AUTH_KEY}"</code></pre></div>
|
|
|
+
|
|
|
+</span>
|
|
|
+
|
|
|
+<span id="example-responses-GETapi-user">
|
|
|
+ <blockquote>
|
|
|
+ <p>Example response (200):</p>
|
|
|
+ </blockquote>
|
|
|
+ <pre>
|
|
|
+
|
|
|
+<code class="language-json" style="max-height: 300px;">{
|
|
|
+ "code": 200,
|
|
|
+ "message": "获取成功",
|
|
|
+ "data": {
|
|
|
+ "id": 1,
|
|
|
+ "mobile": "13800138000",
|
|
|
+ "nickname": "用户昵称"
|
|
|
+ }
|
|
|
+}</code>
|
|
|
+ </pre>
|
|
|
+ </span>
|
|
|
+<span id="execution-results-GETapi-user" hidden>
|
|
|
+ <blockquote>Received response<span
|
|
|
+ id="execution-response-status-GETapi-user"></span>:
|
|
|
+ </blockquote>
|
|
|
+ <pre class="json"><code id="execution-response-content-GETapi-user"
|
|
|
+ data-empty-response-text="<Empty response>" style="max-height: 400px;"></code></pre>
|
|
|
+</span>
|
|
|
+<span id="execution-error-GETapi-user" hidden>
|
|
|
+ <blockquote>Request failed with error:</blockquote>
|
|
|
+ <pre><code id="execution-error-message-GETapi-user">
|
|
|
+
|
|
|
+Tip: Check that you're properly connected to the network.
|
|
|
+If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
|
|
|
+You can check the Dev Tools console for debugging information.</code></pre>
|
|
|
+</span>
|
|
|
+<form id="form-GETapi-user" data-method="GET"
|
|
|
+ data-path="api/user"
|
|
|
+ data-authed="1"
|
|
|
+ data-hasfiles="0"
|
|
|
+ data-isarraybody="0"
|
|
|
+ autocomplete="off"
|
|
|
+ onsubmit="event.preventDefault(); executeTryOut('GETapi-user', this);">
|
|
|
+ <h3>
|
|
|
+ Request
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #8fbcd4; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-tryout-GETapi-user"
|
|
|
+ onclick="tryItOut('GETapi-user');">Try it out ⚡
|
|
|
+ </button>
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-canceltryout-GETapi-user"
|
|
|
+ onclick="cancelTryOut('GETapi-user');" hidden>Cancel 🛑
|
|
|
+ </button>
|
|
|
+ <button type="submit"
|
|
|
+ style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-executetryout-GETapi-user"
|
|
|
+ data-initial-text="Send Request 💥"
|
|
|
+ data-loading-text="⏱ Sending..."
|
|
|
+ hidden>Send Request 💥
|
|
|
+ </button>
|
|
|
+ </h3>
|
|
|
+ <p>
|
|
|
+ <small class="badge badge-green">GET</small>
|
|
|
+ <b><code>api/user</code></b>
|
|
|
+ </p>
|
|
|
+ <h4 class="fancy-heading-panel"><b>Headers</b></h4>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>Authorization</code></b>
|
|
|
+
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="Authorization" class="auth-value" data-endpoint="GETapi-user"
|
|
|
+ value="Bearer {YOUR_AUTH_KEY}"
|
|
|
+ data-component="header">
|
|
|
+ <br>
|
|
|
+<p>Example: <code>Bearer {YOUR_AUTH_KEY}</code></p>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+
|
|
|
+ <h2 id="-PUTapi-user">修改用户信息</h2>
|
|
|
+
|
|
|
+<p>
|
|
|
+<small class="badge badge-darkred">requires authentication</small>
|
|
|
+</p>
|
|
|
+
|
|
|
+<p>修改当前用户的信息</p>
|
|
|
+
|
|
|
+<span id="example-requests-PUTapi-user">
|
|
|
+<blockquote>Example request:</blockquote>
|
|
|
+
|
|
|
+
|
|
|
+<div class="javascript-example">
|
|
|
+ <pre><code class="language-javascript">const url = new URL(
|
|
|
+ "http://127.0.0.1/api/user"
|
|
|
+);
|
|
|
+
|
|
|
+const headers = {
|
|
|
+ "Authorization": "Bearer {YOUR_AUTH_KEY}",
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ "Accept": "application/json",
|
|
|
+};
|
|
|
+
|
|
|
+let body = {
|
|
|
+ "nickname": "用户昵称",
|
|
|
+ "avatar": "https:\/\/example.com\/avatar.jpg"
|
|
|
+};
|
|
|
+
|
|
|
+fetch(url, {
|
|
|
+ method: "PUT",
|
|
|
+ headers,
|
|
|
+ body: JSON.stringify(body),
|
|
|
+}).then(response => response.json());</code></pre></div>
|
|
|
+
|
|
|
+
|
|
|
+<div class="bash-example">
|
|
|
+ <pre><code class="language-bash">curl --request PUT \
|
|
|
+ "http://127.0.0.1/api/user" \
|
|
|
+ --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
|
|
|
+ --header "Content-Type: application/json" \
|
|
|
+ --data "{
|
|
|
+ \"nickname\": \"用户昵称\",
|
|
|
+ \"avatar\": \"https:\\/\\/example.com\\/avatar.jpg\"
|
|
|
+}"
|
|
|
+</code></pre></div>
|
|
|
+
|
|
|
+</span>
|
|
|
+
|
|
|
+<span id="example-responses-PUTapi-user">
|
|
|
+ <blockquote>
|
|
|
+ <p>Example response (200):</p>
|
|
|
+ </blockquote>
|
|
|
+ <pre>
|
|
|
+
|
|
|
+<code class="language-json" style="max-height: 300px;">{
|
|
|
+ "code": 200,
|
|
|
+ "message": "修改成功",
|
|
|
+ "data": null
|
|
|
+}</code>
|
|
|
+ </pre>
|
|
|
+ </span>
|
|
|
+<span id="execution-results-PUTapi-user" hidden>
|
|
|
+ <blockquote>Received response<span
|
|
|
+ id="execution-response-status-PUTapi-user"></span>:
|
|
|
+ </blockquote>
|
|
|
+ <pre class="json"><code id="execution-response-content-PUTapi-user"
|
|
|
+ data-empty-response-text="<Empty response>" style="max-height: 400px;"></code></pre>
|
|
|
+</span>
|
|
|
+<span id="execution-error-PUTapi-user" hidden>
|
|
|
+ <blockquote>Request failed with error:</blockquote>
|
|
|
+ <pre><code id="execution-error-message-PUTapi-user">
|
|
|
+
|
|
|
+Tip: Check that you're properly connected to the network.
|
|
|
+If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
|
|
|
+You can check the Dev Tools console for debugging information.</code></pre>
|
|
|
+</span>
|
|
|
+<form id="form-PUTapi-user" data-method="PUT"
|
|
|
+ data-path="api/user"
|
|
|
+ data-authed="1"
|
|
|
+ data-hasfiles="0"
|
|
|
+ data-isarraybody="0"
|
|
|
+ autocomplete="off"
|
|
|
+ onsubmit="event.preventDefault(); executeTryOut('PUTapi-user', this);">
|
|
|
+ <h3>
|
|
|
+ Request
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #8fbcd4; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-tryout-PUTapi-user"
|
|
|
+ onclick="tryItOut('PUTapi-user');">Try it out ⚡
|
|
|
+ </button>
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-canceltryout-PUTapi-user"
|
|
|
+ onclick="cancelTryOut('PUTapi-user');" hidden>Cancel 🛑
|
|
|
+ </button>
|
|
|
+ <button type="submit"
|
|
|
+ style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-executetryout-PUTapi-user"
|
|
|
+ data-initial-text="Send Request 💥"
|
|
|
+ data-loading-text="⏱ Sending..."
|
|
|
+ hidden>Send Request 💥
|
|
|
+ </button>
|
|
|
+ </h3>
|
|
|
+ <p>
|
|
|
+ <small class="badge badge-darkblue">PUT</small>
|
|
|
+ <b><code>api/user</code></b>
|
|
|
+ </p>
|
|
|
+ <h4 class="fancy-heading-panel"><b>Headers</b></h4>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>Authorization</code></b>
|
|
|
+
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="Authorization" class="auth-value" data-endpoint="PUTapi-user"
|
|
|
+ value="Bearer {YOUR_AUTH_KEY}"
|
|
|
+ data-component="header">
|
|
|
+ <br>
|
|
|
+<p>Example: <code>Bearer {YOUR_AUTH_KEY}</code></p>
|
|
|
+ </div>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>Content-Type</code></b>
|
|
|
+
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="Content-Type" data-endpoint="PUTapi-user"
|
|
|
+ value="application/json"
|
|
|
+ data-component="header">
|
|
|
+ <br>
|
|
|
+<p>Example: <code>application/json</code></p>
|
|
|
+ </div>
|
|
|
+ <h4 class="fancy-heading-panel"><b>Body Parameters</b></h4>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>nickname</code></b>
|
|
|
+<small>string</small>
|
|
|
+<i>optional</i>
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="nickname" data-endpoint="PUTapi-user"
|
|
|
+ value="用户昵称"
|
|
|
+ data-component="body">
|
|
|
+ <br>
|
|
|
+<p>用户昵称. Example: <code>用户昵称</code></p>
|
|
|
+ </div>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>avatar</code></b>
|
|
|
+<small>string</small>
|
|
|
+<i>optional</i>
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="avatar" data-endpoint="PUTapi-user"
|
|
|
+ value="https://example.com/avatar.jpg"
|
|
|
+ data-component="body">
|
|
|
+ <br>
|
|
|
+<p>用户头像. Example: <code>https://example.com/avatar.jpg</code></p>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+
|
|
|
+ <h2 id="-GETapi-user-wallet">获取用户钱包</h2>
|
|
|
+
|
|
|
+<p>
|
|
|
+<small class="badge badge-darkred">requires authentication</small>
|
|
|
+</p>
|
|
|
+
|
|
|
+<p>获取当前用户的钱包信息</p>
|
|
|
+
|
|
|
+<span id="example-requests-GETapi-user-wallet">
|
|
|
+<blockquote>Example request:</blockquote>
|
|
|
+
|
|
|
+
|
|
|
+<div class="javascript-example">
|
|
|
+ <pre><code class="language-javascript">const url = new URL(
|
|
|
+ "http://127.0.0.1/api/user/wallet"
|
|
|
+);
|
|
|
+
|
|
|
+const headers = {
|
|
|
+ "Authorization": "Bearer {YOUR_AUTH_KEY}",
|
|
|
+ "Accept": "application/json",
|
|
|
+};
|
|
|
+
|
|
|
+fetch(url, {
|
|
|
+ method: "GET",
|
|
|
+ headers,
|
|
|
+}).then(response => response.json());</code></pre></div>
|
|
|
+
|
|
|
+
|
|
|
+<div class="bash-example">
|
|
|
+ <pre><code class="language-bash">curl --request GET \
|
|
|
+ --get "http://127.0.0.1/api/user/wallet" \
|
|
|
+ --header "Authorization: Bearer {YOUR_AUTH_KEY}"</code></pre></div>
|
|
|
+
|
|
|
+</span>
|
|
|
+
|
|
|
+<span id="example-responses-GETapi-user-wallet">
|
|
|
+ <blockquote>
|
|
|
+ <p>Example response (200):</p>
|
|
|
+ </blockquote>
|
|
|
+ <pre>
|
|
|
+
|
|
|
+<code class="language-json" style="max-height: 300px;">{
|
|
|
+ "code": 200,
|
|
|
+ "message": "获取成功",
|
|
|
+ "data": {
|
|
|
+ "balance": 100,
|
|
|
+ "freeze": 0
|
|
|
+ }
|
|
|
+}</code>
|
|
|
+ </pre>
|
|
|
+ </span>
|
|
|
+<span id="execution-results-GETapi-user-wallet" hidden>
|
|
|
+ <blockquote>Received response<span
|
|
|
+ id="execution-response-status-GETapi-user-wallet"></span>:
|
|
|
+ </blockquote>
|
|
|
+ <pre class="json"><code id="execution-response-content-GETapi-user-wallet"
|
|
|
+ data-empty-response-text="<Empty response>" style="max-height: 400px;"></code></pre>
|
|
|
+</span>
|
|
|
+<span id="execution-error-GETapi-user-wallet" hidden>
|
|
|
+ <blockquote>Request failed with error:</blockquote>
|
|
|
+ <pre><code id="execution-error-message-GETapi-user-wallet">
|
|
|
+
|
|
|
+Tip: Check that you're properly connected to the network.
|
|
|
+If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
|
|
|
+You can check the Dev Tools console for debugging information.</code></pre>
|
|
|
+</span>
|
|
|
+<form id="form-GETapi-user-wallet" data-method="GET"
|
|
|
+ data-path="api/user/wallet"
|
|
|
+ data-authed="1"
|
|
|
+ data-hasfiles="0"
|
|
|
+ data-isarraybody="0"
|
|
|
+ autocomplete="off"
|
|
|
+ onsubmit="event.preventDefault(); executeTryOut('GETapi-user-wallet', this);">
|
|
|
+ <h3>
|
|
|
+ Request
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #8fbcd4; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-tryout-GETapi-user-wallet"
|
|
|
+ onclick="tryItOut('GETapi-user-wallet');">Try it out ⚡
|
|
|
+ </button>
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-canceltryout-GETapi-user-wallet"
|
|
|
+ onclick="cancelTryOut('GETapi-user-wallet');" hidden>Cancel 🛑
|
|
|
+ </button>
|
|
|
+ <button type="submit"
|
|
|
+ style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-executetryout-GETapi-user-wallet"
|
|
|
+ data-initial-text="Send Request 💥"
|
|
|
+ data-loading-text="⏱ Sending..."
|
|
|
+ hidden>Send Request 💥
|
|
|
+ </button>
|
|
|
+ </h3>
|
|
|
+ <p>
|
|
|
+ <small class="badge badge-green">GET</small>
|
|
|
+ <b><code>api/user/wallet</code></b>
|
|
|
+ </p>
|
|
|
+ <h4 class="fancy-heading-panel"><b>Headers</b></h4>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>Authorization</code></b>
|
|
|
+
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="Authorization" class="auth-value" data-endpoint="GETapi-user-wallet"
|
|
|
+ value="Bearer {YOUR_AUTH_KEY}"
|
|
|
+ data-component="header">
|
|
|
+ <br>
|
|
|
+<p>Example: <code>Bearer {YOUR_AUTH_KEY}</code></p>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+
|
|
|
+ <h2 id="-POSTapi-user-withdraw">用户提现</h2>
|
|
|
+
|
|
|
+<p>
|
|
|
+<small class="badge badge-darkred">requires authentication</small>
|
|
|
+</p>
|
|
|
+
|
|
|
+<p>提现用户的余额</p>
|
|
|
+
|
|
|
+<span id="example-requests-POSTapi-user-withdraw">
|
|
|
+<blockquote>Example request:</blockquote>
|
|
|
+
|
|
|
+
|
|
|
+<div class="javascript-example">
|
|
|
+ <pre><code class="language-javascript">const url = new URL(
|
|
|
+ "http://127.0.0.1/api/user/withdraw"
|
|
|
+);
|
|
|
+
|
|
|
+const headers = {
|
|
|
+ "Authorization": "Bearer {YOUR_AUTH_KEY}",
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ "Accept": "application/json",
|
|
|
+};
|
|
|
+
|
|
|
+let body = {
|
|
|
+ "amount": "100.00",
|
|
|
+ "type": "wechat",
|
|
|
+ "area_code": "330100"
|
|
|
+};
|
|
|
+
|
|
|
+fetch(url, {
|
|
|
+ method: "POST",
|
|
|
+ headers,
|
|
|
+ body: JSON.stringify(body),
|
|
|
+}).then(response => response.json());</code></pre></div>
|
|
|
+
|
|
|
+
|
|
|
+<div class="bash-example">
|
|
|
+ <pre><code class="language-bash">curl --request POST \
|
|
|
+ "http://127.0.0.1/api/user/withdraw" \
|
|
|
+ --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
|
|
|
+ --header "Content-Type: application/json" \
|
|
|
+ --data "{
|
|
|
+ \"amount\": \"100.00\",
|
|
|
+ \"type\": \"wechat\",
|
|
|
+ \"area_code\": \"330100\"
|
|
|
+}"
|
|
|
+</code></pre></div>
|
|
|
+
|
|
|
+</span>
|
|
|
+
|
|
|
+<span id="example-responses-POSTapi-user-withdraw">
|
|
|
+ <blockquote>
|
|
|
+ <p>Example response (200):</p>
|
|
|
+ </blockquote>
|
|
|
+ <pre>
|
|
|
+
|
|
|
+<code class="language-json" style="max-height: 300px;">{
|
|
|
+ "code": 200,
|
|
|
+ "message": "提现成功",
|
|
|
+ "data": null
|
|
|
+}</code>
|
|
|
+ </pre>
|
|
|
+ </span>
|
|
|
+<span id="execution-results-POSTapi-user-withdraw" hidden>
|
|
|
+ <blockquote>Received response<span
|
|
|
+ id="execution-response-status-POSTapi-user-withdraw"></span>:
|
|
|
+ </blockquote>
|
|
|
+ <pre class="json"><code id="execution-response-content-POSTapi-user-withdraw"
|
|
|
+ data-empty-response-text="<Empty response>" style="max-height: 400px;"></code></pre>
|
|
|
+</span>
|
|
|
+<span id="execution-error-POSTapi-user-withdraw" hidden>
|
|
|
+ <blockquote>Request failed with error:</blockquote>
|
|
|
+ <pre><code id="execution-error-message-POSTapi-user-withdraw">
|
|
|
+
|
|
|
+Tip: Check that you're properly connected to the network.
|
|
|
+If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
|
|
|
+You can check the Dev Tools console for debugging information.</code></pre>
|
|
|
+</span>
|
|
|
+<form id="form-POSTapi-user-withdraw" data-method="POST"
|
|
|
+ data-path="api/user/withdraw"
|
|
|
+ data-authed="1"
|
|
|
+ data-hasfiles="0"
|
|
|
+ data-isarraybody="0"
|
|
|
+ autocomplete="off"
|
|
|
+ onsubmit="event.preventDefault(); executeTryOut('POSTapi-user-withdraw', this);">
|
|
|
+ <h3>
|
|
|
+ Request
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #8fbcd4; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-tryout-POSTapi-user-withdraw"
|
|
|
+ onclick="tryItOut('POSTapi-user-withdraw');">Try it out ⚡
|
|
|
+ </button>
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-canceltryout-POSTapi-user-withdraw"
|
|
|
+ onclick="cancelTryOut('POSTapi-user-withdraw');" hidden>Cancel 🛑
|
|
|
+ </button>
|
|
|
+ <button type="submit"
|
|
|
+ style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-executetryout-POSTapi-user-withdraw"
|
|
|
+ data-initial-text="Send Request 💥"
|
|
|
+ data-loading-text="⏱ Sending..."
|
|
|
+ hidden>Send Request 💥
|
|
|
+ </button>
|
|
|
+ </h3>
|
|
|
+ <p>
|
|
|
+ <small class="badge badge-black">POST</small>
|
|
|
+ <b><code>api/user/withdraw</code></b>
|
|
|
+ </p>
|
|
|
+ <h4 class="fancy-heading-panel"><b>Headers</b></h4>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>Authorization</code></b>
|
|
|
+
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="Authorization" class="auth-value" data-endpoint="POSTapi-user-withdraw"
|
|
|
+ value="Bearer {YOUR_AUTH_KEY}"
|
|
|
+ data-component="header">
|
|
|
+ <br>
|
|
|
+<p>Example: <code>Bearer {YOUR_AUTH_KEY}</code></p>
|
|
|
+ </div>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>Content-Type</code></b>
|
|
|
+
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="Content-Type" data-endpoint="POSTapi-user-withdraw"
|
|
|
+ value="application/json"
|
|
|
+ data-component="header">
|
|
|
+ <br>
|
|
|
+<p>Example: <code>application/json</code></p>
|
|
|
+ </div>
|
|
|
+ <h4 class="fancy-heading-panel"><b>Body Parameters</b></h4>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>amount</code></b>
|
|
|
+<small>decimal</small>
|
|
|
+<i>optional</i>
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="amount" data-endpoint="POSTapi-user-withdraw"
|
|
|
+ value="100.00"
|
|
|
+ data-component="body">
|
|
|
+ <br>
|
|
|
+<p>提现金额. Example: <code>100.00</code></p>
|
|
|
+ </div>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>type</code></b>
|
|
|
+<small>string</small>
|
|
|
+<i>optional</i>
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="type" data-endpoint="POSTapi-user-withdraw"
|
|
|
+ value="wechat"
|
|
|
+ data-component="body">
|
|
|
+ <br>
|
|
|
+<p>提现方式. Example: <code>wechat</code></p>
|
|
|
+ </div>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>area_code</code></b>
|
|
|
+<small>string</small>
|
|
|
+<i>optional</i>
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="area_code" data-endpoint="POSTapi-user-withdraw"
|
|
|
+ value="330100"
|
|
|
+ data-component="body">
|
|
|
+ <br>
|
|
|
+<p>行政区划代码. Example: <code>330100</code></p>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+
|
|
|
+ <h2 id="-POSTapi-user-apply-coach">申请成为技师</h2>
|
|
|
+
|
|
|
+<p>
|
|
|
+<small class="badge badge-darkred">requires authentication</small>
|
|
|
+</p>
|
|
|
+
|
|
|
+<p>申请成为技师</p>
|
|
|
+
|
|
|
+<span id="example-requests-POSTapi-user-apply-coach">
|
|
|
+<blockquote>Example request:</blockquote>
|
|
|
+
|
|
|
+
|
|
|
+<div class="javascript-example">
|
|
|
+ <pre><code class="language-javascript">const url = new URL(
|
|
|
+ "http://127.0.0.1/api/user/apply-coach"
|
|
|
+);
|
|
|
+
|
|
|
+const headers = {
|
|
|
+ "Authorization": "Bearer {YOUR_AUTH_KEY}",
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ "Accept": "application/json",
|
|
|
+};
|
|
|
+
|
|
|
+let body = {
|
|
|
+ "mobile": "13800138000",
|
|
|
+ "gender": "male",
|
|
|
+ "work_years": "5",
|
|
|
+ "intention_city": "杭州"
|
|
|
+};
|
|
|
+
|
|
|
+fetch(url, {
|
|
|
+ method: "POST",
|
|
|
+ headers,
|
|
|
+ body: JSON.stringify(body),
|
|
|
+}).then(response => response.json());</code></pre></div>
|
|
|
+
|
|
|
+
|
|
|
+<div class="bash-example">
|
|
|
+ <pre><code class="language-bash">curl --request POST \
|
|
|
+ "http://127.0.0.1/api/user/apply-coach" \
|
|
|
+ --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
|
|
|
+ --header "Content-Type: application/json" \
|
|
|
+ --data "{
|
|
|
+ \"mobile\": \"13800138000\",
|
|
|
+ \"gender\": \"male\",
|
|
|
+ \"work_years\": \"5\",
|
|
|
+ \"intention_city\": \"杭州\"
|
|
|
+}"
|
|
|
+</code></pre></div>
|
|
|
+
|
|
|
+</span>
|
|
|
+
|
|
|
+<span id="example-responses-POSTapi-user-apply-coach">
|
|
|
+ <blockquote>
|
|
|
+ <p>Example response (200):</p>
|
|
|
+ </blockquote>
|
|
|
+ <pre>
|
|
|
+
|
|
|
+<code class="language-json" style="max-height: 300px;">{
|
|
|
+ "code": 200,
|
|
|
+ "message": "申请成功",
|
|
|
+ "data": null
|
|
|
+}</code>
|
|
|
+ </pre>
|
|
|
+ </span>
|
|
|
+<span id="execution-results-POSTapi-user-apply-coach" hidden>
|
|
|
+ <blockquote>Received response<span
|
|
|
+ id="execution-response-status-POSTapi-user-apply-coach"></span>:
|
|
|
+ </blockquote>
|
|
|
+ <pre class="json"><code id="execution-response-content-POSTapi-user-apply-coach"
|
|
|
+ data-empty-response-text="<Empty response>" style="max-height: 400px;"></code></pre>
|
|
|
+</span>
|
|
|
+<span id="execution-error-POSTapi-user-apply-coach" hidden>
|
|
|
+ <blockquote>Request failed with error:</blockquote>
|
|
|
+ <pre><code id="execution-error-message-POSTapi-user-apply-coach">
|
|
|
+
|
|
|
+Tip: Check that you're properly connected to the network.
|
|
|
+If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
|
|
|
+You can check the Dev Tools console for debugging information.</code></pre>
|
|
|
+</span>
|
|
|
+<form id="form-POSTapi-user-apply-coach" data-method="POST"
|
|
|
+ data-path="api/user/apply-coach"
|
|
|
+ data-authed="1"
|
|
|
+ data-hasfiles="0"
|
|
|
+ data-isarraybody="0"
|
|
|
+ autocomplete="off"
|
|
|
+ onsubmit="event.preventDefault(); executeTryOut('POSTapi-user-apply-coach', this);">
|
|
|
+ <h3>
|
|
|
+ Request
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #8fbcd4; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-tryout-POSTapi-user-apply-coach"
|
|
|
+ onclick="tryItOut('POSTapi-user-apply-coach');">Try it out ⚡
|
|
|
+ </button>
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-canceltryout-POSTapi-user-apply-coach"
|
|
|
+ onclick="cancelTryOut('POSTapi-user-apply-coach');" hidden>Cancel 🛑
|
|
|
+ </button>
|
|
|
+ <button type="submit"
|
|
|
+ style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-executetryout-POSTapi-user-apply-coach"
|
|
|
+ data-initial-text="Send Request 💥"
|
|
|
+ data-loading-text="⏱ Sending..."
|
|
|
+ hidden>Send Request 💥
|
|
|
+ </button>
|
|
|
+ </h3>
|
|
|
+ <p>
|
|
|
+ <small class="badge badge-black">POST</small>
|
|
|
+ <b><code>api/user/apply-coach</code></b>
|
|
|
+ </p>
|
|
|
+ <h4 class="fancy-heading-panel"><b>Headers</b></h4>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>Authorization</code></b>
|
|
|
+
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="Authorization" class="auth-value" data-endpoint="POSTapi-user-apply-coach"
|
|
|
+ value="Bearer {YOUR_AUTH_KEY}"
|
|
|
+ data-component="header">
|
|
|
+ <br>
|
|
|
+<p>Example: <code>Bearer {YOUR_AUTH_KEY}</code></p>
|
|
|
+ </div>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>Content-Type</code></b>
|
|
|
+
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="Content-Type" data-endpoint="POSTapi-user-apply-coach"
|
|
|
+ value="application/json"
|
|
|
+ data-component="header">
|
|
|
+ <br>
|
|
|
+<p>Example: <code>application/json</code></p>
|
|
|
+ </div>
|
|
|
+ <h4 class="fancy-heading-panel"><b>Body Parameters</b></h4>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>mobile</code></b>
|
|
|
+<small>string</small>
|
|
|
+<i>optional</i>
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="mobile" data-endpoint="POSTapi-user-apply-coach"
|
|
|
+ value="13800138000"
|
|
|
+ data-component="body">
|
|
|
+ <br>
|
|
|
+<p>手机号. Example: <code>13800138000</code></p>
|
|
|
+ </div>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>gender</code></b>
|
|
|
+<small>string</small>
|
|
|
+<i>optional</i>
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="gender" data-endpoint="POSTapi-user-apply-coach"
|
|
|
+ value="male"
|
|
|
+ data-component="body">
|
|
|
+ <br>
|
|
|
+<p>性别. Example: <code>male</code></p>
|
|
|
+ </div>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>work_years</code></b>
|
|
|
+<small>string</small>
|
|
|
+<i>optional</i>
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="work_years" data-endpoint="POSTapi-user-apply-coach"
|
|
|
+ value="5"
|
|
|
+ data-component="body">
|
|
|
+ <br>
|
|
|
+<p>工作年限. Example: <code>5</code></p>
|
|
|
+ </div>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>intention_city</code></b>
|
|
|
+<small>string</small>
|
|
|
+<i>optional</i>
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="intention_city" data-endpoint="POSTapi-user-apply-coach"
|
|
|
+ value="杭州"
|
|
|
+ data-component="body">
|
|
|
+ <br>
|
|
|
+<p>意向城市. Example: <code>杭州</code></p>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+
|
|
|
+ <h1 id="">用户端-订单管理</h1>
|
|
|
+
|
|
|
+ <p>订单相关的API接口</p>
|
|
|
+
|
|
|
+ <h2 id="-POSTapi-orders-initialize">订单初始化</h2>
|
|
|
+
|
|
|
+<p>
|
|
|
+<small class="badge badge-darkred">requires authentication</small>
|
|
|
+</p>
|
|
|
+
|
|
|
+<p>初始化订单</p>
|
|
|
+
|
|
|
+<span id="example-requests-POSTapi-orders-initialize">
|
|
|
+<blockquote>Example request:</blockquote>
|
|
|
+
|
|
|
+
|
|
|
+<div class="javascript-example">
|
|
|
+ <pre><code class="language-javascript">const url = new URL(
|
|
|
+ "http://127.0.0.1/api/orders/initialize"
|
|
|
+);
|
|
|
+
|
|
|
+const headers = {
|
|
|
+ "Authorization": "Bearer {YOUR_AUTH_KEY}",
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ "Accept": "application/json",
|
|
|
+};
|
|
|
+
|
|
|
+let body = {
|
|
|
+ "coach_id": 1,
|
|
|
+ "area_code": "370602",
|
|
|
+ "project_id": 1
|
|
|
+};
|
|
|
+
|
|
|
+fetch(url, {
|
|
|
+ method: "POST",
|
|
|
+ headers,
|
|
|
+ body: JSON.stringify(body),
|
|
|
+}).then(response => response.json());</code></pre></div>
|
|
|
+
|
|
|
+
|
|
|
+<div class="bash-example">
|
|
|
+ <pre><code class="language-bash">curl --request POST \
|
|
|
+ "http://127.0.0.1/api/orders/initialize" \
|
|
|
+ --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
|
|
|
+ --header "Content-Type: application/json" \
|
|
|
+ --data "{
|
|
|
+ \"coach_id\": 1,
|
|
|
+ \"area_code\": \"370602\",
|
|
|
+ \"project_id\": 1
|
|
|
+}"
|
|
|
+</code></pre></div>
|
|
|
+
|
|
|
+</span>
|
|
|
+
|
|
|
+<span id="example-responses-POSTapi-orders-initialize">
|
|
|
+ <blockquote>
|
|
|
+ <p>Example response (200):</p>
|
|
|
+ </blockquote>
|
|
|
+ <pre>
|
|
|
+
|
|
|
+<code class="language-json" style="max-height: 300px;">{
|
|
|
+ "status": "success",
|
|
|
+ "data": {}
|
|
|
+}</code>
|
|
|
+ </pre>
|
|
|
+ </span>
|
|
|
+<span id="execution-results-POSTapi-orders-initialize" hidden>
|
|
|
+ <blockquote>Received response<span
|
|
|
+ id="execution-response-status-POSTapi-orders-initialize"></span>:
|
|
|
+ </blockquote>
|
|
|
+ <pre class="json"><code id="execution-response-content-POSTapi-orders-initialize"
|
|
|
+ data-empty-response-text="<Empty response>" style="max-height: 400px;"></code></pre>
|
|
|
+</span>
|
|
|
+<span id="execution-error-POSTapi-orders-initialize" hidden>
|
|
|
+ <blockquote>Request failed with error:</blockquote>
|
|
|
+ <pre><code id="execution-error-message-POSTapi-orders-initialize">
|
|
|
+
|
|
|
+Tip: Check that you're properly connected to the network.
|
|
|
+If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
|
|
|
+You can check the Dev Tools console for debugging information.</code></pre>
|
|
|
+</span>
|
|
|
+<form id="form-POSTapi-orders-initialize" data-method="POST"
|
|
|
+ data-path="api/orders/initialize"
|
|
|
+ data-authed="1"
|
|
|
+ data-hasfiles="0"
|
|
|
+ data-isarraybody="0"
|
|
|
+ autocomplete="off"
|
|
|
+ onsubmit="event.preventDefault(); executeTryOut('POSTapi-orders-initialize', this);">
|
|
|
+ <h3>
|
|
|
+ Request
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #8fbcd4; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-tryout-POSTapi-orders-initialize"
|
|
|
+ onclick="tryItOut('POSTapi-orders-initialize');">Try it out ⚡
|
|
|
+ </button>
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-canceltryout-POSTapi-orders-initialize"
|
|
|
+ onclick="cancelTryOut('POSTapi-orders-initialize');" hidden>Cancel 🛑
|
|
|
+ </button>
|
|
|
+ <button type="submit"
|
|
|
+ style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-executetryout-POSTapi-orders-initialize"
|
|
|
+ data-initial-text="Send Request 💥"
|
|
|
+ data-loading-text="⏱ Sending..."
|
|
|
+ hidden>Send Request 💥
|
|
|
+ </button>
|
|
|
+ </h3>
|
|
|
+ <p>
|
|
|
+ <small class="badge badge-black">POST</small>
|
|
|
+ <b><code>api/orders/initialize</code></b>
|
|
|
+ </p>
|
|
|
+ <h4 class="fancy-heading-panel"><b>Headers</b></h4>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>Authorization</code></b>
|
|
|
+
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="Authorization" class="auth-value" data-endpoint="POSTapi-orders-initialize"
|
|
|
+ value="Bearer {YOUR_AUTH_KEY}"
|
|
|
+ data-component="header">
|
|
|
+ <br>
|
|
|
+<p>Example: <code>Bearer {YOUR_AUTH_KEY}</code></p>
|
|
|
+ </div>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>Content-Type</code></b>
|
|
|
+
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="Content-Type" data-endpoint="POSTapi-orders-initialize"
|
|
|
+ value="application/json"
|
|
|
+ data-component="header">
|
|
|
+ <br>
|
|
|
+<p>Example: <code>application/json</code></p>
|
|
|
+ </div>
|
|
|
+ <h4 class="fancy-heading-panel"><b>Body Parameters</b></h4>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>coach_id</code></b>
|
|
|
+<small>integer</small>
|
|
|
+
|
|
|
+ <input type="number" style="display: none"
|
|
|
+ step="any" name="coach_id" data-endpoint="POSTapi-orders-initialize"
|
|
|
+ value="1"
|
|
|
+ data-component="body">
|
|
|
+ <br>
|
|
|
+<p>技师ID. Example: <code>1</code></p>
|
|
|
+ </div>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>area_code</code></b>
|
|
|
+<small>string</small>
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="area_code" data-endpoint="POSTapi-orders-initialize"
|
|
|
+ value="370602"
|
|
|
+ data-component="body">
|
|
|
+ <br>
|
|
|
+<p>区划代码. Example: <code>370602</code></p>
|
|
|
+ </div>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>project_id</code></b>
|
|
|
+<small>integer</small>
|
|
|
+
|
|
|
+ <input type="number" style="display: none"
|
|
|
+ step="any" name="project_id" data-endpoint="POSTapi-orders-initialize"
|
|
|
+ value="1"
|
|
|
+ data-component="body">
|
|
|
+ <br>
|
|
|
+<p>项目ID. Example: <code>1</code></p>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+
|
|
|
+ <h2 id="-POSTapi-orders-create">创建订单</h2>
|
|
|
+
|
|
|
+<p>
|
|
|
+<small class="badge badge-darkred">requires authentication</small>
|
|
|
+</p>
|
|
|
+
|
|
|
+<p>创建订单</p>
|
|
|
+
|
|
|
+<span id="example-requests-POSTapi-orders-create">
|
|
|
+<blockquote>Example request:</blockquote>
|
|
|
+
|
|
|
+
|
|
|
+<div class="javascript-example">
|
|
|
+ <pre><code class="language-javascript">const url = new URL(
|
|
|
+ "http://127.0.0.1/api/orders/create"
|
|
|
+);
|
|
|
+
|
|
|
+const headers = {
|
|
|
+ "Authorization": "Bearer {YOUR_AUTH_KEY}",
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ "Accept": "application/json",
|
|
|
+};
|
|
|
+
|
|
|
+let body = {
|
|
|
+ "project_id": 1,
|
|
|
+ "address_id": 1,
|
|
|
+ "coach_id": 6,
|
|
|
+ "use_balance": false,
|
|
|
+ "service_time": "2024-01-01 10:00:00",
|
|
|
+ "order_id": null
|
|
|
+};
|
|
|
+
|
|
|
+fetch(url, {
|
|
|
+ method: "POST",
|
|
|
+ headers,
|
|
|
+ body: JSON.stringify(body),
|
|
|
+}).then(response => response.json());</code></pre></div>
|
|
|
+
|
|
|
+
|
|
|
+<div class="bash-example">
|
|
|
+ <pre><code class="language-bash">curl --request POST \
|
|
|
+ "http://127.0.0.1/api/orders/create" \
|
|
|
+ --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
|
|
|
+ --header "Content-Type: application/json" \
|
|
|
+ --data "{
|
|
|
+ \"project_id\": 1,
|
|
|
+ \"address_id\": 1,
|
|
|
+ \"coach_id\": 6,
|
|
|
+ \"use_balance\": false,
|
|
|
+ \"service_time\": \"2024-01-01 10:00:00\",
|
|
|
+ \"order_id\": null
|
|
|
+}"
|
|
|
+</code></pre></div>
|
|
|
+
|
|
|
+</span>
|
|
|
+
|
|
|
+<span id="example-responses-POSTapi-orders-create">
|
|
|
+ <blockquote>
|
|
|
+ <p>Example response (200):</p>
|
|
|
+ </blockquote>
|
|
|
+ <pre>
|
|
|
+
|
|
|
+<code class="language-json" style="max-height: 300px;">{
|
|
|
+ "status": "success",
|
|
|
+ "data": {}
|
|
|
+}</code>
|
|
|
+ </pre>
|
|
|
+ </span>
|
|
|
+<span id="execution-results-POSTapi-orders-create" hidden>
|
|
|
+ <blockquote>Received response<span
|
|
|
+ id="execution-response-status-POSTapi-orders-create"></span>:
|
|
|
+ </blockquote>
|
|
|
+ <pre class="json"><code id="execution-response-content-POSTapi-orders-create"
|
|
|
+ data-empty-response-text="<Empty response>" style="max-height: 400px;"></code></pre>
|
|
|
+</span>
|
|
|
+<span id="execution-error-POSTapi-orders-create" hidden>
|
|
|
+ <blockquote>Request failed with error:</blockquote>
|
|
|
+ <pre><code id="execution-error-message-POSTapi-orders-create">
|
|
|
+
|
|
|
+Tip: Check that you're properly connected to the network.
|
|
|
+If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
|
|
|
+You can check the Dev Tools console for debugging information.</code></pre>
|
|
|
+</span>
|
|
|
+<form id="form-POSTapi-orders-create" data-method="POST"
|
|
|
+ data-path="api/orders/create"
|
|
|
+ data-authed="1"
|
|
|
+ data-hasfiles="0"
|
|
|
+ data-isarraybody="0"
|
|
|
+ autocomplete="off"
|
|
|
+ onsubmit="event.preventDefault(); executeTryOut('POSTapi-orders-create', this);">
|
|
|
+ <h3>
|
|
|
+ Request
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #8fbcd4; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-tryout-POSTapi-orders-create"
|
|
|
+ onclick="tryItOut('POSTapi-orders-create');">Try it out ⚡
|
|
|
+ </button>
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-canceltryout-POSTapi-orders-create"
|
|
|
+ onclick="cancelTryOut('POSTapi-orders-create');" hidden>Cancel 🛑
|
|
|
+ </button>
|
|
|
+ <button type="submit"
|
|
|
+ style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-executetryout-POSTapi-orders-create"
|
|
|
+ data-initial-text="Send Request 💥"
|
|
|
+ data-loading-text="⏱ Sending..."
|
|
|
+ hidden>Send Request 💥
|
|
|
+ </button>
|
|
|
+ </h3>
|
|
|
+ <p>
|
|
|
+ <small class="badge badge-black">POST</small>
|
|
|
+ <b><code>api/orders/create</code></b>
|
|
|
+ </p>
|
|
|
+ <h4 class="fancy-heading-panel"><b>Headers</b></h4>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>Authorization</code></b>
|
|
|
+
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="Authorization" class="auth-value" data-endpoint="POSTapi-orders-create"
|
|
|
+ value="Bearer {YOUR_AUTH_KEY}"
|
|
|
+ data-component="header">
|
|
|
+ <br>
|
|
|
+<p>Example: <code>Bearer {YOUR_AUTH_KEY}</code></p>
|
|
|
+ </div>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>Content-Type</code></b>
|
|
|
+
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="Content-Type" data-endpoint="POSTapi-orders-create"
|
|
|
+ value="application/json"
|
|
|
+ data-component="header">
|
|
|
+ <br>
|
|
|
+<p>Example: <code>application/json</code></p>
|
|
|
+ </div>
|
|
|
+ <h4 class="fancy-heading-panel"><b>Body Parameters</b></h4>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>project_id</code></b>
|
|
|
+<small>integer</small>
|
|
|
+
|
|
|
+ <input type="number" style="display: none"
|
|
|
+ step="any" name="project_id" data-endpoint="POSTapi-orders-create"
|
|
|
+ value="1"
|
|
|
+ data-component="body">
|
|
|
+ <br>
|
|
|
+<p>项目ID. Example: <code>1</code></p>
|
|
|
+ </div>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>address_id</code></b>
|
|
|
+<small>integer</small>
|
|
|
+
|
|
|
+ <input type="number" style="display: none"
|
|
|
+ step="any" name="address_id" data-endpoint="POSTapi-orders-create"
|
|
|
+ value="1"
|
|
|
+ data-component="body">
|
|
|
+ <br>
|
|
|
+<p>地址ID. Example: <code>1</code></p>
|
|
|
+ </div>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>coach_id</code></b>
|
|
|
+<small>integer</small>
|
|
|
+
|
|
|
+ <input type="number" style="display: none"
|
|
|
+ step="any" name="coach_id" data-endpoint="POSTapi-orders-create"
|
|
|
+ value="6"
|
|
|
+ data-component="body">
|
|
|
+ <br>
|
|
|
+<p>技师ID. Example: <code>6</code></p>
|
|
|
+ </div>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>use_balance</code></b>
|
|
|
+<small>boolean</small>
|
|
|
+<i>optional</i>
|
|
|
+ <label data-endpoint="POSTapi-orders-create" style="display: none">
|
|
|
+ <input type="radio" name="use_balance"
|
|
|
+ value="true"
|
|
|
+ data-endpoint="POSTapi-orders-create"
|
|
|
+ data-component="body" >
|
|
|
+ <code>true</code>
|
|
|
+ </label>
|
|
|
+ <label data-endpoint="POSTapi-orders-create" style="display: none">
|
|
|
+ <input type="radio" name="use_balance"
|
|
|
+ value="false"
|
|
|
+ data-endpoint="POSTapi-orders-create"
|
|
|
+ data-component="body" >
|
|
|
+ <code>false</code>
|
|
|
+ </label>
|
|
|
+ <br>
|
|
|
+<p>使用余额. Example: <code>false</code></p>
|
|
|
+ </div>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>service_time</code></b>
|
|
|
+<small>datetime</small>
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="service_time" data-endpoint="POSTapi-orders-create"
|
|
|
+ value="2024-01-01 10:00:00"
|
|
|
+ data-component="body">
|
|
|
+ <br>
|
|
|
+<p>服务时间. Example: <code>2024-01-01 10:00:00</code></p>
|
|
|
+ </div>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>order_id</code></b>
|
|
|
+<small>integer</small>
|
|
|
+<i>optional</i>
|
|
|
+ <input type="number" style="display: none"
|
|
|
+ step="any" name="order_id" data-endpoint="POSTapi-orders-create"
|
|
|
+ value=""
|
|
|
+ data-component="body">
|
|
|
+ <br>
|
|
|
+<p>订单ID.</p>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+
|
|
|
+ <h2 id="-POSTapi-orders-cancel">取消订单</h2>
|
|
|
+
|
|
|
+<p>
|
|
|
+<small class="badge badge-darkred">requires authentication</small>
|
|
|
+</p>
|
|
|
+
|
|
|
+<p>取消订单</p>
|
|
|
+
|
|
|
+<span id="example-requests-POSTapi-orders-cancel">
|
|
|
+<blockquote>Example request:</blockquote>
|
|
|
+
|
|
|
+
|
|
|
+<div class="javascript-example">
|
|
|
+ <pre><code class="language-javascript">const url = new URL(
|
|
|
+ "http://127.0.0.1/api/orders/cancel"
|
|
|
+);
|
|
|
+
|
|
|
+const headers = {
|
|
|
+ "Authorization": "Bearer {YOUR_AUTH_KEY}",
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ "Accept": "application/json",
|
|
|
+};
|
|
|
+
|
|
|
+let body = {
|
|
|
+ "order_id": 123
|
|
|
+};
|
|
|
+
|
|
|
+fetch(url, {
|
|
|
+ method: "POST",
|
|
|
+ headers,
|
|
|
+ body: JSON.stringify(body),
|
|
|
+}).then(response => response.json());</code></pre></div>
|
|
|
+
|
|
|
+
|
|
|
+<div class="bash-example">
|
|
|
+ <pre><code class="language-bash">curl --request POST \
|
|
|
+ "http://127.0.0.1/api/orders/cancel" \
|
|
|
+ --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
|
|
|
+ --header "Content-Type: application/json" \
|
|
|
+ --data "{
|
|
|
+ \"order_id\": 123
|
|
|
+}"
|
|
|
+</code></pre></div>
|
|
|
+
|
|
|
+</span>
|
|
|
+
|
|
|
+<span id="example-responses-POSTapi-orders-cancel">
|
|
|
+ <blockquote>
|
|
|
+ <p>Example response (200):</p>
|
|
|
+ </blockquote>
|
|
|
+ <pre>
|
|
|
+
|
|
|
+<code class="language-json" style="max-height: 300px;">{
|
|
|
+ "status": "success",
|
|
|
+ "data": {}
|
|
|
+}</code>
|
|
|
+ </pre>
|
|
|
+ </span>
|
|
|
+<span id="execution-results-POSTapi-orders-cancel" hidden>
|
|
|
+ <blockquote>Received response<span
|
|
|
+ id="execution-response-status-POSTapi-orders-cancel"></span>:
|
|
|
+ </blockquote>
|
|
|
+ <pre class="json"><code id="execution-response-content-POSTapi-orders-cancel"
|
|
|
+ data-empty-response-text="<Empty response>" style="max-height: 400px;"></code></pre>
|
|
|
+</span>
|
|
|
+<span id="execution-error-POSTapi-orders-cancel" hidden>
|
|
|
+ <blockquote>Request failed with error:</blockquote>
|
|
|
+ <pre><code id="execution-error-message-POSTapi-orders-cancel">
|
|
|
+
|
|
|
+Tip: Check that you're properly connected to the network.
|
|
|
+If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
|
|
|
+You can check the Dev Tools console for debugging information.</code></pre>
|
|
|
+</span>
|
|
|
+<form id="form-POSTapi-orders-cancel" data-method="POST"
|
|
|
+ data-path="api/orders/cancel"
|
|
|
+ data-authed="1"
|
|
|
+ data-hasfiles="0"
|
|
|
+ data-isarraybody="0"
|
|
|
+ autocomplete="off"
|
|
|
+ onsubmit="event.preventDefault(); executeTryOut('POSTapi-orders-cancel', this);">
|
|
|
+ <h3>
|
|
|
+ Request
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #8fbcd4; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-tryout-POSTapi-orders-cancel"
|
|
|
+ onclick="tryItOut('POSTapi-orders-cancel');">Try it out ⚡
|
|
|
+ </button>
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-canceltryout-POSTapi-orders-cancel"
|
|
|
+ onclick="cancelTryOut('POSTapi-orders-cancel');" hidden>Cancel 🛑
|
|
|
+ </button>
|
|
|
+ <button type="submit"
|
|
|
+ style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-executetryout-POSTapi-orders-cancel"
|
|
|
+ data-initial-text="Send Request 💥"
|
|
|
+ data-loading-text="⏱ Sending..."
|
|
|
+ hidden>Send Request 💥
|
|
|
+ </button>
|
|
|
+ </h3>
|
|
|
+ <p>
|
|
|
+ <small class="badge badge-black">POST</small>
|
|
|
+ <b><code>api/orders/cancel</code></b>
|
|
|
+ </p>
|
|
|
+ <h4 class="fancy-heading-panel"><b>Headers</b></h4>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>Authorization</code></b>
|
|
|
+
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="Authorization" class="auth-value" data-endpoint="POSTapi-orders-cancel"
|
|
|
+ value="Bearer {YOUR_AUTH_KEY}"
|
|
|
+ data-component="header">
|
|
|
+ <br>
|
|
|
+<p>Example: <code>Bearer {YOUR_AUTH_KEY}</code></p>
|
|
|
+ </div>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>Content-Type</code></b>
|
|
|
+
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="Content-Type" data-endpoint="POSTapi-orders-cancel"
|
|
|
+ value="application/json"
|
|
|
+ data-component="header">
|
|
|
+ <br>
|
|
|
+<p>Example: <code>application/json</code></p>
|
|
|
+ </div>
|
|
|
+ <h4 class="fancy-heading-panel"><b>Body Parameters</b></h4>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>order_id</code></b>
|
|
|
+<small>integer</small>
|
|
|
+
|
|
|
+ <input type="number" style="display: none"
|
|
|
+ step="any" name="order_id" data-endpoint="POSTapi-orders-cancel"
|
|
|
+ value="123"
|
|
|
+ data-component="body">
|
|
|
+ <br>
|
|
|
+<p>订单ID. Example: <code>123</code></p>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+
|
|
|
+ <h2 id="-POSTapi-orders-finish">结束订单</h2>
|
|
|
+
|
|
|
+<p>
|
|
|
+<small class="badge badge-darkred">requires authentication</small>
|
|
|
+</p>
|
|
|
+
|
|
|
+<p>结束订单</p>
|
|
|
+
|
|
|
+<span id="example-requests-POSTapi-orders-finish">
|
|
|
+<blockquote>Example request:</blockquote>
|
|
|
+
|
|
|
+
|
|
|
+<div class="javascript-example">
|
|
|
+ <pre><code class="language-javascript">const url = new URL(
|
|
|
+ "http://127.0.0.1/api/orders/finish"
|
|
|
+);
|
|
|
+
|
|
|
+const headers = {
|
|
|
+ "Authorization": "Bearer {YOUR_AUTH_KEY}",
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ "Accept": "application/json",
|
|
|
+};
|
|
|
+
|
|
|
+let body = {
|
|
|
+ "order_id": 1
|
|
|
+};
|
|
|
+
|
|
|
+fetch(url, {
|
|
|
+ method: "POST",
|
|
|
+ headers,
|
|
|
+ body: JSON.stringify(body),
|
|
|
+}).then(response => response.json());</code></pre></div>
|
|
|
+
|
|
|
+
|
|
|
+<div class="bash-example">
|
|
|
+ <pre><code class="language-bash">curl --request POST \
|
|
|
+ "http://127.0.0.1/api/orders/finish" \
|
|
|
+ --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
|
|
|
+ --header "Content-Type: application/json" \
|
|
|
+ --data "{
|
|
|
+ \"order_id\": 1
|
|
|
+}"
|
|
|
+</code></pre></div>
|
|
|
+
|
|
|
+</span>
|
|
|
+
|
|
|
+<span id="example-responses-POSTapi-orders-finish">
|
|
|
+ <blockquote>
|
|
|
+ <p>Example response (200):</p>
|
|
|
+ </blockquote>
|
|
|
+ <pre>
|
|
|
+
|
|
|
+<code class="language-json" style="max-height: 300px;">{
|
|
|
+ "status": "success",
|
|
|
+ "data": {}
|
|
|
+}</code>
|
|
|
+ </pre>
|
|
|
+ </span>
|
|
|
+<span id="execution-results-POSTapi-orders-finish" hidden>
|
|
|
+ <blockquote>Received response<span
|
|
|
+ id="execution-response-status-POSTapi-orders-finish"></span>:
|
|
|
+ </blockquote>
|
|
|
+ <pre class="json"><code id="execution-response-content-POSTapi-orders-finish"
|
|
|
+ data-empty-response-text="<Empty response>" style="max-height: 400px;"></code></pre>
|
|
|
+</span>
|
|
|
+<span id="execution-error-POSTapi-orders-finish" hidden>
|
|
|
+ <blockquote>Request failed with error:</blockquote>
|
|
|
+ <pre><code id="execution-error-message-POSTapi-orders-finish">
|
|
|
+
|
|
|
+Tip: Check that you're properly connected to the network.
|
|
|
+If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
|
|
|
+You can check the Dev Tools console for debugging information.</code></pre>
|
|
|
+</span>
|
|
|
+<form id="form-POSTapi-orders-finish" data-method="POST"
|
|
|
+ data-path="api/orders/finish"
|
|
|
+ data-authed="1"
|
|
|
+ data-hasfiles="0"
|
|
|
+ data-isarraybody="0"
|
|
|
+ autocomplete="off"
|
|
|
+ onsubmit="event.preventDefault(); executeTryOut('POSTapi-orders-finish', this);">
|
|
|
+ <h3>
|
|
|
+ Request
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #8fbcd4; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-tryout-POSTapi-orders-finish"
|
|
|
+ onclick="tryItOut('POSTapi-orders-finish');">Try it out ⚡
|
|
|
+ </button>
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-canceltryout-POSTapi-orders-finish"
|
|
|
+ onclick="cancelTryOut('POSTapi-orders-finish');" hidden>Cancel 🛑
|
|
|
+ </button>
|
|
|
+ <button type="submit"
|
|
|
+ style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-executetryout-POSTapi-orders-finish"
|
|
|
+ data-initial-text="Send Request 💥"
|
|
|
+ data-loading-text="⏱ Sending..."
|
|
|
+ hidden>Send Request 💥
|
|
|
+ </button>
|
|
|
+ </h3>
|
|
|
+ <p>
|
|
|
+ <small class="badge badge-black">POST</small>
|
|
|
+ <b><code>api/orders/finish</code></b>
|
|
|
+ </p>
|
|
|
+ <h4 class="fancy-heading-panel"><b>Headers</b></h4>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>Authorization</code></b>
|
|
|
+
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="Authorization" class="auth-value" data-endpoint="POSTapi-orders-finish"
|
|
|
+ value="Bearer {YOUR_AUTH_KEY}"
|
|
|
+ data-component="header">
|
|
|
+ <br>
|
|
|
+<p>Example: <code>Bearer {YOUR_AUTH_KEY}</code></p>
|
|
|
+ </div>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>Content-Type</code></b>
|
|
|
+
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="Content-Type" data-endpoint="POSTapi-orders-finish"
|
|
|
+ value="application/json"
|
|
|
+ data-component="header">
|
|
|
+ <br>
|
|
|
+<p>Example: <code>application/json</code></p>
|
|
|
+ </div>
|
|
|
+ <h4 class="fancy-heading-panel"><b>Body Parameters</b></h4>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>order_id</code></b>
|
|
|
+<small>integer</small>
|
|
|
+
|
|
|
+ <input type="number" style="display: none"
|
|
|
+ step="any" name="order_id" data-endpoint="POSTapi-orders-finish"
|
|
|
+ value="1"
|
|
|
+ data-component="body">
|
|
|
+ <br>
|
|
|
+<p>订单ID. Example: <code>1</code></p>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+
|
|
|
+ <h2 id="-POSTapi-orders-confirm-leave">确认技师离开</h2>
|
|
|
+
|
|
|
+<p>
|
|
|
+<small class="badge badge-darkred">requires authentication</small>
|
|
|
+</p>
|
|
|
+
|
|
|
+<p>确认技师离开</p>
|
|
|
+
|
|
|
+<span id="example-requests-POSTapi-orders-confirm-leave">
|
|
|
+<blockquote>Example request:</blockquote>
|
|
|
+
|
|
|
+
|
|
|
+<div class="javascript-example">
|
|
|
+ <pre><code class="language-javascript">const url = new URL(
|
|
|
+ "http://127.0.0.1/api/orders/confirm-leave"
|
|
|
+);
|
|
|
+
|
|
|
+const headers = {
|
|
|
+ "Authorization": "Bearer {YOUR_AUTH_KEY}",
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ "Accept": "application/json",
|
|
|
+};
|
|
|
+
|
|
|
+let body = {
|
|
|
+ "order_id": 123
|
|
|
+};
|
|
|
+
|
|
|
+fetch(url, {
|
|
|
+ method: "POST",
|
|
|
+ headers,
|
|
|
+ body: JSON.stringify(body),
|
|
|
+}).then(response => response.json());</code></pre></div>
|
|
|
+
|
|
|
+
|
|
|
+<div class="bash-example">
|
|
|
+ <pre><code class="language-bash">curl --request POST \
|
|
|
+ "http://127.0.0.1/api/orders/confirm-leave" \
|
|
|
+ --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
|
|
|
+ --header "Content-Type: application/json" \
|
|
|
+ --data "{
|
|
|
+ \"order_id\": 123
|
|
|
+}"
|
|
|
+</code></pre></div>
|
|
|
+
|
|
|
+</span>
|
|
|
+
|
|
|
+<span id="example-responses-POSTapi-orders-confirm-leave">
|
|
|
+ <blockquote>
|
|
|
+ <p>Example response (200):</p>
|
|
|
+ </blockquote>
|
|
|
+ <pre>
|
|
|
+
|
|
|
+<code class="language-json" style="max-height: 300px;">{
|
|
|
+ "status": "success",
|
|
|
+ "data": {}
|
|
|
+}</code>
|
|
|
+ </pre>
|
|
|
+ </span>
|
|
|
+<span id="execution-results-POSTapi-orders-confirm-leave" hidden>
|
|
|
+ <blockquote>Received response<span
|
|
|
+ id="execution-response-status-POSTapi-orders-confirm-leave"></span>:
|
|
|
+ </blockquote>
|
|
|
+ <pre class="json"><code id="execution-response-content-POSTapi-orders-confirm-leave"
|
|
|
+ data-empty-response-text="<Empty response>" style="max-height: 400px;"></code></pre>
|
|
|
+</span>
|
|
|
+<span id="execution-error-POSTapi-orders-confirm-leave" hidden>
|
|
|
+ <blockquote>Request failed with error:</blockquote>
|
|
|
+ <pre><code id="execution-error-message-POSTapi-orders-confirm-leave">
|
|
|
+
|
|
|
+Tip: Check that you're properly connected to the network.
|
|
|
+If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
|
|
|
+You can check the Dev Tools console for debugging information.</code></pre>
|
|
|
+</span>
|
|
|
+<form id="form-POSTapi-orders-confirm-leave" data-method="POST"
|
|
|
+ data-path="api/orders/confirm-leave"
|
|
|
+ data-authed="1"
|
|
|
+ data-hasfiles="0"
|
|
|
+ data-isarraybody="0"
|
|
|
+ autocomplete="off"
|
|
|
+ onsubmit="event.preventDefault(); executeTryOut('POSTapi-orders-confirm-leave', this);">
|
|
|
+ <h3>
|
|
|
+ Request
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #8fbcd4; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-tryout-POSTapi-orders-confirm-leave"
|
|
|
+ onclick="tryItOut('POSTapi-orders-confirm-leave');">Try it out ⚡
|
|
|
+ </button>
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-canceltryout-POSTapi-orders-confirm-leave"
|
|
|
+ onclick="cancelTryOut('POSTapi-orders-confirm-leave');" hidden>Cancel 🛑
|
|
|
+ </button>
|
|
|
+ <button type="submit"
|
|
|
+ style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-executetryout-POSTapi-orders-confirm-leave"
|
|
|
+ data-initial-text="Send Request 💥"
|
|
|
+ data-loading-text="⏱ Sending..."
|
|
|
+ hidden>Send Request 💥
|
|
|
+ </button>
|
|
|
+ </h3>
|
|
|
+ <p>
|
|
|
+ <small class="badge badge-black">POST</small>
|
|
|
+ <b><code>api/orders/confirm-leave</code></b>
|
|
|
+ </p>
|
|
|
+ <h4 class="fancy-heading-panel"><b>Headers</b></h4>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>Authorization</code></b>
|
|
|
+
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="Authorization" class="auth-value" data-endpoint="POSTapi-orders-confirm-leave"
|
|
|
+ value="Bearer {YOUR_AUTH_KEY}"
|
|
|
+ data-component="header">
|
|
|
+ <br>
|
|
|
+<p>Example: <code>Bearer {YOUR_AUTH_KEY}</code></p>
|
|
|
+ </div>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>Content-Type</code></b>
|
|
|
+
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="Content-Type" data-endpoint="POSTapi-orders-confirm-leave"
|
|
|
+ value="application/json"
|
|
|
+ data-component="header">
|
|
|
+ <br>
|
|
|
+<p>Example: <code>application/json</code></p>
|
|
|
+ </div>
|
|
|
+ <h4 class="fancy-heading-panel"><b>Body Parameters</b></h4>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>order_id</code></b>
|
|
|
+<small>integer</small>
|
|
|
+
|
|
|
+ <input type="number" style="display: none"
|
|
|
+ step="any" name="order_id" data-endpoint="POSTapi-orders-confirm-leave"
|
|
|
+ value="123"
|
|
|
+ data-component="body">
|
|
|
+ <br>
|
|
|
+<p>订单ID. Example: <code>123</code></p>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+
|
|
|
+ <h2 id="-GETapi-orders-list">获取订单列表</h2>
|
|
|
+
|
|
|
+<p>
|
|
|
+<small class="badge badge-darkred">requires authentication</small>
|
|
|
+</p>
|
|
|
+
|
|
|
+<p>获取订单列表</p>
|
|
|
+
|
|
|
+<span id="example-requests-GETapi-orders-list">
|
|
|
+<blockquote>Example request:</blockquote>
|
|
|
+
|
|
|
+
|
|
|
+<div class="javascript-example">
|
|
|
+ <pre><code class="language-javascript">const url = new URL(
|
|
|
+ "http://127.0.0.1/api/orders/list"
|
|
|
+);
|
|
|
+
|
|
|
+const headers = {
|
|
|
+ "Authorization": "Bearer {YOUR_AUTH_KEY}",
|
|
|
+ "Accept": "application/json",
|
|
|
+};
|
|
|
+
|
|
|
+fetch(url, {
|
|
|
+ method: "GET",
|
|
|
+ headers,
|
|
|
+}).then(response => response.json());</code></pre></div>
|
|
|
+
|
|
|
+
|
|
|
+<div class="bash-example">
|
|
|
+ <pre><code class="language-bash">curl --request GET \
|
|
|
+ --get "http://127.0.0.1/api/orders/list" \
|
|
|
+ --header "Authorization: Bearer {YOUR_AUTH_KEY}"</code></pre></div>
|
|
|
+
|
|
|
+</span>
|
|
|
+
|
|
|
+<span id="example-responses-GETapi-orders-list">
|
|
|
+ <blockquote>
|
|
|
+ <p>Example response (200):</p>
|
|
|
+ </blockquote>
|
|
|
+ <pre>
|
|
|
+
|
|
|
+<code class="language-json" style="max-height: 300px;">{
|
|
|
+ "status": "success",
|
|
|
+ "data": []
|
|
|
+}</code>
|
|
|
+ </pre>
|
|
|
+ </span>
|
|
|
+<span id="execution-results-GETapi-orders-list" hidden>
|
|
|
+ <blockquote>Received response<span
|
|
|
+ id="execution-response-status-GETapi-orders-list"></span>:
|
|
|
+ </blockquote>
|
|
|
+ <pre class="json"><code id="execution-response-content-GETapi-orders-list"
|
|
|
+ data-empty-response-text="<Empty response>" style="max-height: 400px;"></code></pre>
|
|
|
+</span>
|
|
|
+<span id="execution-error-GETapi-orders-list" hidden>
|
|
|
+ <blockquote>Request failed with error:</blockquote>
|
|
|
+ <pre><code id="execution-error-message-GETapi-orders-list">
|
|
|
+
|
|
|
+Tip: Check that you're properly connected to the network.
|
|
|
+If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
|
|
|
+You can check the Dev Tools console for debugging information.</code></pre>
|
|
|
+</span>
|
|
|
+<form id="form-GETapi-orders-list" data-method="GET"
|
|
|
+ data-path="api/orders/list"
|
|
|
+ data-authed="1"
|
|
|
+ data-hasfiles="0"
|
|
|
+ data-isarraybody="0"
|
|
|
+ autocomplete="off"
|
|
|
+ onsubmit="event.preventDefault(); executeTryOut('GETapi-orders-list', this);">
|
|
|
+ <h3>
|
|
|
+ Request
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #8fbcd4; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-tryout-GETapi-orders-list"
|
|
|
+ onclick="tryItOut('GETapi-orders-list');">Try it out ⚡
|
|
|
+ </button>
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-canceltryout-GETapi-orders-list"
|
|
|
+ onclick="cancelTryOut('GETapi-orders-list');" hidden>Cancel 🛑
|
|
|
+ </button>
|
|
|
+ <button type="submit"
|
|
|
+ style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-executetryout-GETapi-orders-list"
|
|
|
+ data-initial-text="Send Request 💥"
|
|
|
+ data-loading-text="⏱ Sending..."
|
|
|
+ hidden>Send Request 💥
|
|
|
+ </button>
|
|
|
+ </h3>
|
|
|
+ <p>
|
|
|
+ <small class="badge badge-green">GET</small>
|
|
|
+ <b><code>api/orders/list</code></b>
|
|
|
+ </p>
|
|
|
+ <h4 class="fancy-heading-panel"><b>Headers</b></h4>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>Authorization</code></b>
|
|
|
+
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="Authorization" class="auth-value" data-endpoint="GETapi-orders-list"
|
|
|
+ value="Bearer {YOUR_AUTH_KEY}"
|
|
|
+ data-component="header">
|
|
|
+ <br>
|
|
|
+<p>Example: <code>Bearer {YOUR_AUTH_KEY}</code></p>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+
|
|
|
+ <h2 id="-GETapi-orders-detail--id-">获取订单详情</h2>
|
|
|
+
|
|
|
+<p>
|
|
|
+<small class="badge badge-darkred">requires authentication</small>
|
|
|
+</p>
|
|
|
+
|
|
|
+<p>获取订单详情</p>
|
|
|
+
|
|
|
+<span id="example-requests-GETapi-orders-detail--id-">
|
|
|
+<blockquote>Example request:</blockquote>
|
|
|
+
|
|
|
+
|
|
|
+<div class="javascript-example">
|
|
|
+ <pre><code class="language-javascript">const url = new URL(
|
|
|
+ "http://127.0.0.1/api/orders/detail/1"
|
|
|
+);
|
|
|
+
|
|
|
+const headers = {
|
|
|
+ "Authorization": "Bearer {YOUR_AUTH_KEY}",
|
|
|
+ "Accept": "application/json",
|
|
|
+};
|
|
|
+
|
|
|
+fetch(url, {
|
|
|
+ method: "GET",
|
|
|
+ headers,
|
|
|
+}).then(response => response.json());</code></pre></div>
|
|
|
+
|
|
|
+
|
|
|
+<div class="bash-example">
|
|
|
+ <pre><code class="language-bash">curl --request GET \
|
|
|
+ --get "http://127.0.0.1/api/orders/detail/1" \
|
|
|
+ --header "Authorization: Bearer {YOUR_AUTH_KEY}"</code></pre></div>
|
|
|
+
|
|
|
+</span>
|
|
|
+
|
|
|
+<span id="example-responses-GETapi-orders-detail--id-">
|
|
|
+ <blockquote>
|
|
|
+ <p>Example response (200):</p>
|
|
|
+ </blockquote>
|
|
|
+ <pre>
|
|
|
+
|
|
|
+<code class="language-json" style="max-height: 300px;">{
|
|
|
+ "status": "success",
|
|
|
+ "data": {}
|
|
|
+}</code>
|
|
|
+ </pre>
|
|
|
+ </span>
|
|
|
+<span id="execution-results-GETapi-orders-detail--id-" hidden>
|
|
|
+ <blockquote>Received response<span
|
|
|
+ id="execution-response-status-GETapi-orders-detail--id-"></span>:
|
|
|
+ </blockquote>
|
|
|
+ <pre class="json"><code id="execution-response-content-GETapi-orders-detail--id-"
|
|
|
+ data-empty-response-text="<Empty response>" style="max-height: 400px;"></code></pre>
|
|
|
+</span>
|
|
|
+<span id="execution-error-GETapi-orders-detail--id-" hidden>
|
|
|
+ <blockquote>Request failed with error:</blockquote>
|
|
|
+ <pre><code id="execution-error-message-GETapi-orders-detail--id-">
|
|
|
+
|
|
|
+Tip: Check that you're properly connected to the network.
|
|
|
+If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
|
|
|
+You can check the Dev Tools console for debugging information.</code></pre>
|
|
|
+</span>
|
|
|
+<form id="form-GETapi-orders-detail--id-" data-method="GET"
|
|
|
+ data-path="api/orders/detail/{id}"
|
|
|
+ data-authed="1"
|
|
|
+ data-hasfiles="0"
|
|
|
+ data-isarraybody="0"
|
|
|
+ autocomplete="off"
|
|
|
+ onsubmit="event.preventDefault(); executeTryOut('GETapi-orders-detail--id-', this);">
|
|
|
+ <h3>
|
|
|
+ Request
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #8fbcd4; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-tryout-GETapi-orders-detail--id-"
|
|
|
+ onclick="tryItOut('GETapi-orders-detail--id-');">Try it out ⚡
|
|
|
+ </button>
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-canceltryout-GETapi-orders-detail--id-"
|
|
|
+ onclick="cancelTryOut('GETapi-orders-detail--id-');" hidden>Cancel 🛑
|
|
|
+ </button>
|
|
|
+ <button type="submit"
|
|
|
+ style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-executetryout-GETapi-orders-detail--id-"
|
|
|
+ data-initial-text="Send Request 💥"
|
|
|
+ data-loading-text="⏱ Sending..."
|
|
|
+ hidden>Send Request 💥
|
|
|
+ </button>
|
|
|
+ </h3>
|
|
|
+ <p>
|
|
|
+ <small class="badge badge-green">GET</small>
|
|
|
+ <b><code>api/orders/detail/{id}</code></b>
|
|
|
+ </p>
|
|
|
+ <h4 class="fancy-heading-panel"><b>Headers</b></h4>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>Authorization</code></b>
|
|
|
+
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="Authorization" class="auth-value" data-endpoint="GETapi-orders-detail--id-"
|
|
|
+ value="Bearer {YOUR_AUTH_KEY}"
|
|
|
+ data-component="header">
|
|
|
+ <br>
|
|
|
+<p>Example: <code>Bearer {YOUR_AUTH_KEY}</code></p>
|
|
|
+ </div>
|
|
|
+ <h4 class="fancy-heading-panel"><b>URL Parameters</b></h4>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>id</code></b>
|
|
|
+<small>string</small>
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="id" data-endpoint="GETapi-orders-detail--id-"
|
|
|
+ value="1"
|
|
|
+ data-component="url">
|
|
|
+ <br>
|
|
|
+<p>订单ID. Example: <code>1</code></p>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+
|
|
|
+ <h1 id="">用户端-项目管理</h1>
|
|
|
+
|
|
|
+ <p>项目相关的API接口</p>
|
|
|
+
|
|
|
+ <h2 id="-GETapi-project">获取项目列表</h2>
|
|
|
+
|
|
|
+<p>
|
|
|
+<small class="badge badge-darkred">requires authentication</small>
|
|
|
+</p>
|
|
|
+
|
|
|
+<p>根据区域代码获取项目列表</p>
|
|
|
+
|
|
|
+<span id="example-requests-GETapi-project">
|
|
|
+<blockquote>Example request:</blockquote>
|
|
|
+
|
|
|
+
|
|
|
+<div class="javascript-example">
|
|
|
+ <pre><code class="language-javascript">const url = new URL(
|
|
|
+ "http://127.0.0.1/api/project"
|
|
|
+);
|
|
|
+
|
|
|
+const params = {
|
|
|
+ "area_code": "330100",
|
|
|
+ "project_cate_id": "1",
|
|
|
+};
|
|
|
+Object.keys(params)
|
|
|
+ .forEach(key => url.searchParams.append(key, params[key]));
|
|
|
+
|
|
|
+const headers = {
|
|
|
+ "Authorization": "Bearer {YOUR_AUTH_KEY}",
|
|
|
+ "Accept": "application/json",
|
|
|
+};
|
|
|
+
|
|
|
+fetch(url, {
|
|
|
+ method: "GET",
|
|
|
+ headers,
|
|
|
+}).then(response => response.json());</code></pre></div>
|
|
|
+
|
|
|
+
|
|
|
+<div class="bash-example">
|
|
|
+ <pre><code class="language-bash">curl --request GET \
|
|
|
+ --get "http://127.0.0.1/api/project?area_code=330100&project_cate_id=1" \
|
|
|
+ --header "Authorization: Bearer {YOUR_AUTH_KEY}"</code></pre></div>
|
|
|
+
|
|
|
+</span>
|
|
|
+
|
|
|
+<span id="example-responses-GETapi-project">
|
|
|
+ <blockquote>
|
|
|
+ <p>Example response (200):</p>
|
|
|
+ </blockquote>
|
|
|
+ <pre>
|
|
|
+
|
|
|
+<code class="language-json" style="max-height: 300px;">{
|
|
|
+ "code": 200,
|
|
|
+ "message": "获取成功",
|
|
|
+ "data": {
|
|
|
+ "current_page": 1,
|
|
|
+ "data": [
|
|
|
+ {
|
|
|
+ "id": 1,
|
|
|
+ "name": "项目名称",
|
|
|
+ "description": "项目描述",
|
|
|
+ "price": "100.00",
|
|
|
+ "duration": 60,
|
|
|
+ "category": {
|
|
|
+ "id": 1,
|
|
|
+ "name": "分类名称"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "total": 10,
|
|
|
+ "per_page": 10
|
|
|
+ }
|
|
|
+}</code>
|
|
|
+ </pre>
|
|
|
+ </span>
|
|
|
+<span id="execution-results-GETapi-project" hidden>
|
|
|
+ <blockquote>Received response<span
|
|
|
+ id="execution-response-status-GETapi-project"></span>:
|
|
|
+ </blockquote>
|
|
|
+ <pre class="json"><code id="execution-response-content-GETapi-project"
|
|
|
+ data-empty-response-text="<Empty response>" style="max-height: 400px;"></code></pre>
|
|
|
+</span>
|
|
|
+<span id="execution-error-GETapi-project" hidden>
|
|
|
+ <blockquote>Request failed with error:</blockquote>
|
|
|
+ <pre><code id="execution-error-message-GETapi-project">
|
|
|
+
|
|
|
+Tip: Check that you're properly connected to the network.
|
|
|
+If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
|
|
|
+You can check the Dev Tools console for debugging information.</code></pre>
|
|
|
+</span>
|
|
|
+<form id="form-GETapi-project" data-method="GET"
|
|
|
+ data-path="api/project"
|
|
|
+ data-authed="1"
|
|
|
+ data-hasfiles="0"
|
|
|
+ data-isarraybody="0"
|
|
|
+ autocomplete="off"
|
|
|
+ onsubmit="event.preventDefault(); executeTryOut('GETapi-project', this);">
|
|
|
+ <h3>
|
|
|
+ Request
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #8fbcd4; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-tryout-GETapi-project"
|
|
|
+ onclick="tryItOut('GETapi-project');">Try it out ⚡
|
|
|
+ </button>
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-canceltryout-GETapi-project"
|
|
|
+ onclick="cancelTryOut('GETapi-project');" hidden>Cancel 🛑
|
|
|
+ </button>
|
|
|
+ <button type="submit"
|
|
|
+ style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-executetryout-GETapi-project"
|
|
|
+ data-initial-text="Send Request 💥"
|
|
|
+ data-loading-text="⏱ Sending..."
|
|
|
+ hidden>Send Request 💥
|
|
|
+ </button>
|
|
|
+ </h3>
|
|
|
+ <p>
|
|
|
+ <small class="badge badge-green">GET</small>
|
|
|
+ <b><code>api/project</code></b>
|
|
|
+ </p>
|
|
|
+ <h4 class="fancy-heading-panel"><b>Headers</b></h4>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>Authorization</code></b>
|
|
|
+
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="Authorization" class="auth-value" data-endpoint="GETapi-project"
|
|
|
+ value="Bearer {YOUR_AUTH_KEY}"
|
|
|
+ data-component="header">
|
|
|
+ <br>
|
|
|
+<p>Example: <code>Bearer {YOUR_AUTH_KEY}</code></p>
|
|
|
+ </div>
|
|
|
+ <h4 class="fancy-heading-panel"><b>Query Parameters</b></h4>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>area_code</code></b>
|
|
|
+<small>string</small>
|
|
|
+<i>optional</i>
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="area_code" data-endpoint="GETapi-project"
|
|
|
+ value="330100"
|
|
|
+ data-component="query">
|
|
|
+ <br>
|
|
|
+<p>区域代码. Example: <code>330100</code></p>
|
|
|
+ </div>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>project_cate_id</code></b>
|
|
|
+<small>integer</small>
|
|
|
+<i>optional</i>
|
|
|
+ <input type="number" style="display: none"
|
|
|
+ step="any" name="project_cate_id" data-endpoint="GETapi-project"
|
|
|
+ value="1"
|
|
|
+ data-component="query">
|
|
|
+ <br>
|
|
|
+<p>项目分类ID. Example: <code>1</code></p>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+
|
|
|
+ <h2 id="-GETapi-project--id--detail">获取项目详情</h2>
|
|
|
+
|
|
|
+<p>
|
|
|
+<small class="badge badge-darkred">requires authentication</small>
|
|
|
+</p>
|
|
|
+
|
|
|
+<p>获取指定项目的详细信息</p>
|
|
|
+
|
|
|
+<span id="example-requests-GETapi-project--id--detail">
|
|
|
+<blockquote>Example request:</blockquote>
|
|
|
+
|
|
|
+
|
|
|
+<div class="javascript-example">
|
|
|
+ <pre><code class="language-javascript">const url = new URL(
|
|
|
+ "http://127.0.0.1/api/project/1/detail"
|
|
|
+);
|
|
|
+
|
|
|
+const params = {
|
|
|
+ "area_code": "330100",
|
|
|
+};
|
|
|
+Object.keys(params)
|
|
|
+ .forEach(key => url.searchParams.append(key, params[key]));
|
|
|
+
|
|
|
+const headers = {
|
|
|
+ "Authorization": "Bearer {YOUR_AUTH_KEY}",
|
|
|
+ "Accept": "application/json",
|
|
|
+};
|
|
|
+
|
|
|
+fetch(url, {
|
|
|
+ method: "GET",
|
|
|
+ headers,
|
|
|
+}).then(response => response.json());</code></pre></div>
|
|
|
+
|
|
|
+
|
|
|
+<div class="bash-example">
|
|
|
+ <pre><code class="language-bash">curl --request GET \
|
|
|
+ --get "http://127.0.0.1/api/project/1/detail?area_code=330100" \
|
|
|
+ --header "Authorization: Bearer {YOUR_AUTH_KEY}"</code></pre></div>
|
|
|
+
|
|
|
+</span>
|
|
|
+
|
|
|
+<span id="example-responses-GETapi-project--id--detail">
|
|
|
+ <blockquote>
|
|
|
+ <p>Example response (200):</p>
|
|
|
+ </blockquote>
|
|
|
+ <pre>
|
|
|
+
|
|
|
+<code class="language-json" style="max-height: 300px;">{
|
|
|
+ "code": 200,
|
|
|
+ "message": "获取成功",
|
|
|
+ "data": {
|
|
|
+ "id": 1,
|
|
|
+ "name": "项目名称",
|
|
|
+ "description": "项目描述",
|
|
|
+ "price": "100.00",
|
|
|
+ "duration": 60,
|
|
|
+ "category": {
|
|
|
+ "id": 1,
|
|
|
+ "name": "分类名称"
|
|
|
+ },
|
|
|
+ "agent": {
|
|
|
+ "id": 1,
|
|
|
+ "name": "代理商名称",
|
|
|
+ "contact": "联系人",
|
|
|
+ "mobile": "13800138000"
|
|
|
+ }
|
|
|
+ }
|
|
|
+}</code>
|
|
|
+ </pre>
|
|
|
+ <blockquote>
|
|
|
+ <p>Example response (400):</p>
|
|
|
+ </blockquote>
|
|
|
+ <pre>
|
|
|
+
|
|
|
+<code class="language-json" style="max-height: 300px;">{
|
|
|
+ "code": 400,
|
|
|
+ "message": "该区域暂无代理商"
|
|
|
+}</code>
|
|
|
+ </pre>
|
|
|
+ <blockquote>
|
|
|
+ <p>Example response (404):</p>
|
|
|
+ </blockquote>
|
|
|
+ <pre>
|
|
|
+
|
|
|
+<code class="language-json" style="max-height: 300px;">{
|
|
|
+ "code": 404,
|
|
|
+ "message": "项目不存在"
|
|
|
+}</code>
|
|
|
+ </pre>
|
|
|
+ </span>
|
|
|
+<span id="execution-results-GETapi-project--id--detail" hidden>
|
|
|
+ <blockquote>Received response<span
|
|
|
+ id="execution-response-status-GETapi-project--id--detail"></span>:
|
|
|
+ </blockquote>
|
|
|
+ <pre class="json"><code id="execution-response-content-GETapi-project--id--detail"
|
|
|
+ data-empty-response-text="<Empty response>" style="max-height: 400px;"></code></pre>
|
|
|
+</span>
|
|
|
+<span id="execution-error-GETapi-project--id--detail" hidden>
|
|
|
+ <blockquote>Request failed with error:</blockquote>
|
|
|
+ <pre><code id="execution-error-message-GETapi-project--id--detail">
|
|
|
+
|
|
|
+Tip: Check that you're properly connected to the network.
|
|
|
+If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
|
|
|
+You can check the Dev Tools console for debugging information.</code></pre>
|
|
|
+</span>
|
|
|
+<form id="form-GETapi-project--id--detail" data-method="GET"
|
|
|
+ data-path="api/project/{id}/detail"
|
|
|
+ data-authed="1"
|
|
|
+ data-hasfiles="0"
|
|
|
+ data-isarraybody="0"
|
|
|
+ autocomplete="off"
|
|
|
+ onsubmit="event.preventDefault(); executeTryOut('GETapi-project--id--detail', this);">
|
|
|
+ <h3>
|
|
|
+ Request
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #8fbcd4; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-tryout-GETapi-project--id--detail"
|
|
|
+ onclick="tryItOut('GETapi-project--id--detail');">Try it out ⚡
|
|
|
+ </button>
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-canceltryout-GETapi-project--id--detail"
|
|
|
+ onclick="cancelTryOut('GETapi-project--id--detail');" hidden>Cancel 🛑
|
|
|
+ </button>
|
|
|
+ <button type="submit"
|
|
|
+ style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-executetryout-GETapi-project--id--detail"
|
|
|
+ data-initial-text="Send Request 💥"
|
|
|
+ data-loading-text="⏱ Sending..."
|
|
|
+ hidden>Send Request 💥
|
|
|
+ </button>
|
|
|
+ </h3>
|
|
|
+ <p>
|
|
|
+ <small class="badge badge-green">GET</small>
|
|
|
+ <b><code>api/project/{id}/detail</code></b>
|
|
|
+ </p>
|
|
|
+ <h4 class="fancy-heading-panel"><b>Headers</b></h4>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>Authorization</code></b>
|
|
|
+
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="Authorization" class="auth-value" data-endpoint="GETapi-project--id--detail"
|
|
|
+ value="Bearer {YOUR_AUTH_KEY}"
|
|
|
+ data-component="header">
|
|
|
+ <br>
|
|
|
+<p>Example: <code>Bearer {YOUR_AUTH_KEY}</code></p>
|
|
|
+ </div>
|
|
|
+ <h4 class="fancy-heading-panel"><b>URL Parameters</b></h4>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>id</code></b>
|
|
|
+<small>integer</small>
|
|
|
+
|
|
|
+ <input type="number" style="display: none"
|
|
|
+ step="any" name="id" data-endpoint="GETapi-project--id--detail"
|
|
|
+ value="1"
|
|
|
+ data-component="url">
|
|
|
+ <br>
|
|
|
+<p>项目ID. Example: <code>1</code></p>
|
|
|
+ </div>
|
|
|
+ <h4 class="fancy-heading-panel"><b>Query Parameters</b></h4>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>area_code</code></b>
|
|
|
+<small>string</small>
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="area_code" data-endpoint="GETapi-project--id--detail"
|
|
|
+ value="330100"
|
|
|
+ data-component="query">
|
|
|
+ <br>
|
|
|
+<p>区域代码. Example: <code>330100</code></p>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+
|
|
|
+ <h2 id="-GETapi-project-coach-list">获取技师项目列表</h2>
|
|
|
+
|
|
|
+<p>
|
|
|
+<small class="badge badge-darkred">requires authentication</small>
|
|
|
+</p>
|
|
|
+
|
|
|
+<p>获取指定技师已开通的项目列表</p>
|
|
|
+
|
|
|
+<span id="example-requests-GETapi-project-coach-list">
|
|
|
+<blockquote>Example request:</blockquote>
|
|
|
+
|
|
|
+
|
|
|
+<div class="javascript-example">
|
|
|
+ <pre><code class="language-javascript">const url = new URL(
|
|
|
+ "http://127.0.0.1/api/project/coach-list"
|
|
|
+);
|
|
|
+
|
|
|
+const params = {
|
|
|
+ "coach_id": "1",
|
|
|
+ "area_code": "330100",
|
|
|
+ "project_cate_id": "1",
|
|
|
+};
|
|
|
+Object.keys(params)
|
|
|
+ .forEach(key => url.searchParams.append(key, params[key]));
|
|
|
+
|
|
|
+const headers = {
|
|
|
+ "Authorization": "Bearer {YOUR_AUTH_KEY}",
|
|
|
+ "Accept": "application/json",
|
|
|
+};
|
|
|
+
|
|
|
+fetch(url, {
|
|
|
+ method: "GET",
|
|
|
+ headers,
|
|
|
+}).then(response => response.json());</code></pre></div>
|
|
|
+
|
|
|
+
|
|
|
+<div class="bash-example">
|
|
|
+ <pre><code class="language-bash">curl --request GET \
|
|
|
+ --get "http://127.0.0.1/api/project/coach-list?coach_id=1&area_code=330100&project_cate_id=1" \
|
|
|
+ --header "Authorization: Bearer {YOUR_AUTH_KEY}"</code></pre></div>
|
|
|
+
|
|
|
+</span>
|
|
|
+
|
|
|
+<span id="example-responses-GETapi-project-coach-list">
|
|
|
+ <blockquote>
|
|
|
+ <p>Example response (200):</p>
|
|
|
+ </blockquote>
|
|
|
+ <pre>
|
|
|
+
|
|
|
+<code class="language-json" style="max-height: 300px;">{
|
|
|
+ "code": 200,
|
|
|
+ "message": "获取成功",
|
|
|
+ "data": {
|
|
|
+ "current_page": 1,
|
|
|
+ "data": [
|
|
|
+ {
|
|
|
+ "id": 1,
|
|
|
+ "name": "项目名称",
|
|
|
+ "description": "项目描述",
|
|
|
+ "price": "100.00",
|
|
|
+ "duration": 60,
|
|
|
+ "category": {
|
|
|
+ "id": 1,
|
|
|
+ "name": "分类名称"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "total": 10,
|
|
|
+ "per_page": 10
|
|
|
+ }
|
|
|
+}</code>
|
|
|
+ </pre>
|
|
|
+ <blockquote>
|
|
|
+ <p>Example response (404):</p>
|
|
|
+ </blockquote>
|
|
|
+ <pre>
|
|
|
+
|
|
|
+<code class="language-json" style="max-height: 300px;">{
|
|
|
+ "code": 404,
|
|
|
+ "message": "技师不存在或未通过认证"
|
|
|
+}</code>
|
|
|
+ </pre>
|
|
|
+ </span>
|
|
|
+<span id="execution-results-GETapi-project-coach-list" hidden>
|
|
|
+ <blockquote>Received response<span
|
|
|
+ id="execution-response-status-GETapi-project-coach-list"></span>:
|
|
|
+ </blockquote>
|
|
|
+ <pre class="json"><code id="execution-response-content-GETapi-project-coach-list"
|
|
|
+ data-empty-response-text="<Empty response>" style="max-height: 400px;"></code></pre>
|
|
|
+</span>
|
|
|
+<span id="execution-error-GETapi-project-coach-list" hidden>
|
|
|
+ <blockquote>Request failed with error:</blockquote>
|
|
|
+ <pre><code id="execution-error-message-GETapi-project-coach-list">
|
|
|
+
|
|
|
+Tip: Check that you're properly connected to the network.
|
|
|
+If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
|
|
|
+You can check the Dev Tools console for debugging information.</code></pre>
|
|
|
+</span>
|
|
|
+<form id="form-GETapi-project-coach-list" data-method="GET"
|
|
|
+ data-path="api/project/coach-list"
|
|
|
+ data-authed="1"
|
|
|
+ data-hasfiles="0"
|
|
|
+ data-isarraybody="0"
|
|
|
+ autocomplete="off"
|
|
|
+ onsubmit="event.preventDefault(); executeTryOut('GETapi-project-coach-list', this);">
|
|
|
+ <h3>
|
|
|
+ Request
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #8fbcd4; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-tryout-GETapi-project-coach-list"
|
|
|
+ onclick="tryItOut('GETapi-project-coach-list');">Try it out ⚡
|
|
|
+ </button>
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-canceltryout-GETapi-project-coach-list"
|
|
|
+ onclick="cancelTryOut('GETapi-project-coach-list');" hidden>Cancel 🛑
|
|
|
+ </button>
|
|
|
+ <button type="submit"
|
|
|
+ style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-executetryout-GETapi-project-coach-list"
|
|
|
+ data-initial-text="Send Request 💥"
|
|
|
+ data-loading-text="⏱ Sending..."
|
|
|
+ hidden>Send Request 💥
|
|
|
+ </button>
|
|
|
+ </h3>
|
|
|
+ <p>
|
|
|
+ <small class="badge badge-green">GET</small>
|
|
|
+ <b><code>api/project/coach-list</code></b>
|
|
|
+ </p>
|
|
|
+ <h4 class="fancy-heading-panel"><b>Headers</b></h4>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>Authorization</code></b>
|
|
|
+
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="Authorization" class="auth-value" data-endpoint="GETapi-project-coach-list"
|
|
|
+ value="Bearer {YOUR_AUTH_KEY}"
|
|
|
+ data-component="header">
|
|
|
+ <br>
|
|
|
+<p>Example: <code>Bearer {YOUR_AUTH_KEY}</code></p>
|
|
|
+ </div>
|
|
|
+ <h4 class="fancy-heading-panel"><b>Query Parameters</b></h4>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>coach_id</code></b>
|
|
|
+<small>integer</small>
|
|
|
+
|
|
|
+ <input type="number" style="display: none"
|
|
|
+ step="any" name="coach_id" data-endpoint="GETapi-project-coach-list"
|
|
|
+ value="1"
|
|
|
+ data-component="query">
|
|
|
+ <br>
|
|
|
+<p>技师ID. Example: <code>1</code></p>
|
|
|
+ </div>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>area_code</code></b>
|
|
|
+<small>string</small>
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="area_code" data-endpoint="GETapi-project-coach-list"
|
|
|
+ value="330100"
|
|
|
+ data-component="query">
|
|
|
+ <br>
|
|
|
+<p>区域代码. Example: <code>330100</code></p>
|
|
|
+ </div>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>project_cate_id</code></b>
|
|
|
+<small>integer</small>
|
|
|
+<i>optional</i>
|
|
|
+ <input type="number" style="display: none"
|
|
|
+ step="any" name="project_cate_id" data-endpoint="GETapi-project-coach-list"
|
|
|
+ value="1"
|
|
|
+ data-component="query">
|
|
|
+ <br>
|
|
|
+<p>项目分类ID. Example: <code>1</code></p>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+
|
|
|
+ <h1 id="">账户管理</h1>
|
|
|
+
|
|
|
+ <p>包含登录、注册、账户管理等基础功能</p>
|
|
|
+
|
|
|
+ <h2 id="-POSTapi-account-send-code">发送验证码</h2>
|
|
|
+
|
|
|
+<p>
|
|
|
+<small class="badge badge-darkred">requires authentication</small>
|
|
|
+</p>
|
|
|
+
|
|
|
+<p>向指定手机号发送验证码</p>
|
|
|
+
|
|
|
+<span id="example-requests-POSTapi-account-send-code">
|
|
|
+<blockquote>Example request:</blockquote>
|
|
|
+
|
|
|
+
|
|
|
+<div class="javascript-example">
|
|
|
+ <pre><code class="language-javascript">const url = new URL(
|
|
|
+ "http://127.0.0.1/api/account/send-code"
|
|
|
+);
|
|
|
+
|
|
|
+const headers = {
|
|
|
+ "Authorization": "Bearer {YOUR_AUTH_KEY}",
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ "Accept": "application/json",
|
|
|
+};
|
|
|
+
|
|
|
+let body = {
|
|
|
+ "mobile": "13800138000"
|
|
|
+};
|
|
|
+
|
|
|
+fetch(url, {
|
|
|
+ method: "POST",
|
|
|
+ headers,
|
|
|
+ body: JSON.stringify(body),
|
|
|
+}).then(response => response.json());</code></pre></div>
|
|
|
+
|
|
|
+
|
|
|
+<div class="bash-example">
|
|
|
+ <pre><code class="language-bash">curl --request POST \
|
|
|
+ "http://127.0.0.1/api/account/send-code" \
|
|
|
+ --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
|
|
|
+ --header "Content-Type: application/json" \
|
|
|
+ --data "{
|
|
|
+ \"mobile\": \"13800138000\"
|
|
|
+}"
|
|
|
+</code></pre></div>
|
|
|
+
|
|
|
+</span>
|
|
|
+
|
|
|
+<span id="example-responses-POSTapi-account-send-code">
|
|
|
+ <blockquote>
|
|
|
+ <p>Example response (200):</p>
|
|
|
+ </blockquote>
|
|
|
+ <pre>
|
|
|
+
|
|
|
+<code class="language-json" style="max-height: 300px;">{
|
|
|
+ "code": 200,
|
|
|
+ "message": "验证码发送成功",
|
|
|
+ "data": null
|
|
|
+}</code>
|
|
|
+ </pre>
|
|
|
+ </span>
|
|
|
+<span id="execution-results-POSTapi-account-send-code" hidden>
|
|
|
+ <blockquote>Received response<span
|
|
|
+ id="execution-response-status-POSTapi-account-send-code"></span>:
|
|
|
+ </blockquote>
|
|
|
+ <pre class="json"><code id="execution-response-content-POSTapi-account-send-code"
|
|
|
+ data-empty-response-text="<Empty response>" style="max-height: 400px;"></code></pre>
|
|
|
+</span>
|
|
|
+<span id="execution-error-POSTapi-account-send-code" hidden>
|
|
|
+ <blockquote>Request failed with error:</blockquote>
|
|
|
+ <pre><code id="execution-error-message-POSTapi-account-send-code">
|
|
|
+
|
|
|
+Tip: Check that you're properly connected to the network.
|
|
|
+If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
|
|
|
+You can check the Dev Tools console for debugging information.</code></pre>
|
|
|
+</span>
|
|
|
+<form id="form-POSTapi-account-send-code" data-method="POST"
|
|
|
+ data-path="api/account/send-code"
|
|
|
+ data-authed="1"
|
|
|
+ data-hasfiles="0"
|
|
|
+ data-isarraybody="0"
|
|
|
+ autocomplete="off"
|
|
|
+ onsubmit="event.preventDefault(); executeTryOut('POSTapi-account-send-code', this);">
|
|
|
+ <h3>
|
|
|
+ Request
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #8fbcd4; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-tryout-POSTapi-account-send-code"
|
|
|
+ onclick="tryItOut('POSTapi-account-send-code');">Try it out ⚡
|
|
|
+ </button>
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-canceltryout-POSTapi-account-send-code"
|
|
|
+ onclick="cancelTryOut('POSTapi-account-send-code');" hidden>Cancel 🛑
|
|
|
+ </button>
|
|
|
+ <button type="submit"
|
|
|
+ style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-executetryout-POSTapi-account-send-code"
|
|
|
+ data-initial-text="Send Request 💥"
|
|
|
+ data-loading-text="⏱ Sending..."
|
|
|
+ hidden>Send Request 💥
|
|
|
+ </button>
|
|
|
+ </h3>
|
|
|
+ <p>
|
|
|
+ <small class="badge badge-black">POST</small>
|
|
|
+ <b><code>api/account/send-code</code></b>
|
|
|
+ </p>
|
|
|
+ <h4 class="fancy-heading-panel"><b>Headers</b></h4>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>Authorization</code></b>
|
|
|
+
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="Authorization" class="auth-value" data-endpoint="POSTapi-account-send-code"
|
|
|
+ value="Bearer {YOUR_AUTH_KEY}"
|
|
|
+ data-component="header">
|
|
|
+ <br>
|
|
|
+<p>Example: <code>Bearer {YOUR_AUTH_KEY}</code></p>
|
|
|
+ </div>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>Content-Type</code></b>
|
|
|
+
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="Content-Type" data-endpoint="POSTapi-account-send-code"
|
|
|
+ value="application/json"
|
|
|
+ data-component="header">
|
|
|
+ <br>
|
|
|
+<p>Example: <code>application/json</code></p>
|
|
|
+ </div>
|
|
|
+ <h4 class="fancy-heading-panel"><b>Body Parameters</b></h4>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>mobile</code></b>
|
|
|
+<small>string</small>
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="mobile" data-endpoint="POSTapi-account-send-code"
|
|
|
+ value="13800138000"
|
|
|
+ data-component="body">
|
|
|
+ <br>
|
|
|
+<p>手机号码. Example: <code>13800138000</code></p>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+
|
|
|
+ <h2 id="-POSTapi-account-login">用户登录</h2>
|
|
|
+
|
|
|
+<p>
|
|
|
+<small class="badge badge-darkred">requires authentication</small>
|
|
|
+</p>
|
|
|
+
|
|
|
+<p>使用手机号和验证码登录账户</p>
|
|
|
+
|
|
|
+<span id="example-requests-POSTapi-account-login">
|
|
|
+<blockquote>Example request:</blockquote>
|
|
|
+
|
|
|
+
|
|
|
+<div class="javascript-example">
|
|
|
+ <pre><code class="language-javascript">const url = new URL(
|
|
|
+ "http://127.0.0.1/api/account/login"
|
|
|
+);
|
|
|
+
|
|
|
+const headers = {
|
|
|
+ "Authorization": "Bearer {YOUR_AUTH_KEY}",
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ "Accept": "application/json",
|
|
|
+};
|
|
|
+
|
|
|
+let body = {
|
|
|
+ "mobile": "13800138000",
|
|
|
+ "code": "123456"
|
|
|
+};
|
|
|
+
|
|
|
+fetch(url, {
|
|
|
+ method: "POST",
|
|
|
+ headers,
|
|
|
+ body: JSON.stringify(body),
|
|
|
+}).then(response => response.json());</code></pre></div>
|
|
|
+
|
|
|
+
|
|
|
+<div class="bash-example">
|
|
|
+ <pre><code class="language-bash">curl --request POST \
|
|
|
+ "http://127.0.0.1/api/account/login" \
|
|
|
+ --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
|
|
|
+ --header "Content-Type: application/json" \
|
|
|
+ --data "{
|
|
|
+ \"mobile\": \"13800138000\",
|
|
|
+ \"code\": \"123456\"
|
|
|
+}"
|
|
|
+</code></pre></div>
|
|
|
+
|
|
|
+</span>
|
|
|
+
|
|
|
+<span id="example-responses-POSTapi-account-login">
|
|
|
+ <blockquote>
|
|
|
+ <p>Example response (200):</p>
|
|
|
+ </blockquote>
|
|
|
+ <pre>
|
|
|
+
|
|
|
+<code class="language-json" style="max-height: 300px;">{
|
|
|
+ "code": 200,
|
|
|
+ "message": "登录成功",
|
|
|
+ "data": {
|
|
|
+ "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...",
|
|
|
+ "user": {
|
|
|
+ "id": 1,
|
|
|
+ "mobile": "13800138000",
|
|
|
+ "nickname": "用户昵称"
|
|
|
+ }
|
|
|
+ }
|
|
|
+}</code>
|
|
|
+ </pre>
|
|
|
+ </span>
|
|
|
+<span id="execution-results-POSTapi-account-login" hidden>
|
|
|
+ <blockquote>Received response<span
|
|
|
+ id="execution-response-status-POSTapi-account-login"></span>:
|
|
|
+ </blockquote>
|
|
|
+ <pre class="json"><code id="execution-response-content-POSTapi-account-login"
|
|
|
+ data-empty-response-text="<Empty response>" style="max-height: 400px;"></code></pre>
|
|
|
+</span>
|
|
|
+<span id="execution-error-POSTapi-account-login" hidden>
|
|
|
+ <blockquote>Request failed with error:</blockquote>
|
|
|
+ <pre><code id="execution-error-message-POSTapi-account-login">
|
|
|
+
|
|
|
+Tip: Check that you're properly connected to the network.
|
|
|
+If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
|
|
|
+You can check the Dev Tools console for debugging information.</code></pre>
|
|
|
+</span>
|
|
|
+<form id="form-POSTapi-account-login" data-method="POST"
|
|
|
+ data-path="api/account/login"
|
|
|
+ data-authed="1"
|
|
|
+ data-hasfiles="0"
|
|
|
+ data-isarraybody="0"
|
|
|
+ autocomplete="off"
|
|
|
+ onsubmit="event.preventDefault(); executeTryOut('POSTapi-account-login', this);">
|
|
|
+ <h3>
|
|
|
+ Request
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #8fbcd4; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-tryout-POSTapi-account-login"
|
|
|
+ onclick="tryItOut('POSTapi-account-login');">Try it out ⚡
|
|
|
+ </button>
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-canceltryout-POSTapi-account-login"
|
|
|
+ onclick="cancelTryOut('POSTapi-account-login');" hidden>Cancel 🛑
|
|
|
+ </button>
|
|
|
+ <button type="submit"
|
|
|
+ style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-executetryout-POSTapi-account-login"
|
|
|
+ data-initial-text="Send Request 💥"
|
|
|
+ data-loading-text="⏱ Sending..."
|
|
|
+ hidden>Send Request 💥
|
|
|
+ </button>
|
|
|
+ </h3>
|
|
|
+ <p>
|
|
|
+ <small class="badge badge-black">POST</small>
|
|
|
+ <b><code>api/account/login</code></b>
|
|
|
+ </p>
|
|
|
+ <h4 class="fancy-heading-panel"><b>Headers</b></h4>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>Authorization</code></b>
|
|
|
+
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="Authorization" class="auth-value" data-endpoint="POSTapi-account-login"
|
|
|
+ value="Bearer {YOUR_AUTH_KEY}"
|
|
|
+ data-component="header">
|
|
|
+ <br>
|
|
|
+<p>Example: <code>Bearer {YOUR_AUTH_KEY}</code></p>
|
|
|
+ </div>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>Content-Type</code></b>
|
|
|
+
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="Content-Type" data-endpoint="POSTapi-account-login"
|
|
|
+ value="application/json"
|
|
|
+ data-component="header">
|
|
|
+ <br>
|
|
|
+<p>Example: <code>application/json</code></p>
|
|
|
+ </div>
|
|
|
+ <h4 class="fancy-heading-panel"><b>Body Parameters</b></h4>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>mobile</code></b>
|
|
|
+<small>string</small>
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="mobile" data-endpoint="POSTapi-account-login"
|
|
|
+ value="13800138000"
|
|
|
+ data-component="body">
|
|
|
+ <br>
|
|
|
+<p>手机号码. Example: <code>13800138000</code></p>
|
|
|
+ </div>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>code</code></b>
|
|
|
+<small>string</small>
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="code" data-endpoint="POSTapi-account-login"
|
|
|
+ value="123456"
|
|
|
+ data-component="body">
|
|
|
+ <br>
|
|
|
+<p>验证码. Example: <code>123456</code></p>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+
|
|
|
+ <h2 id="-POSTapi-account-wx-login">微信登录</h2>
|
|
|
+
|
|
|
+<p>
|
|
|
+<small class="badge badge-darkred">requires authentication</small>
|
|
|
+</p>
|
|
|
+
|
|
|
+<p>使用微信openid登录账户</p>
|
|
|
+
|
|
|
+<span id="example-requests-POSTapi-account-wx-login">
|
|
|
+<blockquote>Example request:</blockquote>
|
|
|
+
|
|
|
+
|
|
|
+<div class="javascript-example">
|
|
|
+ <pre><code class="language-javascript">const url = new URL(
|
|
|
+ "http://127.0.0.1/api/account/wx-login"
|
|
|
+);
|
|
|
+
|
|
|
+const headers = {
|
|
|
+ "Authorization": "Bearer {YOUR_AUTH_KEY}",
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ "Accept": "application/json",
|
|
|
+};
|
|
|
+
|
|
|
+let body = {
|
|
|
+ "openid": "wx_123456789"
|
|
|
+};
|
|
|
+
|
|
|
+fetch(url, {
|
|
|
+ method: "POST",
|
|
|
+ headers,
|
|
|
+ body: JSON.stringify(body),
|
|
|
+}).then(response => response.json());</code></pre></div>
|
|
|
+
|
|
|
+
|
|
|
+<div class="bash-example">
|
|
|
+ <pre><code class="language-bash">curl --request POST \
|
|
|
+ "http://127.0.0.1/api/account/wx-login" \
|
|
|
+ --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
|
|
|
+ --header "Content-Type: application/json" \
|
|
|
+ --data "{
|
|
|
+ \"openid\": \"wx_123456789\"
|
|
|
+}"
|
|
|
+</code></pre></div>
|
|
|
+
|
|
|
+</span>
|
|
|
+
|
|
|
+<span id="example-responses-POSTapi-account-wx-login">
|
|
|
+ <blockquote>
|
|
|
+ <p>Example response (200):</p>
|
|
|
+ </blockquote>
|
|
|
+ <pre>
|
|
|
+
|
|
|
+<code class="language-json" style="max-height: 300px;">{
|
|
|
+ "code": 200,
|
|
|
+ "message": "登录成功",
|
|
|
+ "data": {
|
|
|
+ "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...",
|
|
|
+ "user": {
|
|
|
+ "id": 1,
|
|
|
+ "openid": "wx_123456789",
|
|
|
+ "nickname": "微信昵称"
|
|
|
+ }
|
|
|
+ }
|
|
|
+}</code>
|
|
|
+ </pre>
|
|
|
+ </span>
|
|
|
+<span id="execution-results-POSTapi-account-wx-login" hidden>
|
|
|
+ <blockquote>Received response<span
|
|
|
+ id="execution-response-status-POSTapi-account-wx-login"></span>:
|
|
|
+ </blockquote>
|
|
|
+ <pre class="json"><code id="execution-response-content-POSTapi-account-wx-login"
|
|
|
+ data-empty-response-text="<Empty response>" style="max-height: 400px;"></code></pre>
|
|
|
+</span>
|
|
|
+<span id="execution-error-POSTapi-account-wx-login" hidden>
|
|
|
+ <blockquote>Request failed with error:</blockquote>
|
|
|
+ <pre><code id="execution-error-message-POSTapi-account-wx-login">
|
|
|
+
|
|
|
+Tip: Check that you're properly connected to the network.
|
|
|
+If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
|
|
|
+You can check the Dev Tools console for debugging information.</code></pre>
|
|
|
+</span>
|
|
|
+<form id="form-POSTapi-account-wx-login" data-method="POST"
|
|
|
+ data-path="api/account/wx-login"
|
|
|
+ data-authed="1"
|
|
|
+ data-hasfiles="0"
|
|
|
+ data-isarraybody="0"
|
|
|
+ autocomplete="off"
|
|
|
+ onsubmit="event.preventDefault(); executeTryOut('POSTapi-account-wx-login', this);">
|
|
|
+ <h3>
|
|
|
+ Request
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #8fbcd4; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-tryout-POSTapi-account-wx-login"
|
|
|
+ onclick="tryItOut('POSTapi-account-wx-login');">Try it out ⚡
|
|
|
+ </button>
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-canceltryout-POSTapi-account-wx-login"
|
|
|
+ onclick="cancelTryOut('POSTapi-account-wx-login');" hidden>Cancel 🛑
|
|
|
+ </button>
|
|
|
+ <button type="submit"
|
|
|
+ style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-executetryout-POSTapi-account-wx-login"
|
|
|
+ data-initial-text="Send Request 💥"
|
|
|
+ data-loading-text="⏱ Sending..."
|
|
|
+ hidden>Send Request 💥
|
|
|
+ </button>
|
|
|
+ </h3>
|
|
|
+ <p>
|
|
|
+ <small class="badge badge-black">POST</small>
|
|
|
+ <b><code>api/account/wx-login</code></b>
|
|
|
+ </p>
|
|
|
+ <h4 class="fancy-heading-panel"><b>Headers</b></h4>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>Authorization</code></b>
|
|
|
+
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="Authorization" class="auth-value" data-endpoint="POSTapi-account-wx-login"
|
|
|
+ value="Bearer {YOUR_AUTH_KEY}"
|
|
|
+ data-component="header">
|
|
|
+ <br>
|
|
|
+<p>Example: <code>Bearer {YOUR_AUTH_KEY}</code></p>
|
|
|
+ </div>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>Content-Type</code></b>
|
|
|
+
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="Content-Type" data-endpoint="POSTapi-account-wx-login"
|
|
|
+ value="application/json"
|
|
|
+ data-component="header">
|
|
|
+ <br>
|
|
|
+<p>Example: <code>application/json</code></p>
|
|
|
+ </div>
|
|
|
+ <h4 class="fancy-heading-panel"><b>Body Parameters</b></h4>
|
|
|
+ <div style=" padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>openid</code></b>
|
|
|
+<small>string</small>
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="openid" data-endpoint="POSTapi-account-wx-login"
|
|
|
+ value="wx_123456789"
|
|
|
+ data-component="body">
|
|
|
+ <br>
|
|
|
+<p>微信openid. Example: <code>wx_123456789</code></p>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+
|
|
|
+ <h2 id="-POSTapi-account-logout">用户退出</h2>
|
|
|
+
|
|
|
+<p>
|
|
|
+<small class="badge badge-darkred">requires authentication</small>
|
|
|
+</p>
|
|
|
+
|
|
|
+<p>退出当前账户登录状态</p>
|
|
|
+
|
|
|
+<span id="example-requests-POSTapi-account-logout">
|
|
|
+<blockquote>Example request:</blockquote>
|
|
|
+
|
|
|
+
|
|
|
+<div class="javascript-example">
|
|
|
+ <pre><code class="language-javascript">const url = new URL(
|
|
|
+ "http://127.0.0.1/api/account/logout"
|
|
|
+);
|
|
|
+
|
|
|
+const headers = {
|
|
|
+ "Authorization": "Bearer {YOUR_AUTH_KEY}",
|
|
|
+ "Accept": "application/json",
|
|
|
+};
|
|
|
+
|
|
|
+fetch(url, {
|
|
|
+ method: "POST",
|
|
|
+ headers,
|
|
|
+}).then(response => response.json());</code></pre></div>
|
|
|
+
|
|
|
+
|
|
|
+<div class="bash-example">
|
|
|
+ <pre><code class="language-bash">curl --request POST \
|
|
|
+ "http://127.0.0.1/api/account/logout" \
|
|
|
+ --header "Authorization: Bearer {YOUR_AUTH_KEY}"</code></pre></div>
|
|
|
+
|
|
|
+</span>
|
|
|
+
|
|
|
+<span id="example-responses-POSTapi-account-logout">
|
|
|
+ <blockquote>
|
|
|
+ <p>Example response (200):</p>
|
|
|
+ </blockquote>
|
|
|
+ <pre>
|
|
|
+
|
|
|
+<code class="language-json" style="max-height: 300px;">{
|
|
|
+ "code": 200,
|
|
|
+ "message": "退出成功",
|
|
|
+ "data": null
|
|
|
+}</code>
|
|
|
+ </pre>
|
|
|
+ </span>
|
|
|
+<span id="execution-results-POSTapi-account-logout" hidden>
|
|
|
+ <blockquote>Received response<span
|
|
|
+ id="execution-response-status-POSTapi-account-logout"></span>:
|
|
|
+ </blockquote>
|
|
|
+ <pre class="json"><code id="execution-response-content-POSTapi-account-logout"
|
|
|
+ data-empty-response-text="<Empty response>" style="max-height: 400px;"></code></pre>
|
|
|
+</span>
|
|
|
+<span id="execution-error-POSTapi-account-logout" hidden>
|
|
|
+ <blockquote>Request failed with error:</blockquote>
|
|
|
+ <pre><code id="execution-error-message-POSTapi-account-logout">
|
|
|
+
|
|
|
+Tip: Check that you're properly connected to the network.
|
|
|
+If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
|
|
|
+You can check the Dev Tools console for debugging information.</code></pre>
|
|
|
+</span>
|
|
|
+<form id="form-POSTapi-account-logout" data-method="POST"
|
|
|
+ data-path="api/account/logout"
|
|
|
+ data-authed="1"
|
|
|
+ data-hasfiles="0"
|
|
|
+ data-isarraybody="0"
|
|
|
+ autocomplete="off"
|
|
|
+ onsubmit="event.preventDefault(); executeTryOut('POSTapi-account-logout', this);">
|
|
|
+ <h3>
|
|
|
+ Request
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #8fbcd4; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-tryout-POSTapi-account-logout"
|
|
|
+ onclick="tryItOut('POSTapi-account-logout');">Try it out ⚡
|
|
|
+ </button>
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-canceltryout-POSTapi-account-logout"
|
|
|
+ onclick="cancelTryOut('POSTapi-account-logout');" hidden>Cancel 🛑
|
|
|
+ </button>
|
|
|
+ <button type="submit"
|
|
|
+ style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-executetryout-POSTapi-account-logout"
|
|
|
+ data-initial-text="Send Request 💥"
|
|
|
+ data-loading-text="⏱ Sending..."
|
|
|
+ hidden>Send Request 💥
|
|
|
+ </button>
|
|
|
+ </h3>
|
|
|
+ <p>
|
|
|
+ <small class="badge badge-black">POST</small>
|
|
|
+ <b><code>api/account/logout</code></b>
|
|
|
+ </p>
|
|
|
+ <h4 class="fancy-heading-panel"><b>Headers</b></h4>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>Authorization</code></b>
|
|
|
+
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="Authorization" class="auth-value" data-endpoint="POSTapi-account-logout"
|
|
|
+ value="Bearer {YOUR_AUTH_KEY}"
|
|
|
+ data-component="header">
|
|
|
+ <br>
|
|
|
+<p>Example: <code>Bearer {YOUR_AUTH_KEY}</code></p>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+
|
|
|
+ <h2 id="-DELETEapi-account">用户注销</h2>
|
|
|
+
|
|
|
+<p>
|
|
|
+<small class="badge badge-darkred">requires authentication</small>
|
|
|
+</p>
|
|
|
+
|
|
|
+<p>永久注销当前账户</p>
|
|
|
+
|
|
|
+<span id="example-requests-DELETEapi-account">
|
|
|
+<blockquote>Example request:</blockquote>
|
|
|
+
|
|
|
+
|
|
|
+<div class="javascript-example">
|
|
|
+ <pre><code class="language-javascript">const url = new URL(
|
|
|
+ "http://127.0.0.1/api/account"
|
|
|
+);
|
|
|
+
|
|
|
+const headers = {
|
|
|
+ "Authorization": "Bearer {YOUR_AUTH_KEY}",
|
|
|
+ "Accept": "application/json",
|
|
|
+};
|
|
|
+
|
|
|
+fetch(url, {
|
|
|
+ method: "DELETE",
|
|
|
+ headers,
|
|
|
+}).then(response => response.json());</code></pre></div>
|
|
|
+
|
|
|
+
|
|
|
+<div class="bash-example">
|
|
|
+ <pre><code class="language-bash">curl --request DELETE \
|
|
|
+ "http://127.0.0.1/api/account" \
|
|
|
+ --header "Authorization: Bearer {YOUR_AUTH_KEY}"</code></pre></div>
|
|
|
+
|
|
|
+</span>
|
|
|
+
|
|
|
+<span id="example-responses-DELETEapi-account">
|
|
|
+ <blockquote>
|
|
|
+ <p>Example response (200):</p>
|
|
|
+ </blockquote>
|
|
|
+ <pre>
|
|
|
+
|
|
|
+<code class="language-json" style="max-height: 300px;">{
|
|
|
+ "code": 200,
|
|
|
+ "message": "注销成功",
|
|
|
+ "data": null
|
|
|
+}</code>
|
|
|
+ </pre>
|
|
|
+ </span>
|
|
|
+<span id="execution-results-DELETEapi-account" hidden>
|
|
|
+ <blockquote>Received response<span
|
|
|
+ id="execution-response-status-DELETEapi-account"></span>:
|
|
|
+ </blockquote>
|
|
|
+ <pre class="json"><code id="execution-response-content-DELETEapi-account"
|
|
|
+ data-empty-response-text="<Empty response>" style="max-height: 400px;"></code></pre>
|
|
|
+</span>
|
|
|
+<span id="execution-error-DELETEapi-account" hidden>
|
|
|
+ <blockquote>Request failed with error:</blockquote>
|
|
|
+ <pre><code id="execution-error-message-DELETEapi-account">
|
|
|
+
|
|
|
+Tip: Check that you're properly connected to the network.
|
|
|
+If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
|
|
|
+You can check the Dev Tools console for debugging information.</code></pre>
|
|
|
+</span>
|
|
|
+<form id="form-DELETEapi-account" data-method="DELETE"
|
|
|
+ data-path="api/account"
|
|
|
+ data-authed="1"
|
|
|
+ data-hasfiles="0"
|
|
|
+ data-isarraybody="0"
|
|
|
+ autocomplete="off"
|
|
|
+ onsubmit="event.preventDefault(); executeTryOut('DELETEapi-account', this);">
|
|
|
+ <h3>
|
|
|
+ Request
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #8fbcd4; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-tryout-DELETEapi-account"
|
|
|
+ onclick="tryItOut('DELETEapi-account');">Try it out ⚡
|
|
|
+ </button>
|
|
|
+ <button type="button"
|
|
|
+ style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-canceltryout-DELETEapi-account"
|
|
|
+ onclick="cancelTryOut('DELETEapi-account');" hidden>Cancel 🛑
|
|
|
+ </button>
|
|
|
+ <button type="submit"
|
|
|
+ style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
+ id="btn-executetryout-DELETEapi-account"
|
|
|
+ data-initial-text="Send Request 💥"
|
|
|
+ data-loading-text="⏱ Sending..."
|
|
|
+ hidden>Send Request 💥
|
|
|
+ </button>
|
|
|
+ </h3>
|
|
|
+ <p>
|
|
|
+ <small class="badge badge-red">DELETE</small>
|
|
|
+ <b><code>api/account</code></b>
|
|
|
+ </p>
|
|
|
+ <h4 class="fancy-heading-panel"><b>Headers</b></h4>
|
|
|
+ <div style="padding-left: 28px; clear: unset;">
|
|
|
+ <b style="line-height: 2;"><code>Authorization</code></b>
|
|
|
+
|
|
|
+
|
|
|
+ <input type="text" style="display: none"
|
|
|
+ name="Authorization" class="auth-value" data-endpoint="DELETEapi-account"
|
|
|
+ value="Bearer {YOUR_AUTH_KEY}"
|
|
|
+ data-component="header">
|
|
|
+ <br>
|
|
|
+<p>Example: <code>Bearer {YOUR_AUTH_KEY}</code></p>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ </div>
|
|
|
+ <div class="dark-box">
|
|
|
+ <div class="lang-selector">
|
|
|
+ <button type="button" class="lang-button" data-language-name="javascript">javascript</button>
|
|
|
+ <button type="button" class="lang-button" data-language-name="bash">bash</button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</div>
|
|
|
+</body>
|
|
|
+
|
|
|
+<script src="http://127.0.0.1/vendor/scribe/js/tryitout-4.38.0.js"></script>
|
|
|
+<script src="http://127.0.0.1/vendor/scribe/js/theme-default-4.38.0.js"></script>
|
|
|
+
|
|
|
+
|
|
|
+<script src="http://127.0.0.1/vendor/scribe/js/my-custom.js"></script>
|
|
|
+<script src="http://127.0.0.1/vendor/scribe/js/custom.js"></script>
|
|
|
+
|
|
|
+</html>
|