feiyu02
2025-09-30 6904763f0e74d9a9fa4dbc39f635d2aee39416c6
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/WxUserController.kt
@@ -1,14 +1,12 @@
package cn.flightfeather.supervision.lightshare.web
import cn.flightfeather.supervision.lightshare.service.WxUserService
import cn.flightfeather.supervision.lightshare.vo.AccessTokenPW
import cn.flightfeather.supervision.lightshare.vo.AccessTokenWX
import io.swagger.annotations.Api
import io.swagger.annotations.ApiOperation
import io.swagger.annotations.ApiParam
import org.springframework.web.bind.annotation.PostMapping
import org.springframework.web.bind.annotation.RequestBody
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController
import org.springframework.web.bind.annotation.*
@Api(tags = ["微信用户信息API接口"])
@RestController
@@ -20,4 +18,26 @@
    fun loginWx(
        @ApiParam("登录信息") @RequestBody accessTokenWX: AccessTokenWX
    ) = wxUserService.loginWx(accessTokenWX)
    @ApiOperation(value = "登录")
    @PostMapping("/loginPW")
    fun loginPW(
            @ApiParam("登录信息") @RequestBody accessTokenPW: AccessTokenPW
    ) = wxUserService.loginPw(accessTokenPW)
    @ApiOperation(value = "微信接入验证")
    @GetMapping("/message/subscribe/result")
    fun subscribeCheck(
        @ApiParam("微信加密签名") @RequestParam signature: String,
        @ApiParam("时间戳") @RequestParam timestamp: String,
        @ApiParam("随机数") @RequestParam nonce: String,
        @ApiParam("随机字符串") @RequestParam echostr: String,
    ) = wxUserService.subscribeCheck(signature, timestamp, nonce, echostr)
    @ApiOperation(value = "微信用户订阅消息结果推送", notes = "微信会将用户订阅消息、消息推送情况等信息通过此接口发送过来")
    @PostMapping("/message/subscribe/result")
    fun subscribeResult(
        @ApiParam("消息") @RequestBody msg: String
    ) = wxUserService.subscribeResult(msg)
}