Files
eaiadminandClaude Code c1af86c934 feat(asr): 本地语音转写接入为一级路由 + 并行工作流合并提交
按用户指示做**一包提交**,不按工作流拆分。本提交刻意混合了多条并行线:

  · 本地 ASR 接管:audio 成为与 chat/embed/image/video 同等的路由类别
    (IsLocalRoute 单一判据、audio 健康探测、default_audio_route、
    auto 占位、GET /api/ai/routes/audio、回退云端时界面明示「音频已出网」)
  · LLM 调用层:ctx 贯穿、ToolCall/ToolSchema、EmptyCompletionError /
    TransientUpstreamError(按错误类型而非文案判重试)
  · 编排 Agent:general_assistant orchestrate/persistence/spec_driver
  · 联网搜索:internal/search(playwright)
  · 网盘:backend + 前端
  · 前端 UI:导航/路由/工作台若干页
  · 交付文档:DELIVERY.md / AR04 / 部署文档的「无 Python」表述据实改写,
    新增 eai_agentplatform-asr.service、asr.env、clonezilla-cleanup 清 ~/asr-poc

不分拆的原因:dev 早期,粒度不该打断工作节奏。且实测过——这些改动
**在编译上是同一个单元**(llm.go 的 ctx 签名变更牵动 12 个调用点,
chat_message.go 的 ctx 改动又与编排重写同处一个 hunk),拆出来的中间态编不过。
详见 TOP_CODING_RULES.md G14.5 与 bugs_and_errors.md E09。

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-26 22:21:39 +08:00

52 lines
2.7 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package model
import "time"
// NetdiskFolder 网盘目录(团队共享,路径式组织)。
//
// 设计对齐 pj0034 的 asset_folder:path 为 `/` 分隔的绝对路径(如 `/市场部/2026Q1`),
// 用唯一约束 (company_id, path) 防重名。`/` 根目录是 system folder,不可删/改名。
// 团队共享盘:全公司共用一套目录树,company_id 统一取创始公司 Id,跨部门共享。
type NetdiskFolder struct {
ID uint `gorm:"primaryKey" json:"id"`
CompanyID uint `gorm:"not null;index" json:"company_id"`
Path string `gorm:"size:500;not null;index" json:"path"`
DisplayName string `gorm:"size:100;not null" json:"display_name"`
CreatedByID uint `gorm:"not null" json:"created_by_id"`
CreatedAt time.Time `json:"created_at"`
}
func (NetdiskFolder) TableName() string { return "netdisk_folder" }
// NetdiskFile 网盘文件(团队共享,审批前置)。
//
// 状态流转:
// - Status: pending(待审批) / approved(已通过) / rejected(已驳回)
// - Recycle: deleted_at/deleted_by 非空表示已移入回收站(软删除),可恢复或彻底删除
//
// 审批前置(对齐现有素材管理制度):员工上传进入 pending,需管理员审批通过后才对团队可见;
// 管理员上传自动 approved。已 approved 的文件才对其它成员暴露。
// FolderPath 记录文件所在的目录路径(冗余自目录表,便于按路径列出与移动)。
type NetdiskFile struct {
ID uint `gorm:"primaryKey" json:"id"`
CompanyID uint `gorm:"not null;index" json:"company_id"`
FolderPath string `gorm:"size:500;not null;default:/;index" json:"folder_path"`
Filename string `gorm:"size:256;not null" json:"filename"`
StoredName string `gorm:"size:64;not null" json:"stored_name"`
FileExt string `gorm:"size:16;not null" json:"file_ext"`
MimeType string `gorm:"size:128" json:"mime_type"`
FileSize int64 `gorm:"not null" json:"file_size"`
Status string `gorm:"size:16;not null;default:pending;index" json:"status"` // pending / approved / rejected
Source string `gorm:"size:16;not null" json:"source"` // employee / admin
SubmitterID uint `gorm:"not null;index" json:"submitter_id"`
RejectReason string `gorm:"size:512" json:"reject_reason"`
AuditBy *uint `json:"audit_by"`
AuditAt *time.Time `json:"audit_at"`
// 回收站软删除
DeletedAt *time.Time `gorm:"index" json:"deleted_at"`
DeletedBy *uint `json:"deleted_by"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
func (NetdiskFile) TableName() string { return "netdisk_file" }