|
@@ -3,6 +3,13 @@ package com.ym.mec.teacher.controller;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
|
+import java.io.IOException;
|
|
|
+import java.io.PrintWriter;
|
|
|
+
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+
|
|
|
+import org.apache.commons.io.IOUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.http.HttpStatus;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
@@ -58,8 +65,16 @@ public class TeacherContractController extends BaseController {
|
|
|
|
|
|
@ApiOperation(value = "异步通知")
|
|
|
@PostMapping("/callback")
|
|
|
- public HttpResponseResult<String> callback(String jsonStr) {
|
|
|
+ public void callback(HttpServletRequest request, HttpServletResponse response) throws IOException {
|
|
|
+ String jsonStr = IOUtils.toString(request.getInputStream(), "UTF-8");
|
|
|
teacherContractsService.callback(jsonStr);
|
|
|
- return succeed("success");
|
|
|
+ returnMsg("success", response);
|
|
|
+ }
|
|
|
+
|
|
|
+ private void returnMsg(String msg, HttpServletResponse response) throws IOException {
|
|
|
+ response.addHeader("Content-Type", "text/html;charset=UTF-8");
|
|
|
+ PrintWriter print = response.getWriter();
|
|
|
+ print.print(msg);
|
|
|
+ print.flush();
|
|
|
}
|
|
|
}
|