package intimate import ( "database/sql" "reflect" "github.com/474420502/hunter" "github.com/tidwall/gjson" ) type ISetAnchorInfo interface { SetUid(int64) // SetPlatform(string) // SetAnchorId(string) // SetAnchorName(string) // SetLiveUrl(sql.NullString) // SetChannel(sql.NullString) // SetTags(interface{}) // SetExt(interface{}) // SetUpdateTime(sql.NullTime) // } type IGetAnchorInfo interface { GetUid() int64 // GetPlatform() string // GetAnchorId() string // GetAnchorName() string // GetLiveUrl() sql.NullString // GetChannel() sql.NullString // GetTags() interface{} GetExt() interface{} // GetUpdateTime() sql.NullTime // } type AnchorInfo struct { Uid int64 // Platform string // AnchorId string // AnchorName string // LiveUrl sql.NullString // Channel sql.NullString // Tags interface{} Ext interface{} // UpdateTime sql.NullTime // } // Set Simple Value func (ai *AnchorInfo) Set(field string, value interface{}) { reflect.ValueOf(ai).Elem().FieldByName(field).Set(reflect.ValueOf(value)) } // GetTags Get return Tags interface{} func (ai *AnchorInfo) GetTags() interface{} { return ai.Tags } // SetTags Set Tags interface{} func (ai *AnchorInfo) SetTags(Tags interface{}) { ai.Tags = Tags } // GetUpdateTime Get return UpdateTime time.Time func (ai *AnchorInfo) GetUpdateTime() sql.NullTime { return ai.UpdateTime } // SetUpdateTime Set UpdateTime time.Time func (ai *AnchorInfo) SetUpdateTime(UpdateTime sql.NullTime) { ai.UpdateTime = UpdateTime } // GetExt Get return Ext interface{} func (ai *AnchorInfo) GetExt() interface{} { return ai.Ext } // SetExt Set Ext interface{} func (ai *AnchorInfo) SetExt(Ext interface{}) { ai.Ext = Ext } // GetChannel Get return Channel sql.NullString func (ai *AnchorInfo) GetChannel() sql.NullString { return ai.Channel } // SetChannel Set Channel sql.NullString func (ai *AnchorInfo) SetChannel(Channel sql.NullString) { ai.Channel = Channel } // GetLiveUrl Get return LiveUrl sql.NullString func (ai *AnchorInfo) GetLiveUrl() sql.NullString { return ai.LiveUrl } // SetLiveUrl Set LiveUrl sql.NullString func (ai *AnchorInfo) SetLiveUrl(LiveUrl sql.NullString) { ai.LiveUrl = LiveUrl } // GetAnchorName Get return AnchorName string func (ai *AnchorInfo) GetAnchorName() string { return ai.AnchorName } // SetAnchorName Set AnchorName string func (ai *AnchorInfo) SetAnchorName(AnchorName string) { ai.AnchorName = AnchorName } // GetAnchorId Get return AnchorId string func (ai *AnchorInfo) GetAnchorId() string { return ai.AnchorId } // SetAnchorId Set AnchorId string func (ai *AnchorInfo) SetAnchorId(AnchorId string) { ai.AnchorId = AnchorId } // GetPlatform Get return Platform string func (ai *AnchorInfo) GetPlatform() string { return ai.Platform } // SetPlatform Set Platform string func (ai *AnchorInfo) SetPlatform(Platform string) { ai.Platform = Platform } // GetUid Get return Uid int64 func (ai *AnchorInfo) GetUid() int64 { return ai.Uid } // SetUid Set Uid int64 func (ai *AnchorInfo) SetUid(Uid int64) { ai.Uid = Uid } type IGetCollectLog interface { GetUid() int64 // GetPlatform() string // GetAnchorId() string // GetIsLiveStreaming() int32 // GetIsError() int32 // GetFollowers() sql.NullInt64 // GetViews() sql.NullInt64 // GetGiver() interface{} // GetGratuity() sql.NullInt64 // GetLiveTitle() sql.NullString // GetLiveStartTime() sql.NullTime // GetLiveEndTime() sql.NullTime // GetUpdateTime() sql.NullTime // GetTags() interface{} // GetExt() interface{} // GetErrorMsg() sql.NullString // } type ISetCollectLog interface { SetUid(int64) // SetPlatform(string) // SetAnchorId(string) // SetIsLiveStreaming(int32) // SetIsError(int32) // SetFollowers(sql.NullInt64) // SetViews(sql.NullInt64) // SetGiver(interface{}) // SetGratuity(sql.NullInt64) // SetLiveTitle(sql.NullString) // SetLiveStartTime(sql.NullTime) // SetLiveEndTime(sql.NullTime) // SetUpdateTime(sql.NullTime) // SetTags(interface{}) // SetExt(interface{}) // SetErrorMsg(sql.NullString) // } type CollectLog struct { Uid int64 // Platform string // AnchorId string // IsLiveStreaming int32 // IsError int32 // Followers sql.NullInt64 // Views sql.NullInt64 // Giver interface{} // Gratuity sql.NullInt64 // LiveTitle sql.NullString // LiveStartTime sql.NullTime // LiveEndTime sql.NullTime // UpdateTime sql.NullTime // Tags interface{} Ext interface{} // ErrorMsg sql.NullString // } // Set Simple Value func (cl *CollectLog) Set(field string, value interface{}) { reflect.ValueOf(cl).Elem().FieldByName(field).Set(reflect.ValueOf(value)) } // GetTags Get return Tags interface{} func (cl *CollectLog) GetTags() interface{} { return cl.Tags } // SetTags Set Tags interface{} func (cl *CollectLog) SetTags(Tags interface{}) { cl.Tags = Tags } // GetErrorMsg Get return Error sql.NullString func (cl *CollectLog) GetErrorMsg() sql.NullString { return cl.ErrorMsg } // SetErrorMsg Set Error sql.NullString func (cl *CollectLog) SetErrorMsg(ErrorMsg sql.NullString) { cl.ErrorMsg = ErrorMsg } // GetExt Get return Ext interface{} func (cl *CollectLog) GetExt() interface{} { return cl.Ext } // SetExt Set Ext interface{} func (cl *CollectLog) SetExt(Ext interface{}) { cl.Ext = Ext } // GetUpdateTime Get return UpdateTime time.Time func (cl *CollectLog) GetUpdateTime() sql.NullTime { return cl.UpdateTime } // SetUpdateTime Set UpdateTime time.Time func (cl *CollectLog) SetUpdateTime(UpdateTime sql.NullTime) { cl.UpdateTime = UpdateTime } // GetLiveEndTime Get return ShowEndTime sql.NullTime func (cl *CollectLog) GetLiveEndTime() sql.NullTime { return cl.LiveEndTime } // SetLiveEndTime Set ShowEndTime sql.NullTime func (cl *CollectLog) SetLiveEndTime(ShowEndTime sql.NullTime) { cl.LiveEndTime = ShowEndTime } // GetLiveStartTime Get return ShowStartTime sql.NullTime func (cl *CollectLog) GetLiveStartTime() sql.NullTime { return cl.LiveStartTime } // SetLiveStartTime Set ShowStartTime sql.NullTime func (cl *CollectLog) SetLiveStartTime(ShowStartTime sql.NullTime) { cl.LiveStartTime = ShowStartTime } // GetLiveTitle Get return ShowTitle sql.NullString func (cl *CollectLog) GetLiveTitle() sql.NullString { return cl.LiveTitle } // SetLiveTitle Set ShowTitle sql.NullString func (cl *CollectLog) SetLiveTitle(ShowTitle sql.NullString) { cl.LiveTitle = ShowTitle } // GetGratuity Get return Gratuity sql.NullInt32 func (cl *CollectLog) GetGratuity() sql.NullInt64 { return cl.Gratuity } // SetGratuity Set Gratuity sql.NullInt32 func (cl *CollectLog) SetGratuity(Gratuity sql.NullInt64) { cl.Gratuity = Gratuity } // GetGiver Get return Giver interface{} func (cl *CollectLog) GetGiver() interface{} { return cl.Giver } // SetGiver Set Giver interface{} func (cl *CollectLog) SetGiver(Giver interface{}) { cl.Giver = Giver } // GetViews Get return Views sql.NullInt64 func (cl *CollectLog) GetViews() sql.NullInt64 { return cl.Views } // SetViews Set Views sql.NullInt64 func (cl *CollectLog) SetViews(Views sql.NullInt64) { cl.Views = Views } // GetFollowers Get return Followers sql.NullInt64 func (cl *CollectLog) GetFollowers() sql.NullInt64 { return cl.Followers } // SetFollowers Set Followers sql.NullInt32 func (cl *CollectLog) SetFollowers(Followers sql.NullInt64) { cl.Followers = Followers } // GetIsError Get return IsError int32 func (cl *CollectLog) GetIsError() int32 { return cl.IsError } // SetIsError Set IsError int32 func (cl *CollectLog) SetIsError(IsError int32) { cl.IsError = IsError } // GetIsLiveStreaming Get return IsShowing int32 func (cl *CollectLog) GetIsLiveStreaming() int32 { return cl.IsLiveStreaming } // SetIsLiveStreaming Set IsShowing int32 func (cl *CollectLog) SetIsLiveStreaming(IsLive int32) { cl.IsLiveStreaming = IsLive } // GetAnchorId Get return AnchorId string func (cl *CollectLog) GetAnchorId() string { return cl.AnchorId } // SetAnchorId Set AnchorId string func (cl *CollectLog) SetAnchorId(AnchorId string) { cl.AnchorId = AnchorId } // GetPlatform Get return Platform string func (cl *CollectLog) GetPlatform() string { return cl.Platform } // SetPlatform Set Platform string func (cl *CollectLog) SetPlatform(Platform string) { cl.Platform = Platform } // GetUid Get return Uid int64 func (cl *CollectLog) GetUid() int64 { return cl.Uid } // SetUid Set Uid int64 func (cl *CollectLog) SetUid(Uid int64) { cl.Uid = Uid } type ExtractorSource struct { source gjson.Result extractor *hunter.Extractor } func NewExtractorSource(gr gjson.Result) *ExtractorSource { es := &ExtractorSource{} es.source = gr return es } func (es *ExtractorSource) CreateExtractor() { es.extractor = hunter.NewExtractor([]byte(es.source.Str)) } func (es *ExtractorSource) GetSource() gjson.Result { return es.source } func (es *ExtractorSource) GetExtractor() *hunter.Extractor { return es.extractor }