4142c53fa6
Replace SSE /desktop/events with priority AMQP dispatch for monitoring
runs, and add phase1/phase2 infrastructure so desktop workers can lease,
resume, report, skip, and cancel monitoring tasks over the existing
dispatch WebSocket.
- Add monitoring collect outbox worker and phase2 desktop task fields
- Add /desktop/monitoring/tasks/{lease,resume,result,skip,cancel} routes
- Introduce execution-devtools and network-observer on desktop runtime
- Refactor runtime-controller, LoginView, and doubao adapter for the new flow
- Add channelName column to tracking views
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
741 lines
33 KiB
Go
741 lines
33 KiB
Go
// Code generated by sqlc. DO NOT EDIT.
|
|
// versions:
|
|
// sqlc v1.30.0
|
|
|
|
package generated
|
|
|
|
import (
|
|
"github.com/jackc/pgx/v5/pgtype"
|
|
)
|
|
|
|
type AiPlatform struct {
|
|
ID int64 `json:"id"`
|
|
AiPlatformID string `json:"ai_platform_id"`
|
|
Name string `json:"name"`
|
|
ShortName string `json:"short_name"`
|
|
AccentColor string `json:"accent_color"`
|
|
LoginUrl pgtype.Text `json:"login_url"`
|
|
Status string `json:"status"`
|
|
SortOrder int32 `json:"sort_order"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
}
|
|
|
|
type Article struct {
|
|
ID int64 `json:"id"`
|
|
TenantID int64 `json:"tenant_id"`
|
|
SourceType string `json:"source_type"`
|
|
TemplateID pgtype.Int8 `json:"template_id"`
|
|
PromptRuleID pgtype.Int8 `json:"prompt_rule_id"`
|
|
CurrentVersionID pgtype.Int8 `json:"current_version_id"`
|
|
GenerateStatus string `json:"generate_status"`
|
|
PublishStatus string `json:"publish_status"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
DeletedAt pgtype.Timestamptz `json:"deleted_at"`
|
|
WizardStateJson []byte `json:"wizard_state_json"`
|
|
KolPromptID pgtype.Int8 `json:"kol_prompt_id"`
|
|
}
|
|
|
|
type ArticleTemplate struct {
|
|
ID int64 `json:"id"`
|
|
Scope string `json:"scope"`
|
|
TenantID pgtype.Int8 `json:"tenant_id"`
|
|
OriginType string `json:"origin_type"`
|
|
ShareCodeID pgtype.Int8 `json:"share_code_id"`
|
|
TemplateKey string `json:"template_key"`
|
|
TemplateName string `json:"template_name"`
|
|
PromptTemplate pgtype.Text `json:"prompt_template"`
|
|
PromptVisibility string `json:"prompt_visibility"`
|
|
ProtectedPromptAssetKey pgtype.Text `json:"protected_prompt_asset_key"`
|
|
CardConfigJson []byte `json:"card_config_json"`
|
|
Status string `json:"status"`
|
|
VersionNo int32 `json:"version_no"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
DeletedAt pgtype.Timestamptz `json:"deleted_at"`
|
|
}
|
|
|
|
type ArticleVersion struct {
|
|
ID int64 `json:"id"`
|
|
ArticleID int64 `json:"article_id"`
|
|
VersionNo int32 `json:"version_no"`
|
|
Title pgtype.Text `json:"title"`
|
|
HtmlContent pgtype.Text `json:"html_content"`
|
|
MarkdownContent pgtype.Text `json:"markdown_content"`
|
|
WordCount int32 `json:"word_count"`
|
|
SourceLabel pgtype.Text `json:"source_label"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
}
|
|
|
|
type AuditLog struct {
|
|
ID int64 `json:"id"`
|
|
OperatorID int64 `json:"operator_id"`
|
|
TenantID pgtype.Int8 `json:"tenant_id"`
|
|
Module string `json:"module"`
|
|
Action string `json:"action"`
|
|
BeforeJson []byte `json:"before_json"`
|
|
AfterJson []byte `json:"after_json"`
|
|
Result pgtype.Text `json:"result"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
ResourceType pgtype.Text `json:"resource_type"`
|
|
ResourceID pgtype.Int8 `json:"resource_id"`
|
|
RequestID pgtype.Text `json:"request_id"`
|
|
ErrorMessage pgtype.Text `json:"error_message"`
|
|
}
|
|
|
|
type Brand struct {
|
|
ID int64 `json:"id"`
|
|
TenantID int64 `json:"tenant_id"`
|
|
Name string `json:"name"`
|
|
Description pgtype.Text `json:"description"`
|
|
Status string `json:"status"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
DeletedAt pgtype.Timestamptz `json:"deleted_at"`
|
|
Website pgtype.Text `json:"website"`
|
|
}
|
|
|
|
type BrandKeyword struct {
|
|
ID int64 `json:"id"`
|
|
TenantID int64 `json:"tenant_id"`
|
|
BrandID int64 `json:"brand_id"`
|
|
Name string `json:"name"`
|
|
Status string `json:"status"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
DeletedAt pgtype.Timestamptz `json:"deleted_at"`
|
|
}
|
|
|
|
type BrandQuestion struct {
|
|
ID int64 `json:"id"`
|
|
TenantID int64 `json:"tenant_id"`
|
|
BrandID int64 `json:"brand_id"`
|
|
KeywordID int64 `json:"keyword_id"`
|
|
QuestionText string `json:"question_text"`
|
|
Status string `json:"status"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
DeletedAt pgtype.Timestamptz `json:"deleted_at"`
|
|
}
|
|
|
|
type Competitor struct {
|
|
ID int64 `json:"id"`
|
|
TenantID int64 `json:"tenant_id"`
|
|
BrandID int64 `json:"brand_id"`
|
|
Name string `json:"name"`
|
|
Website pgtype.Text `json:"website"`
|
|
Description pgtype.Text `json:"description"`
|
|
ProductLinesJson []byte `json:"product_lines_json"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
DeletedAt pgtype.Timestamptz `json:"deleted_at"`
|
|
}
|
|
|
|
type DesktopClient struct {
|
|
ID pgtype.UUID `json:"id"`
|
|
TenantID int64 `json:"tenant_id"`
|
|
WorkspaceID int64 `json:"workspace_id"`
|
|
UserID int64 `json:"user_id"`
|
|
TokenHash []byte `json:"token_hash"`
|
|
DeviceName pgtype.Text `json:"device_name"`
|
|
Os pgtype.Text `json:"os"`
|
|
CpuArch pgtype.Text `json:"cpu_arch"`
|
|
ClientVersion pgtype.Text `json:"client_version"`
|
|
Channel pgtype.Text `json:"channel"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
LastSeenAt pgtype.Timestamptz `json:"last_seen_at"`
|
|
LastRotatedAt pgtype.Timestamptz `json:"last_rotated_at"`
|
|
RevokedAt pgtype.Timestamptz `json:"revoked_at"`
|
|
}
|
|
|
|
type DesktopPublishJob struct {
|
|
ID int64 `json:"id"`
|
|
DesktopID pgtype.UUID `json:"desktop_id"`
|
|
TenantID int64 `json:"tenant_id"`
|
|
WorkspaceID int64 `json:"workspace_id"`
|
|
CreatedByUserID int64 `json:"created_by_user_id"`
|
|
Title string `json:"title"`
|
|
ContentRef []byte `json:"content_ref"`
|
|
ScheduledAt pgtype.Timestamptz `json:"scheduled_at"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
}
|
|
|
|
type DesktopTask struct {
|
|
ID int64 `json:"id"`
|
|
DesktopID pgtype.UUID `json:"desktop_id"`
|
|
JobID pgtype.UUID `json:"job_id"`
|
|
TenantID int64 `json:"tenant_id"`
|
|
WorkspaceID int64 `json:"workspace_id"`
|
|
TargetAccountID pgtype.UUID `json:"target_account_id"`
|
|
TargetClientID pgtype.UUID `json:"target_client_id"`
|
|
PlatformID string `json:"platform_id"`
|
|
Kind string `json:"kind"`
|
|
Payload []byte `json:"payload"`
|
|
Status string `json:"status"`
|
|
DedupKey pgtype.Text `json:"dedup_key"`
|
|
ActiveAttemptID pgtype.UUID `json:"active_attempt_id"`
|
|
LeaseTokenHash []byte `json:"lease_token_hash"`
|
|
LeaseExpiresAt pgtype.Timestamptz `json:"lease_expires_at"`
|
|
Attempts int32 `json:"attempts"`
|
|
Result []byte `json:"result"`
|
|
Error []byte `json:"error"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
Priority int32 `json:"priority"`
|
|
Lane string `json:"lane"`
|
|
LaneWeight int32 `json:"lane_weight"`
|
|
Source string `json:"source"`
|
|
SchedulerGroupKey pgtype.Text `json:"scheduler_group_key"`
|
|
MonitorTaskID pgtype.Int8 `json:"monitor_task_id"`
|
|
SupersedesTaskID pgtype.UUID `json:"supersedes_task_id"`
|
|
ControlFlags []byte `json:"control_flags"`
|
|
InterruptGeneration int32 `json:"interrupt_generation"`
|
|
StartedAt pgtype.Timestamptz `json:"started_at"`
|
|
InterruptedAt pgtype.Timestamptz `json:"interrupted_at"`
|
|
InterruptReason pgtype.Text `json:"interrupt_reason"`
|
|
EnqueuedAt pgtype.Timestamptz `json:"enqueued_at"`
|
|
}
|
|
|
|
type DesktopTaskAttempt struct {
|
|
ID int64 `json:"id"`
|
|
DesktopID pgtype.UUID `json:"desktop_id"`
|
|
TaskID pgtype.UUID `json:"task_id"`
|
|
ClientID pgtype.UUID `json:"client_id"`
|
|
LeaseTokenHash []byte `json:"lease_token_hash"`
|
|
StartedAt pgtype.Timestamptz `json:"started_at"`
|
|
EndedAt pgtype.Timestamptz `json:"ended_at"`
|
|
FinalStatus pgtype.Text `json:"final_status"`
|
|
Error []byte `json:"error"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
}
|
|
|
|
type DesktopTaskTrace struct {
|
|
TaskID pgtype.UUID `json:"task_id"`
|
|
AttemptID pgtype.UUID `json:"attempt_id"`
|
|
Size pgtype.Int8 `json:"size"`
|
|
UploadedAt pgtype.Timestamptz `json:"uploaded_at"`
|
|
ObjectKey pgtype.Text `json:"object_key"`
|
|
}
|
|
|
|
type GenerationTask struct {
|
|
ID int64 `json:"id"`
|
|
TenantID int64 `json:"tenant_id"`
|
|
ArticleID pgtype.Int8 `json:"article_id"`
|
|
TaskBatchID pgtype.Text `json:"task_batch_id"`
|
|
QuotaReservationID pgtype.Int8 `json:"quota_reservation_id"`
|
|
TaskType string `json:"task_type"`
|
|
RequestHash pgtype.Text `json:"request_hash"`
|
|
InputParamsJson []byte `json:"input_params_json"`
|
|
Status string `json:"status"`
|
|
ErrorMessage pgtype.Text `json:"error_message"`
|
|
StartedAt pgtype.Timestamptz `json:"started_at"`
|
|
CompletedAt pgtype.Timestamptz `json:"completed_at"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
OperatorID pgtype.Int8 `json:"operator_id"`
|
|
}
|
|
|
|
type ImageAsset struct {
|
|
ID int64 `json:"id"`
|
|
TenantID int64 `json:"tenant_id"`
|
|
FolderID pgtype.Int8 `json:"folder_id"`
|
|
ObjectKey string `json:"object_key"`
|
|
Name string `json:"name"`
|
|
SizeBytes int64 `json:"size_bytes"`
|
|
Status string `json:"status"`
|
|
CreatedBy int64 `json:"created_by"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
DeletedAt pgtype.Timestamptz `json:"deleted_at"`
|
|
ContentHash pgtype.Text `json:"content_hash"`
|
|
}
|
|
|
|
type ImageAssetReference struct {
|
|
ID int64 `json:"id"`
|
|
TenantID int64 `json:"tenant_id"`
|
|
ImageAssetID int64 `json:"image_asset_id"`
|
|
ArticleID int64 `json:"article_id"`
|
|
RefScope string `json:"ref_scope"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
}
|
|
|
|
type ImageFolder struct {
|
|
ID int64 `json:"id"`
|
|
TenantID int64 `json:"tenant_id"`
|
|
Name string `json:"name"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
}
|
|
|
|
type KnowledgeChunksMetum struct {
|
|
ID int64 `json:"id"`
|
|
TenantID int64 `json:"tenant_id"`
|
|
KnowledgeItemID int64 `json:"knowledge_item_id"`
|
|
ChunkIndex int32 `json:"chunk_index"`
|
|
TokenCount int32 `json:"token_count"`
|
|
QdrantPointID string `json:"qdrant_point_id"`
|
|
ItemVersion int32 `json:"item_version"`
|
|
Status string `json:"status"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
}
|
|
|
|
type KnowledgeGroup struct {
|
|
ID int64 `json:"id"`
|
|
TenantID int64 `json:"tenant_id"`
|
|
Name string `json:"name"`
|
|
ParentID pgtype.Int8 `json:"parent_id"`
|
|
SortOrder int32 `json:"sort_order"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
DeletedAt pgtype.Timestamptz `json:"deleted_at"`
|
|
}
|
|
|
|
type KnowledgeItem struct {
|
|
ID int64 `json:"id"`
|
|
TenantID int64 `json:"tenant_id"`
|
|
GroupID int64 `json:"group_id"`
|
|
SourceType string `json:"source_type"`
|
|
Name string `json:"name"`
|
|
SourceUri pgtype.Text `json:"source_uri"`
|
|
StorageKey string `json:"storage_key"`
|
|
ContentText pgtype.Text `json:"content_text"`
|
|
Status string `json:"status"`
|
|
SizeBytes int64 `json:"size_bytes"`
|
|
ItemVersion int32 `json:"item_version"`
|
|
ErrorMessage pgtype.Text `json:"error_message"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
DeletedAt pgtype.Timestamptz `json:"deleted_at"`
|
|
MarkdownContent pgtype.Text `json:"markdown_content"`
|
|
}
|
|
|
|
type KnowledgeParseTask struct {
|
|
ID int64 `json:"id"`
|
|
TenantID int64 `json:"tenant_id"`
|
|
KnowledgeItemID int64 `json:"knowledge_item_id"`
|
|
SourceType string `json:"source_type"`
|
|
Status string `json:"status"`
|
|
ErrorMessage pgtype.Text `json:"error_message"`
|
|
StartedAt pgtype.Timestamptz `json:"started_at"`
|
|
CompletedAt pgtype.Timestamptz `json:"completed_at"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
}
|
|
|
|
type KolAssistTask struct {
|
|
ID string `json:"id"`
|
|
TenantID int64 `json:"tenant_id"`
|
|
KolProfileID int64 `json:"kol_profile_id"`
|
|
PromptID pgtype.Int8 `json:"prompt_id"`
|
|
OperatorID int64 `json:"operator_id"`
|
|
TaskType string `json:"task_type"`
|
|
Status string `json:"status"`
|
|
RequestJson []byte `json:"request_json"`
|
|
ResultJson []byte `json:"result_json"`
|
|
ErrorMessage pgtype.Text `json:"error_message"`
|
|
StartedAt pgtype.Timestamptz `json:"started_at"`
|
|
CompletedAt pgtype.Timestamptz `json:"completed_at"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
}
|
|
|
|
type KolPackage struct {
|
|
ID int64 `json:"id"`
|
|
TenantID int64 `json:"tenant_id"`
|
|
KolProfileID int64 `json:"kol_profile_id"`
|
|
Name string `json:"name"`
|
|
Description pgtype.Text `json:"description"`
|
|
CoverUrl pgtype.Text `json:"cover_url"`
|
|
Industry pgtype.Text `json:"industry"`
|
|
Tags []byte `json:"tags"`
|
|
PriceNote pgtype.Text `json:"price_note"`
|
|
Status string `json:"status"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
DeletedAt pgtype.Timestamptz `json:"deleted_at"`
|
|
}
|
|
|
|
type KolProfile struct {
|
|
ID int64 `json:"id"`
|
|
TenantID int64 `json:"tenant_id"`
|
|
UserID int64 `json:"user_id"`
|
|
DisplayName string `json:"display_name"`
|
|
Bio pgtype.Text `json:"bio"`
|
|
AvatarUrl pgtype.Text `json:"avatar_url"`
|
|
MarketEnabled bool `json:"market_enabled"`
|
|
Status string `json:"status"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
DeletedAt pgtype.Timestamptz `json:"deleted_at"`
|
|
}
|
|
|
|
type KolPrompt struct {
|
|
ID int64 `json:"id"`
|
|
TenantID int64 `json:"tenant_id"`
|
|
PackageID int64 `json:"package_id"`
|
|
Name string `json:"name"`
|
|
PlatformHint pgtype.Text `json:"platform_hint"`
|
|
Status string `json:"status"`
|
|
SortOrder int32 `json:"sort_order"`
|
|
PublishedRevisionNo pgtype.Int4 `json:"published_revision_no"`
|
|
DraftRevisionNo pgtype.Int4 `json:"draft_revision_no"`
|
|
CreatedBy int64 `json:"created_by"`
|
|
UpdatedBy int64 `json:"updated_by"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
DeletedAt pgtype.Timestamptz `json:"deleted_at"`
|
|
PromptAssetKey pgtype.Text `json:"prompt_asset_key"`
|
|
SchemaJson []byte `json:"schema_json"`
|
|
CardConfigJson []byte `json:"card_config_json"`
|
|
}
|
|
|
|
type KolPromptRevision struct {
|
|
ID int64 `json:"id"`
|
|
TenantID int64 `json:"tenant_id"`
|
|
PromptID int64 `json:"prompt_id"`
|
|
RevisionNo int32 `json:"revision_no"`
|
|
PromptAssetKey string `json:"prompt_asset_key"`
|
|
SchemaJson []byte `json:"schema_json"`
|
|
CardConfigJson []byte `json:"card_config_json"`
|
|
CreatedBy int64 `json:"created_by"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
}
|
|
|
|
type KolSubscription struct {
|
|
ID int64 `json:"id"`
|
|
TenantID int64 `json:"tenant_id"`
|
|
PackageID int64 `json:"package_id"`
|
|
Status string `json:"status"`
|
|
ApprovedBy pgtype.Int8 `json:"approved_by"`
|
|
StartAt pgtype.Timestamptz `json:"start_at"`
|
|
EndAt pgtype.Timestamptz `json:"end_at"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
}
|
|
|
|
type KolSubscriptionPrompt struct {
|
|
ID int64 `json:"id"`
|
|
TenantID int64 `json:"tenant_id"`
|
|
SubscriptionID int64 `json:"subscription_id"`
|
|
PackageID int64 `json:"package_id"`
|
|
PromptID int64 `json:"prompt_id"`
|
|
Status string `json:"status"`
|
|
GrantedAt pgtype.Timestamptz `json:"granted_at"`
|
|
RevokedAt pgtype.Timestamptz `json:"revoked_at"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
}
|
|
|
|
type KolUsageLog struct {
|
|
ID int64 `json:"id"`
|
|
TenantID int64 `json:"tenant_id"`
|
|
SubscriptionID pgtype.Int8 `json:"subscription_id"`
|
|
SubscriptionPromptID pgtype.Int8 `json:"subscription_prompt_id"`
|
|
PackageID int64 `json:"package_id"`
|
|
PromptID int64 `json:"prompt_id"`
|
|
PromptRevisionNo int32 `json:"prompt_revision_no"`
|
|
ArticleID pgtype.Int8 `json:"article_id"`
|
|
GenerationTaskID pgtype.Int8 `json:"generation_task_id"`
|
|
Status string `json:"status"`
|
|
VariablesSnapshot []byte `json:"variables_snapshot"`
|
|
SchemaSnapshot []byte `json:"schema_snapshot"`
|
|
RenderedPromptHash pgtype.Text `json:"rendered_prompt_hash"`
|
|
ErrorMessage pgtype.Text `json:"error_message"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
FinishedAt pgtype.Timestamptz `json:"finished_at"`
|
|
}
|
|
|
|
type MediaPlatform struct {
|
|
ID int64 `json:"id"`
|
|
PlatformID string `json:"platform_id"`
|
|
Name string `json:"name"`
|
|
Category string `json:"category"`
|
|
ShortName string `json:"short_name"`
|
|
AccentColor string `json:"accent_color"`
|
|
LoginUrl pgtype.Text `json:"login_url"`
|
|
LogoUrl pgtype.Text `json:"logo_url"`
|
|
Status string `json:"status"`
|
|
SortOrder int32 `json:"sort_order"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
}
|
|
|
|
type Plan struct {
|
|
ID int64 `json:"id"`
|
|
PlanCode string `json:"plan_code"`
|
|
Name string `json:"name"`
|
|
QuotaPolicyJson []byte `json:"quota_policy_json"`
|
|
Status string `json:"status"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
DeletedAt pgtype.Timestamptz `json:"deleted_at"`
|
|
}
|
|
|
|
type PlatformAccount struct {
|
|
ID int64 `json:"id"`
|
|
TenantID int64 `json:"tenant_id"`
|
|
UserID int64 `json:"user_id"`
|
|
PlatformID string `json:"platform_id"`
|
|
PlatformUid string `json:"platform_uid"`
|
|
Nickname string `json:"nickname"`
|
|
AvatarUrl pgtype.Text `json:"avatar_url"`
|
|
Status string `json:"status"`
|
|
MetadataJson []byte `json:"metadata_json"`
|
|
LastCheckAt pgtype.Timestamptz `json:"last_check_at"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
DeletedAt pgtype.Timestamptz `json:"deleted_at"`
|
|
WorkspaceID int64 `json:"workspace_id"`
|
|
DesktopID pgtype.UUID `json:"desktop_id"`
|
|
ClientID pgtype.UUID `json:"client_id"`
|
|
AccountFingerprint pgtype.Text `json:"account_fingerprint"`
|
|
DisplayName string `json:"display_name"`
|
|
Health string `json:"health"`
|
|
VerifiedAt pgtype.Timestamptz `json:"verified_at"`
|
|
Tags []byte `json:"tags"`
|
|
SyncVersion int64 `json:"sync_version"`
|
|
DeleteRequestedAt pgtype.Timestamptz `json:"delete_requested_at"`
|
|
}
|
|
|
|
type PlatformUserRole struct {
|
|
ID int64 `json:"id"`
|
|
UserID int64 `json:"user_id"`
|
|
PlatformRole string `json:"platform_role"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
DeletedAt pgtype.Timestamptz `json:"deleted_at"`
|
|
}
|
|
|
|
type PromptRule struct {
|
|
ID int64 `json:"id"`
|
|
TenantID int64 `json:"tenant_id"`
|
|
GroupID pgtype.Int8 `json:"group_id"`
|
|
Name string `json:"name"`
|
|
PromptContent string `json:"prompt_content"`
|
|
Scene pgtype.Text `json:"scene"`
|
|
DefaultTone pgtype.Text `json:"default_tone"`
|
|
DefaultWordCount pgtype.Int4 `json:"default_word_count"`
|
|
Status string `json:"status"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
DeletedAt pgtype.Timestamptz `json:"deleted_at"`
|
|
}
|
|
|
|
type PromptRuleGroup struct {
|
|
ID int64 `json:"id"`
|
|
TenantID int64 `json:"tenant_id"`
|
|
Name string `json:"name"`
|
|
SortOrder int32 `json:"sort_order"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
DeletedAt pgtype.Timestamptz `json:"deleted_at"`
|
|
}
|
|
|
|
type PromptRuleKnowledgeGroup struct {
|
|
PromptRuleID int64 `json:"prompt_rule_id"`
|
|
KnowledgeGroupID int64 `json:"knowledge_group_id"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
}
|
|
|
|
type PublishBatch struct {
|
|
ID int64 `json:"id"`
|
|
TenantID int64 `json:"tenant_id"`
|
|
ArticleID int64 `json:"article_id"`
|
|
InitiatorUserID int64 `json:"initiator_user_id"`
|
|
Status string `json:"status"`
|
|
PublishType string `json:"publish_type"`
|
|
CoverAssetUrl pgtype.Text `json:"cover_asset_url"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
}
|
|
|
|
type PublishRecord struct {
|
|
ID int64 `json:"id"`
|
|
TenantID int64 `json:"tenant_id"`
|
|
PublishBatchID int64 `json:"publish_batch_id"`
|
|
ArticleID int64 `json:"article_id"`
|
|
PlatformAccountID int64 `json:"platform_account_id"`
|
|
PlatformID string `json:"platform_id"`
|
|
Status string `json:"status"`
|
|
ExternalArticleID pgtype.Text `json:"external_article_id"`
|
|
ExternalArticleUrl pgtype.Text `json:"external_article_url"`
|
|
ExternalManageUrl pgtype.Text `json:"external_manage_url"`
|
|
PublishedAt pgtype.Timestamptz `json:"published_at"`
|
|
RequestPayloadJson []byte `json:"request_payload_json"`
|
|
ResponsePayloadJson []byte `json:"response_payload_json"`
|
|
ErrorMessage pgtype.Text `json:"error_message"`
|
|
RetryCount int32 `json:"retry_count"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
}
|
|
|
|
type QuotaReservation struct {
|
|
ID int64 `json:"id"`
|
|
TenantID int64 `json:"tenant_id"`
|
|
QuotaType string `json:"quota_type"`
|
|
ResourceType string `json:"resource_type"`
|
|
ResourceID pgtype.Int8 `json:"resource_id"`
|
|
ReservedAmount int32 `json:"reserved_amount"`
|
|
ConsumedAmount int32 `json:"consumed_amount"`
|
|
RefundedAmount int32 `json:"refunded_amount"`
|
|
Status string `json:"status"`
|
|
ExpireAt pgtype.Timestamptz `json:"expire_at"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
OperatorID pgtype.Int8 `json:"operator_id"`
|
|
}
|
|
|
|
type ScheduleTask struct {
|
|
ID int64 `json:"id"`
|
|
TenantID int64 `json:"tenant_id"`
|
|
PromptRuleID int64 `json:"prompt_rule_id"`
|
|
BrandID pgtype.Int8 `json:"brand_id"`
|
|
Name string `json:"name"`
|
|
CronExpr string `json:"cron_expr"`
|
|
TargetPlatform pgtype.Text `json:"target_platform"`
|
|
StartAt pgtype.Timestamptz `json:"start_at"`
|
|
EndAt pgtype.Timestamptz `json:"end_at"`
|
|
NextRunAt pgtype.Timestamptz `json:"next_run_at"`
|
|
Status string `json:"status"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
DeletedAt pgtype.Timestamptz `json:"deleted_at"`
|
|
OperatorID pgtype.Int8 `json:"operator_id"`
|
|
EnableWebSearch bool `json:"enable_web_search"`
|
|
GenerateCount int32 `json:"generate_count"`
|
|
}
|
|
|
|
type TaskRecord struct {
|
|
ID int64 `json:"id"`
|
|
TenantID int64 `json:"tenant_id"`
|
|
TaskType string `json:"task_type"`
|
|
ResourceType string `json:"resource_type"`
|
|
ResourceID int64 `json:"resource_id"`
|
|
Status string `json:"status"`
|
|
RetryCount int32 `json:"retry_count"`
|
|
TaskBatchID pgtype.Text `json:"task_batch_id"`
|
|
ErrorMessage pgtype.Text `json:"error_message"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
OperatorID pgtype.Int8 `json:"operator_id"`
|
|
}
|
|
|
|
type TemplateAssistTask struct {
|
|
ID string `json:"id"`
|
|
TenantID int64 `json:"tenant_id"`
|
|
TemplateID int64 `json:"template_id"`
|
|
Status string `json:"status"`
|
|
RequestJson []byte `json:"request_json"`
|
|
ResultJson []byte `json:"result_json"`
|
|
ErrorMessage pgtype.Text `json:"error_message"`
|
|
StartedAt pgtype.Timestamptz `json:"started_at"`
|
|
CompletedAt pgtype.Timestamptz `json:"completed_at"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
TaskType string `json:"task_type"`
|
|
OperatorID pgtype.Int8 `json:"operator_id"`
|
|
}
|
|
|
|
type Tenant struct {
|
|
ID int64 `json:"id"`
|
|
Name string `json:"name"`
|
|
Status string `json:"status"`
|
|
FrozenAt pgtype.Timestamptz `json:"frozen_at"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
DeletedAt pgtype.Timestamptz `json:"deleted_at"`
|
|
}
|
|
|
|
type TenantImageStorageUsage struct {
|
|
TenantID int64 `json:"tenant_id"`
|
|
UsedBytes int64 `json:"used_bytes"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
}
|
|
|
|
type TenantMembership struct {
|
|
ID int64 `json:"id"`
|
|
TenantID int64 `json:"tenant_id"`
|
|
UserID int64 `json:"user_id"`
|
|
TenantRole string `json:"tenant_role"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
DeletedAt pgtype.Timestamptz `json:"deleted_at"`
|
|
}
|
|
|
|
type TenantMonitoringQuota struct {
|
|
TenantID int64 `json:"tenant_id"`
|
|
MaxBrands int32 `json:"max_brands"`
|
|
CollectionMode string `json:"collection_mode"`
|
|
QuestionSelectionMode string `json:"question_selection_mode"`
|
|
CollectFrequency string `json:"collect_frequency"`
|
|
EnabledPlatforms []byte `json:"enabled_platforms"`
|
|
PrimaryClientID pgtype.UUID `json:"primary_client_id"`
|
|
TaskDailyHardCap int32 `json:"task_daily_hard_cap"`
|
|
PlanTier string `json:"plan_tier"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
WorkspaceID int64 `json:"workspace_id"`
|
|
}
|
|
|
|
type TenantPlanSubscription struct {
|
|
ID int64 `json:"id"`
|
|
TenantID int64 `json:"tenant_id"`
|
|
PlanID int64 `json:"plan_id"`
|
|
StartAt pgtype.Timestamptz `json:"start_at"`
|
|
EndAt pgtype.Timestamptz `json:"end_at"`
|
|
Status string `json:"status"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
DeletedAt pgtype.Timestamptz `json:"deleted_at"`
|
|
}
|
|
|
|
type TenantQuotaLedger struct {
|
|
ID int64 `json:"id"`
|
|
TenantID int64 `json:"tenant_id"`
|
|
QuotaType string `json:"quota_type"`
|
|
Delta int32 `json:"delta"`
|
|
BalanceAfter int32 `json:"balance_after"`
|
|
Reason pgtype.Text `json:"reason"`
|
|
ReferenceType pgtype.Text `json:"reference_type"`
|
|
ReferenceID pgtype.Int8 `json:"reference_id"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
OperatorID pgtype.Int8 `json:"operator_id"`
|
|
}
|
|
|
|
type User struct {
|
|
ID int64 `json:"id"`
|
|
Email string `json:"email"`
|
|
Phone pgtype.Text `json:"phone"`
|
|
PasswordHash string `json:"password_hash"`
|
|
Name string `json:"name"`
|
|
AvatarUrl pgtype.Text `json:"avatar_url"`
|
|
Status string `json:"status"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
DeletedAt pgtype.Timestamptz `json:"deleted_at"`
|
|
}
|
|
|
|
type Workspace struct {
|
|
ID int64 `json:"id"`
|
|
TenantID int64 `json:"tenant_id"`
|
|
Name string `json:"name"`
|
|
Slug string `json:"slug"`
|
|
IsDefault bool `json:"is_default"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
}
|
|
|
|
type WorkspaceMembership struct {
|
|
ID int64 `json:"id"`
|
|
WorkspaceID int64 `json:"workspace_id"`
|
|
UserID int64 `json:"user_id"`
|
|
TenantID int64 `json:"tenant_id"`
|
|
Role string `json:"role"`
|
|
IsPrimary bool `json:"is_primary"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
}
|