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

Commit 42a42506 authored by jiangxiulong's avatar jiangxiulong

add type

parent 88af985a
......@@ -2,6 +2,7 @@ package com.liquidnet.service.sweet.controller;
import com.liquidnet.service.sweet.service.impl.SweetWechatApplyEventPushServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -16,12 +17,16 @@ public class SweetWechatApplyEventPushController {
@Autowired
private SweetWechatApplyEventPushServiceImpl pushService;
@GetMapping(produces = "text/plain;charset=utf-8")
public String authGet(@PathVariable Integer type,
@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) {
// @GetMapping(produces = "text/plain;charset=utf-8")
@GetMapping("{type}")
@ApiOperation("验签调用")
public String authGet(
@PathVariable Integer type,
@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 = [{}]",
signature, timestamp, nonce, echostr);
......@@ -32,14 +37,18 @@ public class SweetWechatApplyEventPushController {
return pushService.authGet(type, timestamp, nonce, signature, echostr);
}
@PostMapping(produces = "application/xml; charset=UTF-8")
public String post(@PathVariable Integer type,
@RequestBody String requestBody,
@RequestParam(name = "msg_signature", required = false) String msgSignature,
@RequestParam(name = "encrypt_type", required = false) String encryptType,
@RequestParam(name = "signature", required = false) String signature,
@RequestParam("timestamp") String timestamp,
@RequestParam("nonce") String nonce) {
// @PostMapping(produces = "application/xml; charset=UTF-8")
@PostMapping("{type}")
@ApiOperation("用户动作回调")
public String post(
@PathVariable Integer type,
@RequestBody String requestBody,
@RequestParam(name = "msg_signature", required = false) String msgSignature,
@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=[{}]," +
" timestamp=[{}], nonce=[{}], requestBody=[\n{}\n] ",
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