-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update #11
- Loading branch information
Showing
5 changed files
with
67 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Copyright 2016 by caixw, All rights reserved. | ||
// Use of this source code is governed by a MIT | ||
// license that can be found in the LICENSE file. | ||
|
||
|
||
// @apidoc title of api | ||
// @apiVersion 2.9 | ||
// @apiBaseURL https://api.caixw.io | ||
// @apiLicense MIT https://opensources.org/licenses/MIT | ||
// @apiContent | ||
// line1 | ||
// line2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Copyright 2016 by caixw, All rights reserved. | ||
// Use of this source code is governed by a MIT | ||
// license that can be found in the LICENSE file. | ||
|
||
import std.stdio; | ||
|
||
// @api POST /users/login 登录 | ||
// @apiGroup users | ||
// | ||
// @apiRequest json | ||
// @apiParam username string 登录账号 | ||
// @apiParam password string 密码 | ||
// | ||
// @apiSuccess 201 OK | ||
// @apiParam expires int 过期时间 | ||
// @apiParam token string 凭证 | ||
// @apiExample json | ||
// { | ||
// "expires": 11111111, | ||
// "token": "adl;kfqwer;q;afd" | ||
// } | ||
// | ||
// @apiError 401 账号或密码错误 | ||
void login(http::ResponseWriter w, http::Request& r) { | ||
writeln("/*********", "login"); | ||
// TODO | ||
} | ||
|
||
/* | ||
* @api DELETE /users/login 注销登录 | ||
* @apiGroup users | ||
* | ||
* @apiRequest json | ||
* @apiHeader Authorization xxxx | ||
* | ||
* @apiSuccess 201 OK | ||
* @apiParam expires int 过期时间 | ||
* @apiParam token string 凭证 | ||
* @apiExample json | ||
* { | ||
* "expires": 11111111, | ||
* "token": "adl;kfqwer;q;afd" | ||
* } | ||
*/ | ||
void logout(http::ResponseWriter w, http::Request& r) { | ||
writeln("logout", "*******/"); | ||
// TODO | ||
} |