Skip to content

Commit ced302c

Browse files
author
Matrix-X
committed
fix(work): add_moment_task response field and add GetMomentTaskResult
1 parent fa7c98a commit ced302c

File tree

4 files changed

+27
-3
lines changed

4 files changed

+27
-3
lines changed

src/work/externalContact/moment/client.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,3 +115,18 @@ func (comp *Client) AddMomentTask(ctx context.Context, params *request.RequestAd
115115

116116
return result, err
117117
}
118+
119+
// 获取任务创建结果
120+
// https://developer.work.weixin.qq.com/document/path/95095
121+
func (comp *Client) GetMomentTaskResult(ctx context.Context, jobId string) (*response.ResponseGetMomentTaskResult, error) {
122+
123+
result := &response.ResponseGetMomentTaskResult{}
124+
125+
params := &object.StringMap{
126+
"jobid": jobId,
127+
}
128+
129+
_, err := comp.BaseClient.HttpGet(ctx, "cgi-bin/externalcontact/get_moment_task_result", params, nil, result)
130+
131+
return result, err
132+
}

src/work/externalContact/moment/response/responseAddMomentTask.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,5 @@ type Result struct {
2020

2121
type ResponseAddMomentTask struct {
2222
response.ResponseWork
23-
Status int `json:"status"`
24-
Type string `json:"type"`
25-
Result Result `json:"result"`
23+
JobId int `json:"jobid"`
2624
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package response
2+
3+
import "github.com/ArtisanCloud/PowerWeChat/v3/src/kernel/response"
4+
5+
type ResponseGetMomentTaskResult struct {
6+
response.ResponseWork
7+
8+
Status int `json:"status"`
9+
Type string `json:"type"`
10+
Result Result `json:"result"`
11+
}

0 commit comments

Comments
 (0)