记得上下班打卡 | git大法好,push需谨慎

Commit 42a42506 authored by jiangxiulong's avatar jiangxiulong

add type

parent 88af985a
...@@ -2,6 +2,7 @@ package com.liquidnet.service.sweet.controller; ...@@ -2,6 +2,7 @@ package com.liquidnet.service.sweet.controller;
import com.liquidnet.service.sweet.service.impl.SweetWechatApplyEventPushServiceImpl; import com.liquidnet.service.sweet.service.impl.SweetWechatApplyEventPushServiceImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -16,12 +17,16 @@ public class SweetWechatApplyEventPushController { ...@@ -16,12 +17,16 @@ public class SweetWechatApplyEventPushController {
@Autowired @Autowired
private SweetWechatApplyEventPushServiceImpl pushService; private SweetWechatApplyEventPushServiceImpl pushService;
@GetMapping(produces = "text/plain;charset=utf-8") // @GetMapping(produces = "text/plain;charset=utf-8")
public String authGet(@PathVariable Integer type, @GetMapping("{type}")
@RequestParam(name = "signature", required = false) String signature, @ApiOperation("验签调用")
@RequestParam(name = "timestamp", required = false) String timestamp, public String authGet(
@RequestParam(name = "nonce", required = false) String nonce, @PathVariable Integer type,
@RequestParam(name = "echostr", required = false) String echostr) { @RequestParam(name = "signature", required = false) String signature,
@RequestParam(name = "timestamp", required = false) String timestamp,
@RequestParam(name = "nonce", required = false) String nonce,
@RequestParam(name = "echostr", required = false) String echostr
) {
log.info("\n接收到来自微信服务器的认证消息:signature = [{}], timestamp = [{}], nonce = [{}], echostr = [{}]", log.info("\n接收到来自微信服务器的认证消息:signature = [{}], timestamp = [{}], nonce = [{}], echostr = [{}]",
signature, timestamp, nonce, echostr); signature, timestamp, nonce, echostr);
...@@ -32,14 +37,18 @@ public class SweetWechatApplyEventPushController { ...@@ -32,14 +37,18 @@ public class SweetWechatApplyEventPushController {
return pushService.authGet(type, timestamp, nonce, signature, echostr); return pushService.authGet(type, timestamp, nonce, signature, echostr);
} }
@PostMapping(produces = "application/xml; charset=UTF-8") // @PostMapping(produces = "application/xml; charset=UTF-8")
public String post(@PathVariable Integer type, @PostMapping("{type}")
@RequestBody String requestBody, @ApiOperation("用户动作回调")
@RequestParam(name = "msg_signature", required = false) String msgSignature, public String post(
@RequestParam(name = "encrypt_type", required = false) String encryptType, @PathVariable Integer type,
@RequestParam(name = "signature", required = false) String signature, @RequestBody String requestBody,
@RequestParam("timestamp") String timestamp, @RequestParam(name = "msg_signature", required = false) String msgSignature,
@RequestParam("nonce") String nonce) { @RequestParam(name = "encrypt_type", required = false) String encryptType,
@RequestParam(name = "signature", required = false) String signature,
@RequestParam("timestamp") String timestamp,
@RequestParam("nonce") String nonce
) {
log.info("\n接收微信请求:[msg_signature=[{}], encrypt_type=[{}], signature=[{}]," + log.info("\n接收微信请求:[msg_signature=[{}], encrypt_type=[{}], signature=[{}]," +
" timestamp=[{}], nonce=[{}], requestBody=[\n{}\n] ", " timestamp=[{}], nonce=[{}], requestBody=[\n{}\n] ",
msgSignature, encryptType, signature, timestamp, nonce, requestBody); msgSignature, encryptType, signature, timestamp, nonce, requestBody);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment