goProject/.svn/pristine/bc/bc3b70d0e67d7c540ee994071895fcc82ea4a536.svn-base
2025-01-06 16:21:36 +08:00

53 lines
1.3 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package model
import (
"fmt"
)
// 消费消息请求对象
type ReceiveMessageRequest struct {
// 公共请求参数
common *CommonRequest
// 本次请求的长轮询等待时间。取值范围0 - 30秒如果不设置该参数则默认使用队列属性中的 pollingWaitSeconds 值。
pollingWaitSeconds int
}
// 获取请求方法名
func (this *ReceiveMessageRequest) GetActionName() string {
return "ReceiveMessage"
}
// SetCommonRequestObject 设置公共请求对象
func (this *ReceiveMessageRequest) SetCommonRequest(commonRequest *CommonRequest) {
this.common = commonRequest
}
// AssembleParamMap 组装参数字典
// 返回值
// map[string]string:请求参数字典
func (this *ReceiveMessageRequest) AssembleParamMap() map[string]string {
paramMap := this.common.AssembleParamMap()
paramMap["pollingWaitSeconds"] = fmt.Sprintf("%d", this.pollingWaitSeconds)
return paramMap
}
func NewReceiveMessageRequest(pollingWaitSeconds int) *ReceiveMessageRequest {
return &ReceiveMessageRequest{
pollingWaitSeconds: pollingWaitSeconds,
}
}
// 消费消息请求返回结果对象
type ReceiveMessageResponse struct {
*CommonResponse
// 消息对象
*MessageInfo
}
func NewReceiveMessageResponse() *ReceiveMessageResponse {
return &ReceiveMessageResponse{}
}