You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
107 lines
1.9 KiB
Markdown
107 lines
1.9 KiB
Markdown
# iTi-System
|
|
|
|
`iti-system` 是可复用的系统业务包。
|
|
它注册到 `iti-flask` FastAPI 应用后,提供后台系统常用能力。
|
|
|
|
AI 修改本项目时优先读:
|
|
|
|
```text
|
|
.codex/skills/iti-system-project/SKILL.md
|
|
```
|
|
|
|
## 能力范围
|
|
|
|
- 认证。
|
|
- 用户。
|
|
- 角色。
|
|
- 菜单。
|
|
- 部门。
|
|
- 字典。
|
|
- 配置。
|
|
- 文件。
|
|
- 日志。
|
|
- 用户扩展属性。
|
|
|
|
## 安装
|
|
|
|
```toml
|
|
dependencies = [
|
|
<<<<<<< HEAD
|
|
"iti-flask @ git+ssh://git@example.com/iTi-Flask.git@v0.2.0",
|
|
"iti-system @ git+ssh://git@example.com/iTi-System.git@v0.2.1",
|
|
=======
|
|
"iti-flask @ git+https://git.noahlan.cn/iti-framework/iTi-Flask.git@v0.2.2",
|
|
"iti-system @ git+https://git.noahlan.cn/iti-framework/iTi-System.git@v0.2.2",
|
|
>>>>>>> 9c8246e (docs: docs更新)
|
|
]
|
|
```
|
|
|
|
## 注册
|
|
|
|
```python
|
|
from iti import create_app
|
|
from iti_system import create_system_module
|
|
|
|
from config import config
|
|
|
|
app = create_app(
|
|
config_mapping=config,
|
|
modules=[create_system_module()],
|
|
)
|
|
```
|
|
|
|
注册后会挂载系统路由,并把权限 provider 切换为数据库实现。
|
|
|
|
## 路由入口
|
|
|
|
- `/auth`
|
|
- `/sys/user`
|
|
- `/sys/role`
|
|
- `/sys/menu`
|
|
- `/sys/dept`
|
|
- `/sys/dict`
|
|
- `/sys/config`
|
|
- `/sys/file`
|
|
- `/sys/log`
|
|
- `/sys/user-attributes`
|
|
- `/upload`
|
|
- `/file`
|
|
|
|
## Migration
|
|
|
|
业务项目只保留自己的 Alembic migration 流。
|
|
系统 migration 同步到业务项目的 `migrations/versions`。
|
|
|
|
```bash
|
|
uv run iti-system migrations sync --target migrations/versions
|
|
uv run alembic upgrade head
|
|
```
|
|
|
|
## Seed
|
|
|
|
```bash
|
|
uv run iti-system seed system app:app
|
|
```
|
|
|
|
seed 可重复执行。
|
|
已有管理员不会被重置。
|
|
|
|
seed 会写入默认角色、默认管理员、系统菜单、系统配置、系统字典,以及已注册模块声明的菜单元数据。
|
|
|
|
## 本地开发
|
|
|
|
```bash
|
|
uv sync --extra dev
|
|
uv run pytest -q
|
|
```
|
|
|
|
## 发布
|
|
|
|
`iTi-System` 独立发布。
|
|
它不跟随 `iTi-Flask` 自动发版。
|
|
|
|
```bash
|
|
./scripts/iti-system.sh release
|
|
./scripts/iti-system.sh release v0.2.2
|
|
```
|