refactor: localize protobuf definitions

This commit is contained in:
2026-08-09 20:14:57 +08:00
parent 9f6f318bbb
commit 5ea45a76fe
429 changed files with 54058 additions and 61623 deletions

View File

@@ -7,7 +7,6 @@
package mall
import (
protobuf "bsm/full/protobuf"
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
@@ -33,13 +32,13 @@ const (
// Store(店铺)微服务-公告
type NoticeClient interface {
// 公告列表
Fetch(ctx context.Context, in *protobuf.MallFetchRequest, opts ...grpc.CallOption) (*NoticeListReply, error)
Fetch(ctx context.Context, in *MallFetchRequest, opts ...grpc.CallOption) (*NoticeListReply, error)
// 新建公告
Create(ctx context.Context, in *NoticeItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
Create(ctx context.Context, in *NoticeItem, opts ...grpc.CallOption) (*IdentityStatusReply, error)
// 修改公告
Modify(ctx context.Context, in *NoticeItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
Modify(ctx context.Context, in *NoticeItem, opts ...grpc.CallOption) (*IdentityStatusReply, error)
// 删除公告
Delete(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
Delete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*IdentityStatusReply, error)
}
type noticeClient struct {
@@ -50,7 +49,7 @@ func NewNoticeClient(cc grpc.ClientConnInterface) NoticeClient {
return &noticeClient{cc}
}
func (c *noticeClient) Fetch(ctx context.Context, in *protobuf.MallFetchRequest, opts ...grpc.CallOption) (*NoticeListReply, error) {
func (c *noticeClient) Fetch(ctx context.Context, in *MallFetchRequest, opts ...grpc.CallOption) (*NoticeListReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(NoticeListReply)
err := c.cc.Invoke(ctx, Notice_Fetch_FullMethodName, in, out, cOpts...)
@@ -60,9 +59,9 @@ func (c *noticeClient) Fetch(ctx context.Context, in *protobuf.MallFetchRequest,
return out, nil
}
func (c *noticeClient) Create(ctx context.Context, in *NoticeItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
func (c *noticeClient) Create(ctx context.Context, in *NoticeItem, opts ...grpc.CallOption) (*IdentityStatusReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(protobuf.IdentityStatusReply)
out := new(IdentityStatusReply)
err := c.cc.Invoke(ctx, Notice_Create_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
@@ -70,9 +69,9 @@ func (c *noticeClient) Create(ctx context.Context, in *NoticeItem, opts ...grpc.
return out, nil
}
func (c *noticeClient) Modify(ctx context.Context, in *NoticeItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
func (c *noticeClient) Modify(ctx context.Context, in *NoticeItem, opts ...grpc.CallOption) (*IdentityStatusReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(protobuf.IdentityStatusReply)
out := new(IdentityStatusReply)
err := c.cc.Invoke(ctx, Notice_Modify_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
@@ -80,9 +79,9 @@ func (c *noticeClient) Modify(ctx context.Context, in *NoticeItem, opts ...grpc.
return out, nil
}
func (c *noticeClient) Delete(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
func (c *noticeClient) Delete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*IdentityStatusReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(protobuf.IdentityStatusReply)
out := new(IdentityStatusReply)
err := c.cc.Invoke(ctx, Notice_Delete_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
@@ -97,13 +96,13 @@ func (c *noticeClient) Delete(ctx context.Context, in *protobuf.IdentRequest, op
// Store(店铺)微服务-公告
type NoticeServer interface {
// 公告列表
Fetch(context.Context, *protobuf.MallFetchRequest) (*NoticeListReply, error)
Fetch(context.Context, *MallFetchRequest) (*NoticeListReply, error)
// 新建公告
Create(context.Context, *NoticeItem) (*protobuf.IdentityStatusReply, error)
Create(context.Context, *NoticeItem) (*IdentityStatusReply, error)
// 修改公告
Modify(context.Context, *NoticeItem) (*protobuf.IdentityStatusReply, error)
Modify(context.Context, *NoticeItem) (*IdentityStatusReply, error)
// 删除公告
Delete(context.Context, *protobuf.IdentRequest) (*protobuf.IdentityStatusReply, error)
Delete(context.Context, *IdentRequest) (*IdentityStatusReply, error)
}
// UnimplementedNoticeServer should be embedded to have
@@ -113,16 +112,16 @@ type NoticeServer interface {
// pointer dereference when methods are called.
type UnimplementedNoticeServer struct{}
func (UnimplementedNoticeServer) Fetch(context.Context, *protobuf.MallFetchRequest) (*NoticeListReply, error) {
func (UnimplementedNoticeServer) Fetch(context.Context, *MallFetchRequest) (*NoticeListReply, error) {
return nil, status.Error(codes.Unimplemented, "method Fetch not implemented")
}
func (UnimplementedNoticeServer) Create(context.Context, *NoticeItem) (*protobuf.IdentityStatusReply, error) {
func (UnimplementedNoticeServer) Create(context.Context, *NoticeItem) (*IdentityStatusReply, error) {
return nil, status.Error(codes.Unimplemented, "method Create not implemented")
}
func (UnimplementedNoticeServer) Modify(context.Context, *NoticeItem) (*protobuf.IdentityStatusReply, error) {
func (UnimplementedNoticeServer) Modify(context.Context, *NoticeItem) (*IdentityStatusReply, error) {
return nil, status.Error(codes.Unimplemented, "method Modify not implemented")
}
func (UnimplementedNoticeServer) Delete(context.Context, *protobuf.IdentRequest) (*protobuf.IdentityStatusReply, error) {
func (UnimplementedNoticeServer) Delete(context.Context, *IdentRequest) (*IdentityStatusReply, error) {
return nil, status.Error(codes.Unimplemented, "method Delete not implemented")
}
func (UnimplementedNoticeServer) testEmbeddedByValue() {}
@@ -146,7 +145,7 @@ func RegisterNoticeServer(s grpc.ServiceRegistrar, srv NoticeServer) {
}
func _Notice_Fetch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(protobuf.MallFetchRequest)
in := new(MallFetchRequest)
if err := dec(in); err != nil {
return nil, err
}
@@ -158,7 +157,7 @@ func _Notice_Fetch_Handler(srv interface{}, ctx context.Context, dec func(interf
FullMethod: Notice_Fetch_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(NoticeServer).Fetch(ctx, req.(*protobuf.MallFetchRequest))
return srv.(NoticeServer).Fetch(ctx, req.(*MallFetchRequest))
}
return interceptor(ctx, in, info, handler)
}
@@ -200,7 +199,7 @@ func _Notice_Modify_Handler(srv interface{}, ctx context.Context, dec func(inter
}
func _Notice_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(protobuf.IdentRequest)
in := new(IdentRequest)
if err := dec(in); err != nil {
return nil, err
}
@@ -212,7 +211,7 @@ func _Notice_Delete_Handler(srv interface{}, ctx context.Context, dec func(inter
FullMethod: Notice_Delete_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(NoticeServer).Delete(ctx, req.(*protobuf.IdentRequest))
return srv.(NoticeServer).Delete(ctx, req.(*IdentRequest))
}
return interceptor(ctx, in, info, handler)
}