From 2328d44fa7cf98b0aa6b3812cf8ac989db4a1e73 Mon Sep 17 00:00:00 2001 From: zqj <582132116@qq.com> Date: Thu, 29 Jun 2023 18:03:48 +0800 Subject: [PATCH] add: 添加激活码 --- doc/account.md | 39 +++++++++++++++++++++++++++++++++++++++ models.proto | 1 + 2 files changed, 40 insertions(+), 0 deletions(-) diff --git a/doc/account.md b/doc/account.md index 293a908..14c2dac 100644 --- a/doc/account.md +++ b/doc/account.md @@ -42,7 +42,46 @@ $ curl --request POST 'http://192.168.0.206:8080/v1/register' \ --header 'Content-Type: application/json' \ --data '{ "phone":"17683852936", + "password":"123456", + "code": "", +}' +``` +返回结果: +```shell +{"code":0 ,"message":"success"}} +``` +* code = 0, 则成功 +* code != 0, 则注册失败,message是返回的提示信息 + +### 通过激活码注册接口[/register] +1. 说明:研发提供的接口必须遵循以下协议 +2. 请求方式:POST(JSON) + * 请求参数需要拼接为json,请求体是data-raw, 详情参考【请求参数】 +3. 请求参数:(以参数有就传) + +| 参数 | 类型 | 是否必须 | 备注 | +|----------|--------|------|-----------| +| phone | string | Y | 手机号 | +| password | string | Y | 密码 | +| code | string | Y | 短信验证码(暂无) | + +最后参数组合示例为: +```json +{ + "phone":"17683852936", "password":"123456" +} +``` + +请求示例: +```shell +$ curl --request POST 'http://192.168.0.206:8080/v1/registerbykey' \ +--header 'Content-Type: application/json' \ +--data '{ + "phone":"17683852936", + "password":"123456", + "code": "", + "key":"", }' ``` 返回结果: diff --git a/models.proto b/models.proto index 5b33197..a5646bf 100644 --- a/models.proto +++ b/models.proto @@ -8,6 +8,7 @@ message Account { string phone = 1; // @inject_tag: index:"unique" pri:"1" string password = 2; string uid = 3; + string key = 4; } message Config { -- libgit2 0.21.2