goProject/trunk/framework/mqMgr/model/request_response_BatchDeleteMessage.go

56 lines
1.3 KiB
Go
Raw Normal View History

2025-01-06 16:01:02 +08:00
package model
import (
"fmt"
)
// 批量删除消息请求对象
type BatchDeleteMessageRequest struct {
// 公共请求参数
common *CommonRequest
// 上次消费消息时返回的消息句柄列表
receiptHandleList []string
}
// 获取请求方法名
func (this *BatchDeleteMessageRequest) GetActionName() string {
return "BatchDeleteMessage"
}
// SetCommonRequestObject 设置公共请求对象
func (this *BatchDeleteMessageRequest) SetCommonRequest(commonRequest *CommonRequest) {
this.common = commonRequest
}
// AssembleParamMap 组装参数字典
// 返回值
// map[string]string:请求参数字典
func (this *BatchDeleteMessageRequest) AssembleParamMap() map[string]string {
paramMap := this.common.AssembleParamMap()
for index, msg := range this.receiptHandleList {
key := fmt.Sprintf("receiptHandle.%d", index)
paramMap[key] = msg
}
return paramMap
}
func NewBatchDeleteMessageRequest(receiptHandleList []string) *BatchDeleteMessageRequest {
return &BatchDeleteMessageRequest{
receiptHandleList: receiptHandleList,
}
}
// 批量删除消息请求返回结果对象
type BatchDeleteMessageResponse struct {
*CommonResponse
// 无法成功删除的错误列表
ErrorList []*ErrorInfo `json:"errorList"`
}
func NewBatchDeleteMessageResponse() *BatchDeleteMessageResponse {
return &BatchDeleteMessageResponse{}
}