2020-07-08 07:02:55 +00:00
|
|
|
package intimate
|
|
|
|
|
|
|
|
import (
|
|
|
|
"database/sql"
|
2020-07-17 10:21:38 +00:00
|
|
|
"reflect"
|
2020-07-08 07:02:55 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// Source 的结构体
|
|
|
|
type Source struct {
|
2020-07-20 10:54:34 +00:00
|
|
|
Uid int64 //
|
|
|
|
|
|
|
|
Url string //
|
|
|
|
|
|
|
|
StreamerId sql.NullInt64 //
|
|
|
|
|
2020-07-08 07:02:55 +00:00
|
|
|
Source sql.NullString //
|
2020-07-13 10:10:48 +00:00
|
|
|
PassGob sql.NullString //
|
2020-07-08 07:02:55 +00:00
|
|
|
Ext interface{} //
|
2020-07-14 11:00:34 +00:00
|
|
|
UpdateTime sql.NullTime //
|
2020-07-08 07:02:55 +00:00
|
|
|
ErrorMsg sql.NullString //
|
2020-07-10 04:05:33 +00:00
|
|
|
|
2020-07-20 10:54:34 +00:00
|
|
|
TargetType string //
|
|
|
|
Operator int32 //
|
|
|
|
|
2020-07-17 10:21:38 +00:00
|
|
|
LastOperator int32
|
2020-07-08 07:02:55 +00:00
|
|
|
}
|
|
|
|
|
2020-07-17 10:21:38 +00:00
|
|
|
// Get Simple Value
|
|
|
|
func (so *Source) Get(field string) interface{} {
|
|
|
|
return reflect.ValueOf(so).Elem().FieldByName(field).Interface()
|
2020-07-08 07:02:55 +00:00
|
|
|
}
|
|
|
|
|
2020-07-17 10:21:38 +00: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 07:02:55 +00:00
|
|
|
}
|