2025-06-23 10:15:22 +08:00
|
|
|
package main
|
|
|
|
|
|
|
|
|
|
import (
|
2025-06-24 22:09:05 +08:00
|
|
|
_ "github.com/gogf/gf/contrib/nosql/redis/v2"
|
|
|
|
|
|
2025-06-23 10:15:22 +08:00
|
|
|
"blazing/common/socket"
|
|
|
|
|
"blazing/common/socket/handler"
|
2025-06-23 12:24:23 +08:00
|
|
|
"blazing/cool"
|
2025-06-23 10:15:22 +08:00
|
|
|
"blazing/logic/controller"
|
2025-06-23 12:24:23 +08:00
|
|
|
|
|
|
|
|
"github.com/gogf/gf/v2/os/gctx"
|
2025-06-23 10:15:22 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func main() {
|
2025-06-23 12:24:23 +08:00
|
|
|
if cool.IsRedisMode {
|
|
|
|
|
go cool.ListenFunc(gctx.New())
|
|
|
|
|
}
|
2025-06-26 23:20:11 +08:00
|
|
|
|
2025-06-23 13:39:19 +08:00
|
|
|
Start(cool.Config.PortBL) //注入service
|
2025-06-23 10:15:22 +08:00
|
|
|
}
|
|
|
|
|
func Start(port string) {
|
|
|
|
|
|
|
|
|
|
head := handler.NewTomeeHandler()
|
2025-06-26 23:20:11 +08:00
|
|
|
head.Callback = controller.Recv
|
2025-06-23 10:15:22 +08:00
|
|
|
socket.NewServer(socket.WithPort(port), socket.WithSocketHandler(head)).Start()
|
|
|
|
|
}
|