Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update menu.go #271

Merged
merged 2 commits into from
May 31, 2020
Merged

Update menu.go #271

merged 2 commits into from
May 31, 2020

Conversation

600ML
Copy link
Contributor

@600ML 600ML commented May 31, 2020

json: cannot unmarshal string into Go struct field MatchRule.conditionalmenu.matchrule.group_id of type int32
接口返回是字符串
"matchrule": {
"group_id": "2"
}

结构体定义
//MatchRule 个性化菜单规则
type MatchRule struct {
GroupID int32 json:"group_id,omitempty"
...
}

json: cannot unmarshal string into Go struct field MatchRule.conditionalmenu.matchrule.group_id of type int32
接口返回是字符串
"matchrule": {
"group_id": "2"
}

结构体定义
//MatchRule 个性化菜单规则
type MatchRule struct {
GroupID int32 json:"group_id,omitempty"
...
}
@silenceper
Copy link
Owner

多谢

Copy link
Owner

@silenceper silenceper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里int32的字段是不是都需要统一改成string

officialaccount/menu/menu.go Outdated Show resolved Hide resolved
 "matchrule": {
        "tag_id": "2", 
        "sex": "1", 
        "country": "中国", 
        "province": "广东", 
        "city": "广州", 
        "client_platform_type": "2", 
        "language": "zh_CN"
    }
@silenceper silenceper merged commit 5d9705d into silenceper:release-2.0 May 31, 2020
@xinzf
Copy link

xinzf commented Feb 7, 2023

MatchRule 里面缺少tag_id

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

菜单查询有bug, 结构体matchrule的group_id字段定义类型错了
3 participants