Browse Source

微信客服

master
zhizhi wu 4 years ago
parent
commit
c41cd1df35
  1. 12
      src/main/java/com/ccsens/carbasics/api/MiniController.java

12
src/main/java/com/ccsens/carbasics/api/MiniController.java

@ -33,18 +33,16 @@ import java.util.Map;
@Slf4j @Slf4j
public class MiniController { public class MiniController {
@Value("wx.mini.token") @Value("${mini.token}")
private String token; private String token;
@Value("wx.mini.appId")
private String appId;
@Value("wx.mini.secret")
private String secret;
@ApiOperation(value = "接收微信小程序消息通知", notes = "") @ApiOperation(value = "接收微信小程序消息通知", notes = "")
@RequestMapping(value = "/notice", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"}) @RequestMapping(value = "/notice", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
public String noticeGet(@Validated NoticeDto.ValidMsg validMsg) throws NoSuchAlgorithmException { public String noticeGet(@Validated NoticeDto.ValidMsg validMsg) throws NoSuchAlgorithmException {
log.info("接收微信小程序token:{}",validMsg); log.info("接收微信小程序token:{},token:{}",validMsg,token);
return validMsg.check(token) ? validMsg.getEchostr() : null; boolean check = validMsg.check(token);
log.info("校验结果:{}", check);
return check ? validMsg.getEchostr() : null;
} }
@ApiOperation(value = "接收微信小程序消息通知", notes = "") @ApiOperation(value = "接收微信小程序消息通知", notes = "")

Loading…
Cancel
Save