-
Notifications
You must be signed in to change notification settings - Fork 0
/
health.go
67 lines (47 loc) · 2.11 KB
/
health.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// Package health 家校应用/健康上报
package health
import (
"bytes"
"github.com/cvblood/qywxapi/corporation"
)
const (
apiGetHealthReportStat = "/cgi-bin/health/get_health_report_stat"
apiGetReportJobids = "/cgi-bin/health/get_report_jobids"
apiGetReportJobInfo = "/cgi-bin/health/get_report_job_info"
apiGetReportAnswer = "/cgi-bin/health/get_report_answer"
)
/*
获取健康上报使用统计
See: https://work.weixin.qq.com/api/doc/90000/90135/92747
POST https://qyapi.weixin.qq.com/cgi-bin/health/get_health_report_stat?access_token=ACCESS_TOKEN
*/
func GetHealthReportStat(ctx *corporation.App, payload []byte) (resp []byte, err error) {
return ctx.Client.HTTPPost(apiGetHealthReportStat, bytes.NewReader(payload), "application/json;charset=utf-8")
}
/*
获取健康上报任务ID列表
通过此接口可以获取企业当前正在运行的上报任务ID列表。
See: https://work.weixin.qq.com/api/doc/90000/90135/92749
POST https://qyapi.weixin.qq.com/cgi-bin/health/get_report_jobids?access_token=ACCESS_TOKEN
*/
func GetReportJobids(ctx *corporation.App, payload []byte) (resp []byte, err error) {
return ctx.Client.HTTPPost(apiGetReportJobids, bytes.NewReader(payload), "application/json;charset=utf-8")
}
/*
获取健康上报任务详情
通过此接口可以获取指定的健康上报任务详情。
See: https://work.weixin.qq.com/api/doc/90000/90135/92751
POST https://qyapi.weixin.qq.com/cgi-bin/health/get_report_job_info?access_token=ACCESS_TOKEN
*/
func GetReportJobInfo(ctx *corporation.App, payload []byte) (resp []byte, err error) {
return ctx.Client.HTTPPost(apiGetReportJobInfo, bytes.NewReader(payload), "application/json;charset=utf-8")
}
/*
获取用户填写答案
通过此接口可以获取指定的健康上报任务详情。
See: https://work.weixin.qq.com/api/doc/90000/90135/92754
POST https://qyapi.weixin.qq.com/cgi-bin/health/get_report_answer?access_token=ACCESS_TOKEN
*/
func GetReportAnswer(ctx *corporation.App, payload []byte) (resp []byte, err error) {
return ctx.Client.HTTPPost(apiGetReportAnswer, bytes.NewReader(payload), "application/json;charset=utf-8")
}