upgrade cacheing body request

master
Yixian 3 years ago
parent 7174bab3ed
commit db301e9534

@ -26,6 +26,8 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationEventPublisher; import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.ApplicationEventPublisherAware; import org.springframework.context.ApplicationEventPublisherAware;
import org.springframework.http.HttpEntity;
import org.springframework.util.Assert;
import org.springframework.validation.Errors; import org.springframework.validation.Errors;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -65,13 +67,15 @@ public class RetailValidationController implements ApplicationEventPublisherAwar
} }
@PostMapping("/devices/{devType}/register") @PostMapping("/devices/{devType}/register")
public JSONObject register(@RequestBody String registeration, @PathVariable String devType) { public JSONObject register(HttpEntity<String> registerationEntity, @PathVariable String devType) {
return deviceSupport.register(devType, registeration); Assert.notNull(registerationEntity.getBody(), "Registeration is Empty");
return deviceSupport.register(devType, registerationEntity.getBody());
} }
@PostMapping("/devices/{devType}/manage/register") @PostMapping("/devices/{devType}/manage/register")
public JSONObject manageRegister(@RequestBody String registeration, @PathVariable String devType) { public JSONObject manageRegister(HttpEntity<String> registerationEntity, @PathVariable String devType) {
return manageDeviceSupport.register(devType, registeration); Assert.notNull(registerationEntity.getBody(), "Registeration is Empty");
return manageDeviceSupport.register(devType, registerationEntity.getBody());
} }
@PostMapping("/sign_in_check") @PostMapping("/sign_in_check")

@ -1,10 +1,10 @@
package au.com.royalpay.payment.manage.system.web; package au.com.royalpay.payment.manage.system.web;
import au.com.royalpay.payment.manage.system.core.MailGunService; import au.com.royalpay.payment.manage.system.core.MailGunService;
import org.springframework.http.HttpEntity;
import org.slf4j.Logger; import org.springframework.web.bind.annotation.PostMapping;
import org.slf4j.LoggerFactory; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
@ -14,13 +14,12 @@ import javax.servlet.http.HttpServletResponse;
@RequestMapping(value = "/mailgun") @RequestMapping(value = "/mailgun")
public class MailCallBackController { public class MailCallBackController {
private Logger logger = LoggerFactory.getLogger(getClass());
@Resource @Resource
private MailGunService mailService; private MailGunService mailService;
@PostMapping("/callback") @PostMapping("/callback")
public void dealSuccessNptify(@RequestBody String content) throws Exception { public void dealSuccessNptify(HttpEntity<String> content) throws Exception {
mailService.dealNotify(content); mailService.dealNotify(content.getBody());
} }

@ -19,3 +19,8 @@ spring:
database: 9 database: 9
host: 192.168.0.84 host: 192.168.0.84
port: 6379 port: 6379
app:
http:
cache:
enable: true
path: /
Loading…
Cancel
Save