You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "mengccmumu (via GitHub)" <gi...@apache.org> on 2023/06/18 08:26:37 UTC

[GitHub] [dubbo-go-pixiu] mengccmumu opened a new issue, #569: 对于map[string]interface{}类型数据,pi xiu返回200,body却为空

mengccmumu opened a new issue, #569:
URL: https://github.com/apache/dubbo-go-pixiu/issues/569

   <!-- Please use this template while reporting a bug and provide as much info as possible. Not doing so may result in your bug not being addressed in a timely manner. Thanks!
   
   -->
   
   
   **What happened**:
   用go 启动自定义provider ,定义响应结果为
   ```
   type Test struct { 
       Code int
       Msg string
       Data []map[string]interface{}
   }
   ```
   Data中interface{}有多重可能赋值,可能又是map[string]string,亦或者是struct
   发起curl请求pi-xiu,响应HTTP CODE 为200,但是body内容为空, 查看pi-xiu标准输出日志确实有dubbo provider响应数据。
   是因为解析失败所以body为空?
   
   **What you expected to happen**:
   
   **How to reproduce it (as minimally and precisely as possible)**:
   
   **Anything else we need to know?**:
   


-- 
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: notifications-unsubscribe@dubbo.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go-pixiu] mark4z commented on issue #569: 对于map[string]interface{}类型数据,pi xiu返回200,body却为空

Posted by "mark4z (via GitHub)" <gi...@apache.org>.
mark4z commented on issue #569:
URL: https://github.com/apache/dubbo-go-pixiu/issues/569#issuecomment-1636733944

   数组中多了一个逗号,如果修改了以后还是不行,欢迎重新打开issue


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go-pixiu] mark4z commented on issue #569: 对于map[string]interface{}类型数据,pi xiu返回200,body却为空

Posted by "mark4z (via GitHub)" <gi...@apache.org>.
mark4z commented on issue #569:
URL: https://github.com/apache/dubbo-go-pixiu/issues/569#issuecomment-1636733850

   仅就以上的例子来说,pixiu解析这里是没问题的。因为data就是空的。因为respjson不符合json格式


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go-pixiu] mark4z closed issue #569: 对于map[string]interface{}类型数据,pi xiu返回200,body却为空

Posted by "mark4z (via GitHub)" <gi...@apache.org>.
mark4z closed issue #569: 对于map[string]interface{}类型数据,pi xiu返回200,body却为空
URL: https://github.com/apache/dubbo-go-pixiu/issues/569


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go-pixiu] mark4z commented on issue #569: 对于map[string]interface{}类型数据,pi xiu返回200,body却为空

Posted by "mark4z (via GitHub)" <gi...@apache.org>.
mark4z commented on issue #569:
URL: https://github.com/apache/dubbo-go-pixiu/issues/569#issuecomment-1596382286

   可否提供一个provider的最小demo


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go-pixiu] mengccmumu commented on issue #569: 对于map[string]interface{}类型数据,pi xiu返回200,body却为空

Posted by "mengccmumu (via GitHub)" <gi...@apache.org>.
mengccmumu commented on issue #569:
URL: https://github.com/apache/dubbo-go-pixiu/issues/569#issuecomment-1597307900

   > 可否提供一个provider的最小demo
   
   ```
   package TbConfig
   
   import (
   	"dubbo.apache.org/dubbo-go/v3/config"
   	hessian "github.com/apache/dubbo-go-hessian2"
   )
   
   // 
   func NewBuild() *TbConfig {
   	return &TbConfig{}
   }
   
   // 
   func init() {
   	config.SetProviderService(&TbConfig{})
   	hessian.RegisterPOJO(&TbConfigRequest{})
   	hessian.RegisterPOJO(&ConfigResponse{})
   }
   
   type TbConfig struct {
   }
   
   type AResponse struct {
   	Code int32       `json:"code"`
   	Msg  string      `json:"msg"`
   	Data interface{} `json:"data"`
   }
   
   type TbConfigRequest struct {
   	paramsV      int
   }
   
   type TbConfigResponse struct {
   	Count      int
   	SMap []map[string]interface{}
   }
   
   func (*TbConfig) GetName() string {
   	return "TbConfig"
   }
   func (*TbConfig) GetInterface() string {
   	return "dubbo.golang.a.api.TbConfig"
   }
   
   // Get 
   func (*TbConfig) Get(ctx context.Context, request *TbConfigRequest) (*AResponse, error) {
   	response := &AResponse{}
   	if paramsV == 1 {
   		response.Code = 1
   		response.Msg = "failed"
   		return response, nil
   	}
   	respjson := `
   	{
   		"name" : "test",
   		"values" : [
   			{
   				"a" : 1,
   				"b" : 2
   			},
   			{
   				"a" : 3,
   				"b" : 4
   			},
   		]
   	}
   	`
   
   	resp := make(map[string]interface{})
   	_ = json.Unmarshal([]byte(respjson), &resp)
   	response.Data = resp
   	return response, nil
   }
   
   
   func (TbConfigRequest) JavaClassName() string {
   	return "dubbo.golang.a.b.c.TbConfigRequest"
   }
   
   func (TbConfigResponse) JavaClassName() string {
   	return "dubbo.golang.a.b.c.TbConfigResponse"
   }
   
   ```


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org