27 lines
784 B
Go
27 lines
784 B
Go
package user
|
|
|
|
import (
|
|
"context"
|
|
"github.com/cloudwego/kitex/client/callopt"
|
|
"github.com/cloudwego/kitex/pkg/klog"
|
|
user "github.com/suyiiyii/hertz101/rpc_gen/kitex_gen/user"
|
|
)
|
|
|
|
func Register(ctx context.Context, req *user.RegisterResp, callOptions ...callopt.Option) (resp *user.RegisterResp, err error) {
|
|
resp, err = defaultClient.Register(ctx, req, callOptions...)
|
|
if err != nil {
|
|
klog.CtxErrorf(ctx, "Register call failed,err =%+v", err)
|
|
return nil, err
|
|
}
|
|
return resp, nil
|
|
}
|
|
|
|
func Login(ctx context.Context, req *user.LoginReq, callOptions ...callopt.Option) (resp *user.LoginResp, err error) {
|
|
resp, err = defaultClient.Login(ctx, req, callOptions...)
|
|
if err != nil {
|
|
klog.CtxErrorf(ctx, "Login call failed,err =%+v", err)
|
|
return nil, err
|
|
}
|
|
return resp, nil
|
|
}
|