fix: complete exploration data flow

This commit is contained in:
2026-07-23 22:25:12 +08:00
parent 55ff320cec
commit 5a1b04c4ed
12 changed files with 952 additions and 189 deletions

View File

@@ -14,8 +14,8 @@ type SaDatasetCron struct {
Enabled bool `gorm:"not null;default:true;index"`
NextRunAt *time.Time
LastRunAt *time.Time
LastResult string `gorm:"type:text"`
CreatedAt time.Time
LastResult string `gorm:"type:text"`
CreatedAt time.Time `gorm:"index"`
UpdatedAt time.Time
}

View File

@@ -2,6 +2,7 @@ package models
import (
"database/sql"
"errors"
"github.com/google/uuid"
"gorm.io/gorm"
@@ -28,6 +29,9 @@ func (m *SaDatasetSource) BeforeCreate(tx *gorm.DB) error {
if m.CreatedBy == 0 {
m.CreatedBy = m.OwnerID
}
if m.OwnerID == 0 {
return errors.New("dataset source owner is required")
}
if err := resolveIdentity(tx, &SaUser{}, m.OwnerID, &m.OwnerIdentity); err != nil {
return err
}