LaurenceLiZhixin commented on a change in pull request #270:
URL: https://github.com/apache/dubbo-go-samples/pull/270#discussion_r725592829



##########
File path: filter/custom/go-server/conf/dubbogo.yml
##########
@@ -0,0 +1,20 @@
+dubbo:
+  registries:
+    demoZK:
+      protocol: zookeeper
+      timeout: 3s
+      address: 127.0.0.1:2181
+  protocols:
+    dubbo:
+      name: dubbo
+      port: 20000
+  provider:
+    registry:
+      - demoZK
+    services:
+      UserProvider:
+        protocol: dubbo

Review comment:
       protocol -> protocolIDs 

##########
File path: filter/custom/go-client/pkg/user.go
##########
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package pkg
+
+import (
+       "context"
+       "time"
+)
+
+type User struct {
+       ID   string
+       Name string
+       Age  int32
+       Time time.Time
+}
+
+type UserProvider struct {
+       GetUser func(ctx context.Context, req []interface{}, rsp *User) error

Review comment:
       GetUser func(ctx context.Context, req string) (*User, error)

##########
File path: integrate_test/filter/custom/tests/integration/main_test.go
##########
@@ -0,0 +1,66 @@
+// +build integration
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package integration
+
+import (
+       "context"
+       "os"
+       "testing"
+       "time"
+)
+
+import (
+       "dubbo.apache.org/dubbo-go/v3/config"
+       _ "dubbo.apache.org/dubbo-go/v3/imports"
+)
+
+import (
+       hessian "github.com/apache/dubbo-go-hessian2"
+)
+
+var userProvider = &UserProvider{}
+
+func TestMain(m *testing.M) {
+       config.SetConsumerService(userProvider)
+       hessian.RegisterPOJO(&User{})
+       config.Load()
+       time.Sleep(3 * time.Second)
+
+       os.Exit(m.Run())
+}
+
+type User struct {
+       ID   string
+       Name string
+       Age  int32
+       Time time.Time
+}
+
+type UserProvider struct {
+       GetUser func(ctx context.Context, req []interface{}, rsp *User) error

Review comment:
       同上,改为 GetUser func(ctx context.Context, req string) (*User, error)

##########
File path: filter/custom/go-client/conf/dubbogo.yml
##########
@@ -0,0 +1,18 @@
+# dubbo client yaml configure file
+
+dubbo:
+  registries:
+    demoZK:
+      protocol: zookeeper
+      timeout: 3s
+      address: 127.0.0.1:2181
+  consumer:
+    check: true
+    request_timeout: 3s
+    connect_timeout: 3s
+    registry:

Review comment:
       registry: -> registryIDs

##########
File path: integrate_test/filter/custom/tests/integration/main_test.go
##########
@@ -0,0 +1,66 @@
+// +build integration
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package integration
+
+import (
+       "context"
+       "os"
+       "testing"
+       "time"
+)
+
+import (
+       "dubbo.apache.org/dubbo-go/v3/config"
+       _ "dubbo.apache.org/dubbo-go/v3/imports"
+)
+
+import (
+       hessian "github.com/apache/dubbo-go-hessian2"

Review comment:
       移动到第二个import block,
   提交前使用 github.com/dubbogo/tools/cmd/imports-formatter 格式化一下import block

##########
File path: integrate_test/filter/custom/tests/integration/userprovider_test.go
##########
@@ -0,0 +1,39 @@
+// +build integration
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package integration
+
+import (
+       "context"
+       "testing"
+)
+
+import (
+       "github.com/stretchr/testify/assert"
+)
+
+func TestGetUser(t *testing.T) {
+       user := &User{}
+       err := userProvider.GetUser(context.TODO(), []interface{}{"A001"}, user)

Review comment:
       跟随上述接口修改
   user, err := userProvider.GetUser(context.TODO(), "A001")

##########
File path: filter/custom/go-client/pkg/user.go
##########
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package pkg
+
+import (
+       "context"
+       "time"
+)
+
+type User struct {
+       ID   string
+       Name string
+       Age  int32
+       Time time.Time
+}
+
+type UserProvider struct {
+       GetUser func(ctx context.Context, req []interface{}, rsp *User) error
+}
+
+func (u *UserProvider) Reference() string {
+       return "UserProvider"
+}
+
+func (User) JavaClassName() string {

Review comment:
       func (u *User) JavaClassName() string{

##########
File path: filter/custom/go-server/conf/dubbogo.yml
##########
@@ -0,0 +1,20 @@
+dubbo:
+  registries:
+    demoZK:
+      protocol: zookeeper
+      timeout: 3s
+      address: 127.0.0.1:2181
+  protocols:
+    dubbo:
+      name: dubbo
+      port: 20000
+  provider:
+    registry:

Review comment:
       registry -> registryIDs

##########
File path: integrate_test/filter/custom/tests/integration/main_test.go
##########
@@ -0,0 +1,66 @@
+// +build integration
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package integration
+
+import (
+       "context"
+       "os"
+       "testing"
+       "time"
+)
+
+import (
+       "dubbo.apache.org/dubbo-go/v3/config"
+       _ "dubbo.apache.org/dubbo-go/v3/imports"
+)
+
+import (
+       hessian "github.com/apache/dubbo-go-hessian2"
+)
+
+var userProvider = &UserProvider{}
+
+func TestMain(m *testing.M) {
+       config.SetConsumerService(userProvider)
+       hessian.RegisterPOJO(&User{})
+       config.Load()
+       time.Sleep(3 * time.Second)
+
+       os.Exit(m.Run())
+}
+
+type User struct {
+       ID   string
+       Name string
+       Age  int32
+       Time time.Time
+}
+
+type UserProvider struct {
+       GetUser func(ctx context.Context, req []interface{}, rsp *User) error
+}
+
+func (u *UserProvider) Reference() string {

Review comment:
       删掉这个函数

##########
File path: filter/custom/go-client/pkg/user.go
##########
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package pkg
+
+import (
+       "context"
+       "time"
+)
+
+type User struct {
+       ID   string
+       Name string
+       Age  int32
+       Time time.Time
+}
+
+type UserProvider struct {
+       GetUser func(ctx context.Context, req []interface{}, rsp *User) error
+}
+
+func (u *UserProvider) Reference() string {

Review comment:
       删掉这个函数

##########
File path: integrate_test/filter/custom/tests/integration/main_test.go
##########
@@ -0,0 +1,66 @@
+// +build integration
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package integration
+
+import (
+       "context"
+       "os"
+       "testing"
+       "time"
+)
+
+import (
+       "dubbo.apache.org/dubbo-go/v3/config"
+       _ "dubbo.apache.org/dubbo-go/v3/imports"
+)
+
+import (
+       hessian "github.com/apache/dubbo-go-hessian2"
+)
+
+var userProvider = &UserProvider{}
+
+func TestMain(m *testing.M) {
+       config.SetConsumerService(userProvider)
+       hessian.RegisterPOJO(&User{})
+       config.Load()
+       time.Sleep(3 * time.Second)
+
+       os.Exit(m.Run())
+}
+
+type User struct {
+       ID   string
+       Name string
+       Age  int32
+       Time time.Time
+}
+
+type UserProvider struct {
+       GetUser func(ctx context.Context, req []interface{}, rsp *User) error
+}
+
+func (u *UserProvider) Reference() string {
+       return "UserProvider"
+}
+
+func (User) JavaClassName() string {

Review comment:
       func (u *User) J...




-- 
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]

Reply via email to