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: pages.proto
|
||||
// - protoc-gen-go-grpc v1.6.2
|
||||
// - protoc v7.35.0
|
||||
// source: module/base/cms/proto/pages.proto
|
||||
|
||||
package cms
|
||||
|
||||
import (
|
||||
protobuf "bsm/full/protobuf"
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
@@ -40,11 +41,11 @@ type PagesClient interface {
|
||||
// 获取单页详情 By Key
|
||||
GetByKey(ctx context.Context, in *GetPagesByKeyRequest, opts ...grpc.CallOption) (*PagesItem, error)
|
||||
// 发布单页
|
||||
Create(ctx context.Context, in *PagesItem, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
Create(ctx context.Context, in *PagesItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
// 修改单页
|
||||
Modify(ctx context.Context, in *PagesItem, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
Modify(ctx context.Context, in *PagesItem, 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 pagesClient struct {
|
||||
@@ -85,9 +86,9 @@ func (c *pagesClient) GetByKey(ctx context.Context, in *GetPagesByKeyRequest, op
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *pagesClient) Create(ctx context.Context, in *PagesItem, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
func (c *pagesClient) Create(ctx context.Context, in *PagesItem, 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, Pages_Create_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -95,9 +96,9 @@ func (c *pagesClient) Create(ctx context.Context, in *PagesItem, opts ...grpc.Ca
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *pagesClient) Modify(ctx context.Context, in *PagesItem, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
func (c *pagesClient) Modify(ctx context.Context, in *PagesItem, 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, Pages_Modify_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -105,9 +106,9 @@ func (c *pagesClient) Modify(ctx context.Context, in *PagesItem, opts ...grpc.Ca
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *pagesClient) Delete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
func (c *pagesClient) 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, Pages_Delete_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -116,7 +117,7 @@ func (c *pagesClient) Delete(ctx context.Context, in *IdentRequest, opts ...grpc
|
||||
}
|
||||
|
||||
// PagesServer is the server API for Pages service.
|
||||
// All implementations must embed UnimplementedPagesServer
|
||||
// All implementations should embed UnimplementedPagesServer
|
||||
// for forward compatibility.
|
||||
//
|
||||
// 单页管理
|
||||
@@ -128,15 +129,14 @@ type PagesServer interface {
|
||||
// 获取单页详情 By Key
|
||||
GetByKey(context.Context, *GetPagesByKeyRequest) (*PagesItem, error)
|
||||
// 发布单页
|
||||
Create(context.Context, *PagesItem) (*StatusReply, error)
|
||||
Create(context.Context, *PagesItem) (*protobuf.StatusReply, error)
|
||||
// 修改单页
|
||||
Modify(context.Context, *PagesItem) (*StatusReply, error)
|
||||
Modify(context.Context, *PagesItem) (*protobuf.StatusReply, error)
|
||||
// 删除单页
|
||||
Delete(context.Context, *IdentRequest) (*StatusReply, error)
|
||||
mustEmbedUnimplementedPagesServer()
|
||||
Delete(context.Context, *protobuf.IdentRequest) (*protobuf.StatusReply, error)
|
||||
}
|
||||
|
||||
// UnimplementedPagesServer must be embedded to have
|
||||
// UnimplementedPagesServer should be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
@@ -152,17 +152,16 @@ func (UnimplementedPagesServer) GetByIdentity(context.Context, *GetPagesRequest)
|
||||
func (UnimplementedPagesServer) GetByKey(context.Context, *GetPagesByKeyRequest) (*PagesItem, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetByKey not implemented")
|
||||
}
|
||||
func (UnimplementedPagesServer) Create(context.Context, *PagesItem) (*StatusReply, error) {
|
||||
func (UnimplementedPagesServer) Create(context.Context, *PagesItem) (*protobuf.StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Create not implemented")
|
||||
}
|
||||
func (UnimplementedPagesServer) Modify(context.Context, *PagesItem) (*StatusReply, error) {
|
||||
func (UnimplementedPagesServer) Modify(context.Context, *PagesItem) (*protobuf.StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Modify not implemented")
|
||||
}
|
||||
func (UnimplementedPagesServer) Delete(context.Context, *IdentRequest) (*StatusReply, error) {
|
||||
func (UnimplementedPagesServer) Delete(context.Context, *protobuf.IdentRequest) (*protobuf.StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Delete not implemented")
|
||||
}
|
||||
func (UnimplementedPagesServer) mustEmbedUnimplementedPagesServer() {}
|
||||
func (UnimplementedPagesServer) testEmbeddedByValue() {}
|
||||
func (UnimplementedPagesServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafePagesServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to PagesServer will
|
||||
@@ -273,7 +272,7 @@ func _Pages_Modify_Handler(srv interface{}, ctx context.Context, dec func(interf
|
||||
}
|
||||
|
||||
func _Pages_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
|
||||
}
|
||||
@@ -285,7 +284,7 @@ func _Pages_Delete_Handler(srv interface{}, ctx context.Context, dec func(interf
|
||||
FullMethod: Pages_Delete_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PagesServer).Delete(ctx, req.(*IdentRequest))
|
||||
return srv.(PagesServer).Delete(ctx, req.(*protobuf.IdentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@@ -323,5 +322,5 @@ var Pages_ServiceDesc = grpc.ServiceDesc{
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "pages.proto",
|
||||
Metadata: "module/base/cms/proto/pages.proto",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user