7
0
gaore-common-sdk-go/services/sms/feishu.go

58 lines
1.5 KiB
Go

package sms
import (
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
)
type SendFeiShuWebHookRequest struct {
*requests.JsonRequest
Do string `position:"Json" field:"do"`
Token string `position:"Json" field:"token"`
Content string `position:"Json" field:"content"`
Title string `position:"Json" field:"title"`
TitleColor string `position:"Json" field:"title_color"`
}
type SendFeiShuWebHookResponse struct {
*responses.BaseResponse
FeishuData string `json:"feishu_data"`
}
type FeiShuWebHookDoType = string
const (
FeiShuWebHookDoTypeSendSimpleText FeiShuWebHookDoType = "sendSimpleText"
FeiShuWebHookDoTypeSendRichText FeiShuWebHookDoType = "sendRichText"
FeiShuWebHookDoTypeSendCardText FeiShuWebHookDoType = "sendCardText"
)
type SendFeiShuWebHookParam struct {
Do FeiShuWebHookDoType
Token string
Content string
Title string
TitleColor string
}
func CreateSendFeiShuWebHookRequest(param SendFeiShuWebHookParam) (req *SendFeiShuWebHookRequest) {
req = &SendFeiShuWebHookRequest{
JsonRequest: &requests.JsonRequest{},
Do: param.Do,
Token: param.Token,
Content: param.Content,
Title: param.Title,
TitleColor: param.TitleColor,
}
req.InitWithApiInfo(HOST, VERSION, "/feishu/webhook_send")
req.Method = requests.POST
return
}
func CreateSendFeiShuWebHookResponse() (resp *SendFeiShuWebHookResponse) {
resp = &SendFeiShuWebHookResponse{
BaseResponse: &responses.BaseResponse{},
}
return
}