feat: Phase 4 多平台接入 — Platform Bridge + 6平台适配器 + 身份权限系统 (22文件, 2129行)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-23 16:19:57 +08:00
parent 717ad65b05
commit 965cce7192
22 changed files with 2129 additions and 2 deletions
@@ -0,0 +1,75 @@
package qq
// OBv11 (OneBot v11) protocol types.
// OBv11Message is a message received from QQ via OneBot.
type OBv11Message struct {
PostType string `json:"post_type"` // "message", "notice", "request"
MessageType string `json:"message_type"` // "private", "group"
Time int64 `json:"time"`
SelfID int64 `json:"self_id"`
// Private message fields.
Sender *OBv11Sender `json:"sender,omitempty"`
Message interface{} `json:"message"` // string or []OBv11MessageSegment
RawMessage string `json:"raw_message"`
Font int `json:"font"`
SubType string `json:"sub_type"` // "friend", "group", "other"
MessageID int32 `json:"message_id"`
UserID int64 `json:"user_id"`
TargetID int64 `json:"target_id"`
TempSource int `json:"temp_source"`
// Group message fields.
GroupID int64 `json:"group_id"`
Anonymous interface{} `json:"anonymous"`
MessageSeq int64 `json:"message_seq"`
// Notice fields.
NoticeType string `json:"notice_type"`
}
// OBv11Sender represents a message sender.
type OBv11Sender struct {
UserID int64 `json:"user_id"`
Nickname string `json:"nickname"`
Sex string `json:"sex"`
Age int32 `json:"age"`
Card string `json:"card"` // group card (nickname in group)
Area string `json:"area"`
Level string `json:"level"`
Role string `json:"role"` // "owner", "admin", "member"
Title string `json:"title"`
}
// OBv11MessageSegment is a segment in an array-format message.
type OBv11MessageSegment struct {
Type string `json:"type"`
Data map[string]interface{} `json:"data"`
}
// OBv11APIResponse is the response from an API call.
type OBv11APIResponse struct {
Status string `json:"status"` // "ok" or "failed"
RetCode int `json:"retcode"`
Data interface{} `json:"data"`
Message string `json:"msg"`
Wording string `json:"wording"`
Echo string `json:"echo"`
}
// OBv11SendMsg is the request body for send_msg.
type OBv11SendMsg struct {
Action string `json:"action"`
Params OBv11Params `json:"params"`
Echo string `json:"echo,omitempty"`
}
// OBv11Params holds parameters for send_msg API calls.
type OBv11Params struct {
MessageType string `json:"message_type,omitempty"` // "private", "group"
UserID int64 `json:"user_id,omitempty"`
GroupID int64 `json:"group_id,omitempty"`
Message interface{} `json:"message"`
AutoEscape bool `json:"auto_escape,omitempty"`
}