wx_helper_sdk/response.go

103 lines
2.5 KiB
Go
Raw Permalink Normal View History

2024-01-05 11:54:25 +08:00
package wx_helper_sdk
2024-01-05 17:29:43 +08:00
import "encoding/json"
2024-01-05 11:54:25 +08:00
// CommonResponse
// @description: 公共返回
type CommonResponse struct {
Code int `json:"code"`
Msg string `json:"msg"`
Data any `json:"data"`
}
2024-01-05 17:29:43 +08:00
func (r *CommonResponse) String() string {
data, _ := json.Marshal(r)
return string(data)
}
2024-01-05 11:54:25 +08:00
// UserInfo
// @description: 当前用户信息
type UserInfo struct {
Account string `json:"account"`
City string `json:"city"`
Country string `json:"country"`
CurrentDataPath string `json:"currentDataPath"`
DataSavePath string `json:"dataSavePath"`
DbKey string `json:"dbKey"`
HeadImage string `json:"headImage"`
Mobile string `json:"mobile"`
Name string `json:"name"`
Province string `json:"province"`
Signature string `json:"signature"`
Wxid string `json:"wxid"`
}
2024-01-05 17:29:43 +08:00
func (r *UserInfo) String() string {
data, _ := json.Marshal(r)
return string(data)
}
2024-01-05 11:54:25 +08:00
// Friend
// @description: 朋友信息
type Friend struct {
CustomAccount string `json:"customAccount"`
EncryptName string `json:"encryptName"`
Nickname string `json:"nickname"`
Pinyin string `json:"pinyin"`
PinyinAll string `json:"pinyinAll"`
Reserved1 int `json:"reserved1"`
Reserved2 int `json:"reserved2"`
Type int `json:"type"`
VerifyFlag int `json:"verifyFlag"`
Wxid string `json:"wxid"`
}
2024-01-05 17:29:43 +08:00
func (r *Friend) String() string {
data, _ := json.Marshal(r)
return string(data)
}
// ChatRoomDetail
// @description: 群聊详情
type ChatRoomDetail struct {
ChatRoomId string `json:"chatRoomId"`
Notice string `json:"notice"`
Admin string `json:"admin"`
Xml string `json:"xml"`
}
2024-01-05 17:29:43 +08:00
func (r *ChatRoomDetail) String() string {
data, _ := json.Marshal(r)
return string(data)
}
// ChatRoomMembers
// @description: 群聊人员信息
type ChatRoomMembers struct {
Admin string `json:"admin"`
AdminNickname string `json:"adminNickname"`
ChatRoomId string `json:"chatRoomId"`
MemberNickname string `json:"memberNickname"`
Members string `json:"members"`
}
2024-01-05 17:29:43 +08:00
func (r *ChatRoomMembers) String() string {
data, _ := json.Marshal(r)
return string(data)
}
// ChatRoomMemberProfile
// @description: 获取群成员详细信息
type ChatRoomMemberProfile struct {
Account string `json:"account"`
HeadImage string `json:"headImage"`
Nickname string `json:"nickname"`
V3 string `json:"v3"`
Wxid string `json:"wxid"`
}
func (r *ChatRoomMemberProfile) String() string {
data, _ := json.Marshal(r)
return string(data)
}