-
Notifications
You must be signed in to change notification settings - Fork 61
/
Copy pathtop_api_approval_test.go
46 lines (40 loc) · 1.4 KB
/
top_api_approval_test.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
package godingtalk
import (
"encoding/json"
"testing"
"time"
)
func TestTopAPIProcInst(t *testing.T) {
var compntValues []ProcInstCompntValues
compntValues = append(compntValues, ProcInstCompntValues{Name: "单行输入框", Value: "单行输入框输入的内容"})
detailCompntValues := [][]ProcInstCompntValues{[]ProcInstCompntValues{ProcInstCompntValues{Name: "明细内单行输入框", Value: "明细内单行输入框的内容"}}}
detailValues, _ := json.Marshal(detailCompntValues)
compntValues = append(compntValues, ProcInstCompntValues{Name: "明细1", Value: string(detailValues)})
procInstData := TopAPICreateProcInst{
Approvers: []string{"085354234826136236"},
CCList: []string{"085354234826136236"},
CCPosition: "START",
DeptID: 4207088,
OriginatorUID: "085354234826136236",
ProcessCode: "PROC-FF6YHQ9WQ2-RWDT8XCUTV0U5IAT7JBM1-8MD0TNEJ-6",
FormCompntValues: compntValues,
}
procInstID, err := c.TopAPICreateProcInst(procInstData)
if err != nil {
t.Log(err)
} else {
t.Logf("%+v\n", procInstID)
}
procInst, err := c.TopAPIGetProcInst(procInstID)
if err != nil {
t.Log(err)
} else {
t.Logf("%+v\n", procInst)
}
listResp, err := c.TopAPIListProcInst("PROC-FF6YHQ9WQ2-RWDT8XCUTV0U5IAT7JBM1-8MD0TNEJ-6", time.Now().AddDate(0, 0, -10), time.Now(), 10, 0, nil)
if err != nil {
t.Log(err)
} else {
t.Logf("%+v\n", listResp)
}
}