|
@ -28,15 +28,21 @@ public class DingdingUtil {
|
|
|
|
|
|
private static final Logger logger = LoggerFactory.getLogger(DingdingUtil.class);
|
|
|
|
|
|
//测试
|
|
|
//测试-专有钉钉
|
|
|
// private static final String AppKey = "ceshiyzh-jtP6zf3cfZEqs8UmmYNra";
|
|
|
// private static final String AppSecret = "NbbH9viHPDNTPTuQPz2Y0Y06F88krYWTTPLv0h01";
|
|
|
|
|
|
//正式
|
|
|
private static final String AppKey = "zhyzh-r085NCVALJYmgcDc7oBVFRZj";
|
|
|
private static final String AppSecret = "fH8ZVDGAmJaeF7ujwAZgCi40w0U3im9J801vBaSF";
|
|
|
private static final String DomainName = "openplatform.dg-work.cn";
|
|
|
private static final String tenantId = "50495309";
|
|
|
//正式-浙政钉
|
|
|
private static final String zhdAppKey = "zhyzh-r085NCVALJYmgcDc7oBVFRZj";
|
|
|
private static final String zhdAppSecret = "fH8ZVDGAmJaeF7ujwAZgCi40w0U3im9J801vBaSF";
|
|
|
private static final String zhdDomainName = "openplatform.dg-work.cn";
|
|
|
private static final String zhdtenantId = "50495309";
|
|
|
|
|
|
//正式-专有钉钉
|
|
|
private static final String AppKey = "zhyzh-67H0tpyZr7m8crdJsxI3YVZb";
|
|
|
private static final String AppSecret = "xK0VBIfeUj0gBm0Gp55180Qk6i866230Qch1T96v";
|
|
|
private static final String DomainName = "openplatform-pro.ding.zj.gov.cn";
|
|
|
private static final String tenantId = "196729";
|
|
|
|
|
|
private static final String gettokenApi = "/gettoken.json";
|
|
|
private static final String dingtalk_app_user = "/rpc/oauth2/dingtalk_app_user.json";
|
|
@ -45,7 +51,8 @@ public class DingdingUtil {
|
|
|
private static final String sendMsg = "/chat/sendMsg";
|
|
|
|
|
|
//单聊默认发送者id
|
|
|
private static final String p2pSenderId = "821606";
|
|
|
private static final String p2pSenderId = "78728186";
|
|
|
// private static final String p2pSenderId = "821606";
|
|
|
public static final String picMediaId = "$iwHSAADGgQoAC9EkWgKsb2N0ZXQtc3RyZWFtAwAEAAUABrzrLoqjhIdIKXPi5GCsroJXXzE3ZmI0OGFiNWJhBwAIAAmhMA";
|
|
|
|
|
|
//executableClient要单例,并且使用前要初始化,只需要初始化一次
|
|
@ -56,6 +63,32 @@ public class DingdingUtil {
|
|
|
@Autowired
|
|
|
private JdbcTemplate jdbcTemplate;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 测试浙政钉
|
|
|
*/
|
|
|
public void testZzd() {
|
|
|
// ExecutableClient executableClient = ExecutableClient.getInstance();
|
|
|
// executableClient.setAccessKey(zhdAppKey);
|
|
|
// executableClient.setSecretKey(zhdAppSecret);
|
|
|
// executableClient.setDomainName(zhdDomainName);
|
|
|
// executableClient.setProtocal("https");
|
|
|
// executableClient.init();
|
|
|
// logger.info("get_by_mobiles========="+zhdDomainName);
|
|
|
// //调用API
|
|
|
// PostClient postClient = executableClient.newPostClient(get_by_mobiles);
|
|
|
// //设置参数
|
|
|
// postClient.addParameter("areaCode", "86");
|
|
|
// //手机号码列表,逗号分隔,最多50个
|
|
|
// postClient.addParameter("mobiles", "15659713528");
|
|
|
// postClient.addParameter("tenantId", zhdtenantId);
|
|
|
// postClient.addParameter("namespace", "local");
|
|
|
// //Call API
|
|
|
// String apiResult2 = postClient.post();
|
|
|
// logger.info("get_by_mobiles========="+apiResult2);
|
|
|
}
|
|
|
|
|
|
@PostConstruct
|
|
|
public void clientInit(){
|
|
|
if(executableClient == null){
|