first commit
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
package req
|
||||
|
||||
// 消息回调相关的请求模型
|
||||
|
||||
// MessageCallbackConfigModel 消息回调配置请求模型
|
||||
type MessageCallbackConfigModel struct {
|
||||
CallbackURL string `json:"CallbackURL" binding:"required"` // 回调URL
|
||||
Enabled bool `json:"Enabled"` // 是否启用回调
|
||||
}
|
||||
|
||||
// MessageCallbackPayload 消息回调负载
|
||||
type MessageCallbackPayload struct {
|
||||
MessageID string `json:"message_id"` // 消息ID
|
||||
FromUser string `json:"from_user"` // 发送者
|
||||
ToUser string `json:"to_user"` // 接收者
|
||||
IsGroup bool `json:"is_group"` // 是否群消息
|
||||
MessageType int `json:"message_type"` // 消息类型
|
||||
Content string `json:"content"` // 消息内容
|
||||
MessageData interface{} `json:"message_data"` // 消息数据
|
||||
CreateTime int64 `json:"create_time"` // 消息创建时间
|
||||
}
|
||||
@@ -0,0 +1,505 @@
|
||||
package req
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
// 指令参数
|
||||
// 自动抢红包 101
|
||||
type AutoRedRequestModel struct {
|
||||
Enable int32 `example:"1"` // 是否开启领取红包机制
|
||||
Single int32 `example:"1"` // 是否仅抢单个红包(不同时抢多个)
|
||||
AutoReply int32 `example:"1"` // 是否自动回复感谢
|
||||
TimeInSeconds int32 `example:"0"` // 延迟回复的时间,单位为秒
|
||||
ReplyMessages string // 回复内容(多个消息用逗号隔开)
|
||||
}
|
||||
|
||||
func DealAutoRed(model *AutoRedRequestModel) {
|
||||
if model.Enable != 1 {
|
||||
model.Enable = 0
|
||||
}
|
||||
if model.Single != 1 {
|
||||
model.Single = 0
|
||||
}
|
||||
if model.AutoReply != 1 {
|
||||
model.AutoReply = 0
|
||||
}
|
||||
// TimeInSeconds 0-60
|
||||
if model.TimeInSeconds < 0 {
|
||||
model.TimeInSeconds = 0
|
||||
} else if model.TimeInSeconds > 60 {
|
||||
model.TimeInSeconds = 60
|
||||
}
|
||||
_, model.ReplyMessages = StringToSlice(model.ReplyMessages)
|
||||
}
|
||||
|
||||
// 自动接收转账 106
|
||||
type AutoTransferRequestModel struct {
|
||||
Enable int32 `example:"1"` // 是否开启接收转账功能
|
||||
AutoReply int32 `example:"1"` // 是否开启自动回复
|
||||
TimeInSeconds int32 `example:"0"` // 延迟回复的时间,单位为秒
|
||||
ReplyMessage string // 回复内容(仅一条)
|
||||
}
|
||||
|
||||
func DealTransfer(model *AutoTransferRequestModel) {
|
||||
if model.Enable != 1 {
|
||||
model.Enable = 0
|
||||
}
|
||||
if model.AutoReply != 1 {
|
||||
model.AutoReply = 0
|
||||
}
|
||||
// TimeInSeconds 0-60
|
||||
if model.TimeInSeconds < 0 {
|
||||
model.TimeInSeconds = 0
|
||||
} else if model.TimeInSeconds > 60 {
|
||||
model.TimeInSeconds = 60
|
||||
}
|
||||
model.ReplyMessage = StringTo1000(model.ReplyMessage)
|
||||
}
|
||||
|
||||
// 延迟领取红包 103
|
||||
type DelayRedRequestModel struct {
|
||||
TimeInSeconds int32 `example:"0"` // 延迟领取红包的时间,单位为秒
|
||||
}
|
||||
|
||||
func DealDelayRed(model *DelayRedRequestModel) {
|
||||
// TimeInSeconds 0-60
|
||||
if model.TimeInSeconds < 0 {
|
||||
model.TimeInSeconds = 0
|
||||
} else if model.TimeInSeconds > 60 {
|
||||
model.TimeInSeconds = 60
|
||||
}
|
||||
}
|
||||
|
||||
// 延迟接收转账 113
|
||||
type DelayAutoTransferRequestModel struct {
|
||||
TimeInSeconds int32 `example:"0"` // 延迟接收转账的时间,单位为秒
|
||||
}
|
||||
|
||||
func DealDelayTransfer(model *DelayAutoTransferRequestModel) {
|
||||
// TimeInSeconds 0-60
|
||||
if model.TimeInSeconds < 0 {
|
||||
model.TimeInSeconds = 0
|
||||
} else if model.TimeInSeconds > 60 {
|
||||
model.TimeInSeconds = 60
|
||||
}
|
||||
}
|
||||
|
||||
// 关键字包不抢 118
|
||||
type KeywordAvoidanceRequestModel struct {
|
||||
Enable int32 `example:"1"` // 是否开启关键字包不抢
|
||||
Keywords string // 设置关键字(多个用逗号隔开)
|
||||
}
|
||||
|
||||
func DealKeywordAvoidance(model *KeywordAvoidanceRequestModel) {
|
||||
if model.Enable != 1 {
|
||||
model.Enable = 0
|
||||
}
|
||||
_, model.Keywords = StringToSlice(model.Keywords)
|
||||
}
|
||||
|
||||
// 自动点赞 401
|
||||
type AutoLikeRequestModel struct {
|
||||
Enable int32 `example:"1"` // 是否开启自动点赞
|
||||
StartTime string // 开始时间 // 点赞时间段
|
||||
EndTime string // 结束时间// 点赞时间段
|
||||
TimeInSeconds int32 `example:"0"` // 延迟点赞的时间,单位为秒
|
||||
Mode int32 `example:"1"` // 模式,1-仅点赞分组,0-不点赞分组
|
||||
Groups string // 设置分组,多个用逗号隔开
|
||||
}
|
||||
|
||||
func DealAutoLike(model *AutoLikeRequestModel) {
|
||||
if model.Enable != 1 {
|
||||
model.Enable = 0
|
||||
}
|
||||
// TimeInSeconds 0-60
|
||||
if model.TimeInSeconds < 0 {
|
||||
model.TimeInSeconds = 0
|
||||
} else if model.TimeInSeconds > 60 {
|
||||
model.TimeInSeconds = 60
|
||||
}
|
||||
if model.Mode != 1 {
|
||||
model.Mode = 0
|
||||
}
|
||||
_, model.Groups = StringToSlice(model.Groups)
|
||||
}
|
||||
|
||||
// 朋友圈跟随转发 402
|
||||
type AutoForwardRequestModel struct {
|
||||
EnableAutoForward int32 `example:"1"` // 是否开启跟随转发
|
||||
IsBlockAuthor int32 `example:"1"` // 是否屏蔽作者
|
||||
IsBlockGroup int32 `example:"1"` // 是否屏蔽组
|
||||
Groups string // 设置分组,多个用逗号隔开
|
||||
}
|
||||
|
||||
func DealAutoForward(model *AutoForwardRequestModel) {
|
||||
if model.EnableAutoForward != 1 {
|
||||
model.EnableAutoForward = 0
|
||||
}
|
||||
if model.IsBlockAuthor != 1 {
|
||||
model.IsBlockAuthor = 0
|
||||
}
|
||||
if model.IsBlockGroup != 1 {
|
||||
model.IsBlockGroup = 0
|
||||
}
|
||||
_, model.Groups = StringToSlice(model.Groups)
|
||||
}
|
||||
|
||||
// 朋友圈收藏转发 403
|
||||
type FavoriteForwardRequestModel struct {
|
||||
EnableFavoriteForward int32 `example:"1"` // 是否开启收藏转发
|
||||
IsBlockAuthor int32 `example:"1"` // 是否屏蔽作者
|
||||
IsBlockGroup int32 `example:"1"` // 是否屏蔽组
|
||||
Groups string // 设置分组,多个用逗号隔开
|
||||
}
|
||||
|
||||
func DealFavoriteForward(model *FavoriteForwardRequestModel) {
|
||||
if model.EnableFavoriteForward != 1 {
|
||||
model.EnableFavoriteForward = 0
|
||||
}
|
||||
if model.IsBlockAuthor != 1 {
|
||||
model.IsBlockAuthor = 0
|
||||
}
|
||||
if model.IsBlockGroup != 1 {
|
||||
model.IsBlockGroup = 0
|
||||
}
|
||||
_, model.Groups = StringToSlice(model.Groups)
|
||||
}
|
||||
|
||||
// 朋友圈自动评论 404
|
||||
type AutoCommentRequestModel struct {
|
||||
Enable int32 `example:"1"` // 是否开启自动评论
|
||||
CommentMessages string // 评论内容(多条用逗号隔开)
|
||||
StartTime string // 评论时间段,开始时间
|
||||
EndTime string // 评论时间段,结束时间
|
||||
TimeInSeconds int32 `example:"0"` // 延迟评论的时间,单位为秒
|
||||
Mode int32 `example:"1"` // 模式,1-仅评论分组,0-不评论分组
|
||||
Groups string // 设置分组,多个用逗号隔开
|
||||
}
|
||||
|
||||
func DealAutoComment(model *AutoCommentRequestModel) {
|
||||
if model.Enable != 1 {
|
||||
model.Enable = 0
|
||||
}
|
||||
_, model.CommentMessages = StringToSlice(model.CommentMessages)
|
||||
// TimeInSeconds 0-60
|
||||
if model.TimeInSeconds < 0 {
|
||||
model.TimeInSeconds = 0
|
||||
} else if model.TimeInSeconds > 60 {
|
||||
model.TimeInSeconds = 60
|
||||
}
|
||||
if model.Mode != 1 {
|
||||
model.Mode = 0
|
||||
}
|
||||
_, model.Groups = StringToSlice(model.Groups)
|
||||
}
|
||||
|
||||
// 定时发朋友圈 405
|
||||
type MomentsRequestModel struct {
|
||||
MomentType int32 `example:"1"` // 发圈类型,1-文字,3-图片
|
||||
MomentContent string // 朋友圈内容
|
||||
MomentImages string // 朋友圈图片(最多上传9张,图片路径或链接用逗号隔开)
|
||||
IsBlock int32 `example:"1"` // 发圈时屏蔽组
|
||||
Groups string // 设置分组,多个用逗号隔开
|
||||
ScheduledTime string // 预约发圈时间
|
||||
Status int32 `example:"0"` // 状态,0-未发布,1-已发布,-1-发布失败
|
||||
}
|
||||
|
||||
func DealMoments(model *MomentsRequestModel) {
|
||||
// MomentType must be either 1 or 3
|
||||
if model.MomentType != 3 {
|
||||
model.MomentType = 1 // Default to 1 if invalid
|
||||
}
|
||||
model.MomentContent = StringTo1000(model.MomentContent)
|
||||
_, model.MomentImages = StringToSlice(model.MomentImages)
|
||||
if model.IsBlock != 1 {
|
||||
model.IsBlock = 0
|
||||
|
||||
}
|
||||
_, model.Groups = StringToSlice(model.Groups)
|
||||
// Status can remain as is since it is already initialized
|
||||
}
|
||||
|
||||
// 发大视频朋友圈 406
|
||||
type MomentsPostRequestModel struct {
|
||||
Content string // 朋友圈内容
|
||||
VideoURL string // 视频,最大500M(最多上传1个)
|
||||
IsBlock int32 `example:"1"` // 发圈时屏蔽组
|
||||
Groups string // 设置分组,多个用逗号隔开
|
||||
}
|
||||
|
||||
func DealMomentsPost(model *MomentsPostRequestModel) {
|
||||
model.Content = StringTo1000(model.Content)
|
||||
model.VideoURL = StringTo1000(model.VideoURL)
|
||||
if model.IsBlock != 1 {
|
||||
model.IsBlock = 0
|
||||
}
|
||||
_, model.Groups = StringToSlice(model.Groups)
|
||||
}
|
||||
|
||||
// 欢迎新人入群 502
|
||||
type WelcomeNewMemberRequestModel struct {
|
||||
Enable int32 `example:"1"` // 是否开启欢迎新人入群
|
||||
WelcomeMsg string // 欢迎语内容(仅一条)
|
||||
Mode int32 `example:"1"` // 模式,1-仅欢迎设置群,0-不欢迎设置群
|
||||
Rooms string // 设置的群
|
||||
}
|
||||
|
||||
func DealWelcomeNewMember(model *WelcomeNewMemberRequestModel) {
|
||||
if model.Enable != 1 {
|
||||
model.Enable = 0
|
||||
}
|
||||
model.WelcomeMsg = StringTo1000(model.WelcomeMsg)
|
||||
if model.Mode != 1 {
|
||||
model.Mode = 0
|
||||
}
|
||||
_, model.Rooms = StringToSlice(model.Rooms)
|
||||
}
|
||||
|
||||
// 关键词自动踢人 503
|
||||
type KeywordKickRequestModel struct {
|
||||
Enable int32 `example:"1"` // 是否开启关键词踢人
|
||||
Keywords string // 触发的关键词(多条用逗号分隔)
|
||||
IsLinkKick int32 `example:"1"` // 是否踢发链接的人
|
||||
IsCardKick int32 `example:"1"` // 是否踢发名片的人
|
||||
IsMiniProgramKick int32 `example:"1"` // 是否踢发小程序的人
|
||||
IsImageQRCodeKick int32 `example:"1"` // 是否踢发图片二维码的人
|
||||
Mode int32 `example:"1"` // 模式,1-仅踢设置群,0-不踢设置群
|
||||
Rooms string // 设置的群
|
||||
}
|
||||
|
||||
func DealKeywordKick(model *KeywordKickRequestModel) {
|
||||
if model.Enable != 1 {
|
||||
model.Enable = 0
|
||||
}
|
||||
_, model.Keywords = StringToSlice(model.Keywords)
|
||||
if model.IsLinkKick != 1 {
|
||||
model.IsLinkKick = 0
|
||||
}
|
||||
if model.IsCardKick != 1 {
|
||||
model.IsCardKick = 0
|
||||
}
|
||||
if model.IsMiniProgramKick != 1 {
|
||||
model.IsMiniProgramKick = 0
|
||||
}
|
||||
if model.IsImageQRCodeKick != 1 {
|
||||
model.IsImageQRCodeKick = 0
|
||||
}
|
||||
if model.Mode != 1 {
|
||||
model.Mode = 0
|
||||
}
|
||||
_, model.Rooms = StringToSlice(model.Rooms)
|
||||
}
|
||||
|
||||
// 关键词自动回复 504
|
||||
type ReplyKeywordsItem struct {
|
||||
Keyword string // 触发的关键词
|
||||
Content string // 回复的内容
|
||||
NewMsgId string // 新消息ID 引用了文件助手某条消息时用这个字段
|
||||
MsgType int32 // 收到消息时的类型:1-文本 3-图片 24-笔记 33-小程序 42-名片 49-链接
|
||||
SendType int32 // 回复的类型,发送类型 1-文本 3-图片 49-笔记|链接 2002-小程序 42-名片
|
||||
}
|
||||
|
||||
type KeywordAutoReplyRequestModel struct {
|
||||
Enable int32 `example:"1"` // 是否开启关键词自动回复
|
||||
PrivateReply int32 `example:"1"` // 是否回复私聊
|
||||
Mode int32 `example:"1"` // 模式,1-仅回复设置群,0-不回复设置群
|
||||
Rooms string // 设置的群
|
||||
Keywords []ReplyKeywordsItem // 关键词设置
|
||||
}
|
||||
|
||||
func DealKeywordAutoReply(model *KeywordAutoReplyRequestModel) {
|
||||
if model.Enable != 1 {
|
||||
model.Enable = 0
|
||||
}
|
||||
if model.PrivateReply != 1 {
|
||||
model.PrivateReply = 0
|
||||
}
|
||||
if model.Mode != 1 {
|
||||
model.Mode = 0
|
||||
}
|
||||
_, model.Rooms = StringToSlice(model.Rooms)
|
||||
|
||||
for i := range model.Keywords {
|
||||
model.Keywords[i].Keyword = StringTo1000(model.Keywords[i].Keyword)
|
||||
model.Keywords[i].Content = StringTo1000(model.Keywords[i].Content)
|
||||
// MsgType and SendType are assumed to be validated outside this function
|
||||
}
|
||||
}
|
||||
|
||||
// 万群同步 505
|
||||
type MessageForwardingRequestModel struct {
|
||||
Enable int32 `example:"1"` // 是否开启消息转发
|
||||
MainRoom string // 设置的主讲群
|
||||
Lecturers string // 添加的讲师
|
||||
ForwardRooms string // 设置的转发群
|
||||
StartTime string // 转发时间段,开始时间
|
||||
EndTime string // 转发时间段,结束时间
|
||||
}
|
||||
|
||||
func DealMessageForwarding(model *MessageForwardingRequestModel) {
|
||||
if model.Enable != 1 {
|
||||
model.Enable = 0
|
||||
}
|
||||
model.MainRoom = StringTo1000(model.MainRoom)
|
||||
model.Lecturers = StringTo1000(model.Lecturers)
|
||||
_, model.ForwardRooms = StringToSlice(model.ForwardRooms)
|
||||
// StartTime and EndTime are assumed to be valid formats validated outside this function
|
||||
startTime, endTime := DealTimeRange(model.StartTime, model.EndTime)
|
||||
model.StartTime = startTime
|
||||
model.EndTime = endTime
|
||||
}
|
||||
|
||||
// 自动通过好友 801
|
||||
type AutoApproveRequestModel struct {
|
||||
Enable int32 `example:"1"` // 是否开启自动通过验证
|
||||
AutoReply int32 `example:"1"` // 是否通过验证后自动回复
|
||||
ReplyMessage string // 回复内容(仅一条)
|
||||
}
|
||||
|
||||
func DealAutoApprove(model *AutoApproveRequestModel) {
|
||||
if model.Enable != 1 {
|
||||
model.Enable = 0
|
||||
}
|
||||
if model.AutoReply != 1 {
|
||||
model.AutoReply = 0
|
||||
}
|
||||
model.ReplyMessage = StringTo1000(model.ReplyMessage)
|
||||
}
|
||||
|
||||
// 中文逗号转为英文逗号,清理换行符,过滤空字符串,返回字符串数组和字符串表示
|
||||
func StringToSlice(str string) ([]string, string) {
|
||||
// 清理换行符(包括 \n 和 \r)
|
||||
str = strings.ReplaceAll(str, "\r", "")
|
||||
|
||||
// 回车符转成分隔付(逗号)
|
||||
str = strings.ReplaceAll(str, "\n", ",")
|
||||
|
||||
// 将中文逗号替换为英文逗号
|
||||
str = strings.ReplaceAll(str, ",", ",")
|
||||
|
||||
// 按英文逗号分割成字符串数组
|
||||
strArr := strings.Split(str, ",")
|
||||
var result []string
|
||||
var finalString string = ""
|
||||
|
||||
// 过滤掉空字符串,清理头尾空格
|
||||
for _, v := range strArr {
|
||||
v = strings.TrimSpace(v) // 去掉前后空格
|
||||
if v != "" {
|
||||
// 判断不能大于 1000 个字符
|
||||
if len(finalString+","+v) > 1000 {
|
||||
continue
|
||||
}
|
||||
if finalString != "" {
|
||||
finalString += ","
|
||||
}
|
||||
finalString += v
|
||||
result = append(result, v)
|
||||
}
|
||||
}
|
||||
|
||||
// 将数组转成字符串格式
|
||||
// finalString := strings.Join(result, ",")
|
||||
|
||||
// 返回字符串数组和字符串
|
||||
return result, finalString
|
||||
}
|
||||
|
||||
// 判断字符串不能大于 1000 个字符,大于则截取前 1000 个字符
|
||||
func StringTo1000(str string) string {
|
||||
str = strings.TrimSpace(str) // 去掉前后空格
|
||||
// 只取 前 1000 个字符
|
||||
if len(str) > 1000 {
|
||||
str = str[:1000]
|
||||
}
|
||||
return str
|
||||
}
|
||||
|
||||
// 处理开始时间和结束时间,如果输入格式不正确,则使用默认值
|
||||
func DealTimeRange(startTime string, endTime string) (string, string) {
|
||||
const timeFormat = "15:04"
|
||||
// 解析 StartTime
|
||||
start, errStart := time.Parse(timeFormat, startTime)
|
||||
if errStart != nil {
|
||||
start = time.Date(0, 1, 1, 0, 0, 0, 0, time.UTC) // 设置为 00:00
|
||||
startTime = start.Format(timeFormat)
|
||||
} else {
|
||||
startTime = start.Format(timeFormat)
|
||||
}
|
||||
|
||||
// 解析 EndTime
|
||||
end, errEnd := time.Parse(timeFormat, endTime)
|
||||
if errEnd != nil {
|
||||
end = time.Date(0, 1, 1, 23, 59, 0, 0, time.UTC) // 设置为 23:59
|
||||
endTime = end.Format(timeFormat)
|
||||
} else {
|
||||
endTime = end.Format(timeFormat)
|
||||
}
|
||||
|
||||
// 如果 EndTime 小于 StartTime,则将 EndTime 设置为 StartTime
|
||||
if end.Before(start) {
|
||||
end = start
|
||||
endTime = end.Format(timeFormat)
|
||||
}
|
||||
|
||||
return startTime, endTime
|
||||
}
|
||||
|
||||
// ToJSON 将任意结构体转换为 JSON 字符串
|
||||
func ToJSONStr(input interface{}) (string, error) {
|
||||
// 使用 json.Marshal 将对象转换为 JSON 字节数组
|
||||
bytes, err := json.Marshal(input)
|
||||
if err != nil {
|
||||
// 如果转换失败,返回错误提示
|
||||
return "", err
|
||||
}
|
||||
// 将字节数组转换为字符串并返回
|
||||
return string(bytes), nil
|
||||
}
|
||||
|
||||
// FromJSONS 将 JSON 字符串转换为任意结构体
|
||||
func FromJSONS(input string, output interface{}) error {
|
||||
if len(input) == 0 {
|
||||
// 将空字符串替换为一个空 JSON 对象
|
||||
input = "{}"
|
||||
}
|
||||
err := json.Unmarshal([]byte(input), output)
|
||||
return err
|
||||
}
|
||||
|
||||
// 定时任务执行函数 true 可以执行,false 不执行
|
||||
func IsInTimeRange(StartTime string, EndTime string) bool {
|
||||
// 获取系统当前时间(HH:mm 格式)
|
||||
now := time.Now()
|
||||
layout := "15:04"
|
||||
currentTime, err := time.Parse(layout, now.Format(layout)) // 将当前时间转换为 HH:mm 格式
|
||||
if err != nil {
|
||||
// 如果解析失败,执行任务即可
|
||||
return true
|
||||
}
|
||||
// 解析 StartTime 和 EndTime
|
||||
startTime, err := time.Parse(layout, StartTime)
|
||||
if err != nil {
|
||||
// 如果解析失败,执行任务即可
|
||||
return true
|
||||
}
|
||||
|
||||
endTime, err := time.Parse(layout, EndTime)
|
||||
|
||||
if err != nil {
|
||||
// 如果解析失败,执行任务即可
|
||||
return true
|
||||
}
|
||||
|
||||
// 判断当前时间是否在范围内
|
||||
if (currentTime.After(startTime) || currentTime.Equal(startTime)) && (currentTime.Before(endTime) || currentTime.Equal(endTime)) {
|
||||
// 执行任务
|
||||
return true
|
||||
} else {
|
||||
// 不执行
|
||||
return false
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package req
|
||||
|
||||
// UploadAppAttachModel 上传文件请求模型
|
||||
type UploadAppAttachModel struct {
|
||||
// 文件base64编码内容
|
||||
FileData string `json:"fileData" binding:"required"`
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package req
|
||||
|
||||
// KeywordReplyPair 关键词回复对
|
||||
type KeywordReplyPair struct {
|
||||
Keyword string `json:"keyword"`
|
||||
Reply string `json:"reply"`
|
||||
}
|
||||
|
||||
// SetKeywordReplyModel 设置关键词回复请求
|
||||
type SetKeywordReplyModel struct {
|
||||
Enable bool `json:"enable"` // 是否启用关键词回复
|
||||
Pairs []KeywordReplyPair `json:"pairs"` // 关键词回复对列表
|
||||
}
|
||||
|
||||
// GetKeywordReplyModel 获取关键词回复请求
|
||||
type GetKeywordReplyModel struct {
|
||||
// 空结构体,不需要请求参数
|
||||
}
|
||||
@@ -0,0 +1,749 @@
|
||||
package req
|
||||
|
||||
import (
|
||||
"xiawan/wx/clientsdk/baseinfo"
|
||||
)
|
||||
|
||||
type MessageItem struct {
|
||||
ToUserName string // 接收者 wxid
|
||||
TextContent string // 文本类型消息时内容
|
||||
ImageContent string // 图片类型消息时图片的 base64 编码
|
||||
MsgType int //1 Text 2 Image
|
||||
AtWxIDList []string // 发送艾特消息时的 wxid 列表
|
||||
}
|
||||
|
||||
type SendMessageModel struct {
|
||||
MsgItem []MessageItem // 消息体数组
|
||||
}
|
||||
|
||||
// SnsLocationInfo 朋友圈地址项
|
||||
type SnsLocationInfoModel struct {
|
||||
City string
|
||||
Longitude string
|
||||
Latitude string
|
||||
PoiName string
|
||||
PoiAddress string
|
||||
PoiScale int32
|
||||
PoiInfoURL string
|
||||
PoiClassifyID string
|
||||
PoiClassifyType uint32
|
||||
PoiClickableStatus uint32
|
||||
}
|
||||
|
||||
// SnsMediaItem 朋友圈媒体项
|
||||
type SnsMediaItemModel struct {
|
||||
ID uint32
|
||||
Type uint32
|
||||
Title string
|
||||
Description string
|
||||
Private uint32
|
||||
UserData string
|
||||
SubType uint32
|
||||
URL string
|
||||
URLType string
|
||||
Thumb string
|
||||
ThumType string
|
||||
SizeWidth string
|
||||
SizeHeight string
|
||||
TotalSize string
|
||||
VideoWidth string
|
||||
VideoHeight string
|
||||
MD5 string
|
||||
VideoMD5 string
|
||||
VideoDuration float64
|
||||
}
|
||||
|
||||
type DownloadMediaModel struct {
|
||||
Key string
|
||||
URL string
|
||||
}
|
||||
type TransmitFriendCircleModel struct {
|
||||
SourceID string
|
||||
}
|
||||
|
||||
// 设置朋友圈可见天数
|
||||
type SetFriendCircleDaysModel struct {
|
||||
Function uint32
|
||||
Value uint32
|
||||
}
|
||||
|
||||
// SnsPostItem 发送朋友圈需要的信息
|
||||
type SnsPostItemModel struct {
|
||||
ContentStyle uint32 // 纯文字/图文/引用/视频
|
||||
ContentUrl string
|
||||
Description string
|
||||
Privacy uint32 // 是否仅自己可见
|
||||
Content string // 文本内容
|
||||
MediaList []*SnsMediaItemModel // 图片/视频列表
|
||||
WithUserList []string // 提醒好友看列表
|
||||
GroupUserList []string // 可见好友列表
|
||||
BlackList []string // 不可见好友列表
|
||||
LocationInfo *SnsLocationInfoModel // 发送朋友圈的位置信息
|
||||
}
|
||||
|
||||
type GetSnsInfoModel struct {
|
||||
UserName string
|
||||
FirstPageMD5 string
|
||||
MaxID uint64
|
||||
}
|
||||
type GetIdDetailModel struct {
|
||||
Id string
|
||||
BlackList []string
|
||||
LocationVal int64
|
||||
Location baseinfo.Location
|
||||
}
|
||||
type SetBackgroundImageModel struct {
|
||||
Url string
|
||||
}
|
||||
type SendFavItemCircle struct {
|
||||
SourceID string
|
||||
FavItemID uint32
|
||||
BlackList []string
|
||||
LocationVal int64
|
||||
Location baseinfo.Location
|
||||
}
|
||||
|
||||
// UploadFriendCircleModel 上传朋友圈图片视频信息
|
||||
type UploadFriendCircleModel struct {
|
||||
ImageDataList []string
|
||||
VideoDataList []string
|
||||
}
|
||||
|
||||
type ForwardImageItem struct {
|
||||
ToUserName string
|
||||
AesKey string
|
||||
CdnMidImgUrl string
|
||||
CdnMidImgSize int32
|
||||
CdnThumbImgSize int32
|
||||
}
|
||||
|
||||
type ForwardVideoItem struct {
|
||||
ToUserName string
|
||||
AesKey string
|
||||
CdnVideoUrl string
|
||||
Length int
|
||||
PlayLength int
|
||||
CdnThumbLength int
|
||||
}
|
||||
|
||||
type ForwardMessageModel struct {
|
||||
ForwardImageList []ForwardImageItem
|
||||
ForwardVideoList []ForwardVideoItem
|
||||
}
|
||||
|
||||
type SendEmojiItem struct {
|
||||
ToUserName string
|
||||
EmojiMd5 string
|
||||
EmojiSize int32
|
||||
}
|
||||
type SendEmojiMessageModel struct {
|
||||
EmojiList []SendEmojiItem
|
||||
}
|
||||
|
||||
type RevokeMsgModel struct {
|
||||
NewMsgId string
|
||||
ClientMsgId uint64
|
||||
CreateTime uint64
|
||||
ToUserName string
|
||||
IsImage bool // 标识是否为图片消息
|
||||
ClientImgIdStr string // 保存clientImgId的原始字符串值
|
||||
}
|
||||
|
||||
type AppMessageItem struct {
|
||||
ToUserName string
|
||||
ContentXML string
|
||||
ContentType uint32 // 2001:(红包消息)
|
||||
}
|
||||
|
||||
type AppMessageModel struct {
|
||||
AppList []AppMessageItem
|
||||
}
|
||||
|
||||
type UpdateChatroomAnnouncementModel struct {
|
||||
ChatRoomName string // 群聊ID:xxx@chatroom
|
||||
Content string
|
||||
}
|
||||
|
||||
type GetChatroomMemberDetailModel struct {
|
||||
ChatRoomName string // 群聊ID:xxx@chatroom
|
||||
}
|
||||
|
||||
type ConsentToJoinGroupModel struct {
|
||||
Url string
|
||||
}
|
||||
|
||||
type ChatRoomWxIdListModel struct {
|
||||
ChatRoomWxIdList []string
|
||||
}
|
||||
type SetChatroomAccessVerifyModel struct {
|
||||
ChatRoomName string // 群聊ID:xxx@chatroom
|
||||
Enable bool
|
||||
}
|
||||
type ChatroomMemberModel struct {
|
||||
UserList []string
|
||||
ChatRoomName string // 群聊ID:xxx@chatroom
|
||||
}
|
||||
type ChatroomNameModel struct {
|
||||
Nickname string
|
||||
ChatRoomName string // 群聊ID:xxx@chatroom
|
||||
}
|
||||
type SendPatModel struct {
|
||||
ChatRoomName string // 群聊ID:xxx@chatroom
|
||||
ToUserName string
|
||||
Scene int64
|
||||
}
|
||||
type GroupListModel struct {
|
||||
Key string
|
||||
}
|
||||
type SearchContactModel struct {
|
||||
Tg string
|
||||
FromScene uint64
|
||||
UserName string
|
||||
}
|
||||
type QWApplyAddContactModel struct {
|
||||
UserName string
|
||||
V1 string
|
||||
Content string
|
||||
}
|
||||
type QWSyncChatRoomModel struct {
|
||||
Key string
|
||||
}
|
||||
type QWChatRoomTransferOwnerModel struct {
|
||||
ChatRoomName string // 群聊ID:xxx@chatroom
|
||||
ToUserName string
|
||||
}
|
||||
type QWAddChatRoomMemberModel struct {
|
||||
ChatRoomName string // 群聊ID:xxx@chatroom
|
||||
ToUserName []string
|
||||
}
|
||||
type QWAcceptChatRoomModel struct {
|
||||
Link string
|
||||
Opcode uint32
|
||||
}
|
||||
type QWAdminAcceptJoinChatRoomSetModel struct {
|
||||
ChatRoomName string // 群聊ID:xxx@chatroom
|
||||
P int64
|
||||
}
|
||||
type QWModChatRoomNameModel struct {
|
||||
ChatRoomName string // 群聊ID:xxx@chatroom
|
||||
Name string
|
||||
}
|
||||
type MoveContractModel struct {
|
||||
ChatRoomName string // 群聊ID:xxx@chatroom
|
||||
Val uint32
|
||||
}
|
||||
type CreateChatRoomModel struct {
|
||||
TopIc string
|
||||
UserList []string
|
||||
}
|
||||
|
||||
type TransferGroupOwnerModel struct {
|
||||
ChatRoomName string // 群聊ID:xxx@chatroom
|
||||
NewOwnerUserName string
|
||||
}
|
||||
|
||||
type InviteChatroomMembersModel struct {
|
||||
ChatRoomName string // 群聊ID:xxx@chatroom
|
||||
UserList []string
|
||||
}
|
||||
|
||||
type ScanIntoUrlGroupModel struct {
|
||||
Url string
|
||||
}
|
||||
|
||||
type SnsObjectOpItem struct {
|
||||
SnsObjID string // 朋友圈ID
|
||||
OpType uint32 // 操作码
|
||||
DataLen uint32 // 其它数据长度
|
||||
Data []byte // 其它数据
|
||||
Ext uint32
|
||||
}
|
||||
|
||||
type SendSnsObjectOpRequestModel struct {
|
||||
SnsObjectOpList []SnsObjectOpItem
|
||||
}
|
||||
|
||||
// ReplyCommentItem 回覆的评论项
|
||||
type ReplyCommentItem struct {
|
||||
UserName string // 评论的微信ID
|
||||
NickName string // 发表评论的昵称
|
||||
OpType uint32 // 操作类型:评论/点赞
|
||||
Source uint32 // source
|
||||
}
|
||||
|
||||
// SnsCommentItem 朋友圈项:发表评论/点赞
|
||||
type SnsCommentItem struct {
|
||||
OpType uint32 // 操作类型:评论/点赞
|
||||
ItemID string // 朋友圈项ID
|
||||
ToUserName string // 好友微信ID
|
||||
Content string // 评论内容
|
||||
CreateTime uint32 // 创建时间
|
||||
ReplyCommentID uint32 // 回复的评论ID
|
||||
ReplyItem ReplyCommentItem // 回覆的评论项
|
||||
}
|
||||
|
||||
type SendSnsCommentRequestModel struct {
|
||||
SnsCommentList []SnsCommentItem
|
||||
Tx bool
|
||||
}
|
||||
|
||||
type SnsObjectOpRequestModel struct {
|
||||
SnsObjectOpList []SnsObjectOpItem
|
||||
}
|
||||
|
||||
type DeviceIdLoginModel struct {
|
||||
Proxy string // socks代理,例如:socks5://username:password@ipv4:port
|
||||
LoginData string // 62 数据/A16 数据
|
||||
UserName string // 手机号
|
||||
Password string // 微信密码
|
||||
Ticket string // SMS短信验证码
|
||||
Type int
|
||||
DeviceInfo DeviceInfo // 设备信息
|
||||
}
|
||||
type DeviceInfo struct {
|
||||
Model string
|
||||
AndroidId string
|
||||
Manufacturer string
|
||||
ImeI string
|
||||
}
|
||||
type DelSafeDeviceModel struct {
|
||||
DeviceUUID string
|
||||
}
|
||||
|
||||
type ExtDeviceLoginModel struct {
|
||||
QrConnect string
|
||||
}
|
||||
|
||||
type GetA8KeyRequestModel struct {
|
||||
OpCode uint32
|
||||
Scene uint32
|
||||
ReqUrl string
|
||||
}
|
||||
|
||||
type AppletModel struct {
|
||||
AppId string // 应用ID
|
||||
Opt int32 `example:"1"` // 小程序云函数操作的 Opt; 默认为1
|
||||
Data string // 小程序云函数操作的 Data; json字符串, 注意必须是 json 字符串; 传空时默认值为: '{"with_credentials":true,"from_component":true,"data":{"lang":"zh_CN"},"api_name":"webapi_getuserinfo"}'
|
||||
SdkName string
|
||||
PackageName string
|
||||
}
|
||||
|
||||
type VerifyUserItem struct {
|
||||
Gh string
|
||||
Scene int
|
||||
}
|
||||
|
||||
// 获取通讯录好友
|
||||
type GetContactListModel struct {
|
||||
CurrentWxcontactSeq uint32
|
||||
CurrentChatRoomContactSeq uint32
|
||||
}
|
||||
|
||||
type FollowGHModel struct {
|
||||
GHList []VerifyUserItem
|
||||
}
|
||||
|
||||
type GetLoginQrCodeModel struct {
|
||||
IpadOrmac string
|
||||
Proxy string // socks代理,例如:socks5://username:password@ipv4:port
|
||||
Check bool `example:"false"` // 修改代理时(SetProxy接口) 是否发送检测代理请求(可能导致请求超时)
|
||||
}
|
||||
|
||||
type PhoneLoginModel struct {
|
||||
Url string
|
||||
}
|
||||
|
||||
type UploadMContactModel struct {
|
||||
MobileList []string
|
||||
Mobile string
|
||||
Opcode int32
|
||||
}
|
||||
|
||||
type QRConnectAuthorizeModel struct {
|
||||
QrUrl string
|
||||
}
|
||||
type GetMpA8KeyModel struct {
|
||||
Url string
|
||||
Opcode uint32
|
||||
Scene int64
|
||||
}
|
||||
|
||||
// 历史消息
|
||||
type GetMpHistoryMsgModel struct {
|
||||
Url string
|
||||
}
|
||||
|
||||
type GetQrCodeModel struct {
|
||||
Style uint32 `example:"8"` // 个人二维码样式: 可设置为8, 其余自行探索
|
||||
Recover bool // 保持默认值, 无需修改
|
||||
}
|
||||
|
||||
type PeopleNearbyModel struct {
|
||||
Longitude float32
|
||||
Latitude float32
|
||||
}
|
||||
|
||||
type ModifyCmdStatusModel struct {
|
||||
Key string `example:"101"`
|
||||
Value int `example:"1"`
|
||||
ValueStr string `example:""`
|
||||
Params1 string `example:"自定义参数1"`
|
||||
Params2 string `example:"自定义参数2"`
|
||||
Params3 string `example:"自定义参数3"`
|
||||
Params4 string `example:"自定义参数4"`
|
||||
}
|
||||
|
||||
type ModifyCmdStatusModelNew struct {
|
||||
Key string `example:"101"`
|
||||
Value int `example:"1"`
|
||||
ValueStr string `example:""`
|
||||
}
|
||||
|
||||
// ChannelsLoginModel 视频号助手扫码登录请求模型
|
||||
type ChannelsLoginModel struct {
|
||||
Url string `json:"url" binding:"required"` // 视频号助手扫码登录确认链接
|
||||
FinderUsername string `json:"finderUsername"` // 指定要登录的视频号用户名,为空则选择第一个
|
||||
}
|
||||
|
||||
// ShopLoginConfirmModel 微信小店确认登录请求模型
|
||||
type ShopLoginConfirmModel struct {
|
||||
Url string `json:"url" binding:"required"` // 登录二维码URL
|
||||
}
|
||||
|
||||
type CollectmoneyModel struct {
|
||||
InvalidTime string
|
||||
TransFerId string
|
||||
TransactionId string
|
||||
ToUserName string
|
||||
}
|
||||
type OpenRedEnvelopesModel struct {
|
||||
NativeUrl string
|
||||
}
|
||||
type FavInfoModel struct {
|
||||
FavId uint32
|
||||
KeyBuf string
|
||||
}
|
||||
|
||||
type LabelModel struct {
|
||||
UserLabelList []baseinfo.UserLabelInfoItem
|
||||
// del labelId
|
||||
LabelId string
|
||||
LabelNameList []string
|
||||
}
|
||||
|
||||
type GetSyncMsgModel struct {
|
||||
Key string
|
||||
}
|
||||
type DelContactModel struct {
|
||||
DelUserName string
|
||||
}
|
||||
|
||||
type ModifyUserInfo struct {
|
||||
City string
|
||||
Country string
|
||||
NickName string
|
||||
Province string
|
||||
Signature string
|
||||
Sex uint32
|
||||
InitFlag uint32
|
||||
}
|
||||
type UpdateNickNameModel struct {
|
||||
Scene uint32
|
||||
Val string
|
||||
}
|
||||
type UpdateSexModel struct {
|
||||
Sex uint32
|
||||
City string
|
||||
Province string
|
||||
Country string
|
||||
}
|
||||
type UploadHeadImageModel struct {
|
||||
Base64 string
|
||||
}
|
||||
|
||||
type SendChangePwdRequestModel struct {
|
||||
OldPass string `json:"oldPass"` // 确保json标签是`oldPass`
|
||||
NewPass string `json:"newPass"`
|
||||
OpCode uint32 `json:"opCode"`
|
||||
}
|
||||
type SendModifyRemarkRequestModel struct {
|
||||
UserName string
|
||||
RemarkName string
|
||||
}
|
||||
|
||||
// 设置微信号
|
||||
type AlisaModel struct {
|
||||
Alisa string
|
||||
}
|
||||
|
||||
type UpdateAutopassModel struct {
|
||||
SwitchType uint32
|
||||
}
|
||||
|
||||
// 设置添加方式
|
||||
type WxFunctionSwitchModel struct {
|
||||
Function uint32
|
||||
Value uint32
|
||||
}
|
||||
type SetSendPatModel struct {
|
||||
Value string
|
||||
}
|
||||
|
||||
// 修改步数
|
||||
type UpdateStepNumberModel struct {
|
||||
Number uint64
|
||||
}
|
||||
|
||||
type UserRankLikeModel struct {
|
||||
RankId string
|
||||
}
|
||||
|
||||
// BatchGetContact
|
||||
type BatchGetContactModel struct {
|
||||
UserNames []string
|
||||
RoomWxIDList []string
|
||||
}
|
||||
type SearchContactRequestModel struct {
|
||||
OpCode uint32 // 操作类型
|
||||
UserName string // 要搜索的内容(微信号、手机号、QQ号等)
|
||||
FromScene uint32
|
||||
SearchScene uint32 // 搜索场景
|
||||
}
|
||||
|
||||
type GetFriendRelationModel struct {
|
||||
UserName string
|
||||
}
|
||||
type SendUploadVoiceRequestModel struct {
|
||||
ToUserName string
|
||||
VoiceData string `json:"VoiceData"`
|
||||
VoiceSecond, VoiceFormat int32
|
||||
}
|
||||
|
||||
type CdnUploadVideoRequest struct {
|
||||
ToUserName string
|
||||
VideoData []byte // 视频数据
|
||||
ThumbData []byte // ThumbData
|
||||
}
|
||||
|
||||
type DownloadParam struct {
|
||||
MsgId uint32 // 消息ID(注意是msg_id 不是new_msg_id)
|
||||
TotalLen int // 下载数据的总长度
|
||||
Section DataSection // 当前要获取的数据分包
|
||||
ToUserName string // 下载图片时,图片消息的接收者
|
||||
FromUserName string // 下载图片时,图片消息的发送者
|
||||
CompressType int // 下载图片时,数据压缩类型(默认为0即可)
|
||||
}
|
||||
|
||||
type DataSection struct {
|
||||
StartPos uint32 // 数据分包开始位置
|
||||
DataLen uint32 `example:"61440"` // 数据分包长度(不要超过 65535)
|
||||
}
|
||||
|
||||
type GroupMassMsgTextModel struct {
|
||||
ToUserName []string
|
||||
Content string
|
||||
}
|
||||
type GroupMassMsgImageModel struct {
|
||||
ToUserName []string
|
||||
ImageBase64 string
|
||||
}
|
||||
|
||||
type DownloadVoiceModel struct {
|
||||
ToUserName string
|
||||
NewMsgId string
|
||||
Bufid string
|
||||
Length int
|
||||
}
|
||||
type DownMediaModel struct {
|
||||
AesKey string
|
||||
FileURL string
|
||||
FileType uint32
|
||||
}
|
||||
|
||||
// VerifyUserRequestModel 添加好友/验证好友/打招呼 请求体
|
||||
type VerifyUserRequestModel struct {
|
||||
OpCode uint32 `example:"2"` // 操作类型: 1(免验证发送请求) 2(添加好友/发送验证申请) 3(同意好友/通过好友验证) 4(拒绝好友)
|
||||
VerifyContent string // 添加好友时的(招呼语/验证信息)
|
||||
Scene int `example:"3"` // 添加来源, 同意添加好友时传回调消息xml中的scene值.<br/>添加好友时的枚举值如下: <br/>1(QQ) 2(邮箱) 3(微信号) 4(QQ好友) 8(来自群聊) 13(通讯录)<br/>14(群聊) 15(手机号) 18(附近的人) 25(漂流瓶) 29(摇一摇) 30(二维码)
|
||||
V3 string // V3用户名数据(SearchContact请求返回的UserValue)
|
||||
V4 string // V4校验数据(SearchContact请求返回的AntispamTicket)
|
||||
ChatRoomUserName string // 通过群来添加好友 需要设置此值为群id
|
||||
}
|
||||
|
||||
type GeneratePayQCodeModel struct {
|
||||
Name string // 收款备注
|
||||
Money string // 金额(单位为分), 999 即为 9.99 元
|
||||
}
|
||||
|
||||
type QWContactModel struct {
|
||||
ToUserName string
|
||||
ChatRoom string
|
||||
T string
|
||||
}
|
||||
|
||||
type QWRemarkModel struct {
|
||||
ToUserName string
|
||||
Name string
|
||||
}
|
||||
type QWCreateModel struct {
|
||||
ToUserName []string
|
||||
}
|
||||
type FinderSearchModel struct {
|
||||
Index uint32
|
||||
Userver int32
|
||||
UserKey string
|
||||
Uuid string
|
||||
}
|
||||
|
||||
type FinderUserPrepareModel struct {
|
||||
Userver int32
|
||||
}
|
||||
|
||||
type FinderFollowModel struct {
|
||||
FinderUserName string
|
||||
PosterUsername string
|
||||
OpType int32
|
||||
RefObjectId string
|
||||
Cook string
|
||||
Userver int32
|
||||
}
|
||||
|
||||
type WxBindOpMobileForModel struct {
|
||||
OpCode int64
|
||||
PhoneNumber string
|
||||
VerifyCode string
|
||||
Reg uint64
|
||||
Proxy string
|
||||
}
|
||||
|
||||
type GenAuthKeyModel struct {
|
||||
Count int `example:"1"` // 要生成 AuthKey 的个数; Count小于1默认设置为1
|
||||
Days int `example:"30"` // AuthKey 的过期天数; Days小于1默认设置为30
|
||||
}
|
||||
|
||||
type GenAuthKeyTypeModel struct {
|
||||
Count int `example:"1"` // 要生成 AuthKey 的个数; Count小于1默认设置为1
|
||||
Type int `example:"1"` // 类型 1日 7 周 30月 90季 180 半年 365年 30000永久(数字为标识,非准确天数)
|
||||
}
|
||||
|
||||
type SyncMessageModel struct {
|
||||
Count int // 同步几条消息; 接收空请求体, 默认为0, 同步所有消息
|
||||
}
|
||||
|
||||
type GetChatroomQrCodeModel struct {
|
||||
ChatRoomName string // 群聊ID:xxx@chatroom
|
||||
}
|
||||
|
||||
type DelayAuthKeyModel struct {
|
||||
Key string // 要延期的 AuthKey
|
||||
Days int `example:"30"` // AuthKey 的延期天数; Days 小于1默认设置为30
|
||||
ExpiryDate string // AuthKey 的到期日期(例如: 2024-01-01); 与 Days 参数只能选其一(优先使用 ExpiryDate 参数)
|
||||
}
|
||||
|
||||
type DelayAuthKeyModelNew struct {
|
||||
KeyUse string // 被使用的key
|
||||
}
|
||||
|
||||
type BannedAuthKeyModel struct {
|
||||
Key string // 要禁用的 AuthKey
|
||||
IsBanned int `example:"0"` // isBanned 1 禁用 默认设置为0
|
||||
}
|
||||
|
||||
type DeleteAuthKeyModel struct {
|
||||
Key string // 要删除的 AuthKey
|
||||
Opt int // 删除操作 0:仅删除授权码 1:删除授权码相关的所有数据
|
||||
}
|
||||
|
||||
type CreatePreTransfer struct {
|
||||
ToUserName string // 要转账用户的wxid
|
||||
Fee uint32 // 转账金额(单位为分)
|
||||
Description string // 转账备注
|
||||
}
|
||||
|
||||
type ConfirmPreTransfer struct {
|
||||
BankType string // 付款方式 类型
|
||||
BankSerial string // 付款方式 Serial序列号
|
||||
ReqKey string // 创建转账返回的ReqKey
|
||||
PayPassword string // 支付密码
|
||||
}
|
||||
|
||||
type ShareCardParam struct {
|
||||
ToUserName string // 消息接收者
|
||||
CardWxId string // 名片wxid
|
||||
CardNickName string // 名片昵称
|
||||
CardAlias string // 名片别名(发送公众号名片时留空)
|
||||
CardFlag int // 名片CertFlag(0:个人名片 24:公众号名片)
|
||||
}
|
||||
|
||||
type MessageNoShowParam struct {
|
||||
ToUserName string // 消息接收者
|
||||
}
|
||||
|
||||
// CdnSnsVideoUploadModel CDN朋友圈视频上传请求模型
|
||||
type CdnSnsVideoUploadModel struct {
|
||||
VideoData string // 视频数据的base64编码
|
||||
ThumbData string // 缩略图数据的base64编码
|
||||
}
|
||||
|
||||
type ResponseResult struct {
|
||||
Code int64
|
||||
Success bool
|
||||
Message string
|
||||
Data interface{}
|
||||
Data62 string
|
||||
Debug string
|
||||
}
|
||||
|
||||
type ResponseResult2 struct {
|
||||
Code int64
|
||||
Success bool
|
||||
Message string
|
||||
Data interface{}
|
||||
Data62 string
|
||||
DeviceId string
|
||||
}
|
||||
|
||||
type SessionidQRParam struct {
|
||||
Code int64
|
||||
Success bool
|
||||
Message string
|
||||
Data interface{}
|
||||
Data62 string
|
||||
DeviceId string
|
||||
}
|
||||
|
||||
// 用于公众号文章阅读和点赞功能的请求参数
|
||||
type ReadParam struct {
|
||||
Url string // 公众号文章URL
|
||||
}
|
||||
|
||||
// VerifyCodeModel 验证码验证请求模型
|
||||
type VerifyCodeModel struct {
|
||||
Code string `json:"code" binding:"required"` // 验证码
|
||||
Data62 string `json:"data62" binding:"required"` // 验证码
|
||||
Ticket string `json:"ticket" binding:"required"` // 验证码
|
||||
}
|
||||
|
||||
// SlideTicketModel 滑动验证码请求模型
|
||||
type SlideTicketModel struct {
|
||||
Data62 string `json:"data62" binding:"required"` // 验证码
|
||||
Ticket string `json:"ticket" binding:"required"` // 验证码
|
||||
RandStr string `json:"randstr" bingding:"required"`
|
||||
SlideTicket string `json:"slideticket" binding:"required"`
|
||||
}
|
||||
|
||||
// DownloadEmojiModel 下载表情gif请求模型
|
||||
type DownloadEmojiModel struct {
|
||||
XmlContent string `json:"xml_content" binding:"required"` // msg_type=47的消息xml内容
|
||||
}
|
||||
|
||||
// DownloadQWImageModel 企微图片下载请求模型
|
||||
// 企微图片下载
|
||||
type DownloadQWImageModel struct {
|
||||
Xml string `json:"xml" binding:"required"`
|
||||
}
|
||||
|
||||
// UploadImageToCDNModel 纯CDN图片上传请求模型
|
||||
type UploadImageToCDNModel struct {
|
||||
ImageContent string `json:"imageContent" binding:"required"` // 图片的base64编码
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package req
|
||||
|
||||
// WelcomeConfig 欢迎词配置
|
||||
type WelcomeConfig struct {
|
||||
Enable bool `json:"enable"` // 是否启用欢迎词
|
||||
Content string `json:"content"` // 欢迎词内容
|
||||
ChatRooms []string `json:"chat_rooms"` // 群聊列表 (后台维护,不再通过API设置)
|
||||
GroupKeyword string `json:"group_keyword"` // 设置需要欢迎群的关键词
|
||||
}
|
||||
|
||||
// SetWelcomeModel 设置欢迎词请求
|
||||
type SetWelcomeModel struct {
|
||||
Config WelcomeConfig `json:"config"` // 欢迎词配置
|
||||
}
|
||||
|
||||
// GetWelcomeModel 获取欢迎词配置请求
|
||||
type GetWelcomeModel struct {
|
||||
// 空结构体,不需要请求参数
|
||||
}
|
||||
|
||||
// AdminKeywordConfig 管理员关键词配置
|
||||
type AdminKeywordConfig struct {
|
||||
Enable bool `json:"enable"` // 是否启用关键词设置管理员
|
||||
Keyword string `json:"keyword"` // 设置管理员的关键词
|
||||
}
|
||||
|
||||
// SetAdminKeywordModel 设置管理员关键词请求
|
||||
type SetAdminKeywordModel struct {
|
||||
Config AdminKeywordConfig `json:"config"` // 管理员关键词配置
|
||||
}
|
||||
|
||||
// GetAdminKeywordModel 获取管理员关键词配置请求
|
||||
type GetAdminKeywordModel struct {
|
||||
// 空结构体,不需要请求参数
|
||||
}
|
||||
|
||||
// KickKeywordConfig 踢人关键词配置
|
||||
type KickKeywordConfig struct {
|
||||
Enable bool `json:"enable"` // 是否启用关键词踢人
|
||||
Keyword string `json:"keyword"` // 踢人的关键词
|
||||
}
|
||||
|
||||
// SetKickKeywordModel 设置踢人关键词请求
|
||||
type SetKickKeywordModel struct {
|
||||
Config KickKeywordConfig `json:"config"` // 踢人关键词配置
|
||||
}
|
||||
|
||||
// GetKickKeywordModel 获取踢人关键词配置请求
|
||||
type GetKickKeywordModel struct {
|
||||
// 空结构体,不需要请求参数
|
||||
}
|
||||
|
||||
// InviteKeywordPair 关键词与群ID对应关系
|
||||
type InviteKeywordPair struct {
|
||||
Keyword string `json:"keyword"` // 邀请关键词
|
||||
ChatRoom string `json:"chat_room"` // 对应的群ID
|
||||
}
|
||||
|
||||
// InviteKeywordConfig 关键词邀请入群配置
|
||||
type InviteKeywordConfig struct {
|
||||
Enable bool `json:"enable"` // 是否启用关键词邀请入群
|
||||
SetupKeyword string `json:"setup_keyword"` // 设置关键词的关键词(例如:"设置加群关键词")
|
||||
Pairs []InviteKeywordPair `json:"pairs"` // 关键词与群ID对应关系列表 (后台维护,不再通过API设置)
|
||||
}
|
||||
|
||||
// SetInviteKeywordModel 设置关键词邀请入群请求
|
||||
type SetInviteKeywordModel struct {
|
||||
Config InviteKeywordConfig `json:"config"` // 关键词邀请入群配置
|
||||
}
|
||||
|
||||
// GetInviteKeywordModel 获取关键词邀请入群配置请求
|
||||
type GetInviteKeywordModel struct {
|
||||
// 空结构体,不需要请求参数
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
{
|
||||
"ID": 13353470632052600936,
|
||||
"UserName": "wxid_h0jis127yas122",
|
||||
"CreateTime": 1591857747,
|
||||
"ContentDesc": "一名心",
|
||||
"ContentDescShowType": 0,
|
||||
"ContentDescScene": 0,
|
||||
"Private": 0,
|
||||
"SightFolded": 0,
|
||||
"ShowFlag": 0,
|
||||
"AppInfo": {
|
||||
"ID": "",
|
||||
"Version": "",
|
||||
"AppName": "",
|
||||
"InstallURL": "",
|
||||
"FromURL": "",
|
||||
"IsForceUpdate": 0
|
||||
},
|
||||
"SourceUserName": "",
|
||||
"SourceNickName": "",
|
||||
"StatisticsData": "",
|
||||
"StatExtStr": "",
|
||||
"ContentObject": {
|
||||
"ContentStyle": 15,
|
||||
"Title": "微信小视频",
|
||||
"Description": "Sight",
|
||||
"MediaList": {
|
||||
"Media": [
|
||||
{
|
||||
"Enc": {
|
||||
"Key": "",
|
||||
"Value": 0
|
||||
},
|
||||
"ID": 13353470632432971876,
|
||||
"Type": 6,
|
||||
"Title": "",
|
||||
"Description": "一名心",
|
||||
"Private": 0,
|
||||
"UserData": "",
|
||||
"SubType": 0,
|
||||
"VideoSize": {
|
||||
"Width": "540",
|
||||
"Height": "960"
|
||||
},
|
||||
"URL": {
|
||||
"Type": "1",
|
||||
"MD5": "85d98fe8eda3472129c5fd74524efaaa",
|
||||
"VideoMD5": "a4c529f4b6c9f29f66427ecc14fe4ea4",
|
||||
"Value": "http://szzjwxsns.video.qq.com/102/20202/snsvideodownload?filekey=30340201010420301e0201660402535a041085d98fe8eda3472129c5fd74524efaaa0203032ae5040d00000004627466730000000131&hy=SZ&storeid=32303230303631313134343232363030306365396638373436623638343337323538353830393030303030303636&dotrans=0&ef=15_0&bizid=1023"
|
||||
},
|
||||
"Thumb": {
|
||||
"Type": "1",
|
||||
"Value": "http://vweixinthumb.tc.qq.com/150/20250/snsvideodownload?filekey=30340201010420301e020200960402535a0410491963b8c72a914b121e6ca517797aad02024b4b040d00000004627466730000000131&hy=SZ&storeid=32303230303631313134343232363030306361636264373436623638343337323538353830393030303030303936&bizid=1023"
|
||||
},
|
||||
"Size": {
|
||||
"Width": "540.000000",
|
||||
"Height": "960.000000",
|
||||
"TotalSize": "207589"
|
||||
},
|
||||
"VideoDuration": 4.033333
|
||||
}
|
||||
]
|
||||
},
|
||||
"ContentURL": "https://support.weixin.qq.com/cgi-bin/mmsupport-bin/readtemplate?t=page/common_page__upgrade&v=1"
|
||||
},
|
||||
"ActionInfo": {
|
||||
"AppMsg": {
|
||||
"MessageAction": ""
|
||||
}
|
||||
},
|
||||
"Location": {
|
||||
"PoiClassifyID": "",
|
||||
"PoiName": "",
|
||||
"PoiAddress": "",
|
||||
"PoiClassifyType": 0,
|
||||
"City": ""
|
||||
},
|
||||
"PublicUserName": "",
|
||||
"StreamVideo": {
|
||||
"StreamVideoURL": "",
|
||||
"StreamVideoThumbURL": "",
|
||||
"StreamVideoWebURL": ""
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
//图文
|
||||
{
|
||||
"ContentStyle": 1,
|
||||
"MediaList": [
|
||||
{
|
||||
"ThumType": "1",
|
||||
"Thumb": "调用上传朋友圈图片接口返回",
|
||||
"Description": "",
|
||||
"Type": 2,
|
||||
"MD5": "dc3d66d0fdc3e51f7abad00373854f58",
|
||||
"SizeWidth": "800",
|
||||
"VideoDuration": 0,
|
||||
"UserData": "",
|
||||
"VideoMD5": "",
|
||||
"Title": "",
|
||||
"URLType": "1",
|
||||
"VideoHeight": "",
|
||||
"ID": 1,
|
||||
"SizeHeight": "800",
|
||||
"TotalSize": "126335",
|
||||
"URL": "http://mmsns.qpic.cn/mmsns/PiajxSqBRaELqLq7KFRSzPrYTViaAFrzicTOp5uXczOTiadcrCkFQH1uWibXc0ZyX6kAd/0",
|
||||
"VideoWidth": "",
|
||||
"SubType": 0,
|
||||
"Private": 0
|
||||
}
|
||||
],
|
||||
"Privacy": 0,
|
||||
"Content": "休闲时刻😚零食来一波~"
|
||||
}
|
||||
//文字
|
||||
{
|
||||
"ContentStyle": 2,
|
||||
"Privacy": 0,
|
||||
"Content": "\n休闲时刻😚零食来一波\r\n夏威夷果奶油味坚果"
|
||||
}
|
||||
//视频
|
||||
{
|
||||
"ContentStyle": 15,
|
||||
"MediaList": [
|
||||
{
|
||||
"ThumType": "1",
|
||||
"Thumb": "调用上传朋友圈图片接口返回",
|
||||
"Description": "",
|
||||
"Type": 2,
|
||||
"MD5": "dc3d66d0fdc3e51f7abad00373854f58",
|
||||
"SizeWidth": "800",
|
||||
"VideoDuration": 0,
|
||||
"UserData": "",
|
||||
"VideoMD5": "",
|
||||
"Title": "",
|
||||
"URLType": "1",
|
||||
"VideoHeight": "",
|
||||
"ID": 1,
|
||||
"SizeHeight": "800",
|
||||
"TotalSize": "126335",
|
||||
"URL": "http://aitao.wingscode.com/aitao/upload/663c78e5-1eca-40ca-98a3-8c5f109694b3.mp4?token=54fc22a143276ca331de63d706c0b8bd",
|
||||
"VideoWidth": "",
|
||||
"SubType": 0,
|
||||
"Private": 0
|
||||
}
|
||||
],
|
||||
"Privacy": 0,
|
||||
"Content": "休闲时刻可口n大人小孩都爱吃"
|
||||
}
|
||||
//链接
|
||||
{
|
||||
"ContentStyle": 3,
|
||||
"ContentUrl":"https://mp.weixin.qq.com/mp/homepage?__biz=MzA5MDQ5NTE5MQ==&hid=1&sn=8dccd03f475fec450f2f14b4690e247b&scene=18&devicetype=iOS12.4.3&version=1700112a&lang=zh_CN&nettype=WIFI&ascene=7&session_us=gh_f5ed87696bbf&fontScale=100&pass_ticket=gM1DjNqeOCQghv7AQfAg41js%2FqFjJL87XQwUqv7V3HbGK8yxaNQ1FK%2B40xvX21P4&wx_header=1&scene=2",
|
||||
"Description":"一个字读懂中国建筑——宫",
|
||||
"MediaList": [
|
||||
{
|
||||
"ThumType": "1",
|
||||
"Thumb": "http://szmmsns.qpic.cn/mmsns/DtE8MdW3UaMFPCO2PEm76HiafHmLXHbdAibbeNVDFs0mF7kqyhic4Lar5UdicZiahKmtxnuqYicBBQ920/150",
|
||||
"Description": "",
|
||||
"Type": 2,
|
||||
"MD5": "",
|
||||
"SizeWidth": "800",
|
||||
"VideoDuration": 0,
|
||||
"UserData": "",
|
||||
"VideoMD5": "",
|
||||
"Title": "艺术笔迹",
|
||||
"URLType": "0",
|
||||
"VideoHeight": "",
|
||||
"ID": 1,
|
||||
"SizeHeight": "800",
|
||||
"TotalSize": "126335",
|
||||
"URL": "http://mmbiz.qpic.cn/mmbiz_jpg/Ro4nV0WxTiaQgvyffia62XWMaEJnm1l7nrgHjNNhlIJom9ZD8KYn3iavIZJaAaFKC6W2UcKSDJoxW8QPUoWjA7Z6w/0",
|
||||
"VideoWidth": "",
|
||||
"SubType": 0,
|
||||
"Private": 0
|
||||
}
|
||||
],
|
||||
"Privacy": 0,
|
||||
"Content": "鞯地苛左工地~"
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
{
|
||||
"ContentStyle": 1,
|
||||
"Privacy": 0,
|
||||
"Content": "asdasdadasd",
|
||||
"MediaList": [
|
||||
{
|
||||
"ID": 1,
|
||||
"Type": 1,
|
||||
"Title": "asdasd",
|
||||
"Description": "sadasd",
|
||||
"Private": 0,
|
||||
"UserData": "asdasdas",
|
||||
"SubType": 0,
|
||||
"URL": "sadasd",
|
||||
"URLType": "asdasd",
|
||||
"Thumb": "asdasd",
|
||||
"ThumType": "asdasd",
|
||||
"SizeWidth": "asdasd",
|
||||
"SizeHeight": "",
|
||||
"TotalSize": "",
|
||||
"VideoWidth": "",
|
||||
"VideoHeight": "",
|
||||
"MD5": "",
|
||||
"VideoMD5": "",
|
||||
"VideoDuration": 0
|
||||
},
|
||||
{
|
||||
"ID": 2,
|
||||
"Type": 1,
|
||||
"Title": "asdasd",
|
||||
"Description": "sadasd",
|
||||
"Private": 0,
|
||||
"UserData": "asdasdas",
|
||||
"SubType": 0,
|
||||
"URL": "sadasd",
|
||||
"URLType": "asdasd",
|
||||
"Thumb": "asdasd",
|
||||
"ThumType": "asdasd",
|
||||
"SizeWidth": "asdasd",
|
||||
"SizeHeight": "",
|
||||
"TotalSize": "",
|
||||
"VideoWidth": "",
|
||||
"VideoHeight": "",
|
||||
"MD5": "",
|
||||
"VideoMD5": "",
|
||||
"VideoDuration": 0
|
||||
}
|
||||
],
|
||||
"WithUserList": null,
|
||||
"GroupUserList": null,
|
||||
"BlackList": null,
|
||||
"LocationInfo": null
|
||||
}
|
||||
Reference in New Issue
Block a user