diff --git a/dbpool.go b/dbpool.go index 6453f13..bd9ef15 100644 --- a/dbpool.go +++ b/dbpool.go @@ -363,7 +363,7 @@ func (this *dbPool) internalQueryOne(dataSource string, sql string, params []str if err == nil { dataSet = NewDataSet(rows) } - GetSysLog().Info("xxxxxxxxxxxxxxxxxxx") + if this.style == GO_STYLE_DB { cb(err, dataSet) } else { diff --git a/metatable.go b/metatable.go index 09019ea..517fa73 100644 --- a/metatable.go +++ b/metatable.go @@ -1,12 +1,12 @@ package f5 import ( - "reflect" - "q5" - "os" "bufio" - "fmt" "encoding/json" + "fmt" + "os" + "q5" + "reflect" ) type MetaTable interface { @@ -23,9 +23,9 @@ type LoadFromKeyValue interface { type RawMetaTable[T any] struct { FileName string - PrimKey string - NoLoad bool - rawList []*T + PrimKey string + NoLoad bool + rawList []*T } type IdMetaTable[T any] struct { @@ -38,7 +38,7 @@ type NameMetaTable[T any] struct { nameHash map[string]*T } -func (this *RawMetaTable[T]) Traverse(cb func (*T) bool) { +func (this *RawMetaTable[T]) Traverse(cb func(*T) bool) { for _, val := range this.rawList { if !cb(val) { break @@ -66,7 +66,7 @@ func (this *RawMetaTable[T]) ElementsInit(round int) { type RoundInit3 interface { Init3() } - this.Traverse(func (obj *T) bool { + this.Traverse(func(obj *T) bool { var x interface{} = obj switch round { case 0: @@ -128,7 +128,7 @@ func (this *IdMetaTable[T]) Load() { this.idHash = make(map[int64]*T) i := int64(0) getFuncName := "Get" + q5.ConvertUpperCamelCase(this.PrimKey) - this.Traverse(func (obj *T) bool { + this.Traverse(func(obj *T) bool { if this.PrimKey == "" { this.idHash[i] = obj } else { @@ -159,7 +159,7 @@ func (this *NameMetaTable[T]) Load() { this.nameHash = make(map[string]*T) i := int64(0) getFuncName := "Get" + q5.ConvertUpperCamelCase(this.PrimKey) - this.Traverse(func (obj *T) bool { + this.Traverse(func(obj *T) bool { in := []reflect.Value{} method := reflect.ValueOf(obj).MethodByName(getFuncName) out := method.Call(in) diff --git a/types.go b/types.go index fb8f480..08dbe4f 100644 --- a/types.go +++ b/types.go @@ -7,36 +7,35 @@ import ( const ( WSPROXYPACKHEAD_C_SIZE = 20 WSPROXYPACKHEAD_S_SIZE = 16 - NET_MSG_MAGIC_CODE = uint16('K') + uint16('S') << 8 + NET_MSG_MAGIC_CODE = uint16('K') + uint16('S')<<8 ) type MsgNode struct { - } type IMMsgNode struct { - msgId uint16 + msgId uint16 params q5.Args - next *IMMsgNode + next *IMMsgNode } type Pagination struct { - Total int32 - PerPage int32 + Total int32 + PerPage int32 CurrentPage int32 - TotalPages int32 - Rows *DataSet + TotalPages int32 + Rows *DataSet } type HandlerFunc func(*Context) -type QueryResultCb func (error, *DataSet) -type QueryOneCb func (error, *[]*string) -type PageQueryCb func (error, *Pagination) -type ExecResultCb func (error, int64, int64) +type QueryResultCb func(error, *DataSet) +type QueryOneCb func(error, *DataSet) +type PageQueryCb func(error, *Pagination) +type ExecResultCb func(error, int64, int64) type middleware struct { middlewareType int32 - handlerFunc HandlerFunc - entry q5.ListHead + handlerFunc HandlerFunc + entry q5.ListHead }