2020-07-10 08:13:08 +00:00
|
|
|
package intimate
|
|
|
|
|
|
|
|
import (
|
|
|
|
"database/sql"
|
2020-07-16 07:25:55 +00:00
|
|
|
"reflect"
|
2020-08-05 10:49:47 +00:00
|
|
|
"time"
|
2020-07-10 08:13:08 +00:00
|
|
|
)
|
|
|
|
|
2020-07-17 10:21:38 +00:00
|
|
|
type GetSet struct {
|
2020-07-10 08:13:08 +00:00
|
|
|
}
|
|
|
|
|
2020-08-05 10:49:47 +00:00
|
|
|
type StreamerList struct {
|
|
|
|
UrlHash []byte //
|
|
|
|
Platform Platform //
|
|
|
|
Url string //
|
|
|
|
|
|
|
|
Label sql.NullString //
|
|
|
|
|
|
|
|
Serialize interface{}
|
|
|
|
|
|
|
|
UpdateInterval int32
|
|
|
|
UpdateTime time.Time //
|
|
|
|
|
|
|
|
ErrorMsg sql.NullString
|
|
|
|
Operator int32
|
|
|
|
|
|
|
|
LastOperator int32
|
|
|
|
}
|
|
|
|
|
|
|
|
// Get Simple Value
|
|
|
|
func (sl *StreamerList) Get(field string) interface{} {
|
|
|
|
return reflect.ValueOf(sl).Elem().FieldByName(field).Interface()
|
|
|
|
}
|
|
|
|
|
|
|
|
// Set Simple Value
|
|
|
|
func (sl *StreamerList) Set(field string, value interface{}) {
|
|
|
|
reflect.ValueOf(sl).Elem().FieldByName(field).Set(reflect.ValueOf(value))
|
|
|
|
}
|
|
|
|
|
2020-07-17 10:21:38 +00:00
|
|
|
type Streamer struct {
|
2020-07-23 10:29:56 +00:00
|
|
|
Uid int64 //
|
|
|
|
Platform Platform //
|
|
|
|
UserId string //
|
2020-07-20 10:13:54 +00:00
|
|
|
|
|
|
|
UserName sql.NullString //
|
|
|
|
LiveUrl sql.NullString //
|
|
|
|
Channel sql.NullString //
|
2020-07-31 10:04:10 +00:00
|
|
|
Tags interface{}
|
|
|
|
Ext interface{} //
|
2020-07-20 10:13:54 +00:00
|
|
|
|
|
|
|
IsUpdateStreamer bool // 更新上面的内容
|
|
|
|
IsUpdateUrl bool
|
2020-07-31 10:04:10 +00:00
|
|
|
UpdateInterval int32
|
2020-07-20 10:13:54 +00:00
|
|
|
UpdateUrl interface{}
|
|
|
|
LatestLogUid int64
|
|
|
|
UpdateTime sql.NullTime //
|
|
|
|
|
|
|
|
ErrorMsg sql.NullString
|
|
|
|
Operator int32
|
|
|
|
|
|
|
|
LastOperator int32
|
2020-07-10 08:13:08 +00:00
|
|
|
}
|
|
|
|
|
2020-07-17 10:21:38 +00:00
|
|
|
// Get Simple Value
|
|
|
|
func (ai *Streamer) Get(field string) interface{} {
|
|
|
|
return reflect.ValueOf(ai).Elem().FieldByName(field).Interface()
|
2020-07-15 11:23:45 +00:00
|
|
|
}
|
|
|
|
|
2020-07-16 07:25:55 +00:00
|
|
|
// Set Simple Value
|
2020-07-17 10:21:38 +00:00
|
|
|
func (ai *Streamer) Set(field string, value interface{}) {
|
2020-07-16 07:25:55 +00:00
|
|
|
reflect.ValueOf(ai).Elem().FieldByName(field).Set(reflect.ValueOf(value))
|
|
|
|
}
|
|
|
|
|
2020-07-10 08:13:08 +00:00
|
|
|
type CollectLog struct {
|
2020-07-17 10:21:38 +00:00
|
|
|
LogUid int64 // 日志id
|
|
|
|
StreamerUid int64 // StreamerId 表id与
|
|
|
|
|
2020-08-11 10:26:17 +00:00
|
|
|
Platform Platform //
|
2020-07-17 10:21:38 +00:00
|
|
|
UserId string // 平台的UserId
|
2020-07-20 10:13:54 +00:00
|
|
|
IsLiveStreaming bool //
|
|
|
|
IsError bool //
|
2020-07-16 07:25:55 +00:00
|
|
|
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 //
|
|
|
|
}
|
|
|
|
|
2020-07-17 10:21:38 +00:00
|
|
|
// Get Simple Value
|
|
|
|
func (cl *CollectLog) Get(field string) interface{} {
|
|
|
|
return reflect.ValueOf(cl).Elem().FieldByName(field).Interface()
|
|
|
|
}
|
|
|
|
|
2020-07-16 07:25:55 +00:00
|
|
|
// 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
|
|
|
}
|