feat: 部署初版测试
This commit is contained in:
16
server/internal/model/competitor_monitor.go
Normal file
16
server/internal/model/competitor_monitor.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
type CompetitorMonitor struct {
|
||||
ID uuid.UUID `gorm:"type:uuid;primary_key;default:gen_random_uuid()" json:"id"`
|
||||
UserID uuid.UUID `gorm:"type:uuid;not null;uniqueIndex:idx_user_competitor" json:"user_id"`
|
||||
BrandName string `gorm:"type:varchar(255);not null;uniqueIndex:idx_user_competitor" json:"brand_name"`
|
||||
XHandle string `gorm:"type:varchar(255)" json:"x_handle"`
|
||||
IsActive bool `gorm:"default:true" json:"is_active"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
}
|
||||
18
server/internal/model/generated_reply.go
Normal file
18
server/internal/model/generated_reply.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
type GeneratedReply struct {
|
||||
ID uuid.UUID `gorm:"type:uuid;primary_key;default:gen_random_uuid()" json:"id"`
|
||||
UserID uuid.UUID `gorm:"type:uuid;not null;index:idx_generated_replies_user_id" json:"user_id"`
|
||||
TweetID uuid.UUID `gorm:"type:uuid;not null;index:idx_generated_replies_tweet_id" json:"tweet_id"`
|
||||
StrategyType string `gorm:"type:varchar(100);not null" json:"strategy_type"`
|
||||
Content string `gorm:"type:text;not null" json:"content"`
|
||||
Status string `gorm:"type:varchar(50);default:'draft'" json:"status"` // draft, copied, posted
|
||||
Language string `gorm:"type:varchar(10);default:'en'" json:"language"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
}
|
||||
17
server/internal/model/reply_performance.go
Normal file
17
server/internal/model/reply_performance.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
type ReplyPerformance struct {
|
||||
ID uuid.UUID `gorm:"type:uuid;primary_key;default:gen_random_uuid()" json:"id"`
|
||||
ReplyID uuid.UUID `gorm:"type:uuid;not null;index:idx_reply_performance_reply_id" json:"reply_id"`
|
||||
UserID uuid.UUID `gorm:"type:uuid;not null;index:idx_reply_performance_user_id" json:"user_id"`
|
||||
LikeCountIncrease int `gorm:"default:0" json:"like_count_increase"`
|
||||
ReplyCountIncrease int `gorm:"default:0" json:"reply_count_increase"`
|
||||
InteractionRate float64 `gorm:"default:0.0" json:"interaction_rate"`
|
||||
CheckTime time.Time `json:"check_time"`
|
||||
}
|
||||
24
server/internal/model/tweet.go
Normal file
24
server/internal/model/tweet.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
type Tweet struct {
|
||||
ID uuid.UUID `gorm:"type:uuid;primary_key;default:gen_random_uuid()" json:"id"`
|
||||
XTweetID string `gorm:"type:varchar(255);uniqueIndex:idx_tweets_x_tweet_id;not null" json:"x_tweet_id"`
|
||||
AuthorID string `gorm:"type:varchar(255)" json:"author_id"`
|
||||
AuthorHandle string `gorm:"type:varchar(255)" json:"author_handle"`
|
||||
Content string `gorm:"type:text;not null" json:"content"`
|
||||
PostedAt time.Time `json:"posted_at"`
|
||||
LikeCount int `gorm:"default:0" json:"like_count"`
|
||||
RetweetCount int `gorm:"default:0" json:"retweet_count"`
|
||||
ReplyCount int `gorm:"default:0" json:"reply_count"`
|
||||
HeatScore float64 `gorm:"default:0.0;index:idx_tweets_heat_score" json:"heat_score"`
|
||||
CrawlQueue string `gorm:"type:varchar(20);default:'normal';index:idx_tweets_crawl_queue" json:"crawl_queue"`
|
||||
IsProcessed bool `gorm:"default:false" json:"is_processed"`
|
||||
LastCrawledAt time.Time `gorm:"index:idx_tweets_crawl_queue" json:"last_crawled_at"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
}
|
||||
@@ -7,11 +7,12 @@ import (
|
||||
)
|
||||
|
||||
type User struct {
|
||||
ID uuid.UUID `gorm:"type:uuid;primary_key;default:gen_random_uuid()" json:"id"`
|
||||
Email string `gorm:"unique;not null" json:"email"`
|
||||
PasswordHash string `json:"-"`
|
||||
SubscriptionTier string `gorm:"default:'Free'" json:"subscription_tier"`
|
||||
IdentityLabel string `json:"identity_label"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
ID uuid.UUID `gorm:"type:uuid;primary_key;default:gen_random_uuid()" json:"id"`
|
||||
Email string `gorm:"unique;not null" json:"email"`
|
||||
PasswordHash string `json:"-"`
|
||||
SubscriptionTier string `gorm:"default:'Free'" json:"subscription_tier"`
|
||||
IdentityLabel string `json:"identity_label"`
|
||||
LanguagePreference string `gorm:"default:'auto'" json:"language_preference"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
21
server/internal/model/user_custom_strategy.go
Normal file
21
server/internal/model/user_custom_strategy.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
type UserCustomStrategy struct {
|
||||
ID uuid.UUID `gorm:"type:uuid;primary_key;default:gen_random_uuid()" json:"id"`
|
||||
UserID uuid.UUID `gorm:"type:uuid;not null;uniqueIndex:idx_user_strategy_key" json:"user_id"`
|
||||
StrategyKey string `gorm:"type:varchar(100);not null;uniqueIndex:idx_user_strategy_key" json:"strategy_key"`
|
||||
Label string `gorm:"type:varchar(255);not null" json:"label"`
|
||||
Icon string `gorm:"type:varchar(10)" json:"icon"`
|
||||
Description string `gorm:"type:text" json:"description"`
|
||||
PromptTemplate string `gorm:"type:text" json:"prompt_template"`
|
||||
FewShotExamples string `gorm:"type:jsonb;default:'[]'" json:"few_shot_examples"` // Stored as JSON string
|
||||
IsActive bool `gorm:"default:true" json:"is_active"`
|
||||
SortOrder int `gorm:"default:0" json:"sort_order"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
}
|
||||
26
server/internal/model/user_product_profile.go
Normal file
26
server/internal/model/user_product_profile.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
type UserProductProfile struct {
|
||||
ID uuid.UUID `gorm:"type:uuid;primary_key;default:gen_random_uuid()" json:"id"`
|
||||
UserID uuid.UUID `gorm:"type:uuid;unique;not null" json:"user_id"`
|
||||
ProductName string `gorm:"type:varchar(255)" json:"product_name"`
|
||||
Tagline string `gorm:"type:text" json:"tagline"`
|
||||
Domain string `gorm:"type:varchar(255)" json:"domain"`
|
||||
KeyFeatures string `gorm:"type:jsonb;default:'[]'" json:"key_features"` // Stored as JSON string
|
||||
TargetUsers string `gorm:"type:text" json:"target_users"`
|
||||
ProductUrl string `gorm:"type:varchar(500)" json:"product_url"`
|
||||
Competitors string `gorm:"type:jsonb;default:'[]'" json:"competitors"` // Stored as JSON string
|
||||
RelevanceKeywords string `gorm:"type:jsonb;default:'[]'" json:"relevance_keywords"` // Stored as JSON string
|
||||
CustomContext string `gorm:"type:text" json:"custom_context"`
|
||||
DefaultLLMProvider string `gorm:"type:varchar(50)" json:"default_llm_provider"` // User preferred LLM provider
|
||||
DefaultLLMModel string `gorm:"type:varchar(100)" json:"default_llm_model"` // User preferred LLM model
|
||||
IsActive bool `gorm:"default:true" json:"is_active"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
Reference in New Issue
Block a user