Add AI workflow run management with listing and detail retrieval endpoints, including corresponding response structures and UI integration

This commit is contained in:
mlogclub
2026-06-23 23:05:17 +08:00
parent a670084374
commit 1440c3c4c3
10 changed files with 594 additions and 1 deletions
@@ -2,6 +2,7 @@ package repositories
import (
"agent-desk/internal/models"
"agent-desk/internal/pkg/httpx/params"
"github.com/mlogclub/simple/sqls"
"gorm.io/gorm"
@@ -28,6 +29,21 @@ func (r *aiWorkflowRunRepository) Find(db *gorm.DB, cnd *sqls.Cnd) (list []model
return
}
func (r *aiWorkflowRunRepository) FindPageByParams(db *gorm.DB, params *params.QueryParams) (list []models.AIWorkflowRun, paging *sqls.Paging) {
return r.FindPageByCnd(db, &params.Cnd)
}
func (r *aiWorkflowRunRepository) FindPageByCnd(db *gorm.DB, cnd *sqls.Cnd) (list []models.AIWorkflowRun, paging *sqls.Paging) {
cnd.Find(db, &list)
count := cnd.Count(db, &models.AIWorkflowRun{})
paging = &sqls.Paging{
Page: cnd.Paging.Page,
Limit: cnd.Paging.Limit,
Total: count,
}
return
}
func (r *aiWorkflowRunRepository) Create(db *gorm.DB, t *models.AIWorkflowRun) error {
return db.Create(t).Error
}