package main

import (
	"fmt"
	"reflect"
	"strings"

	_ "github.com/gogf/gf/contrib/nosql/redis/v2"

	_ "blazing/contrib/drivers/pgsql"

	_ "blazing/contrib/files/local"

	// Minio，按需启用
	// _ "blazing/contrib/files/minio"

	// 阿里云OSS，按需启用
	// _ "blazing/contrib/files/oss"

	// _ "blazing/contrib/drivers/sqlite"

	//_ "blazing/contrib/drivers/mysql"

	_ "blazing/modules"

	"blazing/logic/service/task"
	"blazing/login/internal/cmd"

	"github.com/gogf/gf/v2/os/gctx"
	"github.com/gogf/gf/v2/util/gconv"
)

var tt task.GetTaskBufOutboundInfo

func main() {
	//Test_kick()

	cmd.Main.Run(gctx.New())
}

func kick(id int) {
	// //	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)
	// }()
}

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)
	}
}
