Documentation
¶
Index ¶
- Constants
- Variables
- func GetDecryptMsg(source *model.ThirdSource, signature, timestamp, nonce, secretMsg string) (msg string, err error)
- func GetEncryptMsg(source *model.ThirdSource, msg string) (result map[string]string, err error)
- func GetStaffIdByCode(source *model.ThirdSource, authCode string) (string, error)
- func GetStaffIdListInDepartment(source *model.ThirdSource, dingtalkDeptId string) ([]string, error)
- func GetUser(source *model.ThirdSource, staffId string) (string, error)
- func GetUserOutsideDingtalk(source *model.ThirdSource, code string) (staffId, unionId string, err error)
- func SendMessage(source *model.ThirdSource, dingStaffIdList []string, msg *Message) (taskId string, err error)
- type DeptLeaderInfo
- type GetDepartmentResponse
- type GetUserResponse
- type Message
Constants ¶
View Source
const ( MessageTypeText = "text" MessageTypeImage = "image" MessageTypeVoice = "voice" MessageTypeFile = "file" MessageTypeLink = "link" MessageTypeMarkdown = "markdown" MessageTypeActionCard = "action_card" )
Variables ¶
View Source
var DingTalkCryptoMap = make(map[uint64]*dingTalkCrypto)
Functions ¶
func GetDecryptMsg ¶
func GetDecryptMsg(source *model.ThirdSource, signature, timestamp, nonce, secretMsg string) (msg string, err error)
func GetEncryptMsg ¶
func GetStaffIdByCode ¶
func GetStaffIdByCode(source *model.ThirdSource, authCode string) (string, error)
func GetStaffIdListInDepartment ¶
func GetStaffIdListInDepartment(source *model.ThirdSource, dingtalkDeptId string) ([]string, error)
func GetUserOutsideDingtalk ¶
func GetUserOutsideDingtalk(source *model.ThirdSource, code string) (staffId, unionId string, err error)
GetUserOutsideDingtalk 根据code获取用户信息(浙政钉外三方应用扫码登录)
func SendMessage ¶
Types ¶
type DeptLeaderInfo ¶
type GetDepartmentResponse ¶
type GetDepartmentResponse struct {
DeptId string
Name string
ParentId string
OrderNum int
HasChildren bool
OriginalJson string
}
func GetChildrenDepartments ¶
func GetChildrenDepartments(source *model.ThirdSource, parentId string) ([]*GetDepartmentResponse, error)
func GetDepartment ¶
func GetDepartment(source *model.ThirdSource, externalDeptId string) (*GetDepartmentResponse, error)
type GetUserResponse ¶
type Message ¶
type Message struct {
MsgType string `json:"msgtype"` // text/image/voice/file/link/markdown/action_card
Text struct {
Content string `json:"content"`
} `json:"text"`
Image struct {
MediaId string `json:"media_id"`
} `json:"image"`
Voice struct {
MediaId string `json:"media_id"`
Duration string `json:"duration"`
} `json:"voice"`
File struct {
MediaId string `json:"media_id"`
} `json:"file"`
Link struct {
Title string `json:"title"`
Text string `json:"text"`
PicUrl string `json:"picUrl"`
MessageUrl string `json:"messageUrl"`
} `json:"link"`
Markdown struct {
Title string `json:"title"`
Text string `json:"text"`
} `json:"markdown"`
ActionCard struct {
Title string `json:"title"`
Markdown string `json:"markdown"`
SingleTitle string `json:"single_title"`
SingleUrl string `json:"single_url"`
} `json:"action_card"`
}
Click to show internal directories.
Click to hide internal directories.