Documentation
¶
Index ¶
- func BatchPushMessageAsync(c *api.Context) api.ResponseOptions
- func PushMessageForAllSpecificClient(c *api.Context) api.ResponseOptions
- type BatchPushMessageReq
- type BatchPushMessageRespItem
- type PushMessageFirebaseItem
- type PushMessageForAllSpecificClientReq
- type PushMessageForAllSpecificClientResp
- type PushMessageReq
- type PushMessageReqItem
- type PushMessageResp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BatchPushMessageAsync ¶
func BatchPushMessageAsync(c *api.Context) api.ResponseOptions
BatchPushMessageAsync godoc @Summary 异步批量推送消息 @Description 异步批量推送消息, 推送结果请使用获取推送结果接口查看; 如果请求体中设置了 global_message, 那么所有消息列表中的推送消息将为 global_message, 如果具体消息里单独设置了 message 那么将会覆盖掉 global_message @ID push-messages-for-all-users-async @Tags push-async @Accept json @Produce json @Param message body BatchPushMessageReq true "请求体" @Success 200 {object} api.ResponseEntry{data=handler.PushMessageForAllSpecificClientResp} "ok" @Failure 400 {object} api.ResponseEntry "参数错误" @Failure 500 {object} api.ResponseEntry "内部错误" @Router /v1/batch_push_messages_async [post]
func PushMessageForAllSpecificClient ¶
func PushMessageForAllSpecificClient(c *api.Context) api.ResponseOptions
PushMessageForAllSpecificClient godoc @Summary 给客户端所有用户发送push消息 @Description 给客户端所有用户发送push消息; 不支持每条推送消息单独设置消息内容标题等信息 @ID push-messages-for-all-users @Tags push @Accept json @Produce json @Param message body PushMessageForAllSpecificClientReq true "请求体" @Success 200 {object} api.ResponseEntry{data=PushMessageForAllSpecificClientResp} "ok" @Failure 400 {object} api.ResponseEntry "参数错误" @Failure 500 {object} api.ResponseEntry "内部错误" @Router /v1/batch_push_messages [post]
Types ¶
type BatchPushMessageReq ¶
type BatchPushMessageReq struct {
// 全局的默认批量发送的消息, 如果具体的消息设置了 models.PushMessage 那么将覆盖掉此项
GlobalMessage *models.PushMessage `json:"global_message,omitempty"`
// 批量发送的消息列表
MessageItems []PushMessageReqItem `json:"message_items"`
// 异步处理推送时使用
ActionId string `json:"action_id,omitempty"`
}
type BatchPushMessageRespItem ¶
type BatchPushMessageRespItem struct {
PushMessageReqItem
// 0 为 failed 1 为 succeed
PushStatus int `json:"push_status"`
// 失败的原因
Reason string `json:"reason"`
// 第三方平台的响应
PlatformResp interface{} `json:"platform_resp"`
// 错误
Error error `json:"error"`
}
type PushMessageFirebaseItem ¶
type PushMessageFirebaseItem push.MessageFirebaseItem
type PushMessageForAllSpecificClientReq ¶
type PushMessageForAllSpecificClientReq struct {
// 本次全体推送动作的唯一 id, 用于区分每次全体推送
ActionId string `json:"action_id"`
// 推送消息
Message *models.PushMessage `json:"message,omitempty"`
// 待发送的客户端 app id
AppIds []string `json:"app_ids"`
}
type PushMessageReq ¶
type PushMessageReqItem ¶
type PushMessageReqItem struct {
// 推送消息
Message *models.PushMessage `json:"message,omitempty"`
// app id
AppId string `json:"app_id"`
// 设备 token
Token string `json:"token"`
// 用户 id
UserId string `json:"user_id"`
}
type PushMessageResp ¶
type PushMessageResp struct {
// 用户 id
UserId string `json:"user_id"`
// 设备 token
Token string `json:"token"`
// 0 为 failed 1 为 succeed
PushStatus int `json:"push_status"`
// 发布推送通知的响应信息
PushResult string `json:"push_result,omitempty"`
// 请求第三方平台发送推送消息,第三方平台返回的响应结果
PlatformResp interface{} `json:"platform_resp,omitempty"`
// 假如请求失败, 返回的错误
Error error `json:"error,omitempty"`
}