用户
用户 CRUD 与 Token / 密码管理。
用户 CRUD 与 Token / 密码管理。
默认 Base URL:http://127.0.0.1:8090。管理面接口需 Authorization(登录返回的 token)。
鉴权 · 用户
用户 CRUD 与 Token/密码管理。
/auth/v1/users需要鉴权查询用户
查询用户。
参数
- Authorizationheader · string必填
登录返回的 token。
- idquery · string可选
id
- namequery · string可选
name
- offsetquery · integer可选
offset
- limitquery · integer可选
limit
curl -sS -X GET 'http://127.0.0.1:8090/auth/v1/users' \
-H "Authorization: $TOKEN"{
"code": 200000,
"info": "execute success"
}/auth/v1/users需要鉴权创建用户
创建用户。
参数
- Authorizationheader · string必填
登录返回的 token。
- (body)body · User[]必填
请求体为 User 的 JSON 数组;下列为单条字段。
- idbody · string可选
id
- namebody · string可选
name
- passwordbody · string可选
password
- ownerbody · string可选
owner
- sourcebody · string可选
source
- auth_tokenbody · string可选
auth_token
- token_enablebody · bool可选
token_enable
- commentbody · string可选
comment
- user_typebody · string可选
user_type
- mobilebody · string可选
mobile
- emailbody · string可选
email
- metadatabody · map<string,string>可选
metadata
响应字段
- codebody · uint32必填
业务码。
- infobody · string可选
提示信息。
- Userbody · User可选
实体字段。
- idbody · string可选
id
- namebody · string可选
name
- passwordbody · string可选
password
- ownerbody · string可选
owner
- sourcebody · string可选
source
- auth_tokenbody · string可选
auth_token
- token_enablebody · bool可选
token_enable
- commentbody · string可选
comment
- ctimebody · string可选
ctime
- mtimebody · string可选
mtime
- user_typebody · string可选
user_type
- mobilebody · string可选
mobile
- emailbody · string可选
email
- metadatabody · map<string,string>可选
metadata
curl -sS -X POST 'http://127.0.0.1:8090/auth/v1/users' \
-H "Authorization: $TOKEN" \
-H 'Content-Type: application/json' \
-d '[]'{
"code": 200000,
"info": "execute success"
}/auth/v1/users需要鉴权更新用户
更新用户。
参数
- Authorizationheader · string必填
登录返回的 token。
- (body)body · User[]必填
请求体为 User 的 JSON 数组;下列为单条字段。
- idbody · string可选
id
- namebody · string可选
name
- passwordbody · string可选
password
- ownerbody · string可选
owner
- sourcebody · string可选
source
- auth_tokenbody · string可选
auth_token
- token_enablebody · bool可选
token_enable
- commentbody · string可选
comment
- user_typebody · string可选
user_type
- mobilebody · string可选
mobile
- emailbody · string可选
email
- metadatabody · map<string,string>可选
metadata
响应字段
- codebody · uint32必填
业务码。
- infobody · string可选
提示信息。
- Userbody · User可选
实体字段。
- idbody · string可选
id
- namebody · string可选
name
- passwordbody · string可选
password
- ownerbody · string可选
owner
- sourcebody · string可选
source
- auth_tokenbody · string可选
auth_token
- token_enablebody · bool可选
token_enable
- commentbody · string可选
comment
- ctimebody · string可选
ctime
- mtimebody · string可选
mtime
- user_typebody · string可选
user_type
- mobilebody · string可选
mobile
- emailbody · string可选
email
- metadatabody · map<string,string>可选
metadata
curl -sS -X PUT 'http://127.0.0.1:8090/auth/v1/users' \
-H "Authorization: $TOKEN" \
-H 'Content-Type: application/json' \
-d '[]'{
"code": 200000,
"info": "execute success"
}/auth/v1/users/delete需要鉴权删除用户
删除用户。
参数
- Authorizationheader · string必填
登录返回的 token。
- (body)body · User[]必填
请求体为 User 的 JSON 数组;下列为单条字段。
- idbody · string可选
id
- namebody · string可选
name
- passwordbody · string可选
password
- ownerbody · string可选
owner
- sourcebody · string可选
source
- auth_tokenbody · string可选
auth_token
- token_enablebody · bool可选
token_enable
- commentbody · string可选
comment
- user_typebody · string可选
user_type
- mobilebody · string可选
mobile
- emailbody · string可选
email
- metadatabody · map<string,string>可选
metadata
响应字段
- codebody · uint32必填
业务码。
- infobody · string可选
提示信息。
- Userbody · User可选
实体字段。
- idbody · string可选
id
- namebody · string可选
name
- passwordbody · string可选
password
- ownerbody · string可选
owner
- sourcebody · string可选
source
- auth_tokenbody · string可选
auth_token
- token_enablebody · bool可选
token_enable
- commentbody · string可选
comment
- ctimebody · string可选
ctime
- mtimebody · string可选
mtime
- user_typebody · string可选
user_type
- mobilebody · string可选
mobile
- emailbody · string可选
email
- metadatabody · map<string,string>可选
metadata
curl -sS -X POST 'http://127.0.0.1:8090/auth/v1/users/delete' \
-H "Authorization: $TOKEN" \
-H 'Content-Type: application/json' \
-d '[]'{
"code": 200000,
"info": "execute success"
}/auth/v1/user/password需要鉴权修改密码
修改密码。
参数
- Authorizationheader · string必填
登录返回的 token。
- idbody · string可选
id
- old_passwordbody · string可选
old_password
- new_passwordbody · string可选
new_password
响应字段
- codebody · uint32必填
业务码。
- infobody · string可选
提示信息。
- ModifyUserPasswordbody · ModifyUserPassword可选
实体字段。
- idbody · string可选
id
- old_passwordbody · string可选
old_password
- new_passwordbody · string可选
new_password
curl -sS -X PUT 'http://127.0.0.1:8090/auth/v1/user/password' \
-H "Authorization: $TOKEN" \
-H 'Content-Type: application/json' \
-d '[]'{
"code": 200000,
"info": "execute success"
}/auth/v1/user/token需要鉴权获取用户 Token
获取用户 Token。
参数
- Authorizationheader · string必填
登录返回的 token。
- idquery · string必填
id
curl -sS -X GET 'http://127.0.0.1:8090/auth/v1/user/token' \
-H "Authorization: $TOKEN"{
"code": 200000,
"info": "execute success"
}/auth/v1/user/token/enable需要鉴权启用/禁用用户 Token
启用/禁用用户 Token。
参数
- Authorizationheader · string必填
登录返回的 token。
- idbody · string可选
id
- namebody · string可选
name
- passwordbody · string可选
password
- ownerbody · string可选
owner
- sourcebody · string可选
source
- auth_tokenbody · string可选
auth_token
- token_enablebody · bool可选
token_enable
- commentbody · string可选
comment
- user_typebody · string可选
user_type
- mobilebody · string可选
mobile
- emailbody · string可选
email
- metadatabody · map<string,string>可选
metadata
响应字段
- codebody · uint32必填
业务码。
- infobody · string可选
提示信息。
- Userbody · User可选
实体字段。
- idbody · string可选
id
- namebody · string可选
name
- passwordbody · string可选
password
- ownerbody · string可选
owner
- sourcebody · string可选
source
- auth_tokenbody · string可选
auth_token
- token_enablebody · bool可选
token_enable
- commentbody · string可选
comment
- ctimebody · string可选
ctime
- mtimebody · string可选
mtime
- user_typebody · string可选
user_type
- mobilebody · string可选
mobile
- emailbody · string可选
email
- metadatabody · map<string,string>可选
metadata
curl -sS -X PUT 'http://127.0.0.1:8090/auth/v1/user/token/enable' \
-H "Authorization: $TOKEN" \
-H 'Content-Type: application/json' \
-d '[]'{
"code": 200000,
"info": "execute success"
}/auth/v1/user/token/refresh需要鉴权刷新用户 Token
刷新用户 Token。
参数
- Authorizationheader · string必填
登录返回的 token。
- idbody · string可选
id
- namebody · string可选
name
- passwordbody · string可选
password
- ownerbody · string可选
owner
- sourcebody · string可选
source
- auth_tokenbody · string可选
auth_token
- token_enablebody · bool可选
token_enable
- commentbody · string可选
comment
- user_typebody · string可选
user_type
- mobilebody · string可选
mobile
- emailbody · string可选
email
- metadatabody · map<string,string>可选
metadata
响应字段
- codebody · uint32必填
业务码。
- infobody · string可选
提示信息。
- Userbody · User可选
实体字段。
- idbody · string可选
id
- namebody · string可选
name
- passwordbody · string可选
password
- ownerbody · string可选
owner
- sourcebody · string可选
source
- auth_tokenbody · string可选
auth_token
- token_enablebody · bool可选
token_enable
- commentbody · string可选
comment
- ctimebody · string可选
ctime
- mtimebody · string可选
mtime
- user_typebody · string可选
user_type
- mobilebody · string可选
mobile
- emailbody · string可选
email
- metadatabody · map<string,string>可选
metadata
curl -sS -X PUT 'http://127.0.0.1:8090/auth/v1/user/token/refresh' \
-H "Authorization: $TOKEN" \
-H 'Content-Type: application/json' \
-d '[]'{
"code": 200000,
"info": "execute success"
}