feat: add Z12/Z13 bind APIs, stock import, and sync docs
Enable auto default sync channels on agent activate, bind-code/phone confirm flows, publish ALTER, and align admin/yuheng docs with the production bind path.
This commit is contained in:
@@ -75,6 +75,29 @@ ORDER BY updated_at DESC`
|
||||
return out, rows.Err()
|
||||
}
|
||||
|
||||
func (s *PostgresStore) ListPublishedApps(ctx context.Context) ([]*AppRecord, error) {
|
||||
const q = `
|
||||
SELECT app_id, tenant_id, slug, name, schema_name, COALESCE(database_name,''), engine, status,
|
||||
blueprint_json, ddl_json, endpoints_json, error_msg, created_at, updated_at
|
||||
FROM platform_meta.tenant_apps
|
||||
WHERE status = $1
|
||||
ORDER BY tenant_id, slug`
|
||||
rows, err := s.DB.QueryContext(ctx, q, string(StatusPublished))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
out := make([]*AppRecord, 0)
|
||||
for rows.Next() {
|
||||
rec, err := scanApp(rows)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
out = append(out, rec)
|
||||
}
|
||||
return out, rows.Err()
|
||||
}
|
||||
|
||||
func (s *PostgresStore) Save(ctx context.Context, app *AppRecord) error {
|
||||
if app == nil {
|
||||
return fmt.Errorf("app is nil")
|
||||
|
||||
Reference in New Issue
Block a user