8958cb44c0
- Removed ListQuestionVersions method and associated types from BrandService and Queries. - Updated PromptRuleGenerationService to change task naming and handling. - Enhanced ScheduleTaskService to support filtering by created date range and keyword. - Introduced InstantTaskService for managing instant tasks with appropriate filtering and response structures. - Added InstantTaskHandler for handling API requests related to instant tasks. - Created InstantTaskTab component for the admin web interface to display and manage instant tasks. - Updated database migrations to rename source types for articles and generation tasks. - Adjusted models and repository queries to reflect the removal of question version handling.
315 lines
13 KiB
Go
315 lines
13 KiB
Go
// Code generated by sqlc. DO NOT EDIT.
|
|
// versions:
|
|
// sqlc v1.30.0
|
|
|
|
package generated
|
|
|
|
import (
|
|
"github.com/jackc/pgx/v5/pgtype"
|
|
)
|
|
|
|
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"`
|
|
}
|
|
|
|
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"`
|
|
CurrentVersionID pgtype.Int8 `json:"current_version_id"`
|
|
Status string `json:"status"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
DeletedAt pgtype.Timestamptz `json:"deleted_at"`
|
|
}
|
|
|
|
type BrandQuestionVersion struct {
|
|
ID int64 `json:"id"`
|
|
QuestionID int64 `json:"question_id"`
|
|
QuestionText string `json:"question_text"`
|
|
QuestionHash string `json:"question_hash"`
|
|
VersionNo int32 `json:"version_no"`
|
|
IsActive bool `json:"is_active"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_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 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 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 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 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"`
|
|
}
|
|
|
|
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 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 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"`
|
|
}
|