d5151f92bf
2.存储通用包的实现.
134 lines
2.8 KiB
Go
134 lines
2.8 KiB
Go
package intimate
|
|
|
|
import (
|
|
"database/sql"
|
|
"time"
|
|
)
|
|
|
|
// IGetSource 源接口结构
|
|
type IGetSource interface {
|
|
GetUid() int64 //
|
|
GetUrl() string //
|
|
GetTargetType() string //
|
|
GetSource() sql.NullString //
|
|
GetExt() interface{} //
|
|
GetUpdateTime() time.Time //
|
|
GetOperator() int32 //
|
|
GetErrorMsg() sql.NullString //
|
|
}
|
|
|
|
type IUpdateSource interface {
|
|
IGetSource
|
|
|
|
GetLastOperator() int32
|
|
|
|
SetExt(ext interface{}) //
|
|
SetUpdateTime(ut time.Time) //
|
|
SetOperator(operator int32) //
|
|
SetErrorMsg(emsg sql.NullString) //
|
|
}
|
|
|
|
// Source 的结构体
|
|
type Source struct {
|
|
Uid int64 //
|
|
Url string //
|
|
TargetType string //
|
|
Source sql.NullString //
|
|
Ext interface{} //
|
|
UpdateTime time.Time //
|
|
Operator int32 //
|
|
ErrorMsg sql.NullString //
|
|
|
|
lastOperator int32
|
|
}
|
|
|
|
// GetLastOperator Get return lastOperator int32
|
|
func (so *Source) GetLastOperator() int32 {
|
|
return so.lastOperator
|
|
}
|
|
|
|
// SetLastOperator Set lastOperator int32
|
|
func (so *Source) SetLastOperator(lastOperator int32) {
|
|
so.lastOperator = lastOperator
|
|
}
|
|
|
|
// GetErrorMsg Get return ErrorMsg sql.NullString
|
|
func (so *Source) GetErrorMsg() sql.NullString {
|
|
return so.ErrorMsg
|
|
}
|
|
|
|
// SetErrorMsg Set ErrorMsg sql.NullString
|
|
func (so *Source) SetErrorMsg(ErrorMsg sql.NullString) {
|
|
so.ErrorMsg = ErrorMsg
|
|
}
|
|
|
|
// GetOperator Get return Operator sql.NullInt32
|
|
func (so *Source) GetOperator() int32 {
|
|
return so.Operator
|
|
}
|
|
|
|
// SetOperator Set Operator sql.NullInt32
|
|
func (so *Source) SetOperator(Operator int32) {
|
|
so.Operator = Operator
|
|
}
|
|
|
|
// GetUpdateTime Get return UpdateTime time.Time
|
|
func (so *Source) GetUpdateTime() time.Time {
|
|
return so.UpdateTime
|
|
}
|
|
|
|
// SetUpdateTime Set UpdateTime time.Time
|
|
func (so *Source) SetUpdateTime(UpdateTime time.Time) {
|
|
so.UpdateTime = UpdateTime
|
|
}
|
|
|
|
// GetExt Get return Ext interface{}
|
|
func (so *Source) GetExt() interface{} {
|
|
return so.Ext
|
|
}
|
|
|
|
// SetExt Set Ext interface{}
|
|
func (so *Source) SetExt(Ext interface{}) {
|
|
so.Ext = Ext
|
|
}
|
|
|
|
// GetSource Get return Source sql.NullString
|
|
func (so *Source) GetSource() sql.NullString {
|
|
return so.Source
|
|
}
|
|
|
|
// SetSource Set Source sql.NullString
|
|
func (so *Source) SetSource(Source sql.NullString) {
|
|
so.Source = Source
|
|
}
|
|
|
|
// GetTargetType Get return TargetType string
|
|
func (so *Source) GetTargetType() string {
|
|
return so.TargetType
|
|
}
|
|
|
|
// SetTargetType Set TargetType string
|
|
func (so *Source) SetTargetType(TargetType string) {
|
|
so.TargetType = TargetType
|
|
}
|
|
|
|
// GetUrl Get return Url string
|
|
func (so *Source) GetUrl() string {
|
|
return so.Url
|
|
}
|
|
|
|
// SetUrl Set Url string
|
|
func (so *Source) SetUrl(Url string) {
|
|
so.Url = Url
|
|
}
|
|
|
|
// GetUid Get return Uid int64
|
|
func (so *Source) GetUid() int64 {
|
|
return so.Uid
|
|
}
|
|
|
|
// SetUid Set Uid int64
|
|
func (so *Source) SetUid(Uid int64) {
|
|
so.Uid = Uid
|
|
}
|