Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
邬吉朋
ops
Commits
78ffcc9a
Commit
78ffcc9a
authored
Feb 28, 2025
by
wujipeng
Browse files
钉钉-获取在职员工id列表
parent
61a8760c
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/com/ruzhoukj/sms/controller/DingEmployeeController.java
View file @
78ffcc9a
...
@@ -13,6 +13,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
...
@@ -13,6 +13,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -39,15 +40,15 @@ public class DingEmployeeController {
...
@@ -39,15 +40,15 @@ public class DingEmployeeController {
try
{
try
{
DingTalkClient
client
=
new
DefaultDingTalkClient
(
"https://oapi.dingtalk.com/topapi/smartwork/hrm/employee/queryonjob"
);
DingTalkClient
client
=
new
DefaultDingTalkClient
(
"https://oapi.dingtalk.com/topapi/smartwork/hrm/employee/queryonjob"
);
OapiSmartworkHrmEmployeeQueryonjobRequest
req
=
new
OapiSmartworkHrmEmployeeQueryonjobRequest
();
OapiSmartworkHrmEmployeeQueryonjobRequest
req
=
new
OapiSmartworkHrmEmployeeQueryonjobRequest
();
Map
<
String
,
String
>
textParams
=
req
.
getTextParams
();
req
.
setOffset
(
0L
);
textParams
.
put
(
"access_token"
,
accessToken
);
req
.
setSize
(
50L
);
OapiSmartworkHrmEmployeeQueryonjobResponse
rsp
=
client
.
execute
(
req
,
""
);
req
.
setStatusList
(
"3"
);
System
.
out
.
println
(
rsp
.
getBody
());
req
.
setHttpMethod
(
"POST"
);
return
null
;
OapiSmartworkHrmEmployeeQueryonjobResponse
rsp
=
client
.
execute
(
req
,
accessToken
);
return
rsp
.
getResult
().
getDataList
();
}
catch
(
ApiException
e
)
{
}
catch
(
ApiException
e
)
{
e
.
printStackTrace
(
);
throw
new
RuntimeException
(
e
);
}
}
return
null
;
}
}
}
}
src/main/java/com/ruzhoukj/sms/ding/PermissionConfig.java
View file @
78ffcc9a
...
@@ -17,11 +17,11 @@ import org.springframework.context.annotation.Configuration;
...
@@ -17,11 +17,11 @@ import org.springframework.context.annotation.Configuration;
@Configuration
@Configuration
public
class
PermissionConfig
{
public
class
PermissionConfig
{
@Value
(
"ding.key"
)
//
@Value("ding.key")
private
String
key
;
private
String
key
=
"dingatpypxs4jlryvh85"
;
@Value
(
"ding.secret"
)
//
@Value("ding.secret")
private
String
secret
;
private
String
secret
=
"_GVhUwb1bX3_tEAuIMxbD9LIsJsTGlzpUvBroG83_NPt3nxbL4jzbBAPkd_dijD6"
;
public
String
getAccessToken
()
{
public
String
getAccessToken
()
{
try
{
try
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment