feat 初次提交

This commit is contained in:
2026-01-03 14:26:12 +08:00
parent 233fc9933f
commit 9c93ecf6e4
18 changed files with 1329 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
package server
import (
"common/discover/common"
"common/net/grpc/service"
"common/proto/ss/grpc_pb"
"google.golang.org/grpc"
)
type Server struct {
grpc_pb.UnimplementedUserServer
service.Base
}
func NewServer(ttl int64) *Server {
s := &Server{
Base: service.Base{
Target: common.KeyDiscoverUser,
EtcdTTL: ttl,
},
}
s.Base.OnInit = s.OnInit
s.Base.OnClose = s.OnClose
return s
}
func (s *Server) OnInit(serve *grpc.Server) {
grpc_pb.RegisterUserServer(serve, s)
}
func (s *Server) OnClose() {
}