feat(*): 生图与视频工作台 - 新增独立生成流程并整合平台配置
This commit is contained in:
1 parent
4c1d2b4012
commit
1f3f2c6020
69 files changed
+7108
-87
No files matched your search
@@ -22,6 +22,7 @@ import (
|
||||
"yingce/backend/internal/skills"
|
||||
"yingce/backend/internal/sms"
|
||||
"yingce/backend/internal/tools"
|
||||
"yingce/backend/internal/workbench"
|
||||
)
|
||||
|
||||
type Service struct {
|
||||
@@ -79,6 +80,7 @@ type Service struct {
|
||||
auth *auth.Service
|
||||
sms *sms.Service
|
||||
canvas *canvas.Service
|
||||
workbench *workbench.Service
|
||||
piRunnerMu sync.Mutex
|
||||
piRunnerWg sync.WaitGroup
|
||||
piRunners map[string]context.CancelFunc
|
||||
@@ -99,8 +101,9 @@ const taskWorkerConcurrency = 3
|
||||
const taskLogPayloadLimit = 4000
|
||||
|
||||
type CreateTaskRequest struct {
|
||||
creationPrepare *creationTaskPreparation
|
||||
admission *taskAdmission
|
||||
creationPrepare *creationTaskPreparation
|
||||
admission *taskAdmission
|
||||
workbenchKind string
|
||||
// callerHoldsStorageMu 只给已经持有 Service.storageMu 的内部调用设置。
|
||||
// 文件容量检查不能再锁一次,否则审批改参数会自锁。
|
||||
callerHoldsStorageMu bool
|
||||
@@ -117,9 +120,10 @@ type CreateTaskRequest struct {
|
||||
}
|
||||
|
||||
type TaskListOptions struct {
|
||||
Limit int
|
||||
ProjectID string
|
||||
ActiveOnly bool
|
||||
Limit int
|
||||
ProjectID string
|
||||
ActiveOnly bool
|
||||
WorkbenchKind string
|
||||
}
|
||||
|
||||
func New(repo *repository.Repository, dataDir string) *Service {
|
||||
@@ -148,6 +152,7 @@ func newService(repo *repository.Repository, dataDir string) *Service {
|
||||
service.sms = service.newSMSDomain()
|
||||
service.auth.SetSMSDelivery(service.sms)
|
||||
service.canvas = canvas.New(service.repo, canvasHost{svc: service})
|
||||
service.workbench = workbench.New(service.repo, workbenchAdminGate{svc: service}, workbenchAdminGate{svc: service})
|
||||
service.platform = platform.New(service.repo, coordinator, platformHost{svc: service})
|
||||
return service
|
||||
}
|
||||
@@ -234,7 +239,7 @@ func (s *Service) Tasks(userID string, limit int) ([]TaskSummary, error) {
|
||||
}
|
||||
|
||||
func (s *Service) TasksWithOptions(userID string, options TaskListOptions) ([]TaskSummary, error) {
|
||||
tasks, err := s.repo.Tasks(userID, options.Limit, options.ProjectID, options.ActiveOnly)
|
||||
tasks, err := s.repo.TasksWithWorkbenchKind(userID, options.Limit, options.ProjectID, options.ActiveOnly, options.WorkbenchKind)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user