refactor(logic): 优化战斗状态效果持续时间计算及清理冗余代码
This commit is contained in:
@@ -1,14 +1,9 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
"strings"
|
||||
|
||||
_ "github.com/gogf/gf/contrib/nosql/redis/v2"
|
||||
|
||||
_ "blazing/contrib/drivers/pgsql"
|
||||
"blazing/modules/base/service"
|
||||
|
||||
_ "blazing/contrib/files/local"
|
||||
|
||||
@@ -27,11 +22,10 @@ import (
|
||||
"blazing/login/internal/cmd"
|
||||
|
||||
"github.com/gogf/gf/v2/os/gctx"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
)
|
||||
|
||||
func main() {
|
||||
service.TestSendVerificationCode()
|
||||
//service.TestSendVerificationCode()
|
||||
cmd.Main.Run(gctx.New())
|
||||
}
|
||||
|
||||
@@ -47,23 +41,3 @@ func kick(id int) {
|
||||
// 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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user