Skip to content

Commit ab6191f

Browse files
authored
Merge pull request #9 from SilkageNet/master
add puppet schemas and add user_link
2 parents 168e7cb + 99561e0 commit ab6191f

File tree

16 files changed

+450
-5
lines changed

16 files changed

+450
-5
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@
1414
# Dependency directories (remove the comment below to include it)
1515
# vendor/
1616
.idea/
17+
go.sum

go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
module github.com/wechaty/go-wechaty
22

3+
require github.com/otiai10/opengraph v1.1.1
4+
35
go 1.14
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
package schemas
2+
3+
type ContactGender uint8
4+
5+
const (
6+
ContactGenderUnknown ContactGender = 0
7+
ContactGenderMale ContactGender = 1
8+
ContactGenderFemale ContactGender = 2
9+
)
10+
11+
type ContactType uint8
12+
13+
const (
14+
ContactTypeUnknown ContactType = 0
15+
ContactTypePersonal ContactType = 1
16+
ContactTypeOfficial ContactType = 2
17+
)
18+
19+
type ContactQueryFilter struct {
20+
Alias string
21+
Id string
22+
Name string
23+
WeiXin string
24+
}
25+
26+
type ContactPayload struct {
27+
Id string
28+
Gender ContactGender
29+
Type ContactType
30+
Name string
31+
Avatar string
32+
Address string
33+
Alias string
34+
City string
35+
Friend bool
36+
Province string
37+
Signature string
38+
Start bool
39+
WeiXin string
40+
}
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
package schemas
2+
3+
type ScanStatus uint8
4+
5+
const (
6+
ScanStatusUnknown ScanStatus = 0
7+
ScanStatusCancel ScanStatus = 1
8+
ScanStatusWaiting ScanStatus = 2
9+
ScanStatusScanned ScanStatus = 3
10+
ScanStatusConfirmed ScanStatus = 4
11+
ScanStatusTimeout ScanStatus = 5
12+
)
13+
14+
type EventFriendshipPayload struct {
15+
FriendshipId string
16+
}
17+
18+
type EventLoginPayload struct {
19+
ContactId string
20+
}
21+
22+
type EventLogoutPayload struct {
23+
ContactId string
24+
Data string
25+
}
26+
27+
type EventMessagePayload struct {
28+
MessageId string
29+
}
30+
31+
type EventRoomInvitePayload struct {
32+
RoomInvitationId string
33+
}
34+
35+
type EventRoomJoinPayload struct {
36+
InviteeIdList []string
37+
InviterId string
38+
RoomId string
39+
Timestamp int64
40+
}
41+
42+
type EventRoomLeavePayload struct {
43+
RemoveIdList []string
44+
RemoverId string
45+
RoomId string
46+
Timestamp int64
47+
}
48+
49+
type EventRoomTopicPayload struct {
50+
ChangerId string
51+
NewTopic string
52+
OldTopic string
53+
RoomId string
54+
Timestamp int64
55+
}
56+
57+
type EventScanPayload struct {
58+
BaseEventPayload
59+
Status ScanStatus
60+
QrCode string
61+
}
62+
63+
type BaseEventPayload struct {
64+
Data string
65+
}
66+
67+
type EventDongPayload = BaseEventPayload
68+
69+
type EventErrorPayload = BaseEventPayload
70+
71+
type EventReadyPayload = BaseEventPayload
72+
73+
type EventResetPayload = BaseEventPayload
74+
75+
type EventHeartbeatPayload = BaseEventPayload
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
package schemas
2+
3+
type FriendshipType uint8
4+
5+
const (
6+
FriendshipTypeUnknown FriendshipType = 0
7+
FriendshipTypeConfirm FriendshipType = 1
8+
FriendshipTypeReceive FriendshipType = 2
9+
FriendshipTypeVerify FriendshipType = 3
10+
)
11+
12+
type FriendshipSceneType uint8
13+
14+
const (
15+
FriendshipSceneTypeUnknown FriendshipSceneType = 0
16+
FriendshipSceneTypeQQ FriendshipSceneType = 1
17+
FriendshipSceneTypeEmail FriendshipSceneType = 2
18+
FriendshipSceneTypeWeiXin FriendshipSceneType = 3
19+
FriendshipSceneTypeQQTBD FriendshipSceneType = 12 // QQ号搜索
20+
FriendshipSceneTypeRoom FriendshipSceneType = 14
21+
FriendshipSceneTypePhone FriendshipSceneType = 15
22+
FriendshipSceneTypeCard FriendshipSceneType = 17 // 名片分享
23+
FriendshipSceneTypeLocation FriendshipSceneType = 18
24+
FriendshipSceneTypeBottle FriendshipSceneType = 25
25+
FriendshipSceneTypeShaking FriendshipSceneType = 29
26+
FriendshipSceneTypeQRCode FriendshipSceneType = 30
27+
)
28+
29+
type FriendshipPayloadBase struct {
30+
Id string
31+
ContactId string
32+
Hello string
33+
Timestamp int64
34+
}
35+
36+
type FriendshipPayloadConfirm struct {
37+
FriendshipPayloadBase
38+
Type FriendshipType // FriendshipTypeConfirm
39+
}
40+
41+
type FriendshipPayloadReceive struct {
42+
FriendshipPayloadBase
43+
Type FriendshipType // FriendshipTypeReceive
44+
Scene FriendshipSceneType
45+
Stranger string
46+
Ticket string
47+
}
48+
49+
type FriendshipPayloadVerify struct {
50+
FriendshipPayloadBase
51+
Type FriendshipType // FriendshipTypeVerify
52+
}
53+
54+
type FriendshipSearchCondition struct {
55+
Phone string
56+
WeiXin string
57+
}

src/wechaty-puppet/schemas/image.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package schemas
33
type ImageType uint8
44

55
const (
6-
Unknown ImageType = 0
7-
Thumbnail = 1
8-
HD = 2
9-
Artwork = 3
6+
Unknown ImageType = 0
7+
Thumbnail ImageType = 1
8+
HD ImageType = 2
9+
Artwork ImageType = 3
1010
)
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
package schemas
2+
3+
type MessageType uint8
4+
5+
const (
6+
MessageTypeUnknown MessageType = 0
7+
MessageTypeAttachment MessageType = 1
8+
MessageTypeAudio MessageType = 2
9+
MessageTypeContact MessageType = 3
10+
MessageTypeChatHistory MessageType = 4
11+
MessageTypeEmoticon MessageType = 5
12+
MessageTypeImage MessageType = 6
13+
MessageTypeText MessageType = 7
14+
MessageTypeLocation MessageType = 8
15+
MessageTypeMiniProgram MessageType = 9
16+
MessageTypeTransfer MessageType = 10
17+
MessageTypeRedEnvelope MessageType = 11
18+
MessageTypeRecalled MessageType = 12
19+
MessageTypeUrl MessageType = 13
20+
MessageTypeVideo MessageType = 14
21+
)
22+
23+
type WeChatAppMessageType int
24+
25+
const (
26+
WeChatAppMessageTypeText WeChatAppMessageType = 1
27+
WeChatAppMessageTypeImg WeChatAppMessageType = 2
28+
WeChatAppMessageTypeAudio WeChatAppMessageType = 3
29+
WeChatAppMessageTypeVideo WeChatAppMessageType = 4
30+
WeChatAppMessageTypeUrl WeChatAppMessageType = 5
31+
WeChatAppMessageTypeAttach WeChatAppMessageType = 6
32+
WeChatAppMessageTypeOpen WeChatAppMessageType = 7
33+
WeChatAppMessageTypeEmoji WeChatAppMessageType = 8
34+
WeChatAppMessageTypeVoiceRemind WeChatAppMessageType = 9
35+
WeChatAppMessageTypeScanGood WeChatAppMessageType = 10
36+
WeChatAppMessageTypeGood WeChatAppMessageType = 13
37+
WeChatAppMessageTypeEmotion WeChatAppMessageType = 15
38+
WeChatAppMessageTypeCardTicket WeChatAppMessageType = 16
39+
WeChatAppMessageTypeRealtimeShareLocation WeChatAppMessageType = 17
40+
WeChatAppMessageTypeChatHistory WeChatAppMessageType = 19
41+
WeChatAppMessageTypeMiniProgram WeChatAppMessageType = 33
42+
WeChatAppMessageTypeTransfers WeChatAppMessageType = 2000
43+
WeChatAppMessageTypeRedEnvelopes WeChatAppMessageType = 2001
44+
WeChatAppMessageTypeReaderType WeChatAppMessageType = 100001
45+
)
46+
47+
type WeChatMessageType int
48+
49+
const (
50+
WeChatMessageTypeText WeChatMessageType = 1
51+
WeChatMessageTypeImage WeChatMessageType = 3
52+
WeChatMessageTypeVoice WeChatMessageType = 34
53+
WeChatMessageTypeVerifyMsg WeChatMessageType = 37
54+
WeChatMessageTypePossibleFriendMsg WeChatMessageType = 40
55+
WeChatMessageTypeShareCard WeChatMessageType = 42
56+
WeChatMessageTypeVideo WeChatMessageType = 43
57+
WeChatMessageTypeEmoticon WeChatMessageType = 47
58+
WeChatMessageTypeLocation WeChatMessageType = 48
59+
WeChatMessageTypeApp WeChatMessageType = 49
60+
WeChatMessageTypeVOIPMsg WeChatMessageType = 50
61+
WeChatMessageTypeStatusNotify WeChatMessageType = 51
62+
WeChatMessageTypeVOIPNotify WeChatMessageType = 52
63+
WeChatMessageTypeVOIPInvite WeChatMessageType = 53
64+
WeChatMessageTypeMicroVideo WeChatMessageType = 62
65+
WeChatMessageTypeTransfer WeChatMessageType = 2000 // 转账
66+
WeChatMessageTypeRedEnvelope WeChatMessageType = 2001 // 红包
67+
WeChatMessageTypeMiniProgram WeChatMessageType = 2002 // 小程序
68+
WeChatMessageTypeGroupInvite WeChatMessageType = 2003 // 群邀请
69+
WeChatMessageTypeFile WeChatMessageType = 2004 // 文件消息
70+
WeChatMessageTypeSysNotice WeChatMessageType = 9999
71+
WeChatMessageTypeSys WeChatMessageType = 10000
72+
WeChatMessageTypeRecalled WeChatMessageType = 10002
73+
)
74+
75+
type MessagePayloadBase struct {
76+
Id string
77+
MentionIdList []string
78+
Filename string
79+
Text string
80+
Timestamp string
81+
Type MessageType
82+
}
83+
84+
type MessagePayloadRoom struct {
85+
FromId string
86+
RoomId string
87+
ToId string
88+
}
89+
90+
type MessagePayloadTo = MessagePayloadRoom
91+
92+
type MessagePayload struct {
93+
MessagePayloadBase
94+
MessagePayloadRoom
95+
}
96+
97+
type MessageQueryFilter struct {
98+
FromId string
99+
Id string
100+
RoomId string
101+
Text string
102+
ToId string
103+
Type MessageType
104+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package schemas
2+
3+
type MiniProgramPayload struct {
4+
AppId string
5+
Description string
6+
PagePath string
7+
ThumbUrl string
8+
Title string
9+
Username string
10+
ThumbKey string
11+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package schemas
2+
3+
type PuppetOptions struct {
4+
endpoint string
5+
timeout int64
6+
token string
7+
}

src/wechaty-puppet/schemas/room.go

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package schemas
2+
3+
type RoomMemberQueryFilter struct {
4+
Name string
5+
RoomAlias string
6+
ContactAlias string
7+
}
8+
9+
type RoomQueryFilter struct {
10+
Id string
11+
Topic string
12+
}
13+
14+
type RoomPayload struct {
15+
Id string
16+
Topic string
17+
Avatar string
18+
MemberIdList []string
19+
OwnerId string
20+
AdminIdList []string
21+
}
22+
23+
type RoomMemberPayload struct {
24+
Id string
25+
RoomAlias string
26+
InviterId string
27+
Avatar string
28+
Name string
29+
}

0 commit comments

Comments
 (0)