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

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

@ -18,4 +18,9 @@ spring:
redis:
database: 9
host: 192.168.0.84
port: 6379
port: 6379
app:
http:
cache:
enable: true
path: /
Loading…
Cancel
Save