123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714 |
- <!DOCTYPE html>
- <html>
- <head lang="en">
- <title> API Documentation </title>
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
- <link href='http://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'>
-
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap-theme.min.css">
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
-
- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
- <style type="text/css">
- body {
- font-family: 'Roboto', sans-serif;
- }
- .hidden {
- display:none;
- }
- pre {
- outline: 1px solid #ccc;
- padding: 5px; margin: 5px;
- }
- .string { color: green; }
- .number { color: darkorange; }
- .boolean { color: blue; }
- .null { color: magenta; }
- .key { color: red; }
- </style>
- <style type="text/css">
- pre.prettyprint {
- border: 1px solid #ccc;
- margin-bottom: 0;
- padding: 9.5px;
- }
- </style>
- <script>
-
- function syntaxHighlight(json) {
- json = json.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
- return json.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g, function (match) {
- var cls = 'number';
- if (/^"/.test(match)) {
- if (/:$/.test(match)) {
- cls = 'key';
- } else {
- cls = 'string';
- }
- } else if (/true|false/.test(match)) {
- cls = 'boolean';
- } else if (/null/.test(match)) {
- cls = 'null';
- }
- return '<span class="' + cls + '">' + match + '</span>';
- });
- }
- function spaceJson(json){
- var validJson = JSON.parse(json);
- return JSON.stringify(validJson, undefined, 4);
- }
- </script>
- </head>
- <body>
- <nav class="navbar navbar-default navbar-fixed-top">
- <div class="container-fluid">
-
- <div class="navbar-header">
- <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
- data-target="#bs-example-navbar-collapse-1">
- <span class="sr-only">Toggle navigation</span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- </button>
- <a class="navbar-brand" href="#">Gin</a>
- <p class="navbar-text">Developed by Gophers at <a href="http://betacraft.co">Betacraft</a></p>
- </div>
-
-
- </div>
-
- </nav>
- <div class="container-fluid" style="margin-top: 70px;margin-bottom: 20px;">
- <div class="container-fluid">
- <div class="col-md-4">
- <div class="panel panel-default">
- <div class="panel-heading">Base Urls</div>
- <div class="panel-body">
-
- <p>Production : <strong>/api/v1</strong></p>
-
- <p>Staging : <strong>/api/v1</strong></p>
-
- </div>
- </div>
- <ul class="nav nav-pills nav-stacked" role="tablist">
-
- <li role="presentation"><a href="#0top" role="tab" data-toggle="tab">POST : /api/v1/team</a></li>
-
- <li role="presentation"><a href="#1top" role="tab" data-toggle="tab">GET : /api/v1/team</a></li>
-
- <li role="presentation"><a href="#2top" role="tab" data-toggle="tab">PUT : /api/v1/team</a></li>
-
- <li role="presentation"><a href="#3top" role="tab" data-toggle="tab">GET : /api/v1/team/107</a></li>
-
- <li role="presentation"><a href="#4top" role="tab" data-toggle="tab">DELETE : /api/v1/team/107</a></li>
-
- <ul>
- </div>
- <div class="col-md-8 tab-content">
-
- <div id="0top" role="tabpanel" class="tab-pane col-md-10">
-
-
- <p> <H4> Request Headers </H4> </p>
- <table class="table table-bordered table-striped">
- <tr>
- <th>Key</th>
- <th>Value</th>
- </tr>
-
- <tr>
- <td>Apitoken</td>
- <td> {"name": "root", "sig": "dd81ea033c2d11e6a95d0242ac11000c"}</td>
- </tr>
-
- <tr>
- <td>Content-Type</td>
- <td> application/json
</td>
- </tr>
-
- <tr>
- <td>X-Forwarded-For</td>
- <td> </td>
- </tr>
-
- </table>
-
-
-
-
- <p> <H4> Request Body </H4> </p>
- <pre id="request-body-0-0" class="prettyprint">{"resume": "i'm descript"}</pre>
- <script>
-
- var requestHeader ={"Apitoken":"{\"name\": \"root\", \"sig\": \"dd81ea033c2d11e6a95d0242ac11000c\"}","Content-Type":" application/json\r","X-Forwarded-For":" "};
- if (requestHeader["Content-Type"] === "application/json"){
- try {
- var jsonStr = spaceJson("{\"resume\": \"i'm descript\"}");
- document.getElementById('request-body0-0').innerHTML = syntaxHighlight(jsonStr);
- } catch (e) {
-
- }
- }
- </script>
-
- <p><h4> Response Code</h4></p>
- <pre class="prettyprint lang-json">400</pre>
-
- <p><h4> Response Headers</h4></p>
- <table class="table table-bordered table-striped">
- <tr>
- <th>Key</th>
- <th>Value</th>
- </tr>
-
- <tr>
- <td>Access-Control-Allow-Headers</td>
- <td> Content-Type,Token,Apitoken</td>
- </tr>
-
- <tr>
- <td>Access-Control-Allow-Origin</td>
- <td> *</td>
- </tr>
-
- <tr>
- <td>Content-Type</td>
- <td> application/json; charset=utf-8</td>
- </tr>
-
- </table>
-
-
- <p> <H4> Response Body </H4> </p>
- <pre class="prettyprint" id="response-body-0-0">{"error":"Key: 'APICreateTeamInput.Name' Error:Field validation for 'Name' failed on the 'required' tag"}</pre>
- <script>
-
- var responseHeader ={"Access-Control-Allow-Headers":"Content-Type,Token,Apitoken","Access-Control-Allow-Origin":"*","Content-Type":"application/json; charset=utf-8"};
- if (responseHeader["Content-Type"] === "application/json"){
- try {
- var jsonStr = spaceJson("{\"error\":\"Key: 'APICreateTeamInput.Name' Error:Field validation for 'Name' failed on the 'required' tag\"}");
- document.getElementById('response-body-0-0').innerHTML = syntaxHighlight(jsonStr);
- } catch (e) {
-
- }
- }
- </script>
-
- <hr>
-
-
- <p> <H4> Request Headers </H4> </p>
- <table class="table table-bordered table-striped">
- <tr>
- <th>Key</th>
- <th>Value</th>
- </tr>
-
- <tr>
- <td>Apitoken</td>
- <td> {"name": "root", "sig": "dd81ea033c2d11e6a95d0242ac11000c"}</td>
- </tr>
-
- <tr>
- <td>Content-Type</td>
- <td> application/json
</td>
- </tr>
-
- <tr>
- <td>X-Forwarded-For</td>
- <td> </td>
- </tr>
-
- </table>
-
-
-
-
- <p> <H4> Request Body </H4> </p>
- <pre id="request-body-0-1" class="prettyprint">{"team_name": "ateamname","resume": "i'm descript", "users": [1]}</pre>
- <script>
-
- var requestHeader ={"Apitoken":"{\"name\": \"root\", \"sig\": \"dd81ea033c2d11e6a95d0242ac11000c\"}","Content-Type":" application/json\r","X-Forwarded-For":" "};
- if (requestHeader["Content-Type"] === "application/json"){
- try {
- var jsonStr = spaceJson("{\"team_name\": \"ateamname\",\"resume\": \"i'm descript\", \"users\": [1]}");
- document.getElementById('request-body0-1').innerHTML = syntaxHighlight(jsonStr);
- } catch (e) {
-
- }
- }
- </script>
-
- <p><h4> Response Code</h4></p>
- <pre class="prettyprint lang-json">200</pre>
-
- <p><h4> Response Headers</h4></p>
- <table class="table table-bordered table-striped">
- <tr>
- <th>Key</th>
- <th>Value</th>
- </tr>
-
- <tr>
- <td>Access-Control-Allow-Headers</td>
- <td> Content-Type,Token,Apitoken</td>
- </tr>
-
- <tr>
- <td>Access-Control-Allow-Origin</td>
- <td> *</td>
- </tr>
-
- <tr>
- <td>Content-Type</td>
- <td> application/json; charset=utf-8</td>
- </tr>
-
- </table>
-
-
- <p> <H4> Response Body </H4> </p>
- <pre class="prettyprint" id="response-body-0-1">{"message":"team created! Afftect row: 1, Affect refer: 1"}</pre>
- <script>
-
- var responseHeader ={"Access-Control-Allow-Headers":"Content-Type,Token,Apitoken","Access-Control-Allow-Origin":"*","Content-Type":"application/json; charset=utf-8"};
- if (responseHeader["Content-Type"] === "application/json"){
- try {
- var jsonStr = spaceJson("{\"message\":\"team created! Afftect row: 1, Affect refer: 1\"}");
- document.getElementById('response-body-0-1').innerHTML = syntaxHighlight(jsonStr);
- } catch (e) {
-
- }
- }
- </script>
-
- <hr>
-
- </div>
-
- <div id="1top" role="tabpanel" class="tab-pane col-md-10">
-
-
- <p> <H4> Request Headers </H4> </p>
- <table class="table table-bordered table-striped">
- <tr>
- <th>Key</th>
- <th>Value</th>
- </tr>
-
- <tr>
- <td>Apitoken</td>
- <td> {"name": "root", "sig": "dd81ea033c2d11e6a95d0242ac11000c"}</td>
- </tr>
-
- <tr>
- <td>X-Forwarded-For</td>
- <td> </td>
- </tr>
-
- </table>
-
-
-
- <p> <H4> URL Params </H4> </p>
- <table class="table table-bordered table-striped">
- <tr>
- <th>Key</th>
- <th>Value</th>
- </tr>
-
- <tr>
- <td>q</td>
- <td> .+</td>
- </tr>
-
- </table>
-
-
- <p><h4> Response Code</h4></p>
- <pre class="prettyprint lang-json">200</pre>
-
- <p><h4> Response Headers</h4></p>
- <table class="table table-bordered table-striped">
- <tr>
- <th>Key</th>
- <th>Value</th>
- </tr>
-
- <tr>
- <td>Access-Control-Allow-Headers</td>
- <td> Content-Type,Token,Apitoken</td>
- </tr>
-
- <tr>
- <td>Access-Control-Allow-Origin</td>
- <td> *</td>
- </tr>
-
- <tr>
- <td>Content-Type</td>
- <td> application/json; charset=utf-8</td>
- </tr>
-
- </table>
-
-
- <p> <H4> Response Body </H4> </p>
- <pre class="prettyprint" id="response-body-1-0">[{"id":1,"name":"a","resume":"","creator":1},{"id":2,"name":"b","resume":"g","creator":1},{"id":4,"name":"testteam","resume":"i'm test","creator":15},{"id":5,"name":"atestteam","resume":"i'm test","creator":16},{"id":107,"name":"ateamname","resume":"i'm descript","creator":1}]</pre>
- <script>
-
- var responseHeader ={"Access-Control-Allow-Headers":"Content-Type,Token,Apitoken","Access-Control-Allow-Origin":"*","Content-Type":"application/json; charset=utf-8"};
- if (responseHeader["Content-Type"] === "application/json"){
- try {
- var jsonStr = spaceJson("[{\"id\":1,\"name\":\"a\",\"resume\":\"\",\"creator\":1},{\"id\":2,\"name\":\"b\",\"resume\":\"g\",\"creator\":1},{\"id\":4,\"name\":\"testteam\",\"resume\":\"i'm test\",\"creator\":15},{\"id\":5,\"name\":\"atestteam\",\"resume\":\"i'm test\",\"creator\":16},{\"id\":107,\"name\":\"ateamname\",\"resume\":\"i'm descript\",\"creator\":1}]");
- document.getElementById('response-body-1-0').innerHTML = syntaxHighlight(jsonStr);
- } catch (e) {
-
- }
- }
- </script>
-
- <hr>
-
-
- <p> <H4> Request Headers </H4> </p>
- <table class="table table-bordered table-striped">
- <tr>
- <th>Key</th>
- <th>Value</th>
- </tr>
-
- <tr>
- <td>Apitoken</td>
- <td> {"name": "root", "sig": "dd81ea033c2d11e6a95d0242ac11000c"}</td>
- </tr>
-
- <tr>
- <td>X-Forwarded-For</td>
- <td> </td>
- </tr>
-
- </table>
-
-
-
- <p> <H4> URL Params </H4> </p>
- <table class="table table-bordered table-striped">
- <tr>
- <th>Key</th>
- <th>Value</th>
- </tr>
-
- <tr>
- <td>q</td>
- <td> ateamname</td>
- </tr>
-
- </table>
-
-
- <p><h4> Response Code</h4></p>
- <pre class="prettyprint lang-json">200</pre>
-
- <p><h4> Response Headers</h4></p>
- <table class="table table-bordered table-striped">
- <tr>
- <th>Key</th>
- <th>Value</th>
- </tr>
-
- <tr>
- <td>Access-Control-Allow-Headers</td>
- <td> Content-Type,Token,Apitoken</td>
- </tr>
-
- <tr>
- <td>Access-Control-Allow-Origin</td>
- <td> *</td>
- </tr>
-
- <tr>
- <td>Content-Type</td>
- <td> application/json; charset=utf-8</td>
- </tr>
-
- </table>
-
-
- <p> <H4> Response Body </H4> </p>
- <pre class="prettyprint" id="response-body-1-1">[{"id":107,"name":"ateamname","resume":"i'm descript","creator":1}]</pre>
- <script>
-
- var responseHeader ={"Access-Control-Allow-Headers":"Content-Type,Token,Apitoken","Access-Control-Allow-Origin":"*","Content-Type":"application/json; charset=utf-8"};
- if (responseHeader["Content-Type"] === "application/json"){
- try {
- var jsonStr = spaceJson("[{\"id\":107,\"name\":\"ateamname\",\"resume\":\"i'm descript\",\"creator\":1}]");
- document.getElementById('response-body-1-1').innerHTML = syntaxHighlight(jsonStr);
- } catch (e) {
-
- }
- }
- </script>
-
- <hr>
-
- </div>
-
- <div id="2top" role="tabpanel" class="tab-pane col-md-10">
-
-
- <p> <H4> Request Headers </H4> </p>
- <table class="table table-bordered table-striped">
- <tr>
- <th>Key</th>
- <th>Value</th>
- </tr>
-
- <tr>
- <td>Apitoken</td>
- <td> {"name": "root", "sig": "dd81ea033c2d11e6a95d0242ac11000c"}</td>
- </tr>
-
- <tr>
- <td>Content-Type</td>
- <td> application/json
</td>
- </tr>
-
- <tr>
- <td>X-Forwarded-For</td>
- <td> </td>
- </tr>
-
- </table>
-
-
-
-
- <p> <H4> Request Body </H4> </p>
- <pre id="request-body-2-0" class="prettyprint">{"team_id": 107, "resume": "i'm descript update", "users": [4,5,6,7]}</pre>
- <script>
-
- var requestHeader ={"Apitoken":"{\"name\": \"root\", \"sig\": \"dd81ea033c2d11e6a95d0242ac11000c\"}","Content-Type":" application/json\r","X-Forwarded-For":" "};
- if (requestHeader["Content-Type"] === "application/json"){
- try {
- var jsonStr = spaceJson("{\"team_id\": 107, \"resume\": \"i'm descript update\", \"users\": [4,5,6,7]}");
- document.getElementById('request-body2-0').innerHTML = syntaxHighlight(jsonStr);
- } catch (e) {
-
- }
- }
- </script>
-
- <p><h4> Response Code</h4></p>
- <pre class="prettyprint lang-json">200</pre>
-
- <p><h4> Response Headers</h4></p>
- <table class="table table-bordered table-striped">
- <tr>
- <th>Key</th>
- <th>Value</th>
- </tr>
-
- <tr>
- <td>Access-Control-Allow-Headers</td>
- <td> Content-Type,Token,Apitoken</td>
- </tr>
-
- <tr>
- <td>Access-Control-Allow-Origin</td>
- <td> *</td>
- </tr>
-
- <tr>
- <td>Content-Type</td>
- <td> application/json; charset=utf-8</td>
- </tr>
-
- </table>
-
-
- <p> <H4> Response Body </H4> </p>
- <pre class="prettyprint" id="response-body-2-0">{"message":"team updated!"}</pre>
- <script>
-
- var responseHeader ={"Access-Control-Allow-Headers":"Content-Type,Token,Apitoken","Access-Control-Allow-Origin":"*","Content-Type":"application/json; charset=utf-8"};
- if (responseHeader["Content-Type"] === "application/json"){
- try {
- var jsonStr = spaceJson("{\"message\":\"team updated!\"}");
- document.getElementById('response-body-2-0').innerHTML = syntaxHighlight(jsonStr);
- } catch (e) {
-
- }
- }
- </script>
-
- <hr>
-
- </div>
-
- <div id="3top" role="tabpanel" class="tab-pane col-md-10">
-
-
- <p> <H4> Request Headers </H4> </p>
- <table class="table table-bordered table-striped">
- <tr>
- <th>Key</th>
- <th>Value</th>
- </tr>
-
- <tr>
- <td>Apitoken</td>
- <td> {"name": "root", "sig": "dd81ea033c2d11e6a95d0242ac11000c"}</td>
- </tr>
-
- <tr>
- <td>X-Forwarded-For</td>
- <td> </td>
- </tr>
-
- </table>
-
-
-
-
- <p><h4> Response Code</h4></p>
- <pre class="prettyprint lang-json">200</pre>
-
- <p><h4> Response Headers</h4></p>
- <table class="table table-bordered table-striped">
- <tr>
- <th>Key</th>
- <th>Value</th>
- </tr>
-
- <tr>
- <td>Access-Control-Allow-Headers</td>
- <td> Content-Type,Token,Apitoken</td>
- </tr>
-
- <tr>
- <td>Access-Control-Allow-Origin</td>
- <td> *</td>
- </tr>
-
- <tr>
- <td>Content-Type</td>
- <td> application/json; charset=utf-8</td>
- </tr>
-
- </table>
-
-
- <p> <H4> Response Body </H4> </p>
- <pre class="prettyprint" id="response-body-3-0">{"id":107,"name":"ateamname","resume":"i'm descript","creator":1,"users":[{"id":4,"name":"test1","cnname":"翱鶚Test","email":"root123@cepave.com","phone":"99999999999","im":"44955834958","qq":"904394234239","role":0},{"id":5,"name":"don","cnname":"","email":"","phone":"","im":"","qq":"904394234239","role":0},{"id":6,"name":"masato","cnname":"","email":"","phone":"","im":"","qq":"904394234239","role":0},{"id":7,"name":"cepave1","cnname":"","email":"","phone":"","im":"","qq":"904394234239","role":0}]}</pre>
- <script>
-
- var responseHeader ={"Access-Control-Allow-Headers":"Content-Type,Token,Apitoken","Access-Control-Allow-Origin":"*","Content-Type":"application/json; charset=utf-8"};
- if (responseHeader["Content-Type"] === "application/json"){
- try {
- var jsonStr = spaceJson("{\"id\":107,\"name\":\"ateamname\",\"resume\":\"i'm descript\",\"creator\":1,\"users\":[{\"id\":4,\"name\":\"test1\",\"cnname\":\"翱鶚Test\",\"email\":\"root123@cepave.com\",\"phone\":\"99999999999\",\"im\":\"44955834958\",\"qq\":\"904394234239\",\"role\":0},{\"id\":5,\"name\":\"don\",\"cnname\":\"\",\"email\":\"\",\"phone\":\"\",\"im\":\"\",\"qq\":\"904394234239\",\"role\":0},{\"id\":6,\"name\":\"masato\",\"cnname\":\"\",\"email\":\"\",\"phone\":\"\",\"im\":\"\",\"qq\":\"904394234239\",\"role\":0},{\"id\":7,\"name\":\"cepave1\",\"cnname\":\"\",\"email\":\"\",\"phone\":\"\",\"im\":\"\",\"qq\":\"904394234239\",\"role\":0}]}");
- document.getElementById('response-body-3-0').innerHTML = syntaxHighlight(jsonStr);
- } catch (e) {
-
- }
- }
- </script>
-
- <hr>
-
- </div>
-
- <div id="4top" role="tabpanel" class="tab-pane col-md-10">
-
-
- <p> <H4> Request Headers </H4> </p>
- <table class="table table-bordered table-striped">
- <tr>
- <th>Key</th>
- <th>Value</th>
- </tr>
-
- <tr>
- <td>Apitoken</td>
- <td> {"name": "root", "sig": "dd81ea033c2d11e6a95d0242ac11000c"}</td>
- </tr>
-
- <tr>
- <td>X-Forwarded-For</td>
- <td> </td>
- </tr>
-
- </table>
-
-
-
-
- <p><h4> Response Code</h4></p>
- <pre class="prettyprint lang-json">200</pre>
-
- <p><h4> Response Headers</h4></p>
- <table class="table table-bordered table-striped">
- <tr>
- <th>Key</th>
- <th>Value</th>
- </tr>
-
- <tr>
- <td>Access-Control-Allow-Headers</td>
- <td> Content-Type,Token,Apitoken</td>
- </tr>
-
- <tr>
- <td>Access-Control-Allow-Origin</td>
- <td> *</td>
- </tr>
-
- <tr>
- <td>Content-Type</td>
- <td> application/json; charset=utf-8</td>
- </tr>
-
- </table>
-
-
- <p> <H4> Response Body </H4> </p>
- <pre class="prettyprint" id="response-body-4-0">{"message":"team 107 is deleted. Affect row: 1 / refer delete: 4"}</pre>
- <script>
-
- var responseHeader ={"Access-Control-Allow-Headers":"Content-Type,Token,Apitoken","Access-Control-Allow-Origin":"*","Content-Type":"application/json; charset=utf-8"};
- if (responseHeader["Content-Type"] === "application/json"){
- try {
- var jsonStr = spaceJson("{\"message\":\"team 107 is deleted. Affect row: 1 / refer delete: 4\"}");
- document.getElementById('response-body-4-0').innerHTML = syntaxHighlight(jsonStr);
- } catch (e) {
-
- }
- }
- </script>
-
- <hr>
-
- </div>
-
- </div>
- </div>
- </div>
- <hr>
- </body>
- </html>
|