-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
zhaomingqiang
committed
Dec 2, 2021
1 parent
8e772c1
commit 5f14bd1
Showing
4 changed files
with
80 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"github.com/larksuite/oapi-sdk-go/v2" | ||
) | ||
|
||
func main() { | ||
printMessageCard1() | ||
} | ||
|
||
func printMessageCard1() { | ||
card := lark.MessageCard{ | ||
Header: &lark.MessageCardHeader{ | ||
Title: &lark.MessageCardPlainText{Content: "k8s ticket"}, | ||
Template: lark.StringPtr("indigo"), | ||
}, | ||
} | ||
element := &lark.MessageCardAction{} | ||
cluster := &lark.MessageCardEmbedSelectMenuStatic{ | ||
MessageCardEmbedSelectMenuBase: &lark.MessageCardEmbedSelectMenuBase{ | ||
Placeholder: &lark.MessageCardPlainText{ | ||
Content: "choose cluster", | ||
}, | ||
InitialOption: "dev", | ||
}, | ||
} | ||
element.Actions = append(element.Actions, cluster) | ||
card.Elements = append(card.Elements, element) | ||
content, err := card.JSON() | ||
if err != nil { | ||
fmt.Println(err) | ||
} | ||
fmt.Printf("card:%s\n", content) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters