Skip to content

Commit

Permalink
Merge pull request #506 from ArtisanCloud/develop
Browse files Browse the repository at this point in the history
fix(work): add_moment_task response field and add GetMomentTaskResult
  • Loading branch information
Matrix-X committed Jun 17, 2024
2 parents 94425dc + ced302c commit 14d734e
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 3 deletions.
15 changes: 15 additions & 0 deletions src/work/externalContact/moment/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,18 @@ func (comp *Client) AddMomentTask(ctx context.Context, params *request.RequestAd

return result, err
}

// 获取任务创建结果
// https://developer.work.weixin.qq.com/document/path/95095
func (comp *Client) GetMomentTaskResult(ctx context.Context, jobId string) (*response.ResponseGetMomentTaskResult, error) {

result := &response.ResponseGetMomentTaskResult{}

params := &object.StringMap{
"jobid": jobId,
}

_, err := comp.BaseClient.HttpGet(ctx, "cgi-bin/externalcontact/get_moment_task_result", params, nil, result)

return result, err
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,5 @@ type Result struct {

type ResponseAddMomentTask struct {
response.ResponseWork
Status int `json:"status"`
Type string `json:"type"`
Result Result `json:"result"`
JobId int `json:"jobid"`
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package response

import "github.com/ArtisanCloud/PowerWeChat/v3/src/kernel/response"

type ResponseGetMomentTaskResult struct {
response.ResponseWork

Status int `json:"status"`
Type string `json:"type"`
Result Result `json:"result"`
}

0 comments on commit 14d734e

Please sign in to comment.