Files
xingrin/go-backend
yyhuni a5c48fe4d4 feat(frontend,backend): implement IP address management and export functionality
- Add IP address DTO, handler, service, and repository layers in Go backend
- Implement IP address bulk delete endpoint at /ip-addresses/bulk-delete/
- Add IP address export endpoint with optional IP filtering by target
- Simplify IP address hosts column display using ExpandableCell component
- Update IP address export to support filtering selected IPs for download
- Add error handling and toast notifications for export operations
- Internationalize IP address column labels and tooltips in Chinese
- Update IP address service to support filtered exports with comma-separated IPs
- Add host-port mapping seeding for test data generation
- Refactor scope filter and repository queries to support IP address operations
2026-01-13 16:42:57 +08:00
..

Go Backend

Python Django 后端的 Go 重写版本。

技术栈

组件 选择
Web 框架 Gin
ORM GORM
配置 Viper
日志 Zap
认证 JWT (bcrypt)

迁移进度

已完成

模块 说明
项目基础 目录结构、配置管理、数据库连接、日志
数据模型 全部 33 个模型,含索引和约束
JWT 认证 登录、刷新、中间件
用户 API 创建、列表、修改密码
组织 API 完整 CRUD软删除
目标 API 完整 CRUD软删除、类型自动检测
引擎 API 完整 CRUD

🚧 待实现

模块 优先级 说明
Scan API 扫描管理(发起、状态、结果)
Asset API 资产查询(子域名、端口、漏洞等)
Worker 扫描任务执行(核心逻辑)
定时任务 定时扫描
通知 扫描完成通知
统计 资产统计

技术债务

项目 说明 优先级
Context 传递 Repository/Service 加 context 参数
单元测试 Handler/Service 层测试
接口抽象 Repository 接口化(便于 mock
泛型重构 通用 Repository等模块多了再做

运行

# 开发
make run

# 测试
make test

# 构建
make build

API 端点

POST   /api/auth/login          # 登录
POST   /api/auth/refresh        # 刷新 token
GET    /api/auth/me             # 当前用户

POST   /api/users               # 创建用户
GET    /api/users               # 用户列表
PUT    /api/users/password      # 修改密码

GET    /api/organizations       # 组织列表
POST   /api/organizations       # 创建组织
GET    /api/organizations/:id   # 获取组织
PUT    /api/organizations/:id   # 更新组织
DELETE /api/organizations/:id   # 删除组织

GET    /api/targets             # 目标列表
POST   /api/targets             # 创建目标
GET    /api/targets/:id         # 获取目标
PUT    /api/targets/:id         # 更新目标
DELETE /api/targets/:id         # 删除目标

GET    /api/engines             # 引擎列表
POST   /api/engines             # 创建引擎
GET    /api/engines/:id         # 获取引擎
PUT    /api/engines/:id         # 更新引擎
DELETE /api/engines/:id         # 删除引擎