Skip to content
This repository was archived by the owner on Jul 3, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions SDK/auth/authorization_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ func TestAutoDisableTenantToken(t *testing.T) {
config := protocol.ConfigForm{
MinVersion: protocol.VersionForm{},
WideScreenMode: true,
EnableForward: false,
}
builder.SetConfig(config)

Expand Down
8 changes: 8 additions & 0 deletions SDK/message/card_builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ func TestCardAsyncButton(t *testing.T) {
config := protocol.ConfigForm{
MinVersion: protocol.VersionForm{},
WideScreenMode: true,
EnableForward: false,
}
builder.SetConfig(config)
//add block
Expand Down Expand Up @@ -81,6 +82,7 @@ func TestCardSyncButton(t *testing.T) {
config := protocol.ConfigForm{
MinVersion: protocol.VersionForm{},
WideScreenMode: true,
EnableForward: false,
}
builder.SetConfig(config)

Expand Down Expand Up @@ -132,6 +134,7 @@ func TestCardJumpButton(t *testing.T) {
config := protocol.ConfigForm{
MinVersion: protocol.VersionForm{},
WideScreenMode: true,
EnableForward: false,
}
builder.SetConfig(config)
//add block
Expand Down Expand Up @@ -172,6 +175,7 @@ func TestCardImage(t *testing.T) {
config := protocol.ConfigForm{
MinVersion: protocol.VersionForm{},
WideScreenMode: true,
EnableForward: false,
}
builder.SetConfig(config)
//add block
Expand Down Expand Up @@ -215,6 +219,7 @@ func TestCardSelectStaticMenu(t *testing.T) {
config := protocol.ConfigForm{
MinVersion: protocol.VersionForm{},
WideScreenMode: true,
EnableForward: false,
}
builder.SetConfig(config)
//add block
Expand Down Expand Up @@ -265,6 +270,7 @@ func TestCardSelectPersonMenu(t *testing.T) {
config := protocol.ConfigForm{
MinVersion: protocol.VersionForm{},
WideScreenMode: true,
EnableForward: false,
}
builder.SetConfig(config)
//add block
Expand Down Expand Up @@ -308,6 +314,7 @@ func TestCardOverFlowMenu(t *testing.T) {
config := protocol.ConfigForm{
MinVersion: protocol.VersionForm{},
WideScreenMode: true,
EnableForward: false,
}
builder.SetConfig(config)
//add block
Expand Down Expand Up @@ -356,6 +363,7 @@ func TestCardDatePicker(t *testing.T) {
config := protocol.ConfigForm{
MinVersion: protocol.VersionForm{},
WideScreenMode: true,
EnableForward: false,
}
builder.SetConfig(config)
//add block
Expand Down
5 changes: 4 additions & 1 deletion SDK/message/message_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ func TestSendCardMessage(t *testing.T) {
config := protocol.ConfigForm{
MinVersion: protocol.VersionForm{},
WideScreenMode: true,
EnableForward: false,
}
builder.SetConfig(config)

Expand Down Expand Up @@ -356,9 +357,11 @@ func TestBatchSendCardMessage(t *testing.T) {
url := "https://www.google.com"
content := "card message test"
card := protocol.CardForm{
Config: &protocol.ConfigForm{MinVersion: protocol.VersionForm{Version: "1.0"},
Config: &protocol.ConfigForm{
MinVersion: protocol.VersionForm{Version: "1.0"},
Debug: true,
WideScreenMode: true,
EnableForward: false,
},
CardLink: &protocol.URLForm{
Url: &url,
Expand Down
1 change: 1 addition & 0 deletions SDK/protocol/card_element.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ type ConfigForm struct {
MinVersion VersionForm `json:"min_version,omitempty" validate:"omitempty"`
Debug bool `json:"debug,omitempty" validate:"omitempty"`
WideScreenMode bool `json:"wide_screen_mode,omitempty" validate:"omitempty"`
EnableForward bool `json:"enable_forward,omitempty" validate:"omitempty"`
}

type VersionForm struct {
Expand Down
2 changes: 2 additions & 0 deletions demo/bot_receive_and_response/bot_receive_and_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ func BotRecvMsgCard(ctx context.Context, msg *protocol.BotRecvMsg) error {
config := protocol.ConfigForm{
MinVersion: protocol.VersionForm{},
WideScreenMode: true,
EnableForward: false,
}
builder.SetConfig(config)

Expand Down Expand Up @@ -192,6 +193,7 @@ func ActionClickButton(ctx context.Context, callback *protocol.CardCallbackForm)
config := protocol.ConfigForm{
MinVersion: protocol.VersionForm{},
WideScreenMode: true,
EnableForward: false,
}
builder.SetConfig(config)

Expand Down
1 change: 1 addition & 0 deletions demo/send_card/send_card.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func sendCard(chatID, tenantKey, appID string) error {
config := protocol.ConfigForm{
MinVersion: protocol.VersionForm{},
WideScreenMode: true,
EnableForward: false,
}
builder.SetConfig(config)

Expand Down
8 changes: 5 additions & 3 deletions docs/us/send_card.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ builder := &message.CardBuilder{}
config := protocol.ConfigForm{
MinVersion: protocol.VersionForm{},
WideScreenMode: true,
EnableForward: false,
}
builder.SetConfig(config)
```
Expand Down Expand Up @@ -250,9 +251,10 @@ func UpdateCard(token, tenantkey, appid string, openid []string) error {
builder := &message.CardBuilder{}
//add config
config := protocol.ConfigForm{
MinVersion: protocol.VersionForm{},
WideScreenMode: true,
}
MinVersion: protocol.VersionForm{},
WideScreenMode: true,
EnableForward: false,
}
builder.SetConfig(config)

//add header
Expand Down
10 changes: 6 additions & 4 deletions docs/us/webhook_card.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ func BotRecvMsgCard(ctx context.Context, msg *protocol.BotRecvMsg) error {
builder := &message.CardBuilder{}
//add config
config := protocol.ConfigForm{
MinVersion: protocol.VersionForm{},
WideScreenMode: true,
MinVersion: protocol.VersionForm{},
WideScreenMode: true,
EnableForward: false,
}
builder.SetConfig(config)

Expand Down Expand Up @@ -131,8 +132,9 @@ func ActionClickButton(ctx context.Context, callback *protocol.CardCallbackForm)

//add config
config := protocol.ConfigForm{
MinVersion: protocol.VersionForm{},
WideScreenMode: true,
MinVersion: protocol.VersionForm{},
WideScreenMode: true,
EnableForward: false,
}
builder.SetConfig(config)

Expand Down
15 changes: 9 additions & 6 deletions docs/zh/send_card.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ builder := &message.CardBuilder{}
2. 添加和配置 config
```go
//add config
config := protocol.ConfigForm{
MinVersion: protocol.VersionForm{},
WideScreenMode: true,
type ConfigForm struct {
MinVersion VersionForm `json:"min_version,omitempty" validate:"omitempty"`
Debug bool `json:"debug,omitempty" validate:"omitempty"`
WideScreenMode bool `json:"wide_screen_mode,omitempty" validate:"omitempty"`
EnableForward bool `json:"enable_forward,omitempty" validate:"omitempty"`
}
builder.SetConfig(config)
```
Expand Down Expand Up @@ -236,9 +238,10 @@ func UpdateCard(token, tenantkey, appid string, openid []string) error {
builder := &message.CardBuilder{}
//add config
config := protocol.ConfigForm{
MinVersion: protocol.VersionForm{},
WideScreenMode: true,
}
MinVersion: protocol.VersionForm{},
WideScreenMode: true,
EnableForward: false,
}
builder.SetConfig(config)

//add header
Expand Down
14 changes: 8 additions & 6 deletions docs/zh/webhook_card.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,10 @@ func BotRecvMsgCard(ctx context.Context, msg *protocol.BotRecvMsg) error {
builder := &message.CardBuilder{}
//add config
config := protocol.ConfigForm{
MinVersion: protocol.VersionForm{},
WideScreenMode: true,
}
MinVersion: protocol.VersionForm{},
WideScreenMode: true,
EnableForward: false,
}
builder.SetConfig(config)

//add header
Expand Down Expand Up @@ -144,9 +145,10 @@ func ActionClickButton(ctx context.Context, callback *protocol.CardCallbackForm)

//add config
config := protocol.ConfigForm{
MinVersion: protocol.VersionForm{},
WideScreenMode: true,
}
MinVersion: protocol.VersionForm{},
WideScreenMode: true,
EnableForward: false,
}
builder.SetConfig(config)

//add header
Expand Down