Skip to content

Commit 20376ee

Browse files
authored
Merge pull request #625 from ArtisanCloud/develop
Develop
2 parents 9e040a8 + f1a1658 commit 20376ee

File tree

7 files changed

+121
-17
lines changed

7 files changed

+121
-17
lines changed

src/kernel/serverGuard.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ func (serverGuard *ServerGuard) Serve(request *http.Request) (response *http.Res
138138
}
139139

140140
response, err = validatedGuard.Resolve(request)
141+
if err != nil {
142+
return nil, err
143+
}
141144

142145
logger.Info("Server response created:", "content", response.ContentLength)
143146

src/work/externalContact/groupChat/client.go

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,47 @@ func (comp *Client) GetNewExternalUserID(ctx context.Context, chatID string, ext
8080

8181
return result.Items, err
8282
}
83+
84+
// 配置客户群进群方式
85+
// https://developer.work.weixin.qq.com/document/path/92229
86+
func (comp *Client) AddJoinWay(ctx context.Context, params *request.RequestAddJoinWay) (*response.ResponseAddJoinWay, error) {
87+
88+
result := &response.ResponseAddJoinWay{}
89+
90+
_, err := comp.BaseClient.HttpPostJson(ctx, "cgi-bin/externalcontact/groupchat/add_join_way", params, nil, nil, result)
91+
92+
return result, err
93+
}
94+
95+
// 获取客户群进群方式配置
96+
// https://developer.work.weixin.qq.com/document/path/92229
97+
func (comp *Client) GetJoinWay(ctx context.Context, params *request.RequestGetJoinWay) (*response.ResponseGetJoinWay, error) {
98+
99+
result := &response.ResponseGetJoinWay{}
100+
101+
_, err := comp.BaseClient.HttpPostJson(ctx, "cgi-bin/externalcontact/groupchat/get_join_way", params, nil, nil, result)
102+
103+
return result, err
104+
}
105+
106+
// 更新客户群进群方式配置
107+
// https://developer.work.weixin.qq.com/document/path/92229
108+
func (comp *Client) UpdateJoinWay(ctx context.Context, params *request.RequestUpdateJoinWay) (*response.ResponseUpdateJoinWay, error) {
109+
110+
result := &response.ResponseUpdateJoinWay{}
111+
112+
_, err := comp.BaseClient.HttpPostJson(ctx, "cgi-bin/externalcontact/groupchat/update_join_way", params, nil, nil, result)
113+
114+
return result, err
115+
}
116+
117+
// 删除客户群进群方式配置
118+
// https://developer.work.weixin.qq.com/document/path/92229
119+
func (comp *Client) DelJoinWay(ctx context.Context, params *request.RequestDelJoinWay) (*response.ResponseDelJoinWay, error) {
120+
121+
result := &response.ResponseDelJoinWay{}
122+
123+
_, err := comp.BaseClient.HttpPostJson(ctx, "cgi-bin/externalcontact/groupchat/del_join_way", params, nil, nil, result)
124+
125+
return result, err
126+
}

src/work/externalContact/groupChat/request/requestAddGroupChat.go

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package request
2+
3+
type RequestAddJoinWay struct {
4+
Scene int `json:"scene"`
5+
Remark string `json:"remark"`
6+
AutoCreateRoom int `json:"auto_create_room"`
7+
RoomBaseName string `json:"room_base_name"`
8+
RoomBaseId int `json:"room_base_id"`
9+
ChatIdList []string `json:"chat_id_list"`
10+
State string `json:"state"`
11+
}

src/work/externalContact/groupChat/request/requestGroupChatList.go

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,29 @@ type RequestGroupChatList struct {
88
Cursor string `json:"cursor"`
99
Limit int `json:"limit"`
1010
}
11+
12+
type RequestAddGroupChat struct {
13+
StatusFilter int `json:"status_filter"`
14+
OwnerFilter *power.HashMap `json:"owner_filter"`
15+
Cursor string `json:"cursor"`
16+
Limit int `json:"limit"`
17+
}
18+
19+
type RequestGetJoinWay struct {
20+
ConfigId string `json:"config_id"`
21+
}
22+
23+
type RequestUpdateJoinWay struct {
24+
ConfigId string `json:"config_id"`
25+
Scene int `json:"scene"`
26+
Remark string `json:"remark"`
27+
AutoCreateRoom int `json:"auto_create_room"`
28+
RoomBaseName string `json:"room_base_name"`
29+
RoomBaseId int `json:"room_base_id"`
30+
ChatIdList []string `json:"chat_id_list"`
31+
State string `json:"state"`
32+
}
33+
34+
type RequestDelJoinWay struct {
35+
ConfigId string `json:"config_id"`
36+
}

src/work/externalContact/groupChat/response/responseGroupChatList.go

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,33 @@ type ResponseGroupChatList struct {
1414
GroupChatList []*CompactGroupChat `json:"group_chat_list"`
1515
NextCursor string `json:"next_cursor"`
1616
}
17+
18+
type ResponseAddJoinWay struct {
19+
response.ResponseWork
20+
ConfigId string `json:"config_id"`
21+
}
22+
23+
type JoinWay struct {
24+
ConfigId string `json:"config_id"`
25+
Scene int `json:"scene"`
26+
Remark string `json:"remark"`
27+
AutoCreateRoom int `json:"auto_create_room"`
28+
RoomBaseName string `json:"room_base_name"`
29+
RoomBaseId int `json:"room_base_id"`
30+
ChatIdList []string `json:"chat_id_list"`
31+
QrCode string `json:"qr_code"`
32+
State string `json:"state"`
33+
}
34+
35+
type ResponseGetJoinWay struct {
36+
response.ResponseWork
37+
JoinWay JoinWay `json:"join_way"`
38+
}
39+
40+
type ResponseUpdateJoinWay struct {
41+
response.ResponseWork
42+
}
43+
44+
type ResponseDelJoinWay struct {
45+
response.ResponseWork
46+
}
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package request
22

33
type RequestExternalContactRemark struct {
4-
UserID string `json:"userid"`
5-
ExternalUserID string `json:"external_userid"`
6-
Remark string `json:"remark"`
7-
Description string `json:"description"`
8-
RemarkCompany string `json:"remark_company"`
9-
RemarkMobiles []string `json:"remark_mobiles"`
10-
RemarkPicMediaID string `json:"remark_pic_mediaid"`
4+
UserID string `json:"userid,omitempty"`
5+
ExternalUserID string `json:"external_userid,omitempty"`
6+
Remark string `json:"remark,omitempty"`
7+
Description string `json:"description,omitempty"`
8+
RemarkCompany string `json:"remark_company,omitempty"`
9+
RemarkMobiles []string `json:"remark_mobiles,omitempty"`
10+
RemarkPicMediaID string `json:"remark_pic_mediaid,omitempty"`
1111
}

0 commit comments

Comments
 (0)