- staff_test.go
This commit is contained in:
@@ -19,6 +19,7 @@ func init() {
|
|||||||
baseapi.Init(sugarLogger)
|
baseapi.Init(sugarLogger)
|
||||||
|
|
||||||
api = New("ding7iu9cptairtcls0c", "LWrZAFeqUfuVv7n_tc8vPpCAx6PT4CwManx2XCVhJOqGsx2L5XCDuX1sAN_JtvsI")
|
api = New("ding7iu9cptairtcls0c", "LWrZAFeqUfuVv7n_tc8vPpCAx6PT4CwManx2XCVhJOqGsx2L5XCDuX1sAN_JtvsI")
|
||||||
|
api.RetrieveToken()
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestRetrieveToken(t *testing.T) {
|
func TestRetrieveToken(t *testing.T) {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ func (a *API) GetUserID(code string) (userID *UserID, err error) {
|
|||||||
}
|
}
|
||||||
return &UserID{
|
return &UserID{
|
||||||
UserID: utils.Interface2String(result["userid"]),
|
UserID: utils.Interface2String(result["userid"]),
|
||||||
IsSys: result["deviceId"].(bool),
|
IsSys: result["is_sys"].(bool),
|
||||||
DeviceID: utils.Interface2String(result["deviceId"]),
|
DeviceID: utils.Interface2String(result["deviceId"]),
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|||||||
19
platformapi/dingdingapi/staff_test.go
Normal file
19
platformapi/dingdingapi/staff_test.go
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
package dingdingapi
|
||||||
|
|
||||||
|
import "testing"
|
||||||
|
|
||||||
|
func TestGetUserID(t *testing.T) {
|
||||||
|
result, err := api.GetUserID("1fe4d383a90734b7a00b09387fc3108a")
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err.Error())
|
||||||
|
}
|
||||||
|
sugarLogger.Debug(result)
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestGetUserDetail(t *testing.T) {
|
||||||
|
result, err := api.GetUserDetail("1552554217695044")
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err.Error())
|
||||||
|
}
|
||||||
|
sugarLogger.Debug(result)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user