Add AI workflow run management with listing and detail retrieval endpoints, including corresponding response structures and UI integration
This commit is contained in:
@@ -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, ¶ms.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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user