@Service public class WxgzhNoticeService extends Object
| 构造器和说明 |
|---|
WxgzhNoticeService() |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
checkSignature(String signature,
String timestamp,
String nonce)
验证来自微信服务器的签名合法性
|
String |
getCodeTicket(String expireSecond,
int sceneInt)
创建带有整数场景值的临时二维码票据
|
String |
getCodeTicket(String expireSecond,
String sceneStr)
创建带有字符串场景值的临时二维码票据
|
String |
getSuccessUrl()
获取授权成功后跳转页面URL地址
|
String |
send(long userId,
String loginName,
String message)
根据用户ID发送登录通知
|
String |
send(Long userId,
String title,
String content)
根据用户ID发送公众号消息
|
String |
sendLoginMsg(String openId,
String loginName,
String message)
发送登录通知给指定用户
|
void |
sendMsg(String openId,
String templateId,
Map<String,String> dataMap)
使用指定模板向特定用户发送微信模板消息
|
public String send(Long userId, String title, String content) throws Exception
userId - 用户IDtitle - 消息标题content - 消息内容Exception - 发送过程中可能出现的异常public void sendMsg(String openId, String templateId, Map<String,String> dataMap) throws Exception
openId - 接收消息的用户OpenIDtemplateId - 模板消息IDdataMap - 模板数据键值对Exception - 发送过程中的异常信息public String sendLoginMsg(String openId, String loginName, String message) throws SQLException, BusiException
openId - 用户在微信平台的唯一标识loginName - 登录账户名称message - 附加的消息内容SQLException - SQL执行错误时抛出BusiException - 业务逻辑异常时抛出public String send(long userId, String loginName, String message) throws SQLException, BusiException
userId - 用户系统内部IDloginName - 登录用户名message - 通知正文内容SQLException - 数据库操作异常BusiException - 业务处理异常public String getCodeTicket(String expireSecond, String sceneStr) throws BusiException
expireSecond - 二维码过期时间(单位:秒)sceneStr - 场景字符串,长度限制为1~64字符BusiException - 业务异常情况public String getCodeTicket(String expireSecond, int sceneInt) throws SQLException, BusiException
expireSecond - 二维码过期时间(单位:秒)sceneInt - 整型场景值,范围为1~100000(永久二维码最大值)SQLException - 数据库访问异常BusiException - 业务处理异常public String getSuccessUrl() throws SQLException, BusiException
SQLException - 数据查询异常BusiException - 配置缺失时抛出public boolean checkSignature(String signature, String timestamp, String nonce) throws BusiException
signature - 微信加密签名timestamp - 时间戳nonce - 随机数BusiException - 加密算法不可用等异常Copyright © 2026. All rights reserved.