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
+61 -10
View File
@@ -13,16 +13,25 @@ import (
)
type (
CreateReq = product.CreateReq
InfoReq = product.InfoReq
ItemsReq = product.ItemsReq
NamesReq = product.NamesReq
StatusReq = product.StatusReq
SortReq = product.SortReq
ItemsData = product.ItemsData
NameItem = product.NameItem
Item = product.Item
Response = product.Response
CreateReq = product.CreateReq
InfoReq = product.InfoReq
ItemsReq = product.ItemsReq
NamesReq = product.NamesReq
StatusReq = product.StatusReq
SortReq = product.SortReq
VerifyReq = product.VerifyReq
VerifyStatusReq = product.VerifyStatusReq
EditApplyReq = product.EditApplyReq
EditApplyPassReq = product.EditApplyPassReq
EditBaseReq = product.EditBaseReq
EditSusceptibleReq = product.EditSusceptibleReq
ItemsData = product.ItemsData
VerifyItemsData = product.VerifyItemsData
VerifyParams = product.VerifyParams
VerifyItem = product.VerifyItem
NameItem = product.NameItem
Item = product.Item
Response = product.Response
Product interface {
Create(ctx context.Context, in *CreateReq, opts ...grpc.CallOption) (*Response, error)
@@ -31,6 +40,13 @@ type (
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)
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)
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)
}
defaultProduct struct {
@@ -73,3 +89,38 @@ func (m *defaultProduct) Sort(ctx context.Context, in *SortReq, opts ...grpc.Cal
client := product.NewProductClient(m.cli.Conn())
return client.Sort(ctx, in, opts...)
}
func (m *defaultProduct) Verify(ctx context.Context, in *VerifyReq, opts ...grpc.CallOption) (*Response, error) {
client := product.NewProductClient(m.cli.Conn())
return client.Verify(ctx, in, opts...)
}
func (m *defaultProduct) VerifyFirst(ctx context.Context, in *VerifyStatusReq, opts ...grpc.CallOption) (*Response, error) {
client := product.NewProductClient(m.cli.Conn())
return client.VerifyFirst(ctx, in, opts...)
}
func (m *defaultProduct) VerifySecond(ctx context.Context, in *VerifyStatusReq, opts ...grpc.CallOption) (*Response, error) {
client := product.NewProductClient(m.cli.Conn())
return client.VerifySecond(ctx, in, opts...)
}
func (m *defaultProduct) EditApply(ctx context.Context, in *EditApplyReq, opts ...grpc.CallOption) (*Response, error) {
client := product.NewProductClient(m.cli.Conn())
return client.EditApply(ctx, in, opts...)
}
func (m *defaultProduct) EditApplyPass(ctx context.Context, in *EditApplyPassReq, opts ...grpc.CallOption) (*Response, error) {
client := product.NewProductClient(m.cli.Conn())
return client.EditApplyPass(ctx, in, opts...)
}
func (m *defaultProduct) EditBase(ctx context.Context, in *EditBaseReq, opts ...grpc.CallOption) (*Response, error) {
client := product.NewProductClient(m.cli.Conn())
return client.EditBase(ctx, in, opts...)
}
func (m *defaultProduct) EditSusceptible(ctx context.Context, in *EditSusceptibleReq, opts ...grpc.CallOption) (*Response, error) {
client := product.NewProductClient(m.cli.Conn())
return client.EditSusceptible(ctx, in, opts...)
}