java调⽤个⼈接⼝进⾏发好友,发
java调⽤个⼈接⼝进⾏发好友,发
/**
* 发好友消息任务
*
* @author wechatno:tangjinjinwx
* @param ctx
* @param vo
*/
@Async
public void handleMsg(ChannelHandlerContext ctx, TransportMessage vo, String contentJsonStr) {
try {
室内设计师工资log.debug(contentJsonStr);
WeChatGroupSendTaskMessage.Builder bd = wBuilder();
JsonFormat.parser().merge(contentJsonStr, bd);
WeChatGroupSendTaskMessage req = bd.build();
asyncTaskService.msgSend2Phone(ctx, WeChatId(), EnumMsgType.WeChatGroupSendTask, vo, req);
} catch (Exception e) {
e.printStackTrace();
MessageUtil.sendJsonErrMsg(ctx, EnumErrorCode.InvalidParam, Constant.ERROR_MSG_DECODFAIL);
}
释小龙助理}
//接⼝参考www.wlkankan/cate40/247.html
/**
* 发消息任务
*
* @author wechatno:tangjinjinwx
*/
private static void talkMsgToFriend(TaskTimeInfo info, TimeTaskDetailsDao timeTaskDetailsDao,List<String> friends) { for(String friend:friends){
ByteString byteString = Content());
TalkToFriendTaskMessage.Builder wBuilder();
王彦霖女友被扒build.WechatId());
build.setFriendId(friend);
build.setContent(byteString);
build.Id());
Restype()==1){//⽂本类型
build.setContentType(EnumContentType.Text);
}else Restype()==2){//图⽚类型
build.setContentType(EnumContentType.Picture);
宋新妮 吴宗宪}else Restype()==3){//语⾳类型
build.setContentType(EnumContentType.Voice);
}else Restype()==4){//视频类型
build.setContentType(EnumContentType.Video);
}else Restype()==6){//链接类型
build.setContentType(EnumContentType.Link);
}else Restype()==13){//⼩程序
build.setContentType(EnumContentType.WeApp);
}
TalkToFriendTaskMessage msg = build.build();
if (null != msg) {
try {
String json = JsonFormat.printer().print(msg);
if(!StringUtils.isEmpty(json)){
奇太映主演的电视剧TimeTaskDetails detail = new TimeTaskDetails();
张恒老公
detail.Id());
detail.setExecute_Execute_time());
detail.setJson_content(json);
timeTaskDetailsDao.insert(detail);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
}