2020-07-08 15:02:55 +08:00
|
|
|
package intimate
|
|
|
|
|
|
|
|
import (
|
|
|
|
"database/sql"
|
2020-07-17 18:21:38 +08:00
|
|
|
"reflect"
|
2020-07-08 15:02:55 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
// Source 的结构体
|
|
|
|
type Source struct {
|
2020-07-20 18:54:34 +08:00
|
|
|
Uid int64 //
|
|
|
|
|
|
|
|
Url string //
|
|
|
|
|
|
|
|
StreamerId sql.NullInt64 //
|
|
|
|
|
2020-07-08 15:02:55 +08:00
|
|
|
Source sql.NullString //
|
2020-07-13 18:10:48 +08:00
|
|
|
PassGob sql.NullString //
|
2020-07-08 15:02:55 +08:00
|
|
|
Ext interface{} //
|
2020-07-14 19:00:34 +08:00
|
|
|
UpdateTime sql.NullTime //
|
2020-07-08 15:02:55 +08:00
|
|
|
ErrorMsg sql.NullString //
|
2020-07-10 12:05:33 +08:00
|
|
|
|
2020-07-23 18:29:56 +08:00
|
|
|
Target Target //
|
|
|
|
Operator int32 //
|
2020-07-20 18:54:34 +08:00
|
|
|
|
2020-07-17 18:21:38 +08:00
|
|
|
LastOperator int32
|
2020-07-08 15:02:55 +08:00
|
|
|
}
|
|
|
|
|
2020-07-17 18:21:38 +08:00
|
|
|
// Get Simple Value
|
|
|
|
func (so *Source) Get(field string) interface{} {
|
|
|
|
return reflect.ValueOf(so).Elem().FieldByName(field).Interface()
|
2020-07-08 15:02:55 +08:00
|
|
|
}
|
|
|
|
|
2020-07-17 18:21:38 +08:00
|
|
|
// Set Simple Value
|
|
|
|
func (so *Source) Set(field string, value interface{}) {
|
|
|
|
reflect.ValueOf(so).Elem().FieldByName(field).Set(reflect.ValueOf(value))
|
2020-07-08 15:02:55 +08:00
|
|
|
}
|