forked from chanjarster/weixin-java-tools
-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
CP_标签管理
Daniel Qian edited this page Oct 22, 2014
·
1 revision
要注意的是,通过API新建的标签默认处于解锁状态,要到管理员界面里把标签锁定,然后再刷新管理员界面,才能够在管理员界面删除标签
tagId = wxService.tagCreate("测试标签4");
wxService.tagUpdate(tagId, "测试标签-改名");
List<WxCpTag> tags = wxService.tagGet();
List<String> userIds = new ArrayList<String>();
userIds.add(userId);
wxService.tagAddUsers(tagId, userIds);
List<WxCpUser> users = wxService.tagGetUsers(tagId);
List<String> userIds = new ArrayList<String>();
userIds.add(userId);
wxService.tagRemoveUsers(tagId, userIds);
wxService.tagDelete(tagId);
String encType = request.getParameter("encrypt_type");
String nonce = request.getParameter("nonce");
String timestamp = request.getParameter("timestamp");
String msgSignature = request.getParameter("msg_signature");
String signature = request.getParameter("signature");
String openid = request.getParameter("openid");
log.info("接收微信请求:[openid=[{}], [openid=[{}],[signature=[{}], encType=[{}], msgSignature=[{}],"
+ " timestamp=[{}], nonce=[{}], requestBody=[{}] ",
appid, openid, signature, encType, msgSignature, timestamp, nonce, requestBody);
// 请求里面没有对应信息。 // if (!this.wxMpService.switchover(appid)) { //appid // throw new IllegalArgumentException(String.format("未找到对应appid=[%s]的配置,请核实!", appid)); // }
if (!wxMpService.checkSignature(timestamp, nonce, signature)) {
throw new IllegalArgumentException("非法请求,可能属于伪造的请求!");
}
return ResponseEntity.ok("");