2024-04-08 18:51:46 +08:00
|
|
|
from flask_restful import fields
|
|
|
|
|
|
|
|
from libs.helper import TimestampField
|
|
|
|
|
2024-08-15 12:54:05 +08:00
|
|
|
simple_account_fields = {"id": fields.String, "name": fields.String, "email": fields.String}
|
2024-04-08 18:51:46 +08:00
|
|
|
|
|
|
|
account_fields = {
|
2024-08-15 12:54:05 +08:00
|
|
|
"id": fields.String,
|
|
|
|
"name": fields.String,
|
|
|
|
"avatar": fields.String,
|
|
|
|
"email": fields.String,
|
|
|
|
"is_password_set": fields.Boolean,
|
|
|
|
"interface_language": fields.String,
|
|
|
|
"interface_theme": fields.String,
|
|
|
|
"timezone": fields.String,
|
|
|
|
"last_login_at": TimestampField,
|
|
|
|
"last_login_ip": fields.String,
|
|
|
|
"created_at": TimestampField,
|
2024-04-08 18:51:46 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
account_with_role_fields = {
|
2024-08-15 12:54:05 +08:00
|
|
|
"id": fields.String,
|
|
|
|
"name": fields.String,
|
|
|
|
"avatar": fields.String,
|
|
|
|
"email": fields.String,
|
|
|
|
"last_login_at": TimestampField,
|
|
|
|
"last_active_at": TimestampField,
|
|
|
|
"created_at": TimestampField,
|
|
|
|
"role": fields.String,
|
|
|
|
"status": fields.String,
|
2024-04-08 18:51:46 +08:00
|
|
|
}
|
|
|
|
|
2024-08-15 12:54:05 +08:00
|
|
|
account_with_role_list_fields = {"accounts": fields.List(fields.Nested(account_with_role_fields))}
|