You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What version of Go and system type/arch are you using?
go 1.22.0, linux/amd64
What version of GoFrame are you using?
2.7.0
Can this bug be re-produced with the latest release?
post a request
What did you do?
when i post a request {"id":0,"ProductName":"","ProductStatus":""} to goframe ,but get {"id":0,"ProductName":"","ProductStatus":""}
//post
curl --location --request POST 'http://192.168.10.211:8888/v1/product/update' --header 'Content-Type: application/json' --header 'Accept: /' --header 'Host: 192.168.10.211:8888' --header 'Connection: keep-alive' --data-raw '{
"id": 5,
"product_name": "xxxx",
"product_status": "开发中",
}'
{"id":0,"ProductName":"","ProductStatus":""}
What version of
Go
and system type/arch are you using?go 1.22.0, linux/amd64
What version of
GoFrame
are you using?2.7.0
Can this bug be re-produced with the latest release?
post a request
What did you do?
when i post a request {"id":0,"ProductName":"","ProductStatus":""} to goframe ,but get {"id":0,"ProductName":"","ProductStatus":""}
//post
curl --location --request POST 'http://192.168.10.211:8888/v1/product/update' --header 'Content-Type: application/json' --header 'Accept: /' --header 'Host: 192.168.10.211:8888' --header 'Connection: keep-alive' --data-raw '{
"id": 5,
"product_name": "xxxx",
"product_status": "开发中",
}'
{"id":0,"ProductName":"","ProductStatus":""}
//controller
func (c *ControllerV1) UpdateSysProduct(ctx context.Context, req *v1.UpdateSysProductReq) (res *v1.UpdateSysProductRes, err error) {
r := g.RequestFromCtx(ctx)
fmt.Println(req)
r.Response.WriteJson(req)
data := model.UpdateSysProductInput{}
err = gconv.Scan(req, &data)
if err != nil {
return nil, err
}
// 调用服务层方法更新部门信息
err = service.SysProduct().UpdateSysProduct(ctx, model.UpdateSysProductInput{
//Id: req.Id,
//ProductName: req.ProductName,
//ProductStatus: req.ProductStatus,
})
}
//api struct
type UpdateSysProductReq struct {
g.Meta
path:"/product/update" method:"post" tags:"product管理" summary:"更新单个product信息"
Id int
v:"min:1#请选择需要update的内容" json:"id" dc:"productID"
// productIDProductCommonData
}
type UpdateSysProductRes struct {
Message string
json:"message" dc:"消息"
// 消息Code int
json:"code" dc:"状态码"
// 状态码}
What did you expect to see?
how can i deal it
What did you see instead?
The text was updated successfully, but these errors were encountered: