first commit
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
// goctl 1.10.1
|
||||
// Source: product.proto
|
||||
|
||||
package productclient
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"product/product"
|
||||
|
||||
"github.com/zeromicro/go-zero/zrpc"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
type (
|
||||
AddReq = product.AddReq
|
||||
AddResp = product.AddResp
|
||||
EditReq = product.EditReq
|
||||
EditResp = product.EditResp
|
||||
|
||||
Product interface {
|
||||
Add(ctx context.Context, in *AddReq, opts ...grpc.CallOption) (*AddResp, error)
|
||||
Edit(ctx context.Context, in *EditReq, opts ...grpc.CallOption) (*EditResp, error)
|
||||
}
|
||||
|
||||
defaultProduct struct {
|
||||
cli zrpc.Client
|
||||
}
|
||||
)
|
||||
|
||||
func NewProduct(cli zrpc.Client) Product {
|
||||
return &defaultProduct{
|
||||
cli: cli,
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultProduct) Add(ctx context.Context, in *AddReq, opts ...grpc.CallOption) (*AddResp, error) {
|
||||
client := product.NewProductClient(m.cli.Conn())
|
||||
return client.Add(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultProduct) Edit(ctx context.Context, in *EditReq, opts ...grpc.CallOption) (*EditResp, error) {
|
||||
client := product.NewProductClient(m.cli.Conn())
|
||||
return client.Edit(ctx, in, opts...)
|
||||
}
|
||||
Reference in New Issue
Block a user