-
-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update api body params to schema (#461)
- Loading branch information
Showing
12 changed files
with
76 additions
and
43 deletions.
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 |
---|---|---|
|
@@ -22,21 +22,21 @@ class AuthLoginParam(AuthSchemaBase): | |
|
||
class RegisterUserParam(AuthSchemaBase): | ||
nickname: str | None = None | ||
email: EmailStr = Field(..., examples=['[email protected]']) | ||
email: EmailStr = Field(examples=['[email protected]']) | ||
|
||
|
||
class AddUserParam(AuthSchemaBase): | ||
dept_id: int | ||
roles: list[int] | ||
nickname: str | None = None | ||
email: EmailStr = Field(..., examples=['[email protected]']) | ||
email: EmailStr = Field(examples=['[email protected]']) | ||
|
||
|
||
class UserInfoSchemaBase(SchemaBase): | ||
dept_id: int | None = None | ||
username: str | ||
nickname: str | ||
email: EmailStr = Field(..., examples=['[email protected]']) | ||
email: EmailStr = Field(examples=['[email protected]']) | ||
phone: CustomPhoneNumber | None = None | ||
|
||
|
||
|
@@ -49,7 +49,7 @@ class UpdateUserRoleParam(SchemaBase): | |
|
||
|
||
class AvatarParam(SchemaBase): | ||
url: HttpUrl = Field(..., description='头像 http 地址') | ||
url: HttpUrl = Field(description='头像 http 地址') | ||
|
||
|
||
class GetUserInfoNoRelationDetail(UserInfoSchemaBase): | ||
|
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,11 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
from pydantic import Field | ||
|
||
from backend.common.schema import SchemaBase | ||
|
||
|
||
class ImportParam(SchemaBase): | ||
app: str = Field(description='应用名称,用于代码生成到指定 app') | ||
table_name: str = Field(description='数据库表名') | ||
table_schema: str = Field(description='数据库名') |
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,2 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- |
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,11 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
from pydantic import Field | ||
|
||
from backend.common.schema import SchemaBase | ||
|
||
|
||
class RunParam(SchemaBase): | ||
name: str = Field(description='任务名称') | ||
args: list | None = Field(default=None, description='任务函数位置参数') | ||
kwargs: dict | None = Field(default=None, description='任务函数关键字参数') |
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