refactor: centralize protobuf and remove go-zero
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.1
|
||||
// - protoc (unknown)
|
||||
// source: site.proto
|
||||
// - protoc-gen-go-grpc v1.6.2
|
||||
// - protoc v7.35.0
|
||||
// source: module/base/cms/proto/site.proto
|
||||
|
||||
package cms
|
||||
|
||||
import (
|
||||
protobuf "bsm/full/protobuf"
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
@@ -33,15 +34,15 @@ const (
|
||||
// CMS - 站点
|
||||
type SiteClient interface {
|
||||
// 站点列表
|
||||
Fetch(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*SiteListReply, error)
|
||||
Fetch(ctx context.Context, in *protobuf.Empty, opts ...grpc.CallOption) (*SiteListReply, error)
|
||||
// 站点详情
|
||||
Get(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*SiteItem, error)
|
||||
Get(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*SiteItem, error)
|
||||
// 添加站点
|
||||
Create(ctx context.Context, in *SiteItem, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
Create(ctx context.Context, in *SiteItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
// 修改站点
|
||||
Modify(ctx context.Context, in *SiteItem, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
Modify(ctx context.Context, in *SiteItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
// 删除站点
|
||||
Delete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
Delete(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
}
|
||||
|
||||
type siteClient struct {
|
||||
@@ -52,7 +53,7 @@ func NewSiteClient(cc grpc.ClientConnInterface) SiteClient {
|
||||
return &siteClient{cc}
|
||||
}
|
||||
|
||||
func (c *siteClient) Fetch(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*SiteListReply, error) {
|
||||
func (c *siteClient) Fetch(ctx context.Context, in *protobuf.Empty, opts ...grpc.CallOption) (*SiteListReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(SiteListReply)
|
||||
err := c.cc.Invoke(ctx, Site_Fetch_FullMethodName, in, out, cOpts...)
|
||||
@@ -62,7 +63,7 @@ func (c *siteClient) Fetch(ctx context.Context, in *Empty, opts ...grpc.CallOpti
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *siteClient) Get(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*SiteItem, error) {
|
||||
func (c *siteClient) Get(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*SiteItem, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(SiteItem)
|
||||
err := c.cc.Invoke(ctx, Site_Get_FullMethodName, in, out, cOpts...)
|
||||
@@ -72,9 +73,9 @@ func (c *siteClient) Get(ctx context.Context, in *IdentRequest, opts ...grpc.Cal
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *siteClient) Create(ctx context.Context, in *SiteItem, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
func (c *siteClient) Create(ctx context.Context, in *SiteItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StatusReply)
|
||||
out := new(protobuf.StatusReply)
|
||||
err := c.cc.Invoke(ctx, Site_Create_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -82,9 +83,9 @@ func (c *siteClient) Create(ctx context.Context, in *SiteItem, opts ...grpc.Call
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *siteClient) Modify(ctx context.Context, in *SiteItem, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
func (c *siteClient) Modify(ctx context.Context, in *SiteItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StatusReply)
|
||||
out := new(protobuf.StatusReply)
|
||||
err := c.cc.Invoke(ctx, Site_Modify_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -92,9 +93,9 @@ func (c *siteClient) Modify(ctx context.Context, in *SiteItem, opts ...grpc.Call
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *siteClient) Delete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
func (c *siteClient) Delete(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StatusReply)
|
||||
out := new(protobuf.StatusReply)
|
||||
err := c.cc.Invoke(ctx, Site_Delete_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -103,48 +104,46 @@ func (c *siteClient) Delete(ctx context.Context, in *IdentRequest, opts ...grpc.
|
||||
}
|
||||
|
||||
// SiteServer is the server API for Site service.
|
||||
// All implementations must embed UnimplementedSiteServer
|
||||
// All implementations should embed UnimplementedSiteServer
|
||||
// for forward compatibility.
|
||||
//
|
||||
// CMS - 站点
|
||||
type SiteServer interface {
|
||||
// 站点列表
|
||||
Fetch(context.Context, *Empty) (*SiteListReply, error)
|
||||
Fetch(context.Context, *protobuf.Empty) (*SiteListReply, error)
|
||||
// 站点详情
|
||||
Get(context.Context, *IdentRequest) (*SiteItem, error)
|
||||
Get(context.Context, *protobuf.IdentRequest) (*SiteItem, error)
|
||||
// 添加站点
|
||||
Create(context.Context, *SiteItem) (*StatusReply, error)
|
||||
Create(context.Context, *SiteItem) (*protobuf.StatusReply, error)
|
||||
// 修改站点
|
||||
Modify(context.Context, *SiteItem) (*StatusReply, error)
|
||||
Modify(context.Context, *SiteItem) (*protobuf.StatusReply, error)
|
||||
// 删除站点
|
||||
Delete(context.Context, *IdentRequest) (*StatusReply, error)
|
||||
mustEmbedUnimplementedSiteServer()
|
||||
Delete(context.Context, *protobuf.IdentRequest) (*protobuf.StatusReply, error)
|
||||
}
|
||||
|
||||
// UnimplementedSiteServer must be embedded to have
|
||||
// UnimplementedSiteServer should be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedSiteServer struct{}
|
||||
|
||||
func (UnimplementedSiteServer) Fetch(context.Context, *Empty) (*SiteListReply, error) {
|
||||
func (UnimplementedSiteServer) Fetch(context.Context, *protobuf.Empty) (*SiteListReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Fetch not implemented")
|
||||
}
|
||||
func (UnimplementedSiteServer) Get(context.Context, *IdentRequest) (*SiteItem, error) {
|
||||
func (UnimplementedSiteServer) Get(context.Context, *protobuf.IdentRequest) (*SiteItem, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Get not implemented")
|
||||
}
|
||||
func (UnimplementedSiteServer) Create(context.Context, *SiteItem) (*StatusReply, error) {
|
||||
func (UnimplementedSiteServer) Create(context.Context, *SiteItem) (*protobuf.StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Create not implemented")
|
||||
}
|
||||
func (UnimplementedSiteServer) Modify(context.Context, *SiteItem) (*StatusReply, error) {
|
||||
func (UnimplementedSiteServer) Modify(context.Context, *SiteItem) (*protobuf.StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Modify not implemented")
|
||||
}
|
||||
func (UnimplementedSiteServer) Delete(context.Context, *IdentRequest) (*StatusReply, error) {
|
||||
func (UnimplementedSiteServer) Delete(context.Context, *protobuf.IdentRequest) (*protobuf.StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Delete not implemented")
|
||||
}
|
||||
func (UnimplementedSiteServer) mustEmbedUnimplementedSiteServer() {}
|
||||
func (UnimplementedSiteServer) testEmbeddedByValue() {}
|
||||
func (UnimplementedSiteServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeSiteServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to SiteServer will
|
||||
@@ -165,7 +164,7 @@ func RegisterSiteServer(s grpc.ServiceRegistrar, srv SiteServer) {
|
||||
}
|
||||
|
||||
func _Site_Fetch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(Empty)
|
||||
in := new(protobuf.Empty)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -177,13 +176,13 @@ func _Site_Fetch_Handler(srv interface{}, ctx context.Context, dec func(interfac
|
||||
FullMethod: Site_Fetch_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SiteServer).Fetch(ctx, req.(*Empty))
|
||||
return srv.(SiteServer).Fetch(ctx, req.(*protobuf.Empty))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Site_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(IdentRequest)
|
||||
in := new(protobuf.IdentRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -195,7 +194,7 @@ func _Site_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{
|
||||
FullMethod: Site_Get_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SiteServer).Get(ctx, req.(*IdentRequest))
|
||||
return srv.(SiteServer).Get(ctx, req.(*protobuf.IdentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@@ -237,7 +236,7 @@ func _Site_Modify_Handler(srv interface{}, ctx context.Context, dec func(interfa
|
||||
}
|
||||
|
||||
func _Site_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(IdentRequest)
|
||||
in := new(protobuf.IdentRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -249,7 +248,7 @@ func _Site_Delete_Handler(srv interface{}, ctx context.Context, dec func(interfa
|
||||
FullMethod: Site_Delete_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SiteServer).Delete(ctx, req.(*IdentRequest))
|
||||
return srv.(SiteServer).Delete(ctx, req.(*protobuf.IdentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@@ -283,5 +282,5 @@ var Site_ServiceDesc = grpc.ServiceDesc{
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "site.proto",
|
||||
Metadata: "module/base/cms/proto/site.proto",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user