类 UserThirdpartWxPubController
java.lang.Object
net.sohelp.boot.admin.core.base.BaseController
net.sohelp.boot.dev.web.user.UserThirdpartWxPubController
@RestController("dev-user-thirdpart-wxpub")
@RequestMapping("/dev/user/wxpub")
public class UserThirdpartWxPubController
extends BaseController
微信公众号相关接口控制器
- 从以下版本开始:
- 2024/10/22 18:27
- 作者:
- ShenganWu
-
字段概要
从类继承的字段 net.sohelp.boot.admin.core.base.BaseController
request, response -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明获取微信公众号带参数二维码的 ticket,并进行 URL 编码后返回voidgetWxgzhManage(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) 处理微信公众号回调请求(GET 和 POST) 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("ADMIN") public ApiResult<String> getWxgzhCode() throws TokenAuthenticationException, UnsupportedEncodingException, SQLException, BusiException获取微信公众号带参数二维码的 ticket,并进行 URL 编码后返回- 返回:
- 返回经过 UTF-8 编码后的二维码 ticket 字符串
- 抛出:
TokenAuthenticationException- token 认证异常UnsupportedEncodingException- 不支持的编码格式异常SQLException- SQL 执行异常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) GET 请求用于验证服务器有效性 POST 请求处理用户扫码、关注等事件推送- 参数:
request- HTTP 请求对象response- HTTP 响应对象- 抛出:
Exception- 异常信息
-
sendWxPub
@PostMapping("/sendWxPub") @Permission("ADMIN") @Transactional(rollbackFor=java.lang.Exception.class) public ApiResult<String> sendWxPub(@RequestBody Map<String, Object> paramMap) throws Exception向指定用户发送微信公众号模板消息- 参数:
paramMap- 包含 to_user_id 和 message 的参数映射- 返回:
- 操作结果描述
- 抛出:
Exception- 数据库操作或其他服务调用异常
-
wxPublicUnbind
@PostMapping("/unbind") @Permission("ADMIN") public ApiResult<String> wxPublicUnbind() throws TokenAuthenticationException解除当前登录用户的微信公众号绑定关系- 返回:
- 成功提示信息
- 抛出:
TokenAuthenticationException- token 认证失败时抛出
-