Skip to content

Commit

Permalink
Refactor SubscribeMessage struct to use a map for data field
Browse files Browse the repository at this point in the history
  • Loading branch information
royalrick committed Oct 14, 2024
1 parent 5fb84be commit 599c0f8
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions subscribe_message.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,11 +264,15 @@ func (cli *Client) getTemplateList(api, token string) (*GetTemplateListResponse,

// SubscribeMessage 订阅消息
type SubscribeMessage struct {
ToUser string `json:"touser"`
TemplateID string `json:"template_id"`
Page string `json:"page,omitempty"`
MiniprogramState MiniprogramState `json:"miniprogram_state,omitempty"`
Data string `json:"data"`
ToUser string `json:"touser"`
TemplateID string `json:"template_id"`
Page string `json:"page,omitempty"`
MiniprogramState MiniprogramState `json:"miniprogram_state,omitempty"`
Data map[string]SubscribeMessageValue `json:"data"`
}

type SubscribeMessageValue struct {
Value string `json:"value"`
}

// MiniprogramState 跳转小程序类型
Expand Down

0 comments on commit 599c0f8

Please sign in to comment.