dingtalk

package
v1.8.101 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: Zlib Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const ApiPrefixUrl = "https://oapi.dingtalk.com"

Variables

This section is empty.

Functions

func GetAccessToken

func GetAccessToken(tk token.Token, d data.D) (access.Token, error)

func Notify added in v1.8.4

func Notify(option *config.Options, content interface{}, call FillContentCallback) error

func SendMessage

func SendMessage(corp token.Base, msg Message) (string, error)

SendMessage 发送应用消息,群聊消息,客户欢迎语

Types

type AccessToken

type AccessToken struct {
	Token    string `json:"access_token"`
	ExpireIn int64  `json:"expires_in"`
}

func (AccessToken) GetAccessToken

func (a AccessToken) GetAccessToken() access.Value

func (AccessToken) GetRefAccessToken

func (a AccessToken) GetRefAccessToken() access.Value

type At

type At struct {
	AtMobiles []string `json:"atMobiles,omitempty"`
	AtUserIds []string `json:"atUserIds,omitempty"`
	IsAtAll   bool     `json:"isAtAll,omitempty"`
}
"at": {
          "atMobiles": [
              "150XXXXXXXX"
          ],
          "atUserIds": [
              "user123"
          ],
          "isAtAll": false
      }

type Content

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

type FillContentCallback added in v1.8.4

type FillContentCallback func(*config.Options, interface{}) string

type Image

type Image struct {
	MediaId string `json:"media_id"`
}
type Link struct {
	Title  string `json:"title"`
	Picurl string `json:"picUrl"`
	Text   string `json:"text"`
	Url    string `json:"messageUrl"`
}

type Message

type Message interface {
	IsGroup() bool
	IsAgent() bool
	IsRoot() bool
}

func NewMessage

func NewMessage(toWho ToWho, msgType string, at *At, msg interface{}) Message

type Response

type Response struct {
	Code int32  `json:"errcode"`
	Msg  string `json:"errmsg"`
}

func (Response) ReturnIf

func (r Response) ReturnIf(api *token.Api) error

type ToAgent

type ToAgent struct {
	AgentId int32  `json:"agentid,omitempty"` //应用id
	ToUser  string `json:"touser,omitempty"`  //企业号中的用户帐号
	ToTag   string `json:"totag,omitempty"`   //企业号中的标签id,群发使用(推荐)
	ToParty string `json:"toparty,omitempty"` //企业号中的部门id,群发时使用。
}

func (*ToAgent) IsAgent

func (to *ToAgent) IsAgent() (bool, *ToAgent)

func (*ToAgent) IsGroup

func (to *ToAgent) IsGroup() (bool, *ToGroup)

func (*ToAgent) IsRoot

func (to *ToAgent) IsRoot() (bool, *ToRoot)

type ToGroup

type ToGroup struct {
	ChatId string `json:"chatid,omitempty"`
}

func (*ToGroup) IsAgent

func (to *ToGroup) IsAgent() (bool, *ToAgent)

func (*ToGroup) IsGroup

func (to *ToGroup) IsGroup() (bool, *ToGroup)

func (*ToGroup) IsRoot

func (to *ToGroup) IsRoot() (bool, *ToRoot)

type ToRoot

type ToRoot struct {
}

func (*ToRoot) IsAgent

func (to *ToRoot) IsAgent() (bool, *ToAgent)

func (*ToRoot) IsGroup

func (to *ToRoot) IsGroup() (bool, *ToGroup)

func (*ToRoot) IsRoot

func (to *ToRoot) IsRoot() (bool, *ToRoot)

type ToWho

type ToWho interface {
	IsGroup() (bool, *ToGroup)
	IsAgent() (bool, *ToAgent)
	IsRoot() (bool, *ToRoot)
}

type Video

type Video struct {
	MediaId string `json:"media_id"`
	Title   string `json:"title"`
	Desc    string `json:"description"`
}

type Voice

type Voice struct {
	MediaId string `json:"media_id"`
}

Jump to

Keyboard shortcuts

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