feat 包命名规范

This commit is contained in:
2026-02-11 14:49:52 +08:00
parent 146c1734fa
commit 185518257f
8 changed files with 49 additions and 51 deletions

View File

@@ -0,0 +1,39 @@
package grpcserver
import (
"git.hlsq.asia/mmorpg/service-common/config"
"git.hlsq.asia/mmorpg/service-common/discover/common"
"git.hlsq.asia/mmorpg/service-common/net/grpc/service"
"git.hlsq.asia/mmorpg/service-common/proto/rs/rspb"
"google.golang.org/grpc"
)
type Server struct {
rspb.UnimplementedSceneServer
service.Base
}
func NewServer(cfg *config.GrpcConfig) *Server {
s := &Server{
Base: service.Base{
Target: common.KeyDiscoverScene,
ServiceName: common.KeyDiscoverServiceNameScene,
Cfg: cfg,
},
}
s.Base.OnCustomGrpcServerOption = s.OnCustomGrpcServerOption
s.Base.OnInit = s.OnInit
s.Base.OnClose = s.OnClose
return s
}
func (s *Server) OnCustomGrpcServerOption() []grpc.ServerOption {
return nil
}
func (s *Server) OnInit(serve *grpc.Server) {
rspb.RegisterSceneServer(serve, s)
}
func (s *Server) OnClose() {
}