Replaced custom password generation and verification logic with a new pkg/password.py module using Argon2 for secure hashing. Updated model field types to use PEP 604 union syntax (e.g., str | None) and improved type annotations. Refactored admin and session routes to use new password utilities and direct model methods for CRUD operations. Removed legacy tool-based password functions and cleaned up .idea project files.
20 lines
463 B
Python
20 lines
463 B
Python
from pydantic import BaseModel
|
|
from typing import Literal
|
|
|
|
class DefaultResponse(BaseModel):
|
|
code: int = 0
|
|
data: dict | list | bool | None = None
|
|
msg: str = ""
|
|
|
|
class ObjectData(BaseModel):
|
|
id: int
|
|
type: Literal['normal', 'car']
|
|
key: str
|
|
name: str
|
|
icon: str
|
|
status: Literal['ok', 'lost']
|
|
phone: str
|
|
context: str | None = None
|
|
lost_description: str | None = None
|
|
create_time: str
|
|
lost_time: str | None = None |