Commit 78ffcc9a authored by wujipeng's avatar wujipeng
Browse files

钉钉-获取在职员工id列表

parent 61a8760c
......@@ -13,6 +13,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -39,15 +40,15 @@ public class DingEmployeeController {
try {
DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/smartwork/hrm/employee/queryonjob");
OapiSmartworkHrmEmployeeQueryonjobRequest req = new OapiSmartworkHrmEmployeeQueryonjobRequest();
Map<String, String> textParams = req.getTextParams();
textParams.put("access_token", accessToken);
OapiSmartworkHrmEmployeeQueryonjobResponse rsp = client.execute(req, "");
System.out.println(rsp.getBody());
return null;
req.setOffset(0L);
req.setSize(50L);
req.setStatusList("3");
req.setHttpMethod("POST");
OapiSmartworkHrmEmployeeQueryonjobResponse rsp = client.execute(req, accessToken);
return rsp.getResult().getDataList();
} catch (ApiException e) {
e.printStackTrace();
throw new RuntimeException(e);
}
return null;
}
}
}
......@@ -17,11 +17,11 @@ import org.springframework.context.annotation.Configuration;
@Configuration
public class PermissionConfig {
@Value("ding.key")
private String key;
// @Value("ding.key")
private String key = "dingatpypxs4jlryvh85";
@Value("ding.secret")
private String secret;
// @Value("ding.secret")
private String secret = "_GVhUwb1bX3_tEAuIMxbD9LIsJsTGlzpUvBroG83_NPt3nxbL4jzbBAPkd_dijD6";
public String getAccessToken() {
try {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment