BaseRepository,同时支持 dataclass 和 Pydantic BaseModel 的实体,可以在领域层使用 Pydantic 校验,同时 ORM ↔ Entity 的转换仍然自动化。
# src/apps/panel/infrastructure/base_repository.py
from typing import Type, List, Dict, Any, Optional
from tortoise.models import Model| from starlette.applications import Starlette | |
| from starlette.routing import Route | |
| from starlette.responses import PlainTextResponse | |
| import httpx | |
| import aiohttp | |
| HOST, PORT = "localhost", 8000 | |
| URL = f"http://{HOST}:{PORT}/" | 
To remove a submodule you need to:
How To Install git on Mac?
How To Install Homebrew on Mac in China mainland?
How To Config Vim?
| # to generate your dhparam.pem file, run in the terminal | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 | 
| alias gpl="git pull origin" | |
| alias gps="git push origin" | |
| alias gst="git status" | |
| alias gd="git diff" | |
| alias gsm="git commit -m" | |
| alias grs="git reset --soft" | |
| alias grh="git reset --hard" | |
| alias gdca='git diff --cached' | |
| alias del_pyc="find . -type f -name '*.pyc' -delete" | |
| alias py_info="python --version" |