2020-07-10 08:13:08 +00:00
|
|
|
package intimate
|
|
|
|
|
|
|
|
import (
|
|
|
|
"database/sql"
|
2020-07-16 07:25:55 +00:00
|
|
|
"reflect"
|
|
|
|
|
|
|
|
"github.com/474420502/hunter"
|
|
|
|
"github.com/tidwall/gjson"
|
2020-07-10 08:13:08 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type ISetAnchorInfo interface {
|
2020-07-16 03:02:30 +00:00
|
|
|
SetUid(int64) //
|
|
|
|
SetPlatform(string) //
|
|
|
|
SetAnchorId(string) //
|
|
|
|
SetAnchorName(string) //
|
|
|
|
SetLiveUrl(sql.NullString) //
|
|
|
|
SetChannel(sql.NullString) //
|
|
|
|
SetTags(interface{}) //
|
|
|
|
SetExt(interface{}) //
|
|
|
|
SetUpdateTime(sql.NullTime) //
|
2020-07-10 08:13:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type IGetAnchorInfo interface {
|
2020-07-15 11:23:45 +00:00
|
|
|
GetUid() int64 //
|
|
|
|
GetPlatform() string //
|
|
|
|
GetAnchorId() string //
|
|
|
|
GetAnchorName() string //
|
|
|
|
GetLiveUrl() sql.NullString //
|
|
|
|
GetChannel() sql.NullString //
|
|
|
|
GetTags() interface{}
|
2020-07-16 03:02:30 +00:00
|
|
|
GetExt() interface{} //
|
|
|
|
GetUpdateTime() sql.NullTime //
|
2020-07-10 08:13:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type AnchorInfo struct {
|
|
|
|
Uid int64 //
|
|
|
|
Platform string //
|
|
|
|
AnchorId string //
|
|
|
|
AnchorName string //
|
|
|
|
LiveUrl sql.NullString //
|
|
|
|
Channel sql.NullString //
|
2020-07-15 11:23:45 +00:00
|
|
|
Tags interface{}
|
2020-07-16 03:02:30 +00:00
|
|
|
Ext interface{} //
|
|
|
|
UpdateTime sql.NullTime //
|
2020-07-15 11:23:45 +00:00
|
|
|
}
|
|
|
|
|
2020-07-16 07:25:55 +00:00
|
|
|
// Set Simple Value
|
|
|
|
func (ai *AnchorInfo) Set(field string, value interface{}) {
|
|
|
|
reflect.ValueOf(ai).Elem().FieldByName(field).Set(reflect.ValueOf(value))
|
|
|
|
}
|
|
|
|
|
2020-07-15 11:23:45 +00:00
|
|
|
// 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
|
2020-07-10 08:13:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// GetUpdateTime Get return UpdateTime time.Time
|
2020-07-16 03:02:30 +00:00
|
|
|
func (ai *AnchorInfo) GetUpdateTime() sql.NullTime {
|
2020-07-10 08:13:08 +00:00
|
|
|
return ai.UpdateTime
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetUpdateTime Set UpdateTime time.Time
|
2020-07-16 03:02:30 +00:00
|
|
|
func (ai *AnchorInfo) SetUpdateTime(UpdateTime sql.NullTime) {
|
2020-07-10 08:13:08 +00:00
|
|
|
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 //
|
2020-07-16 07:25:55 +00:00
|
|
|
GetIsLiveStreaming() int32 //
|
2020-07-10 08:13:08 +00:00
|
|
|
GetIsError() int32 //
|
2020-07-14 11:00:34 +00:00
|
|
|
GetFollowers() sql.NullInt64 //
|
|
|
|
GetViews() sql.NullInt64 //
|
2020-07-10 08:13:08 +00:00
|
|
|
GetGiver() interface{} //
|
2020-07-14 11:00:34 +00:00
|
|
|
GetGratuity() sql.NullInt64 //
|
2020-07-16 07:25:55 +00:00
|
|
|
GetLiveTitle() sql.NullString //
|
|
|
|
GetLiveStartTime() sql.NullTime //
|
|
|
|
GetLiveEndTime() sql.NullTime //
|
2020-07-14 11:00:34 +00:00
|
|
|
GetUpdateTime() sql.NullTime //
|
2020-07-15 11:23:45 +00:00
|
|
|
GetTags() interface{} //
|
2020-07-10 08:13:08 +00:00
|
|
|
GetExt() interface{} //
|
2020-07-10 10:31:17 +00:00
|
|
|
GetErrorMsg() sql.NullString //
|
2020-07-10 08:13:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type ISetCollectLog interface {
|
|
|
|
SetUid(int64) //
|
|
|
|
SetPlatform(string) //
|
|
|
|
SetAnchorId(string) //
|
2020-07-16 07:25:55 +00:00
|
|
|
SetIsLiveStreaming(int32) //
|
2020-07-10 08:13:08 +00:00
|
|
|
SetIsError(int32) //
|
2020-07-14 11:00:34 +00:00
|
|
|
SetFollowers(sql.NullInt64) //
|
|
|
|
SetViews(sql.NullInt64) //
|
2020-07-10 08:13:08 +00:00
|
|
|
SetGiver(interface{}) //
|
2020-07-14 11:00:34 +00:00
|
|
|
SetGratuity(sql.NullInt64) //
|
2020-07-16 07:25:55 +00:00
|
|
|
SetLiveTitle(sql.NullString) //
|
|
|
|
SetLiveStartTime(sql.NullTime) //
|
|
|
|
SetLiveEndTime(sql.NullTime) //
|
2020-07-14 11:00:34 +00:00
|
|
|
SetUpdateTime(sql.NullTime) //
|
2020-07-15 11:23:45 +00:00
|
|
|
SetTags(interface{}) //
|
2020-07-10 08:13:08 +00:00
|
|
|
SetExt(interface{}) //
|
2020-07-10 10:31:17 +00:00
|
|
|
SetErrorMsg(sql.NullString) //
|
2020-07-10 08:13:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type CollectLog struct {
|
2020-07-16 07:25:55 +00:00
|
|
|
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))
|
2020-07-10 08:13:08 +00:00
|
|
|
}
|
|
|
|
|
2020-07-15 11:23:45 +00:00
|
|
|
// 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
|
|
|
|
}
|
|
|
|
|
2020-07-10 10:31:17 +00:00
|
|
|
// GetErrorMsg Get return Error sql.NullString
|
|
|
|
func (cl *CollectLog) GetErrorMsg() sql.NullString {
|
|
|
|
return cl.ErrorMsg
|
2020-07-10 08:13:08 +00:00
|
|
|
}
|
|
|
|
|
2020-07-10 10:31:17 +00:00
|
|
|
// SetErrorMsg Set Error sql.NullString
|
|
|
|
func (cl *CollectLog) SetErrorMsg(ErrorMsg sql.NullString) {
|
|
|
|
cl.ErrorMsg = ErrorMsg
|
2020-07-10 08:13:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// 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
|
2020-07-14 11:00:34 +00:00
|
|
|
func (cl *CollectLog) GetUpdateTime() sql.NullTime {
|
2020-07-10 08:13:08 +00:00
|
|
|
return cl.UpdateTime
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetUpdateTime Set UpdateTime time.Time
|
2020-07-14 11:00:34 +00:00
|
|
|
func (cl *CollectLog) SetUpdateTime(UpdateTime sql.NullTime) {
|
2020-07-10 08:13:08 +00:00
|
|
|
cl.UpdateTime = UpdateTime
|
|
|
|
}
|
|
|
|
|
2020-07-16 07:25:55 +00:00
|
|
|
// GetLiveEndTime Get return ShowEndTime sql.NullTime
|
|
|
|
func (cl *CollectLog) GetLiveEndTime() sql.NullTime {
|
|
|
|
return cl.LiveEndTime
|
2020-07-10 08:13:08 +00:00
|
|
|
}
|
|
|
|
|
2020-07-16 07:25:55 +00:00
|
|
|
// SetLiveEndTime Set ShowEndTime sql.NullTime
|
|
|
|
func (cl *CollectLog) SetLiveEndTime(ShowEndTime sql.NullTime) {
|
|
|
|
cl.LiveEndTime = ShowEndTime
|
2020-07-10 08:13:08 +00:00
|
|
|
}
|
|
|
|
|
2020-07-16 07:25:55 +00:00
|
|
|
// GetLiveStartTime Get return ShowStartTime sql.NullTime
|
|
|
|
func (cl *CollectLog) GetLiveStartTime() sql.NullTime {
|
|
|
|
return cl.LiveStartTime
|
2020-07-10 08:13:08 +00:00
|
|
|
}
|
|
|
|
|
2020-07-16 07:25:55 +00:00
|
|
|
// SetLiveStartTime Set ShowStartTime sql.NullTime
|
|
|
|
func (cl *CollectLog) SetLiveStartTime(ShowStartTime sql.NullTime) {
|
|
|
|
cl.LiveStartTime = ShowStartTime
|
2020-07-10 08:13:08 +00:00
|
|
|
}
|
|
|
|
|
2020-07-16 07:25:55 +00:00
|
|
|
// GetLiveTitle Get return ShowTitle sql.NullString
|
|
|
|
func (cl *CollectLog) GetLiveTitle() sql.NullString {
|
|
|
|
return cl.LiveTitle
|
2020-07-10 08:13:08 +00:00
|
|
|
}
|
|
|
|
|
2020-07-16 07:25:55 +00:00
|
|
|
// SetLiveTitle Set ShowTitle sql.NullString
|
|
|
|
func (cl *CollectLog) SetLiveTitle(ShowTitle sql.NullString) {
|
|
|
|
cl.LiveTitle = ShowTitle
|
2020-07-10 08:13:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// GetGratuity Get return Gratuity sql.NullInt32
|
2020-07-14 11:00:34 +00:00
|
|
|
func (cl *CollectLog) GetGratuity() sql.NullInt64 {
|
2020-07-10 08:13:08 +00:00
|
|
|
return cl.Gratuity
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetGratuity Set Gratuity sql.NullInt32
|
2020-07-14 11:00:34 +00:00
|
|
|
func (cl *CollectLog) SetGratuity(Gratuity sql.NullInt64) {
|
2020-07-10 08:13:08 +00:00
|
|
|
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
|
|
|
|
}
|
|
|
|
|
2020-07-14 11:00:34 +00:00
|
|
|
// GetViews Get return Views sql.NullInt64
|
|
|
|
func (cl *CollectLog) GetViews() sql.NullInt64 {
|
2020-07-10 08:13:08 +00:00
|
|
|
return cl.Views
|
|
|
|
}
|
|
|
|
|
2020-07-14 11:00:34 +00:00
|
|
|
// SetViews Set Views sql.NullInt64
|
|
|
|
func (cl *CollectLog) SetViews(Views sql.NullInt64) {
|
2020-07-10 08:13:08 +00:00
|
|
|
cl.Views = Views
|
|
|
|
}
|
|
|
|
|
2020-07-14 11:00:34 +00:00
|
|
|
// GetFollowers Get return Followers sql.NullInt64
|
|
|
|
func (cl *CollectLog) GetFollowers() sql.NullInt64 {
|
2020-07-10 08:13:08 +00:00
|
|
|
return cl.Followers
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetFollowers Set Followers sql.NullInt32
|
2020-07-14 11:00:34 +00:00
|
|
|
func (cl *CollectLog) SetFollowers(Followers sql.NullInt64) {
|
2020-07-10 08:13:08 +00:00
|
|
|
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
|
|
|
|
}
|
|
|
|
|
2020-07-16 07:25:55 +00:00
|
|
|
// GetIsLiveStreaming Get return IsShowing int32
|
|
|
|
func (cl *CollectLog) GetIsLiveStreaming() int32 {
|
|
|
|
return cl.IsLiveStreaming
|
2020-07-10 08:13:08 +00:00
|
|
|
}
|
|
|
|
|
2020-07-16 07:25:55 +00:00
|
|
|
// SetIsLiveStreaming Set IsShowing int32
|
|
|
|
func (cl *CollectLog) SetIsLiveStreaming(IsLive int32) {
|
|
|
|
cl.IsLiveStreaming = IsLive
|
2020-07-10 08:13:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// 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
|
|
|
|
}
|
2020-07-16 07:25:55 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
}
|