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.5.1
|
||||
// - protoc (unknown)
|
||||
// source: staff.proto
|
||||
// - protoc-gen-go-grpc v1.6.2
|
||||
// - protoc v7.35.0
|
||||
// source: module/ec/mall/proto/staff.proto
|
||||
|
||||
package mall
|
||||
|
||||
import (
|
||||
protobuf "bsm/full/protobuf"
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
@@ -37,17 +38,17 @@ type StaffClient interface {
|
||||
// 登录
|
||||
Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginReply, error)
|
||||
// 获取工作人员列表
|
||||
Fetch(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*StaffListReply, error)
|
||||
Fetch(ctx context.Context, in *protobuf.MallFetchRequest, opts ...grpc.CallOption) (*StaffListReply, error)
|
||||
// 创建工作人员
|
||||
Create(ctx context.Context, in *StaffItem, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
Create(ctx context.Context, in *StaffItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
|
||||
// 删除工作人员
|
||||
Delete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
Delete(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
|
||||
// 获取个人信息
|
||||
GetProfile(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StaffItem, error)
|
||||
GetProfile(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*StaffItem, error)
|
||||
// 设置个人信息
|
||||
SetProfile(ctx context.Context, in *StaffItem, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
SetProfile(ctx context.Context, in *StaffItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
|
||||
// 设置账号密码
|
||||
SetPassword(ctx context.Context, in *SetAccountRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
SetPassword(ctx context.Context, in *SetAccountRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
|
||||
}
|
||||
|
||||
type staffClient struct {
|
||||
@@ -68,7 +69,7 @@ func (c *staffClient) Login(ctx context.Context, in *LoginRequest, opts ...grpc.
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *staffClient) Fetch(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*StaffListReply, error) {
|
||||
func (c *staffClient) Fetch(ctx context.Context, in *protobuf.MallFetchRequest, opts ...grpc.CallOption) (*StaffListReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StaffListReply)
|
||||
err := c.cc.Invoke(ctx, Staff_Fetch_FullMethodName, in, out, cOpts...)
|
||||
@@ -78,9 +79,9 @@ func (c *staffClient) Fetch(ctx context.Context, in *FetchRequest, opts ...grpc.
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *staffClient) Create(ctx context.Context, in *StaffItem, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
func (c *staffClient) Create(ctx context.Context, in *StaffItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StatusReply)
|
||||
out := new(protobuf.IdentityStatusReply)
|
||||
err := c.cc.Invoke(ctx, Staff_Create_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -88,9 +89,9 @@ func (c *staffClient) Create(ctx context.Context, in *StaffItem, opts ...grpc.Ca
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *staffClient) Delete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
func (c *staffClient) Delete(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StatusReply)
|
||||
out := new(protobuf.IdentityStatusReply)
|
||||
err := c.cc.Invoke(ctx, Staff_Delete_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -98,7 +99,7 @@ func (c *staffClient) Delete(ctx context.Context, in *IdentRequest, opts ...grpc
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *staffClient) GetProfile(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StaffItem, error) {
|
||||
func (c *staffClient) GetProfile(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*StaffItem, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StaffItem)
|
||||
err := c.cc.Invoke(ctx, Staff_GetProfile_FullMethodName, in, out, cOpts...)
|
||||
@@ -108,9 +109,9 @@ func (c *staffClient) GetProfile(ctx context.Context, in *IdentRequest, opts ...
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *staffClient) SetProfile(ctx context.Context, in *StaffItem, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
func (c *staffClient) SetProfile(ctx context.Context, in *StaffItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StatusReply)
|
||||
out := new(protobuf.IdentityStatusReply)
|
||||
err := c.cc.Invoke(ctx, Staff_SetProfile_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -118,9 +119,9 @@ func (c *staffClient) SetProfile(ctx context.Context, in *StaffItem, opts ...grp
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *staffClient) SetPassword(ctx context.Context, in *SetAccountRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
func (c *staffClient) SetPassword(ctx context.Context, in *SetAccountRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StatusReply)
|
||||
out := new(protobuf.IdentityStatusReply)
|
||||
err := c.cc.Invoke(ctx, Staff_SetPassword_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -129,7 +130,7 @@ func (c *staffClient) SetPassword(ctx context.Context, in *SetAccountRequest, op
|
||||
}
|
||||
|
||||
// StaffServer is the server API for Staff service.
|
||||
// All implementations must embed UnimplementedStaffServer
|
||||
// All implementations should embed UnimplementedStaffServer
|
||||
// for forward compatibility.
|
||||
//
|
||||
// Store(店铺)微服务-工作人员
|
||||
@@ -137,21 +138,20 @@ type StaffServer interface {
|
||||
// 登录
|
||||
Login(context.Context, *LoginRequest) (*LoginReply, error)
|
||||
// 获取工作人员列表
|
||||
Fetch(context.Context, *FetchRequest) (*StaffListReply, error)
|
||||
Fetch(context.Context, *protobuf.MallFetchRequest) (*StaffListReply, error)
|
||||
// 创建工作人员
|
||||
Create(context.Context, *StaffItem) (*StatusReply, error)
|
||||
Create(context.Context, *StaffItem) (*protobuf.IdentityStatusReply, error)
|
||||
// 删除工作人员
|
||||
Delete(context.Context, *IdentRequest) (*StatusReply, error)
|
||||
Delete(context.Context, *protobuf.IdentRequest) (*protobuf.IdentityStatusReply, error)
|
||||
// 获取个人信息
|
||||
GetProfile(context.Context, *IdentRequest) (*StaffItem, error)
|
||||
GetProfile(context.Context, *protobuf.IdentRequest) (*StaffItem, error)
|
||||
// 设置个人信息
|
||||
SetProfile(context.Context, *StaffItem) (*StatusReply, error)
|
||||
SetProfile(context.Context, *StaffItem) (*protobuf.IdentityStatusReply, error)
|
||||
// 设置账号密码
|
||||
SetPassword(context.Context, *SetAccountRequest) (*StatusReply, error)
|
||||
mustEmbedUnimplementedStaffServer()
|
||||
SetPassword(context.Context, *SetAccountRequest) (*protobuf.IdentityStatusReply, error)
|
||||
}
|
||||
|
||||
// UnimplementedStaffServer must be embedded to have
|
||||
// UnimplementedStaffServer should be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
@@ -159,28 +159,27 @@ type StaffServer interface {
|
||||
type UnimplementedStaffServer struct{}
|
||||
|
||||
func (UnimplementedStaffServer) Login(context.Context, *LoginRequest) (*LoginReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Login not implemented")
|
||||
return nil, status.Error(codes.Unimplemented, "method Login not implemented")
|
||||
}
|
||||
func (UnimplementedStaffServer) Fetch(context.Context, *FetchRequest) (*StaffListReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Fetch not implemented")
|
||||
func (UnimplementedStaffServer) Fetch(context.Context, *protobuf.MallFetchRequest) (*StaffListReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Fetch not implemented")
|
||||
}
|
||||
func (UnimplementedStaffServer) Create(context.Context, *StaffItem) (*StatusReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
|
||||
func (UnimplementedStaffServer) Create(context.Context, *StaffItem) (*protobuf.IdentityStatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Create not implemented")
|
||||
}
|
||||
func (UnimplementedStaffServer) Delete(context.Context, *IdentRequest) (*StatusReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
|
||||
func (UnimplementedStaffServer) Delete(context.Context, *protobuf.IdentRequest) (*protobuf.IdentityStatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Delete not implemented")
|
||||
}
|
||||
func (UnimplementedStaffServer) GetProfile(context.Context, *IdentRequest) (*StaffItem, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetProfile not implemented")
|
||||
func (UnimplementedStaffServer) GetProfile(context.Context, *protobuf.IdentRequest) (*StaffItem, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetProfile not implemented")
|
||||
}
|
||||
func (UnimplementedStaffServer) SetProfile(context.Context, *StaffItem) (*StatusReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method SetProfile not implemented")
|
||||
func (UnimplementedStaffServer) SetProfile(context.Context, *StaffItem) (*protobuf.IdentityStatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method SetProfile not implemented")
|
||||
}
|
||||
func (UnimplementedStaffServer) SetPassword(context.Context, *SetAccountRequest) (*StatusReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method SetPassword not implemented")
|
||||
func (UnimplementedStaffServer) SetPassword(context.Context, *SetAccountRequest) (*protobuf.IdentityStatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method SetPassword not implemented")
|
||||
}
|
||||
func (UnimplementedStaffServer) mustEmbedUnimplementedStaffServer() {}
|
||||
func (UnimplementedStaffServer) testEmbeddedByValue() {}
|
||||
func (UnimplementedStaffServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeStaffServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to StaffServer will
|
||||
@@ -190,7 +189,7 @@ type UnsafeStaffServer interface {
|
||||
}
|
||||
|
||||
func RegisterStaffServer(s grpc.ServiceRegistrar, srv StaffServer) {
|
||||
// If the following call pancis, it indicates UnimplementedStaffServer was
|
||||
// If the following call panics, it indicates UnimplementedStaffServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
@@ -219,7 +218,7 @@ func _Staff_Login_Handler(srv interface{}, ctx context.Context, dec func(interfa
|
||||
}
|
||||
|
||||
func _Staff_Fetch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(FetchRequest)
|
||||
in := new(protobuf.MallFetchRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -231,7 +230,7 @@ func _Staff_Fetch_Handler(srv interface{}, ctx context.Context, dec func(interfa
|
||||
FullMethod: Staff_Fetch_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(StaffServer).Fetch(ctx, req.(*FetchRequest))
|
||||
return srv.(StaffServer).Fetch(ctx, req.(*protobuf.MallFetchRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@@ -255,7 +254,7 @@ func _Staff_Create_Handler(srv interface{}, ctx context.Context, dec func(interf
|
||||
}
|
||||
|
||||
func _Staff_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
|
||||
}
|
||||
@@ -267,13 +266,13 @@ func _Staff_Delete_Handler(srv interface{}, ctx context.Context, dec func(interf
|
||||
FullMethod: Staff_Delete_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(StaffServer).Delete(ctx, req.(*IdentRequest))
|
||||
return srv.(StaffServer).Delete(ctx, req.(*protobuf.IdentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Staff_GetProfile_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 _Staff_GetProfile_Handler(srv interface{}, ctx context.Context, dec func(in
|
||||
FullMethod: Staff_GetProfile_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(StaffServer).GetProfile(ctx, req.(*IdentRequest))
|
||||
return srv.(StaffServer).GetProfile(ctx, req.(*protobuf.IdentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@@ -363,5 +362,5 @@ var Staff_ServiceDesc = grpc.ServiceDesc{
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "staff.proto",
|
||||
Metadata: "module/ec/mall/proto/staff.proto",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user