logan
|
ca308e277d
|
feat: v0.3.1 — Go/Gin 后端重写 + gh-ost 集成
架构变更:
- Python/FastAPI → Go/Gin 重写(Python 后端保留在 backend-python/)
- GORM + SQLite(兼容现有数据库表结构)
- JWT 认证 + RBAC 权限中间件
Go 后端结构:
- cmd/server/main.go — 入口,端口 9000
- config/config.go — 环境变量配置
- internal/model/ — GORM 模型(30张表,完全兼容 SQLite)
- internal/handler/ — auth/instance/ticket/dashboard/ghost handler
- internal/middleware/ — JWT 认证 + CORS
- internal/ghost/ — gh-ost 集成模块(同步/异步执行,任务管理)
- router/router.go — API 路由注册(/api/v1/...)
gh-ost 集成:
- RunGhOst() 同步执行
- RunGhOstAsync() 异步执行 + 进度追踪
- TaskManager 管理多个并发任务
- API: POST /ghost/dry-run, /ghost/execute, GET /ghost/status/:taskId
核心 API 已对齐:
- POST /auth/login (JWT)
- GET /dashboard/stats, /dashboard/my-tickets
- GET /tickets/statistics, CRUD + approve/execute
- GET/POST/PUT/DELETE /instances
- GET /users, /audit-rules, /announcements, /settings
已验证:
- 登录 admin/admin123 ✅
- Dashboard 99工单/110查询/4实例 ✅
- 工单统计按角色过滤 ✅
|
2026-05-25 21:40:54 +08:00 |
|
logan
|
2cfd45c9d1
|
feat: run.sh restart/stop/status + real DB connector + GitLab CI
1. run.sh: start/stop/restart/status/logs/build/test
- PID file management in .pids/
- Colored output, health check wait, log files
- Auto alembic migrate on start
2. DB Connector (replaces mock aiomysql):
- MySQL: aiomysql (connect/query/dml/test)
- PostgreSQL: asyncpg (connect/query/dml/test)
- SQLite: sqlite3 via executor (connect/query/dml/test)
- Unified interface: DBConnector.test_connection/execute_query/execute_dml
- Connection test returns version + latency
3. GitLab CI/CD pipeline:
- test: backend pytest + frontend build
- build: Docker images (manual trigger)
- deploy: SSH deploy (manual trigger)
- Cache: pip + node_modules
Tests: 128 passing, frontend build: OK
|
2026-05-22 15:16:59 +08:00 |
|
 loganandClaude Opus 4.7
|
439155c92e
|
Initial commit: SQL audit platform v0.1.0
FastAPI backend with auth, user, instance, ticket, query, dashboard APIs.
React + TypeScript frontend with mock data UI (10 pages).
SQLite + async SQLAlchemy, JWT auth, role-based access control.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
2026-05-22 11:11:57 +08:00 |
|