feat 初次提交

This commit is contained in:
2026-01-03 14:26:08 +08:00
parent ebeb244e1e
commit 887cb242e3
30 changed files with 1918 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
package server
import (
"common/discover/common"
"common/net/grpc/service"
"common/proto/ss/grpc_pb"
"gateway/internal/handler/ws_handler"
"google.golang.org/grpc"
)
type Server struct {
grpc_pb.UnimplementedGatewayServer
service.Base
}
func NewServer(ttl int64) *Server {
s := &Server{
Base: service.Base{
Target: common.KeyDiscoverGateway,
EtcdTTL: ttl,
},
}
s.Base.OnInit = s.OnInit
s.Base.OnClose = s.OnClose
return s
}
func (s *Server) OnInit(serve *grpc.Server) {
ws_handler.GatewaySID = s.SID
grpc_pb.RegisterGatewayServer(serve, s)
}
func (s *Server) OnClose() {
}