Compare View
Commits (2)
Showing
3 changed files
Show diff stats
account.proto
@@ -32,4 +32,15 @@ message VersionInfo { | @@ -32,4 +32,15 @@ message VersionInfo { | ||
32 | int32 head = 1; | 32 | int32 head = 1; |
33 | int32 big = 2; | 33 | int32 big = 2; |
34 | int32 small = 3; | 34 | int32 small = 3; |
35 | +} | ||
36 | + | ||
37 | +message RegisterByKey { | ||
38 | + string phone = 1; // @inject_tag: binding:"required" | ||
39 | + string password = 2; // @inject_tag: binding:"required" | ||
40 | + string code = 3; // @inject_tag: binding:"required" | ||
41 | + string key = 4; // @inject_tag: binding:"required" | ||
42 | +} | ||
43 | + | ||
44 | +message AccountKeyList { | ||
45 | + map<string,string> keys = 1; | ||
35 | } | 46 | } |
36 | \ No newline at end of file | 47 | \ No newline at end of file |
doc/account.md
@@ -42,7 +42,46 @@ $ curl --request POST 'http://192.168.0.206:8080/v1/register' \ | @@ -42,7 +42,46 @@ $ curl --request POST 'http://192.168.0.206:8080/v1/register' \ | ||
42 | --header 'Content-Type: application/json' \ | 42 | --header 'Content-Type: application/json' \ |
43 | --data '{ | 43 | --data '{ |
44 | "phone":"17683852936", | 44 | "phone":"17683852936", |
45 | + "password":"123456", | ||
46 | + "code": "", | ||
47 | +}' | ||
48 | +``` | ||
49 | +返回结果: | ||
50 | +```shell | ||
51 | +{"code":0 ,"message":"success"}} | ||
52 | +``` | ||
53 | +* code = 0, 则成功 | ||
54 | +* code != 0, 则注册失败,message是返回的提示信息 | ||
55 | + | ||
56 | +### 通过激活码注册接口[/register] | ||
57 | +1. 说明:研发提供的接口必须遵循以下协议 | ||
58 | +2. 请求方式:POST(JSON) | ||
59 | + * 请求参数需要拼接为json,请求体是data-raw, 详情参考【请求参数】 | ||
60 | +3. 请求参数:(以参数有就传) | ||
61 | + | ||
62 | +| 参数 | 类型 | 是否必须 | 备注 | | ||
63 | +|----------|--------|------|-----------| | ||
64 | +| phone | string | Y | 手机号 | | ||
65 | +| password | string | Y | 密码 | | ||
66 | +| code | string | Y | 短信验证码(暂无) | | ||
67 | + | ||
68 | +最后参数组合示例为: | ||
69 | +```json | ||
70 | +{ | ||
71 | + "phone":"17683852936", | ||
45 | "password":"123456" | 72 | "password":"123456" |
73 | +} | ||
74 | +``` | ||
75 | + | ||
76 | +请求示例: | ||
77 | +```shell | ||
78 | +$ curl --request POST 'http://192.168.0.206:8080/v1/registerbykey' \ | ||
79 | +--header 'Content-Type: application/json' \ | ||
80 | +--data '{ | ||
81 | + "phone":"17683852936", | ||
82 | + "password":"123456", | ||
83 | + "code": "", | ||
84 | + "key":"", | ||
46 | }' | 85 | }' |
47 | ``` | 86 | ``` |
48 | 返回结果: | 87 | 返回结果: |
models.proto
@@ -8,6 +8,7 @@ message Account { | @@ -8,6 +8,7 @@ message Account { | ||
8 | string phone = 1; // @inject_tag: index:"unique" pri:"1" | 8 | string phone = 1; // @inject_tag: index:"unique" pri:"1" |
9 | string password = 2; | 9 | string password = 2; |
10 | string uid = 3; | 10 | string uid = 3; |
11 | + string key = 4; | ||
11 | } | 12 | } |
12 | 13 | ||
13 | message Config { | 14 | message Config { |