52 lines
893 B
Go
52 lines
893 B
Go
package constants
|
|
|
|
import "net/url"
|
|
|
|
const DingTalkBseUrl = "https://oapi.dingtalk.com"
|
|
|
|
type RequestUrl string
|
|
|
|
const (
|
|
RequestUrlGetUserGet RequestUrl = "/topapi/v2/user/get"
|
|
RequestUrlGetDeptGet RequestUrl = "/topapi/v2/department/get"
|
|
)
|
|
|
|
func GetDingTalkRequestUrl(path RequestUrl, query map[string]string) string {
|
|
u, _ := url.Parse(DingTalkBseUrl + string(path))
|
|
q := u.Query()
|
|
for key, val := range query {
|
|
q.Add(key, val)
|
|
}
|
|
u.RawQuery = q.Encode()
|
|
return u.String()
|
|
}
|
|
|
|
// IsBoss 是否是老板
|
|
type IsBoss int
|
|
|
|
const (
|
|
IsBossTrue IsBoss = 1
|
|
IsBossFalse IsBoss = 0
|
|
)
|
|
|
|
// IsSenior 是否是老板
|
|
type IsSenior int
|
|
|
|
const (
|
|
IsSeniorTrue IsSenior = 1
|
|
IsSeniorFalse IsSenior = 0
|
|
)
|
|
|
|
type ConversationType string
|
|
|
|
const (
|
|
ConversationTypeSingle = "1" // 单聊
|
|
ConversationTypeGroup = "2" //群聊
|
|
)
|
|
|
|
type BotMsgType string
|
|
|
|
const (
|
|
BotMsgTypeText BotMsgType = "text"
|
|
)
|