类 UserThirdpartWxPubController
java.lang.Object
net.sohelp.boot.admin.core.base.BaseController
net.sohelp.boot.demo.web.user.UserThirdpartWxPubController
@RestController("admin-user-thirdpart-wxpub")
@RequestMapping("/admin/user/wxpub")
public class UserThirdpartWxPubController
extends BaseController
微信公众号控制器
提供与微信公众号相关的接口,包括获取二维码、处理回调事件、发送消息以及解绑操作。
- 从以下版本开始:
- 2024/10/22 18:27
- 作者:
- ShenganWu
-
字段概要
从类继承的字段 net.sohelp.boot.admin.core.base.BaseController
request, response -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明获取微信公众号带参二维码票据并进行URL编码后返回voidgetWxgzhManage(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) 处理微信公众号服务器推送的消息(GET用于验证签名,POST用于处理扫码等事件)发送微信模板消息给指定用户解除当前登录用户的微信公众号绑定关系从类继承的方法 net.sohelp.boot.admin.core.base.BaseController
error, error, fail, fail, fail, getLoginID, getLoginName, getLoginOrgID, getLoginOrgName, getLoginUser, getNickname, getTenantId, getUserName, getUserNo, i18n, i18n, isAdministrator, isDeveloper, limit, offset, ok, ok, response, response, responseStream, success, success, success, success, validateToken
-
构造器详细资料
-
UserThirdpartWxPubController
public UserThirdpartWxPubController()
-
-
方法详细资料
-
getWxgzhCode
@PostMapping("/getWxgzhCode") @Permission("") public ApiResult<String> getWxgzhCode() throws TokenAuthenticationException, UnsupportedEncodingException, SQLException, BusiException获取微信公众号带参二维码票据并进行URL编码后返回- 返回:
- ApiResult
返回经过UTF-8编码后的二维码票据字符串 - 抛出:
TokenAuthenticationException- 认证失败异常UnsupportedEncodingException- 不支持的字符集编码异常SQLException- 数据库访问异常BusiException- 业务逻辑异常
-
getWxgzhManage
@RequestMapping(value="/wx/callback", method={GET,POST}) public void getWxgzhManage(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws Exception 处理微信公众号服务器推送的消息(GET用于验证签名,POST用于处理扫码等事件)- 参数:
request- HTTP请求对象response- HTTP响应对象- 抛出:
Exception- 各种可能发生的异常
-
sendWxPub
@PostMapping("/sendWxPub") @Permission("") @Transactional(rollbackFor=java.lang.Exception.class) public ApiResult<String> sendWxPub(@RequestBody Map<String, Object> paramMap) throws Exception发送微信模板消息给指定用户- 参数:
paramMap- 包含发送信息的参数映射表,必须包含 to_user_id 和 message 字段- 返回:
- ApiResult
操作结果描述 - 抛出:
Exception- 可能抛出的各种异常
-
wxPublicUnbind
@PostMapping("/unbind") @Permission("") public ApiResult<String> wxPublicUnbind() throws TokenAuthenticationException解除当前登录用户的微信公众号绑定关系- 返回:
- ApiResult
解绑操作的结果提示信息 - 抛出:
TokenAuthenticationException- token认证失败时抛出此异常
-