2025-06-23 12:24:23 +08:00
|
|
|
|
package main
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
2025-08-28 19:17:03 +00:00
|
|
|
|
"fmt"
|
|
|
|
|
|
"reflect"
|
|
|
|
|
|
"strings"
|
|
|
|
|
|
|
2025-06-23 12:24:23 +08:00
|
|
|
|
_ "github.com/gogf/gf/contrib/nosql/redis/v2"
|
2025-07-06 01:49:19 +08:00
|
|
|
|
|
|
|
|
|
|
_ "blazing/contrib/drivers/pgsql"
|
|
|
|
|
|
|
2025-06-23 12:24:23 +08:00
|
|
|
|
_ "blazing/contrib/files/local"
|
|
|
|
|
|
|
|
|
|
|
|
// Minio,按需启用
|
|
|
|
|
|
// _ "blazing/contrib/files/minio"
|
|
|
|
|
|
|
|
|
|
|
|
// 阿里云OSS,按需启用
|
|
|
|
|
|
// _ "blazing/contrib/files/oss"
|
|
|
|
|
|
|
|
|
|
|
|
// _ "blazing/contrib/drivers/sqlite"
|
|
|
|
|
|
|
2025-07-04 19:40:01 +08:00
|
|
|
|
//_ "blazing/contrib/drivers/mysql"
|
2025-06-23 12:24:23 +08:00
|
|
|
|
|
|
|
|
|
|
_ "blazing/modules"
|
|
|
|
|
|
|
|
|
|
|
|
"blazing/login/internal/cmd"
|
2025-08-27 20:52:15 +00:00
|
|
|
|
|
|
|
|
|
|
"github.com/gogf/gf/v2/os/gctx"
|
2025-08-28 19:17:03 +00:00
|
|
|
|
"github.com/gogf/gf/v2/util/gconv"
|
2025-06-23 12:24:23 +08:00
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
func main() {
|
2025-09-04 23:57:22 +08:00
|
|
|
|
|
2025-07-06 19:31:30 +08:00
|
|
|
|
cmd.Main.Run(gctx.New())
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func kick(id int) {
|
2025-07-17 05:20:30 +08:00
|
|
|
|
// // go Start(cool.Config.Port)
|
|
|
|
|
|
// //go rpc()
|
|
|
|
|
|
// go func() {
|
|
|
|
|
|
// t := rpc.StartClient(0, &struct{}{})
|
|
|
|
|
|
// err := t.Kick(1)
|
|
|
|
|
|
// fmt.Println(err)
|
|
|
|
|
|
// //err := t.Kick(1)
|
|
|
|
|
|
// err = t.Kick(10001)
|
|
|
|
|
|
// fmt.Println(err)
|
|
|
|
|
|
// }()
|
2025-06-23 12:24:23 +08:00
|
|
|
|
}
|
2025-08-28 19:17:03 +00:00
|
|
|
|
|
|
|
|
|
|
type ssss struct {
|
|
|
|
|
|
ttt int `cmd:"111|222"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func Test_kick() {
|
|
|
|
|
|
value := reflect.ValueOf(ssss{})
|
|
|
|
|
|
|
|
|
|
|
|
// 获取类型
|
|
|
|
|
|
typ := value.Type()
|
|
|
|
|
|
// 遍历结构体字段
|
|
|
|
|
|
// fmt.Printf("结构体 %s 的字段信息:\n", t.Name())
|
|
|
|
|
|
for i := 0; i < typ.NumField(); i++ {
|
|
|
|
|
|
field := typ.Field(i)
|
|
|
|
|
|
t := field.Tag.Get("cmd")
|
|
|
|
|
|
//t1 := strings.Split(t, "|")
|
|
|
|
|
|
t2 := gconv.SliceUint32(strings.Split(t, "|"))
|
|
|
|
|
|
fmt.Println(t2)
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|