LaurenceLiZhixin commented on a change in pull request #242:
URL: https://github.com/apache/dubbo-go-samples/pull/242#discussion_r707156625
##########
File path: rpc/jsonrpc/go-client/pkg/user.go
##########
@@ -34,48 +34,48 @@ type JsonRPCUser struct {
func (u JsonRPCUser) String() string {
return fmt.Sprintf(
"User{ID:%s, Name:%s, Age:%d, Time:%s, Sex:%s}",
- u.ID, u.Name, u.Age, time.Unix(u.Time, 0).Format("2006-01-02
15:04:05.99999"), u.Sex,
+ u.ID, u.Name, u.Age, time.Unix(int64(u.Time),
0).Format("2006-01-02 15:04:05.99999"), u.Sex,
)
}
type UserProvider struct {
- GetUsers func(req []interface{}) ([]JsonRPCUser, error)
- GetUser func(ctx context.Context, req []interface{}, rsp *JsonRPCUser)
error
- GetUser0 func(id string, name string) (JsonRPCUser, error)
- GetUser1 func(ctx context.Context, req []interface{}, rsp *JsonRPCUser)
error
- GetUser2 func(ctx context.Context, req []interface{}, rsp *JsonRPCUser)
error `dubbo:"getUser"`
+ GetUsers func(ids []interface{}) ([]*JsonRPCUser, error)
+ GetUser func(ctx context.Context, id string) (*JsonRPCUser, error)
+ GetUser0 func(id string, name string) (*JsonRPCUser, error)
+ GetUser1 func(ctx context.Context, id string) (*JsonRPCUser, error)
+ GetUser2 func(ctx context.Context, id string) (*JsonRPCUser, error)
`dubbo:"getUser"`
GetUser3 func() error
- Echo func(ctx context.Context, req interface{}) (interface{},
error) // Echo represent EchoFilter will be used
+ Echo func(ctx context.Context, req string) (string, error) // Echo
represent EchoFilter will be used
}
func (u *UserProvider) Reference() string {
- return "UserProvider"
+ return "com.ikurento.user.UserProvider"
}
type UserProvider1 struct {
- GetUsers func(req []interface{}) ([]JsonRPCUser, error)
- GetUser func(ctx context.Context, req []interface{}, rsp *JsonRPCUser)
error
- GetUser0 func(id string, name string) (JsonRPCUser, error)
- GetUser1 func(ctx context.Context, req []interface{}, rsp *JsonRPCUser)
error
- GetUser2 func(ctx context.Context, req []interface{}, rsp *JsonRPCUser)
error `dubbo:"getUser"`
+ GetUsers func(ids []interface{}) ([]*JsonRPCUser, error)
+ GetUser func(ctx context.Context, id string) (*JsonRPCUser, error)
+ GetUser0 func(id string, name string) (*JsonRPCUser, error)
+ GetUser1 func(ctx context.Context, id string) (*JsonRPCUser, error)
+ GetUser2 func(ctx context.Context, id string) (*JsonRPCUser, error)
`dubbo:"getUser"`
GetUser3 func() error
- Echo func(ctx context.Context, req interface{}) (interface{},
error) // Echo represent EchoFilter will be used
+ Echo func(ctx context.Context, req string) (string, error) // Echo
represent EchoFilter will be used
}
func (u *UserProvider1) Reference() string {
- return "UserProvider1"
+ return "com.ikurento.user.UserProvider1"
}
type UserProvider2 struct {
- GetUsers func(req []interface{}) ([]JsonRPCUser, error)
- GetUser func(ctx context.Context, req []interface{}, rsp *JsonRPCUser)
error
- GetUser0 func(id string, name string) (JsonRPCUser, error)
- GetUser1 func(ctx context.Context, req []interface{}, rsp *JsonRPCUser)
error
- GetUser2 func(ctx context.Context, req []interface{}, rsp *JsonRPCUser)
error `dubbo:"getUser"`
+ GetUsers func(ids []interface{}) ([]*JsonRPCUser, error)
+ GetUser func(ctx context.Context, id string) (*JsonRPCUser, error)
+ GetUser0 func(id string, name string) (*JsonRPCUser, error)
+ GetUser1 func(ctx context.Context, id string) (*JsonRPCUser, error)
+ GetUser2 func(ctx context.Context, id string) (*JsonRPCUser, error)
`dubbo:"getUser"`
GetUser3 func() error
- Echo func(ctx context.Context, req interface{}) (interface{},
error) // Echo represent EchoFilter will be used
+ Echo func(ctx context.Context, req string) (string, error) // Echo
represent EchoFilter will be used
}
func (u *UserProvider2) Reference() string {
Review comment:
Reference 我们全部删掉,在配置文件中,配置UserProvider2,替换原来的Reference
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]