code format

This commit is contained in:
殷勇 2023-09-04 18:29:00 +08:00
parent 155220a3b2
commit fe1acddcc8
3 changed files with 25 additions and 26 deletions

View File

@ -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 {

View File

@ -1,12 +1,12 @@
package f5
import (
"reflect"
"q5"
"os"
"bufio"
"fmt"
"encoding/json"
"fmt"
"os"
"q5"
"reflect"
)
type MetaTable interface {
@ -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)

View File

@ -7,11 +7,10 @@ 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 {
@ -30,10 +29,10 @@ type Pagination struct {
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