feat: test product

This commit is contained in:
zzw
2026-08-11 09:30:38 +08:00
parent a38fff4917
commit bdc582ad5f
22 changed files with 2730 additions and 75 deletions
File diff suppressed because it is too large Load Diff
+286 -6
View File
@@ -19,12 +19,19 @@ import (
const _ = grpc.SupportPackageIsVersion9
const (
Product_Create_FullMethodName = "/product.Product/Create"
Product_Info_FullMethodName = "/product.Product/Info"
Product_Items_FullMethodName = "/product.Product/Items"
Product_Names_FullMethodName = "/product.Product/Names"
Product_Status_FullMethodName = "/product.Product/Status"
Product_Sort_FullMethodName = "/product.Product/Sort"
Product_Create_FullMethodName = "/product.Product/Create"
Product_Info_FullMethodName = "/product.Product/Info"
Product_Items_FullMethodName = "/product.Product/Items"
Product_Names_FullMethodName = "/product.Product/Names"
Product_Status_FullMethodName = "/product.Product/Status"
Product_Sort_FullMethodName = "/product.Product/Sort"
Product_Verify_FullMethodName = "/product.Product/Verify"
Product_VerifyFirst_FullMethodName = "/product.Product/VerifyFirst"
Product_VerifySecond_FullMethodName = "/product.Product/VerifySecond"
Product_EditApply_FullMethodName = "/product.Product/EditApply"
Product_EditApplyPass_FullMethodName = "/product.Product/EditApplyPass"
Product_EditBase_FullMethodName = "/product.Product/EditBase"
Product_EditSusceptible_FullMethodName = "/product.Product/EditSusceptible"
)
// ProductClient is the client API for Product service.
@@ -37,6 +44,20 @@ type ProductClient interface {
Names(ctx context.Context, in *NamesReq, opts ...grpc.CallOption) (*Response, error)
Status(ctx context.Context, in *StatusReq, opts ...grpc.CallOption) (*Response, error)
Sort(ctx context.Context, in *SortReq, opts ...grpc.CallOption) (*Response, error)
// 审核列表: status: 1: 一审, 2: 二审
Verify(ctx context.Context, in *VerifyReq, opts ...grpc.CallOption) (*Response, error)
// 一审通过/驳回
VerifyFirst(ctx context.Context, in *VerifyStatusReq, opts ...grpc.CallOption) (*Response, error)
// 二审通过/驳回
VerifySecond(ctx context.Context, in *VerifyStatusReq, opts ...grpc.CallOption) (*Response, error)
// 编辑申请(解锁编辑权限)
EditApply(ctx context.Context, in *EditApplyReq, opts ...grpc.CallOption) (*Response, error)
// TODO: 临时接口,企微编辑申请审批对接后删除
EditApplyPass(ctx context.Context, in *EditApplyPassReq, opts ...grpc.CallOption) (*Response, error)
// 编辑基础信息
EditBase(ctx context.Context, in *EditBaseReq, opts ...grpc.CallOption) (*Response, error)
// 编辑敏感信息(进入一审)
EditSusceptible(ctx context.Context, in *EditSusceptibleReq, opts ...grpc.CallOption) (*Response, error)
}
type productClient struct {
@@ -107,6 +128,76 @@ func (c *productClient) Sort(ctx context.Context, in *SortReq, opts ...grpc.Call
return out, nil
}
func (c *productClient) Verify(ctx context.Context, in *VerifyReq, opts ...grpc.CallOption) (*Response, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(Response)
err := c.cc.Invoke(ctx, Product_Verify_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *productClient) VerifyFirst(ctx context.Context, in *VerifyStatusReq, opts ...grpc.CallOption) (*Response, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(Response)
err := c.cc.Invoke(ctx, Product_VerifyFirst_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *productClient) VerifySecond(ctx context.Context, in *VerifyStatusReq, opts ...grpc.CallOption) (*Response, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(Response)
err := c.cc.Invoke(ctx, Product_VerifySecond_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *productClient) EditApply(ctx context.Context, in *EditApplyReq, opts ...grpc.CallOption) (*Response, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(Response)
err := c.cc.Invoke(ctx, Product_EditApply_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *productClient) EditApplyPass(ctx context.Context, in *EditApplyPassReq, opts ...grpc.CallOption) (*Response, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(Response)
err := c.cc.Invoke(ctx, Product_EditApplyPass_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *productClient) EditBase(ctx context.Context, in *EditBaseReq, opts ...grpc.CallOption) (*Response, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(Response)
err := c.cc.Invoke(ctx, Product_EditBase_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *productClient) EditSusceptible(ctx context.Context, in *EditSusceptibleReq, opts ...grpc.CallOption) (*Response, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(Response)
err := c.cc.Invoke(ctx, Product_EditSusceptible_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// ProductServer is the server API for Product service.
// All implementations must embed UnimplementedProductServer
// for forward compatibility.
@@ -117,6 +208,20 @@ type ProductServer interface {
Names(context.Context, *NamesReq) (*Response, error)
Status(context.Context, *StatusReq) (*Response, error)
Sort(context.Context, *SortReq) (*Response, error)
// 审核列表: status: 1: 一审, 2: 二审
Verify(context.Context, *VerifyReq) (*Response, error)
// 一审通过/驳回
VerifyFirst(context.Context, *VerifyStatusReq) (*Response, error)
// 二审通过/驳回
VerifySecond(context.Context, *VerifyStatusReq) (*Response, error)
// 编辑申请(解锁编辑权限)
EditApply(context.Context, *EditApplyReq) (*Response, error)
// TODO: 临时接口,企微编辑申请审批对接后删除
EditApplyPass(context.Context, *EditApplyPassReq) (*Response, error)
// 编辑基础信息
EditBase(context.Context, *EditBaseReq) (*Response, error)
// 编辑敏感信息(进入一审)
EditSusceptible(context.Context, *EditSusceptibleReq) (*Response, error)
mustEmbedUnimplementedProductServer()
}
@@ -145,6 +250,27 @@ func (UnimplementedProductServer) Status(context.Context, *StatusReq) (*Response
func (UnimplementedProductServer) Sort(context.Context, *SortReq) (*Response, error) {
return nil, status.Error(codes.Unimplemented, "method Sort not implemented")
}
func (UnimplementedProductServer) Verify(context.Context, *VerifyReq) (*Response, error) {
return nil, status.Error(codes.Unimplemented, "method Verify not implemented")
}
func (UnimplementedProductServer) VerifyFirst(context.Context, *VerifyStatusReq) (*Response, error) {
return nil, status.Error(codes.Unimplemented, "method VerifyFirst not implemented")
}
func (UnimplementedProductServer) VerifySecond(context.Context, *VerifyStatusReq) (*Response, error) {
return nil, status.Error(codes.Unimplemented, "method VerifySecond not implemented")
}
func (UnimplementedProductServer) EditApply(context.Context, *EditApplyReq) (*Response, error) {
return nil, status.Error(codes.Unimplemented, "method EditApply not implemented")
}
func (UnimplementedProductServer) EditApplyPass(context.Context, *EditApplyPassReq) (*Response, error) {
return nil, status.Error(codes.Unimplemented, "method EditApplyPass not implemented")
}
func (UnimplementedProductServer) EditBase(context.Context, *EditBaseReq) (*Response, error) {
return nil, status.Error(codes.Unimplemented, "method EditBase not implemented")
}
func (UnimplementedProductServer) EditSusceptible(context.Context, *EditSusceptibleReq) (*Response, error) {
return nil, status.Error(codes.Unimplemented, "method EditSusceptible not implemented")
}
func (UnimplementedProductServer) mustEmbedUnimplementedProductServer() {}
func (UnimplementedProductServer) testEmbeddedByValue() {}
@@ -274,6 +400,132 @@ func _Product_Sort_Handler(srv interface{}, ctx context.Context, dec func(interf
return interceptor(ctx, in, info, handler)
}
func _Product_Verify_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(VerifyReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ProductServer).Verify(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Product_Verify_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ProductServer).Verify(ctx, req.(*VerifyReq))
}
return interceptor(ctx, in, info, handler)
}
func _Product_VerifyFirst_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(VerifyStatusReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ProductServer).VerifyFirst(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Product_VerifyFirst_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ProductServer).VerifyFirst(ctx, req.(*VerifyStatusReq))
}
return interceptor(ctx, in, info, handler)
}
func _Product_VerifySecond_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(VerifyStatusReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ProductServer).VerifySecond(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Product_VerifySecond_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ProductServer).VerifySecond(ctx, req.(*VerifyStatusReq))
}
return interceptor(ctx, in, info, handler)
}
func _Product_EditApply_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(EditApplyReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ProductServer).EditApply(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Product_EditApply_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ProductServer).EditApply(ctx, req.(*EditApplyReq))
}
return interceptor(ctx, in, info, handler)
}
func _Product_EditApplyPass_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(EditApplyPassReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ProductServer).EditApplyPass(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Product_EditApplyPass_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ProductServer).EditApplyPass(ctx, req.(*EditApplyPassReq))
}
return interceptor(ctx, in, info, handler)
}
func _Product_EditBase_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(EditBaseReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ProductServer).EditBase(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Product_EditBase_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ProductServer).EditBase(ctx, req.(*EditBaseReq))
}
return interceptor(ctx, in, info, handler)
}
func _Product_EditSusceptible_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(EditSusceptibleReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ProductServer).EditSusceptible(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Product_EditSusceptible_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ProductServer).EditSusceptible(ctx, req.(*EditSusceptibleReq))
}
return interceptor(ctx, in, info, handler)
}
// Product_ServiceDesc is the grpc.ServiceDesc for Product service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
@@ -305,6 +557,34 @@ var Product_ServiceDesc = grpc.ServiceDesc{
MethodName: "Sort",
Handler: _Product_Sort_Handler,
},
{
MethodName: "Verify",
Handler: _Product_Verify_Handler,
},
{
MethodName: "VerifyFirst",
Handler: _Product_VerifyFirst_Handler,
},
{
MethodName: "VerifySecond",
Handler: _Product_VerifySecond_Handler,
},
{
MethodName: "EditApply",
Handler: _Product_EditApply_Handler,
},
{
MethodName: "EditApplyPass",
Handler: _Product_EditApplyPass_Handler,
},
{
MethodName: "EditBase",
Handler: _Product_EditBase_Handler,
},
{
MethodName: "EditSusceptible",
Handler: _Product_EditSusceptible_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "proto/admin/product.proto",