modify: auth 配置
This commit is contained in:
@@ -0,0 +1,11 @@
|
|||||||
|
[POST]
|
||||||
|
cacheable = false
|
||||||
|
auth_required = true
|
||||||
|
summary = "修改密码"
|
||||||
|
docstring = "验证旧密码后更新为新密码"
|
||||||
|
params = ["user_id: str", "old_password: str", "new_password: str"]
|
||||||
|
|
||||||
|
[POST.response_model]
|
||||||
|
result = {type = "str", required = true}
|
||||||
|
message = {type = "str", required = true}
|
||||||
|
timestamp = {type = "float", required = false}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
[GET]
|
||||||
|
cacheable = false
|
||||||
|
auth_required = true
|
||||||
|
summary = "获取当前用户信息"
|
||||||
|
docstring = "根据用户ID获取用户详细信息"
|
||||||
|
params = ["user_id: str"]
|
||||||
|
|
||||||
|
[GET.response_model]
|
||||||
|
result = {type = "str", required = true}
|
||||||
|
id = {type = "str", required = true}
|
||||||
|
username = {type = "str", required = true}
|
||||||
|
email = {type = "str", required = true}
|
||||||
|
full_name = {type = "str", required = false}
|
||||||
|
avatar_url = {type = "str", required = false}
|
||||||
|
phone = {type = "str", required = false}
|
||||||
|
is_active = {type = "bool", required = true}
|
||||||
|
is_verified = {type = "bool", required = true}
|
||||||
|
is_superuser = {type = "bool", required = true}
|
||||||
|
created_at = {type = "str", required = false}
|
||||||
|
updated_at = {type = "str", required = false}
|
||||||
|
last_login_at = {type = "str", required = false}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
[POST]
|
||||||
|
cacheable = false
|
||||||
|
auth_required = false
|
||||||
|
summary = "用户注册"
|
||||||
|
docstring = "创建新用户账号,用户名和邮箱必须唯一"
|
||||||
|
params = ["username: str", "password: str", "email: str", "full_name: str", "phone: str"]
|
||||||
|
|
||||||
|
[POST.response_model]
|
||||||
|
result = {type = "str", required = true}
|
||||||
|
message = {type = "str", required = true}
|
||||||
|
user_id = {type = "str", required = false}
|
||||||
|
timestamp = {type = "float", required = false}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
[POST]
|
||||||
|
cacheable = false
|
||||||
|
auth_required = true
|
||||||
|
summary = "更新用户资料"
|
||||||
|
docstring = "更新当前用户的基本资料信息(全名、邮箱、头像、手机号)"
|
||||||
|
params = ["user_id: str", "full_name: str", "email: str", "avatar_url: str", "phone: str"]
|
||||||
|
|
||||||
|
[POST.response_model]
|
||||||
|
result = {type = "str", required = true}
|
||||||
|
message = {type = "str", required = true}
|
||||||
|
timestamp = {type = "float", required = false}
|
||||||
@@ -18,6 +18,7 @@ cacheable = true
|
|||||||
summary = "Add two numbers (POST)"
|
summary = "Add two numbers (POST)"
|
||||||
docstring = "Add two numbers via POST JSON body"
|
docstring = "Add two numbers via POST JSON body"
|
||||||
params = ["a: float", "b: float"]
|
params = ["a: float", "b: float"]
|
||||||
|
auth_required = true
|
||||||
|
|
||||||
[POST.response_model]
|
[POST.response_model]
|
||||||
result = { type = "float", required = true }
|
result = { type = "float", required = true }
|
||||||
|
|||||||
Reference in New Issue
Block a user