| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- package dingtalk
- import (
- "fmt"
- "testing"
- )
- func TestQuerySchemaByProcessCode(t *testing.T) {
- client := NewClient()
- w := client.GetWorkflow()
- s, _ := w.QuerySchemaByProcessCode("PROC-7A5F6215-A8CF-4DD1-AB2C-5B1AB84C4E19")
- fmt.Println(s)
- }
- func TestStartProcessInstance(t *testing.T) {
- //client := NewClient()
- //w := client.GetWorkflow()
- ////formComponentValues0Details0Details0 := &workflow.StartProcessInstanceRequestFormComponentValuesDetailsDetails{
- //// Id: tea.String("PhoneField_IZI2LP8QF6O0"),
- //// BizAlias: tea.String("Phone"),
- //// Name: tea.String("PhoneField"),
- //// Value: tea.String("123xxxxxxxx"),
- //// ExtValue: tea.String("总个数:1"),
- //// ComponentType: tea.String("PhoneField"),
- ////}
- ////formComponentValues0Details0 := &workflow.StartProcessInstanceRequestFormComponentValuesDetails{
- //// Id: tea.String("PhoneField_IZI2LP8QF6O0"),
- //// BizAlias: tea.String("Phone"),
- //// Name: tea.String("PhoneField"),
- //// Value: tea.String("123xxxxxxxx"),
- //// ExtValue: tea.String("总个数:1"),
- //// Details: []*workflow.StartProcessInstanceRequestFormComponentValuesDetailsDetails{formComponentValues0Details0Details0},
- ////}
- ////表单信息
- //TextField_1RC8GZWYGO4G0 := &workflow.StartProcessInstanceRequestFormComponentValues{
- // Id: tea.String("TextField_1RC8GZWYGO4G0"),
- // Name: tea.String("单行输入框"),
- // Value: tea.String("123xxxxxxxx"),
- //}
- //
- //DDAttachment_17PC5KQBVEM80 := &workflow.StartProcessInstanceRequestFormComponentValues{
- // Id: tea.String("DDAttachment_17PC5KQBVEM80"),
- // Name: tea.String("附件"),
- // Value: tea.String("123xxxxxxxx"),
- //}
- //
- //startProcessInstanceRequest := &workflow.StartProcessInstanceRequest{
- // OriginatorUserId: tea.String("47073111989114"),
- // ProcessCode: tea.String("PROC-7A5F6215-A8CF-4DD1-AB2C-5B1AB84C4E19"),
- // DeptId: tea.Int64(435711466),
- // FormComponentValues: []*workflow.StartProcessInstanceRequestFormComponentValues{TextField_1RC8GZWYGO4G0, DDAttachment_17PC5KQBVEM80},
- //}
- ////w.StartProcessInstance("47073111989114", "PROC-7A5F6215-A8CF-4DD1-AB2C-5B1AB84C4E19", 435711466) 8xljy04PZiS9iPxp5PhDnUzQiEiE
- //resp, _ := w.StartProcessInstance(startProcessInstanceRequest)
- //fmt.Println(resp)
- }
- func TestQueryUserInfoByPhone(t *testing.T) {
- client := NewClient()
- c := client.GetContact()
- resp1 := c.QueryUserIdByPhone("18653295560")
- resp2 := c.QueryUserInfoByUserId(resp1.Result.Userid)
- fmt.Println(resp2)
- }
|