data

package
v0.0.0-...-2e8b363 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 30, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

internal/data/goods_aweme.go

internal/data/goods_blogger.go

internal/data/goods_portrayal.go

internal/data/goods_trend.go

Index

Constants

View Source
const (
	DataTypeVideoRank                  = "video_rank"
	DataTypeVideoDetail                = "video_detail"
	DataTypeVideoSummaryHeadless       = "video_summary_headless"
	DataTypeVideoTrendHeadless         = "video_trend_headless"
	DataTypeGoodsAwemeAnalysisHeadless = "goods_aweme_analysis_headless"
	DataTypeGoodsChartDataHeadless     = "goods_chart_data_headless"
	DataTypeGoodsPortrayalHeadless     = "goods_portrayal_headless"
)

在这里定义data_type,全部地方都适用这里的定义

Variables

ProviderSet is data providers.

Functions

func CopyBloggerToDTO

func CopyBloggerToDTO(b *Blogger) *v1.BloggerDTO

CopyBloggerToDTO 将 data.Blogger 模型转换为 v1.BloggerDTO

func CopyProductToDTO

func CopyProductToDTO(p *Product) *v1.ProductDTO

CopyProductToDTO 将 data.Product 模型转换为 v1.ProductDTO

func CopySourceDataToDTO

func CopySourceDataToDTO(s *SourceData) *v1.SourceData

func CopyVideoRankToDTO

func CopyVideoRankToDTO(do *VideoRank) *v1.VideoRankDTO

func CopyVideoToDTO

func CopyVideoToDTO(v *Video) *v1.VideoDTO

CopyVideoToDTO 将 data.Video 模型转换为 v1.VideoDTO

func CopyVideoTrendToDTO

func CopyVideoTrendToDTO(vt *VideoTrend) *v1.VideoTrendDTO

CopyVideoTrendToDTO 将 data.VideoTrend 模型转换为 v1.VideoTrendDTO

func NewRedisClient

func NewRedisClient(conf *conf.Data) redis.Cmdable

NewRedisClient 初始化 Redis 客户端

Types

type Blogger

type Blogger struct {
	BloggerId        int64     `gorm:"primaryKey"`
	CreatedAt        time.Time `gorm:"autoCreateTime;type:timestamp"`
	UpdatedAt        time.Time `gorm:"autoUpdateTime;type:timestamp"`
	BloggerUid       string    `gorm:"size:255;index"`
	BloggerName      string    `gorm:"size:255"`
	BloggerAvatar    string    `gorm:"size:1024"`
	BloggerFansNum   int64
	BloggerTag       string `gorm:"size:255"`
	BloggerDetailUrl string `gorm:"column:blogger_detail_url;size:1024;not null;default:''"`
}

Blogger 博主维度表

func (Blogger) TableName

func (Blogger) TableName() string

type BloggerRepo

type BloggerRepo interface {
	Upsert(ctx context.Context, blogger *Blogger) error
	ListPage(ctx context.Context, page, size int, query, sortBy string, sortOrder v1.SortOrder) ([]*Blogger, int64, error)
	Get(ctx context.Context, bloggerId int64) (*Blogger, error) // 新增此行
}

func NewBloggerRepo

func NewBloggerRepo(data *Data) BloggerRepo

type Data

type Data struct {
	Logger      *log.Helper
	DataSources []*conf.DataSource // assume this exists
	// contains filtered or unexported fields
}

Data .

func NewData

func NewData(c *conf.Data, redisClient redis.Cmdable, logger log.Logger) (*Data, func(), error)

NewData .

type GoodsAweme

type GoodsAweme struct {
	Id                int64     `gorm:"primarykey;autoIncrement"`
	GoodsId           string    `gorm:"column:goods_id;size:255;not null;index"`
	AwemeId           string    `gorm:"column:aweme_id;size:255;not null;uniqueIndex:idx_goods_aweme"`
	BloggerId         int64     `gorm:"column:blogger_id;not null"`
	AwemePubTime      time.Time `gorm:"column:aweme_pub_time"`
	AwemeDesc         string    `gorm:"column:aweme_desc;type:text"`
	AwemeCoverUrl     string    `gorm:"column:aweme_cover_url;size:1024"`
	AwemeDetailUrl    string    `gorm:"column:aweme_detail_url;size:1024"`
	AwemeSaleCountStr string    `gorm:"column:aweme_sale_count_str;size:255"`
	AwemeSaleGmvStr   string    `gorm:"column:aweme_sale_gmv_str;size:255"`
	LikeCountStr      string    `gorm:"column:like_count_str;size:255"`
	CommentCountStr   string    `gorm:"column:comment_count_str;size:255"`
	ShareCountStr     string    `gorm:"column:share_count_str;size:255"`
	PlayCountStr      string    `gorm:"column:play_count_str;size:255"`
	CollectCountStr   string    `gorm:"column:collect_count_str;size:255"`
	GPM               string    `gorm:"column:gpm;size:255"`
	CreatedAt         time.Time `gorm:"column:created_at"`
	UpdatedAt         time.Time `gorm:"column:updated_at"`
}

GoodsAweme 对应 /api/v3/goods/aweme/loadAwemeAnalysis 接口返回的 Items

func (*GoodsAweme) TableName

func (ga *GoodsAweme) TableName() string

type GoodsAwemeRepo

type GoodsAwemeRepo interface {
	BatchCreate(ctx context.Context, awemes []*GoodsAweme) error
	List(ctx context.Context, req *v1.ListGoodsAwemesRequest) ([]*GoodsAweme, int64, error)
}

func NewGoodsAwemeRepo

func NewGoodsAwemeRepo(data *Data, logger log.Logger) GoodsAwemeRepo

type GoodsBlogger

type GoodsBlogger struct {
	Id int64 `gorm:"primarykey;autoIncrement"`
	// 复合唯一索引,确保一个商品只关联一个达人一次
	GoodsId   string `gorm:"column:goods_id;size:255;not null;uniqueIndex:idx_goods_blogger"`
	BloggerId int64  `gorm:"column:blogger_id;not null;uniqueIndex:idx_goods_blogger"`

	// --- 达人冗余信息 ---
	BloggerUid    string `gorm:"size:255"`
	BloggerName   string `gorm:"size:255"`
	BloggerAvatar string `gorm:"size:1024"`
	FansNum       int64
	Tag           string `gorm:"size:255"`

	// --- 视频带货聚合数据 ---
	AwemeCountStr     string `gorm:"column:aweme_count_str;size:255"` // 视频数量
	AwemeSaleCountStr string `gorm:"column:aweme_sale_count_str;size:255"`
	AwemeSaleGmvStr   string `gorm:"column:aweme_sale_gmv_str;size:255"`

	CreatedAt time.Time `gorm:"column:created_at"`
	UpdatedAt time.Time `gorm:"column:updated_at"`
}

GoodsBlogger 存储商品和达人的关联关系,并冗余达人核心信息

func (*GoodsBlogger) TableName

func (gb *GoodsBlogger) TableName() string

type GoodsBloggerRepo

type GoodsBloggerRepo interface {
	BatchUpsert(ctx context.Context, goodsBloggers []*GoodsBlogger) error
}

func NewGoodsBloggerRepo

func NewGoodsBloggerRepo(data *Data) GoodsBloggerRepo

type GoodsPortrayal

type GoodsPortrayal struct {
	Id            int64     `gorm:"primaryKey"`
	CreatedAt     time.Time `gorm:"autoCreateTime"`
	UpdatedAt     time.Time `gorm:"autoUpdateTime"`
	GoodsId       string    `gorm:"size:255;not null;uniqueIndex"`
	PortrayalData JSONB     `gorm:"type:jsonb"` // 使用 JSONB 类型
}

GoodsPortrayal 存储完整的用户画像数据

func (GoodsPortrayal) TableName

func (GoodsPortrayal) TableName() string

type GoodsPortrayalRepo

type GoodsPortrayalRepo interface {
	CreateOrUpdate(ctx context.Context, portrayal *GoodsPortrayal) error
	GetByGID(ctx context.Context, gid string) (*GoodsPortrayal, error) // <--- 新增方法
}

func NewGoodsPortrayalRepo

func NewGoodsPortrayalRepo(data *Data) GoodsPortrayalRepo

type GoodsTrend

type GoodsTrend struct {
	Id                int64     `gorm:"primaryKey"`
	CreatedAt         time.Time `gorm:"autoCreateTime;type:timestamp"`
	UpdatedAt         time.Time `gorm:"autoUpdateTime;type:timestamp"`
	GoodsId           string    `gorm:"size:255;not null;index:idx_goods_date,unique"`
	DateCode          int       `gorm:"not null;index:idx_goods_date,unique"`
	AwemeCount        int64
	AwemeCountStr     string `gorm:"size:255"`
	BloggerCount      int64
	BloggerCountStr   string `gorm:"size:255"`
	AwemeSaleGmv      float64
	AwemeSaleGmvStr   string `gorm:"size:255"`
	AwemeSaleCount    int64
	AwemeSaleCountStr string `gorm:"size:255"`
	ListTimeStr       string `gorm:"size:255"`
	TimeStamp         int64
}

GoodsTrend 存储商品每日的带货趋势数据

func (GoodsTrend) TableName

func (GoodsTrend) TableName() string

type GoodsTrendRepo

type GoodsTrendRepo interface {
	BatchOverwrite(ctx context.Context, trends []*GoodsTrend) error
	List(ctx context.Context, req *v1.ListGoodsTrendsRequest) ([]*GoodsTrend, int64, error)
}

func NewGoodsTrendRepo

func NewGoodsTrendRepo(data *Data) GoodsTrendRepo

type JSONB

type JSONB json.RawMessage

JSONB a custom type for handling JSONB data

func (*JSONB) Scan

func (j *JSONB) Scan(value interface{}) error

func (JSONB) Value

func (j JSONB) Value() (driver.Value, error)

type Product

type Product struct {
	GoodsId   string    `gorm:"primaryKey;size:1024"`
	CreatedAt time.Time `gorm:"autoCreateTime;type:timestamp"`
	UpdatedAt time.Time `gorm:"autoUpdateTime;type:timestamp"`

	GoodsTitle      string  `gorm:"type:text"`
	GoodsCoverUrl   string  `gorm:"size:1024"`
	GoodsPriceRange string  `gorm:"size:255"`
	GoodsPrice      float64 `gorm:"type:numeric"`
	CosRatio        string  `gorm:"size:255"`
	CommissionPrice string  `gorm:"size:255"`
	ShopName        string  `gorm:"size:255"`
	BrandName       string  `gorm:"size:255"`
	CategoryNames   string  `gorm:"size:1024"`

	GoodsDetailUrl string `gorm:"column:goods_detail_url;size:1024;not null;default:''"`

	// Summary from /api/v3/goods/aweme/loadAwemeAnalysis
	AwemeCount        int64  `gorm:"column:aweme_count;not null;default:0"`
	BloggerCount      int64  `gorm:"column:blogger_count;not null;default:0"`
	AwemeSaleCountStr string `gorm:"column:aweme_sale_count_str;size:255;not null;default:''"`
	AwemeSaleGmvStr   string `gorm:"column:aweme_sale_gmv_str;size:255;not null;default:''"`

	// Summary from /api/v3/goods/blogger/list
	RelatedBloggerCountStr string `gorm:"column:related_blogger_count_str;size:255;not null;default:''"`
	BloggerSaleCountStr    string `gorm:"column:blogger_sale_count_str;size:255;not null;default:''"`
	BloggerSaleGmvStr      string `gorm:"column:blogger_sale_gmv_str;size:255;not null;default:''"`
}

Product 商品维度表

func (Product) TableName

func (Product) TableName() string

type ProductForCollection

type ProductForCollection struct {
	GoodsId        string
	GoodsDetailUrl string
}

type ProductRepo

type ProductRepo interface {
	Upsert(ctx context.Context, product *Product) error
	ListPage(ctx context.Context, page, size int, query, sortBy string, sortOrder v1.SortOrder) ([]*Product, int64, error)
	Get(ctx context.Context, goodsId string) (*Product, error)
	UpdateSummary(ctx context.Context, gid string, summary *Product) error
	FindProductsForCollection(ctx context.Context, limit int) ([]*ProductForCollection, error)
	FindProductsExcludingGIDs(ctx context.Context, excludeGIDs []string, limit int) ([]*ProductForCollection, error)
}

func NewProductRepo

func NewProductRepo(data *Data) ProductRepo

type SourceData

type SourceData struct {
	ID            int64     `gorm:"primaryKey"`
	ProviderName  string    `gorm:"type:varchar(255);not null;index"`
	DataType      string    `gorm:"type:varchar(255);not null;index"`
	EntityId      string    `gorm:"type:varchar(255);index"`  // 可选,关联的主要实体ID,不同的数据类型可能有不同的ID
	Status        int32     `gorm:"not null;default:0;index"` // 0: unprocessed, 1: processed, -1: error
	FetchedAt     time.Time `gorm:"autoCreateTime;type:timestamp"`
	Date          string    `gorm:"type:varchar(10);not null;index"`
	RawContent    string    `gorm:"type:text"`
	ProcessingLog string    `gorm:"type:text"`          // 存储ETL处理过程中的错误信息
	Retries       int       `gorm:"not null;default:0"` // 重试次数

	// --- 新增的请求上下文元数据 ---
	RequestMethod  string `gorm:"type:varchar(10)"` // "GET", "POST", etc.
	RequestUrl     string `gorm:"type:text"`
	RequestParams  string `gorm:"type:text"` // 存储 Query 或 Body 的 JSON 字符串
	RequestHeaders string `gorm:"type:text"` // 存储请求头的 JSON 字符串
}

SourceData is the GORM model for storing raw data from various providers. It is the Data Object (DO). SourceData is the GORM model for storing raw data from various providers.

func CopySourceDataToDO

func CopySourceDataToDO(s *v1.SourceData) *SourceData

Save 实现了biz层的接口,负责将数据写入数据库

func (SourceData) TableName

func (SourceData) TableName() string

type SourceDataRepo

type SourceDataRepo interface {
	Save(context.Context, *v1.SourceData) (*v1.SourceData, error)
	UpdateStatus(ctx context.Context, id int64, status int32) error

	FindUnprocessed(ctx context.Context, dataType string) ([]*v1.SourceData, error)
	// UpdateStatusAndLog 原子性地更新状态和处理日志
	UpdateStatusAndLog(ctx context.Context, id int64, status int32, log string) error
	// FindPartiallyCollectedEntityIDs 查找在指定时间后,只采集了部分数据类型的实体ID列表。
	FindPartiallyCollectedEntityIDs(ctx context.Context, since time.Time, dataTypes []string) ([]string, error)
	ListAllCollectedEntityIDs(ctx context.Context, dataTypes []string) ([]string, error)
	// FindLatestByTypeAndEntityID 根据类型和实体ID查找最新的源数据记录
	FindLatestByTypeAndEntityID(ctx context.Context, dataType string, entityId string) (*SourceData, error)
}

SourceDataRepo 是Biz层依赖的Data层接口,由 data/source_data.go 实现

func NewSourceDataRepo

func NewSourceDataRepo(data *Data, logger log.Logger) SourceDataRepo

NewSourceDataRepo .

type Video

type Video struct {
	AwemeId   string    `gorm:"primaryKey;size:1024"`
	CreatedAt time.Time `gorm:"autoCreateTime;type:timestamp"`
	UpdatedAt time.Time `gorm:"autoUpdateTime;type:timestamp"`

	// --- 基础信息 ---
	AwemeDesc      string    `gorm:"type:text"`
	AwemeCoverUrl  string    `gorm:"size:1024"`
	AwemePubTime   time.Time `gorm:"type:timestamp"`
	AwemeShareUrl  string    `gorm:"size:1024"`
	AwemeDetailUrl string    `gorm:"size:1024"`
	BloggerId      int64     `gorm:"index"`

	PlayCountStr       string `gorm:"size:255"`
	LikeCountStr       string `gorm:"size:255"`
	CommentCountStr    string `gorm:"size:255"`
	ShareCountStr      string `gorm:"size:255"`
	CollectCountStr    string `gorm:"size:255"`
	InteractionRateStr string `gorm:"size:255"`
	ScoreStr           string `gorm:"size:255;comment:视频分数"`
	LikeCommentRateStr string `gorm:"size:255"`
	SalesGmvStr        string `gorm:"size:255"`
	SalesCountStr      string `gorm:"size:255"`
	GoodsCountStr      string `gorm:"size:255"`
	GpmStr             string `gorm:"size:255;column:gpm_str"` // 明确指定列名
	AwemeType          int32  `gorm:"type:integer"`
	GoodsId            string `gorm:"size:255;comment:商品ID"`

	// --- 详情信息 (来自下钻采集) 暂时用不上 ---
	DyTagsJSON          string `gorm:"type:text"`
	HotSearchWordsJSON  string `gorm:"type:text"`
	TopicsJSON          string `gorm:"type:text"`
	CommentSegmentsJSON string `gorm:"type:text"`
	InteractionJSON     string `gorm:"type:text"`
	AudienceProfileJSON string `gorm:"type:text"`

	//
	SummaryUpdatedAt *time.Time `gorm:"index;comment:总览数据更新时间;type:timestamp"`
	TrendUpdatedAt   *time.Time `gorm:"index;comment:趋势数据更新时间;type:timestamp"`
	CollectionStatus int32      `gorm:"comment:采集状态"`
}

Video 视频维度表

func (Video) TableName

func (Video) TableName() string

type VideoForCollection

type VideoForCollection struct {
	AwemeId        string
	AwemePubTime   time.Time
	AwemeDetailUrl string
}

VideoForCollection 是为采集任务准备的结构体

type VideoForSummary

type VideoForSummary struct {
	AwemeId      string
	AwemePubTime time.Time `gorm:"type:timestamp"`
}

VideoForSummary 定义了用于下钻采集的视频基础信息

type VideoRank

type VideoRank struct {
	ID        uint      `gorm:"primaryKey"`
	CreatedAt time.Time `gorm:"autoCreateTime;type:timestamp"`

	PeriodType string `gorm:"column:period_type;size:1024;not null"`
	RankDate   string `gorm:"column:rank_date;size:1024;not null"`
	StartDate  string `gorm:"column:start_date;size:1024;not null;default:''"`
	EndDate    string `gorm:"column:end_date;size:1024;not null;default:''"`

	// 视频信息
	AwemeId        string    `gorm:"column:aweme_id;size:1024;not null"`
	AwemeCoverUrl  string    `gorm:"column:aweme_cover_url;size:1024;not null;default:''"`
	AwemeDesc      string    `gorm:"column:aweme_desc;type:text;not null;default:''"`
	AwemePubTime   time.Time `gorm:"column:aweme_pub_time;type:timestamp"`
	AwemeShareUrl  string    `gorm:"column:aweme_share_url;size:1024;not null;default:''"`
	DurationStr    string    `gorm:"column:duration_str;size:1024;not null;default:''"`
	AwemeScoreStr  string    `gorm:"column:aweme_score_str;size:1024;not null;default:''"`
	AwemeDetailUrl string    `gorm:"column:aweme_detail_url;size:1024;not null;default:''"`

	// 商品信息
	GoodsId         string  `gorm:"column:goods_id;size:1024;not null"`
	GoodsTitle      string  `gorm:"column:goods_title;type:text;not null;default:''"`
	GoodsCoverUrl   string  `gorm:"column:goods_cover_url;size:1024;not null;default:''"`
	GoodsPriceRange string  `gorm:"column:goods_price_range;size:1024;not null;default:''"`
	GoodsPrice      float64 `gorm:"column:goods_price"`
	CosRatio        string  `gorm:"column:cos_ratio;size:1024;not null;default:''"`
	CommissionPrice string  `gorm:"column:commission_price;size:1024;not null;default:''"`
	ShopName        string  `gorm:"column:shop_name;size:1024;not null;default:''"`
	BrandName       string  `gorm:"column:brand_name;size:1024;not null;default:''"`
	CategoryNames   string  `gorm:"column:category_names;size:1024;not null;default:''"`

	// 博主信息
	BloggerId      int    `gorm:"column:blogger_id;not null"`
	BloggerUid     string `gorm:"column:blogger_uid;size:1024;not null;default:''"`
	BloggerName    string `gorm:"column:blogger_name;size:1024;not null;default:''"`
	BloggerAvatar  string `gorm:"column:blogger_avatar;size:1024;not null;default:''"`
	BloggerFansNum int    `gorm:"column:blogger_fans_num;not null;default:0"`
	BloggerTag     string `gorm:"column:blogger_tag;size:1024;not null;default:''"`

	// 榜单统计
	SalesCountStr   string `gorm:"column:sales_count_str;size:1024;not null;default:''"`
	TotalSalesStr   string `gorm:"column:total_sales_str;size:1024;not null;default:''"`
	LikeCountIncStr string `gorm:"column:like_count_inc_str;size:1024;not null;default:''"`
	PlayCountIncStr string `gorm:"column:play_count_inc_str;size:1024;not null;default:''"`

	SalesCountLow  int64 `gorm:"column:sales_count_low;comment:销量范围低值"`
	SalesCountHigh int64 `gorm:"column:sales_count_high;comment:销量范围高值"`
	TotalSalesLow  int64 `gorm:"column:total_sales_low;comment:销售额范围低值(分)"`
	TotalSalesHigh int64 `gorm:"column:total_sales_high;comment:销售额范围高值(分)"`
}

VideoRank is the GORM model for storing video ranking data.

type VideoRankRepo

type VideoRankRepo interface {
	// 批量创建视频榜单记录
	BatchCreate(ctx context.Context, ranks []*v1.VideoRankDTO) error
	// 查询单个视频榜单
	GetByAwemeID(ctx context.Context, awemeID, rankType, rankDate string) (*v1.VideoRankDTO, error)
	// 分页查询视频榜单
	ListPage(ctx context.Context, page, size int, rankType, rankDate, sortBy string, sortOrder v1.SortOrder) ([]*v1.VideoRankDTO, int64, error)
	// GetDistinctAwemeIDsByDate 获取指定日期之后上过榜的、不重复的视频ID
	GetDistinctAwemeIDsByDate(ctx context.Context, sinceDate string) ([]string, error)
}

VideoRankRepo defines the interface for batch creation of VideoRank records. VideoRankRepo 定义了视频榜单数据的持久化接口。

func NewVideoRankRepo

func NewVideoRankRepo(db *Data) VideoRankRepo

NewVideoRankRepo creates a new VideoRankRepo.

type VideoRepo

type VideoRepo interface {
	SaveSourceData(context.Context, *v1.SourceData) (*v1.SourceData, error)
	FindVideosByIDs(ctx context.Context, awemeIDs []string, limit int) ([]*VideoForCollection, error)
	UpsertFromRank(ctx context.Context, video *Video) error
	UpdateFromSummary(ctx context.Context, video *Video) error
	FindVideosNeedingSummaryUpdate(ctx context.Context, limit int) ([]*VideoForSummary, error)
	ListPage(ctx context.Context, page, size int, query, sortBy string, sortOrder v1.SortOrder) ([]*Video, int64, error)
	Get(ctx context.Context, awemeId string) (*Video, error)
	FindRecentActiveAwemeIds(ctx context.Context, days int) ([]string, error)
	//FindVideosNeedingTrendUpdate(ctx context.Context, limit int) ([]*VideoForTrend, error)
	FindVideosForDetailsCollection(ctx context.Context, limit int) ([]*VideoForCollection, error)
	UpdateTrendTimestamp(ctx context.Context, awemeId string) error
	FindVideosExcludingIDs(ctx context.Context, ids []string, limit int) ([]*VideoForCollection, error)

} // End of VideoRepo interface

func NewVideoRepo

func NewVideoRepo(data *Data) VideoRepo

type VideoTrend

type VideoTrend struct {
	Id                 int64     `gorm:"primaryKey"`
	CreatedAt          time.Time `gorm:"autoCreateTime;type:timestamp"`
	UpdatedAt          time.Time `gorm:"autoUpdateTime;type:timestamp"`
	AwemeId            string    `gorm:"size:255;not null;"` // 视频ID
	DateCode           int       `gorm:"not null;"`          // 数据日期
	LikeCount          int64
	LikeCountStr       string `gorm:"size:20"`
	ShareCount         int64
	ShareCountStr      string `gorm:"size:20"`
	CommentCount       int64
	CommentCountStr    string `gorm:"size:20"`
	CollectCount       int64
	CollectCountStr    string `gorm:"size:20"`
	InteractionRate    float64
	InteractionRateStr string `gorm:"size:20"`
	IncLikeCount       int64
	IncLikeCountStr    string `gorm:"size:20"`
	IncShareCount      int64
	IncShareCountStr   string `gorm:"size:20"`
	IncCommentCount    int64
	IncCommentCountStr string `gorm:"size:20"`
	IncCollectCount    int64
	IncCollectCountStr string `gorm:"size:20"`
	SalesCount         int64
	SalesCountStr      string `gorm:"size:20"`
	SalesGmv           float64
	SalesGmvStr        string `gorm:"size:20"`
	Fans               int64
	FansStr            string `gorm:"size:20"`
	IncSalesCount      int64
	IncSalesCountStr   string `gorm:"size:20"`
	IncSalesGmv        float64
	IncSalesGmvStr     string `gorm:"size:20"`
	IncFans            int64
	IncFansStr         string `gorm:"size:20"`
	Gpm                float64
	GpmStr             string `gorm:"size:20"`
	ListTimeStr        string `gorm:"size:20"`
	TimeStamp          int64
}

VideoTrend 视频每日趋势数据模型

type VideoTrendRepo

type VideoTrendRepo interface {
	BatchUpsert(ctx context.Context, trends []*VideoTrend) error
	ListPage(ctx context.Context, page, size int, awemeId, startDate, endDate string) ([]*VideoTrend, int64, error)
	BatchOverwrite(ctx context.Context, trends []*VideoTrend) error
}

VideoTrendRepo 定义视频趋势数据仓库接口

func NewVideoTrendRepo

func NewVideoTrendRepo(data *Data) VideoTrendRepo

NewVideoTrendRepo .

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL