refactor: shorten model and table prefixes
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
## Global Constraints
|
||||
|
||||
- 外部 API 前缀为 `/api/v1`,字段为 camelCase,对外 ID 为 UUIDv7 identity。
|
||||
- 数据库模型和表名前缀规则保持 `SenlinAgent` / `senlin_agent_`。
|
||||
- 数据库模型和表名前缀规则保持 `Sa` / `sa_`。
|
||||
- session token 必须签名并过期;handler 只从认证 middleware 读取用户。
|
||||
- 文件路径必须由文件服务构造;标签必须限定在项目内。
|
||||
- AI 请求必须限流并记录 provider、key 类型、action、status 和 error。
|
||||
@@ -121,7 +121,7 @@ type ProjectDTO struct {
|
||||
Description string `json:"description"`
|
||||
}
|
||||
|
||||
func projectDTO(project models.SenlinAgentProject) ProjectDTO {
|
||||
func projectDTO(project models.SaProject) ProjectDTO {
|
||||
return ProjectDTO{ID: project.Identity, Name: project.Name, Identifier: project.Identifier, Icon: project.Icon, Background: project.Background, Description: project.Description}
|
||||
}
|
||||
```
|
||||
|
||||
@@ -240,7 +240,7 @@ AI provider 请求必须先经过限流和密钥选择,随后记录 provider
|
||||
|
||||
## 8. 数据与配置
|
||||
|
||||
- 保留 `senlin_agent_` 表名前缀和 `SenlinAgent` 模型前缀。
|
||||
- 保留 `sa_` 表名前缀和 `Sa` 模型前缀。
|
||||
- 本地开发数据允许清空后通过 `go run ./cmd/seed` 重建。
|
||||
- 代码不得在启动时自动 drop 表或删除生产数据。
|
||||
- Docker Compose、`agent.dev.yaml` 和 README 使用一致的 PostgreSQL 用户、密码、数据库名和端口。
|
||||
|
||||
Reference in New Issue
Block a user