webhook

package
v0.0.0-...-54ebfb4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 1, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const API string = "https://oapi.dingtalk.com/robot/send?access_token="

Variables

This section is empty.

Functions

func SendActionCard

func SendActionCard(accessToken string, text string, title string, hideAvatar string, btnOrientation string, singleTitle string, singleURL string) (string, error)

发送链接地址

整体跳转ActionCard类型 {     "actionCard": {         "title": "乔布斯 20 年前想打造一间苹果咖啡厅,而它正是 Apple Store 的前身",         "text": "![screenshot](@lADOpwk3K80C0M0FoA)  ### 乔布斯 20 年前想打造的苹果咖啡厅  Apple Store 的设计正从原来满满的科技感走向生活化,而其生活化的走向其实可以追溯到 20 年前苹果一个建立咖啡馆的计划",         "hideAvatar": "0",         "btnOrientation": "0",         "singleTitle" : "阅读全文",         "singleURL" : "https://www.dingtalk.com/"     },     "msgtype": "actionCard" }

func SendActionCardBtns

func SendActionCardBtns(accessToken string, text string, title string, hideAvatar string, btnOrientation string, btns []Btns) (string, error)

* 独立跳转ActionCard类型

{
    "actionCard": {
        "title": "乔布斯 20 年前想打造一间苹果咖啡厅,而它正是 Apple Store 的前身",
        "text": "![screenshot](@lADOpwk3K80C0M0FoA)
 ### 乔布斯 20 年前想打造的苹果咖啡厅
 Apple Store 的设计正从原来满满的科技感走向生活化,而其生活化的走向其实可以追溯到 20 年前苹果一个建立咖啡馆的计划",
        "hideAvatar": "0",
        "btnOrientation": "0",
        "btns": [
            {
                "title": "内容不错",
                "actionURL": "https://www.dingtalk.com/"
            },
            {
                "title": "不感兴趣",
                "actionURL": "https://www.dingtalk.com/"
            }
        ]
    },
    "msgtype": "actionCard"
}

func SendFeedCard

func SendFeedCard(accessToken string, links []Link) (string, error)

FeedCard类型

func SendLink(accessToken string, text string, title string, picUrl string, messageUrl string) (string, error)

发送链接地址

func SendText

func SendText(accessToken string, content string) (string, error)

发送文本内容

Types

type ActionCard

type ActionCard struct {
	Text           string `json:"text"`
	Tile           string `json:"title"`
	HideAvatar     string `json:"hideAvatar"`
	BtnOrientation string `json:"btnOrientation"`
	SingleTitle    string `json:"singleTitle"`
	SingleURL      string `json:"singleURL"`
}

整体跳转ActionCard类型

type ActionCardBtns

type ActionCardBtns struct {
	Text           string `json:"text"`
	Tile           string `json:"title"`
	HideAvatar     string `json:"hideAvatar"`
	BtnOrientation string `json:"btnOrientation"`
	Btns           []Btns `json:"btns"`
}

独立跳转ActionCard类型

type At

type At struct {
	AtMobiles []string `json:"atMobiles"`
	IsAtAll   bool     `json:"isAtAll"`
}

@人的操作

type Btns

type Btns struct {
	Title     string `json:"title"`
	ActionURL string `json:"actionURL"`
}
type FeedCardLink struct {
	Links []Link `json:"links"`
}
type Link struct {
	Text       string `json:"text"`
	Title      string `json:"title"`
	PicUrl     string `json:"picUrl"`
	MessageUrl string `json:"messageUrl"`
}

link 类型详细

type MsgActionCard

type MsgActionCard struct {
	MsgType    string     `json:"msgtype"`
	ActionCard ActionCard `json:"actionCard"`
}

整体跳转ActionCard类型

type MsgActionCardBtns

type MsgActionCardBtns struct {
	MsgType    string         `json:"msgtype"`
	ActionCard ActionCardBtns `json:"actionCard"`
}

type MsgFeedCard

type MsgFeedCard struct {
	MsgType      string       `json:"msgtype"`
	FeedCardLink FeedCardLink `json:"feedCard"`
}

FeedCard类型

type MsgLink struct {
	MsgType string `json:"msgtype"`
	Link    Link   `json:"link"`
}

link类型

type MsgText

type MsgText struct {
	MsgType string `json:"msgtype"`
	Text    Text   `json:"text"`
	At      At     `json:"at"`
}

具体的消息数字题

type Text

type Text struct {
	Content string `json:"content"`
}

文本内容主体

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL