model

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CodeMessage

type CodeMessage struct {
	AckId   string         `json:"ack_id"`
	Event   string         `json:"event"`
	Content CodeMessageReq `json:"content"`
}

type CodeMessageReq

type CodeMessageReq struct {
	Type       string    `json:"type,omitempty"`
	Receiver   *Receiver `json:"receiver,omitempty"` // 消息接收者
	TalkType   int       `json:"talk_type" v:"required|in:1,2"`
	ReceiverId int       `json:"receiver_id" v:"required"`
	Lang       string    `json:"lang" v:"required"`
	Code       string    `json:"code" v:"required"`
}

代码消息

type ConsumeContactApply

type ConsumeContactApply struct {
	ApplyId string `json:"apply_id"`
	Type    int    `json:"type"`
}

type ConsumeContactStatus

type ConsumeContactStatus struct {
	Status int `json:"status"`
	UserId int `json:"user_id"`
}

type ConsumeGroupApply

type ConsumeGroupApply struct {
	GroupId int `json:"group_id"`
	UserId  int `json:"user_id"`
}

type ConsumeGroupJoin

type ConsumeGroupJoin struct {
	Gid  int   `json:"group_id"`
	Type int   `json:"type"`
	Uids []int `json:"uids"`
}

type ConsumeTalk

type ConsumeTalk struct {
	TalkType   int `json:"talk_type"`
	SenderID   int `json:"sender_id"`
	ReceiverID int `json:"receiver_id"`
	RecordID   int `json:"record_id"`
}

type ConsumeTalkKeyboard

type ConsumeTalkKeyboard struct {
	SenderID   int `json:"sender_id"`
	ReceiverID int `json:"receiver_id"`
}

type ConsumeTalkRead

type ConsumeTalkRead struct {
	SenderId   int   `json:"sender_id"`
	ReceiverId int   `json:"receiver_id"`
	Ids        []int `json:"ids"`
}

type ConsumeTalkRevoke

type ConsumeTalkRevoke struct {
	RecordId int `json:"record_id"`
}

type EmoticonMessage

type EmoticonMessage struct {
	MsgId   string             `json:"msg_id"`
	Event   string             `json:"event"`
	Content EmoticonMessageReq `json:"content"`
}

type EmoticonMessageReq

type EmoticonMessageReq struct {
	Type       string    `json:"type,omitempty"`
	Receiver   *Receiver `json:"receiver,omitempty"` // 消息接收者
	TalkType   int       `json:"talk_type" v:"required|in:1,2"`
	ReceiverId int       `json:"receiver_id" v:"required"`
	EmoticonId string    `json:"emoticon_id" v:"required"`
}

表情消息

type FileMessage

type FileMessage struct {
	MsgId   string          `json:"msg_id"`
	Event   string          `json:"event"`
	Content ImageMessageReq `json:"content"`
}

type ImageMessage

type ImageMessage struct {
	MsgId   string          `json:"msg_id"`
	Event   string          `json:"event"`
	Content ImageMessageReq `json:"content"`
}

type ImageMessageReq

type ImageMessageReq struct {
	Type       string    `json:"type,omitempty"`
	Url        string    `json:"url,omitempty" v:"required"`    // 图片地址
	Width      int       `json:"width,omitempty" v:"required"`  // 图片宽度
	Height     int       `json:"height,omitempty" v:"required"` // 图片高度
	Size       int       `json:"size,omitempty" v:"required"`   // 图片大小
	Receiver   *Receiver `json:"receiver,omitempty"`            // 消息接收者
	QuoteId    string    `json:"quote_id,omitempty"`            // 引用的消息ID
	TalkType   int       `json:"talk_type" v:"required|in:1,2"`
	ReceiverId int       `json:"receiver_id" v:"required"`
}

图片消息

type KeyboardMessage

type KeyboardMessage struct {
	Event   string `json:"event"`
	Content struct {
		SenderID   int `json:"sender_id"`
		ReceiverID int `json:"receiver_id"`
	} `json:"content"`
}

type LocationMessage

type LocationMessage struct {
	MsgId   string             `json:"msg_id"`
	Event   string             `json:"event"`
	Content LocationMessageReq `json:"content"`
}

type LocationMessageReq

type LocationMessageReq struct {
	Type        string    `json:"type,omitempty"`
	Longitude   string    `json:"longitude,omitempty" v:"required"`   // 地理位置 经度
	Latitude    string    `json:"latitude,omitempty" v:"required"`    // 地理位置 纬度
	Description string    `json:"description,omitempty" v:"required"` // 位置描述
	Receiver    *Receiver `json:"receiver,omitempty"`                 // 消息接收者
	TalkType    int       `json:"talk_type" v:"required|in:1,2"`
	ReceiverId  int       `json:"receiver_id" v:"required"`
}

位置消息

type Mention

type Mention struct {
	All  int   `json:"all,omitempty"`
	Uids []int `json:"uids,omitempty"`
}

type MessageVoteReq

type MessageVoteReq struct {
	Type       string    `json:"type,omitempty"`
	Receiver   *Receiver `json:"receiver,omitempty"` // 消息接收者
	ReceiverId int       `json:"receiver_id" v:"required"`
	Mode       int       `json:"mode" v:"in:0,1"`
	Anonymous  int       `json:"anonymous" v:"in:0,1"`
	Title      string    `json:"title" v:"required"`
	Options    []string  `json:"options"`
}

投票消息接口请求参数

type Receiver

type Receiver struct {
	TalkType   int `json:"talk_type,omitempty"`   // 对话类型 1:私聊 2:群聊
	ReceiverId int `json:"receiver_id,omitempty"` // 接收者ID, 好友ID或群ID
}

type Robot

type Robot struct {
	UserId    int    `json:"user_id,omitempty"`    // 关联用户ID
	RobotName string `json:"robot_name,omitempty"` // 机器人名称
	Describe  string `json:"describe,omitempty"`   // 描述信息
	IsTalk    int    `json:"is_talk,omitempty"`    // 可发送消息[0:否;1:是;]
	Status    int    `json:"status,omitempty"`     // 状态[-1:已删除;0:正常;1:已禁用;]
	Type      int    `json:"type,omitempty"`       // 机器人类型
	Company   string `json:"company,omitempty"`    // 公司
	Model     string `json:"model,omitempty"`      // 模型
	ModelType string `json:"model_type,omitempty"` // 模型类型, 聊天: chat, 画图: image
	Role      string `json:"role,omitempty"`       // 角色
	Prompt    string `json:"prompt,omitempty"`     // 提示
	MsgType   int    `json:"msg_type,omitempty"`   // 消息类型[1:文本消息;2:文件消息;3:会话消息;4:代码消息;5:投票消息;6:群公告;7:好友申请;8:登录通知;9:入群消息/退群消息;]
	Proxy     string `json:"proxy,omitempty"`      // 代理
	CreatedAt int64  `json:"created_at,omitempty"` // 创建时间
	UpdatedAt int64  `json:"updated_at,omitempty"` // 更新时间
}

type SubscribeContent

type SubscribeContent struct {
	Event string `json:"event"`
	Data  string `json:"data"`
}

type TalkReadMessage

type TalkReadMessage struct {
	Event   string `json:"event"`
	Content struct {
		MsgIds     []int `json:"msg_id"`
		ReceiverId int   `json:"receiver_id"`
	} `json:"content"`
}

type TalkRecord

type TalkRecord struct {
	Id         string `json:"id"`          // ID
	RecordId   int    `json:"record_id"`   // 记录ID
	MsgId      string `json:"msg_id"`      // 消息唯一ID
	Sequence   int64  `json:"sequence"`    // 消息时序ID
	TalkType   int    `json:"talk_type"`   // 对话类型[1:私信;2:群聊;]
	MsgType    int    `json:"msg_type"`    // 消息类型
	UserId     int    `json:"user_id"`     // 发送者ID[0:系统用户;]
	ReceiverId int    `json:"receiver_id"` // 接收者ID(用户ID 或 群ID)
	IsRevoke   int    `json:"is_revoke"`   // 是否撤回消息[0:否;1:是;]
	IsMark     int    `json:"is_mark"`     // 是否重要消息[0:否;1:是;]
	IsRead     int    `json:"is_read"`     // 是否已读[0:否;1:是;]
	QuoteId    string `json:"quote_id"`    // 引用消息ID
	Content    string `json:"content"`     // 文本消息
	Extra      string `json:"extra"`       // 扩展信信息
	CreatedAt  string `json:"created_at"`  // 创建时间
	UpdatedAt  string `json:"updated_at"`  // 更新时间
}

type TalkRecordCode

type TalkRecordCode struct {
	Lang string `json:"lang"` // 代码语言
	Code string `json:"code"` // 代码内容
}

type TalkRecordReply

type TalkRecordReply struct {
	UserId   int    `json:"user_id,omitempty"`
	Nickname string `json:"nickname,omitempty"`
	MsgType  int    `json:"msg_type,omitempty"` // 1:文字 2:图片
	Content  string `json:"content,omitempty"`  // 文字或图片连接
	MsgId    string `json:"msg_id,omitempty"`
}

type TalkRecordsItem

type TalkRecordsItem struct {
	Id         int    `json:"id"`
	Sequence   int    `json:"sequence"`
	MsgId      string `json:"msg_id"`
	TalkType   int    `json:"talk_type"`
	MsgType    int    `json:"msg_type"`
	UserId     int    `json:"user_id"`
	ReceiverId int    `json:"receiver_id"`
	Nickname   string `json:"nickname"`
	Avatar     string `json:"avatar"`
	IsRevoke   int    `json:"is_revoke"`
	IsMark     int    `json:"is_mark"`
	IsRead     int    `json:"is_read"`
	Content    string `json:"content"`
	CreatedAt  string `json:"created_at"`
	Extra      any    `json:"extra"` // 额外参数
}

type TextMessage

type TextMessage struct {
	AckId   string         `json:"ack_id"`
	Event   string         `json:"event"`
	Content TextMessageReq `json:"content"`
}

type TextMessageReq

type TextMessageReq struct {
	Type       string    `json:"type,omitempty"` // 消息类型
	Content    string    `json:"content,omitempty" v:"required"`
	Mention    *Mention  `json:"mention,omitempty"`
	QuoteId    string    `json:"quote_id,omitempty"` // 引用的消息ID
	Receiver   *Receiver `json:"receiver,omitempty"` // 消息接收者
	TalkType   int       `json:"talk_type" v:"required|in:1,2"`
	ReceiverId int       `json:"receiver_id" v:"required"`
	Text       string    `json:"text" v:"required"`
}

文本消息

type VoteMessage

type VoteMessage struct {
	MsgId   string         `json:"msg_id"`
	Event   string         `json:"event"`
	Content MessageVoteReq `json:"content"`
}

type VoteStatistics

type VoteStatistics struct {
	Count   int            `json:"count"`
	Options map[string]int `json:"options"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL