|
@@ -1,18 +1,28 @@
|
|
|
package com.sxtvs.open.api.clue.controller;
|
|
|
|
|
|
+import com.fasterxml.jackson.databind.DeserializationFeature;
|
|
|
+//import com.fasterxml.jackson.dataformat.xml.XmlMapper;
|
|
|
+
|
|
|
import com.sxtvs.open.api.clue.entity.WxMessage;
|
|
|
import com.sxtvs.open.api.clue.service.impl.ClueServiceImpl;
|
|
|
import com.sxtvs.open.core.advice.NoAPIResponse;
|
|
|
import com.sxtvs.open.core.sls.AliyunLogger;
|
|
|
import jakarta.annotation.Resource;
|
|
|
import jakarta.servlet.http.HttpServletResponse;
|
|
|
+
|
|
|
+import jakarta.xml.bind.JAXBContext;
|
|
|
+import jakarta.xml.bind.JAXBException;
|
|
|
+import jakarta.xml.bind.Unmarshaller;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.ibatis.builder.xml.XMLMapperBuilder;
|
|
|
import org.springframework.http.MediaType;
|
|
|
-import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
+import java.io.StringReader;
|
|
|
|
|
|
-@Controller
|
|
|
+@RestController
|
|
|
+@Slf4j
|
|
|
@RequestMapping("clue")
|
|
|
public class WxClueController {
|
|
|
|
|
@@ -32,13 +42,14 @@ public class WxClueController {
|
|
|
|
|
|
}
|
|
|
|
|
|
- @PostMapping(value = "wx_create")
|
|
|
+ @PostMapping(value = "wx_create", produces = MediaType.APPLICATION_XML_VALUE)
|
|
|
@NoAPIResponse
|
|
|
public void wxCreate(@RequestBody WxMessage wxMessage,
|
|
|
- HttpServletResponse response) throws IOException {
|
|
|
+ HttpServletResponse response) throws IOException, JAXBException {
|
|
|
|
|
|
logger.info("wx xml", wxMessage, "key", "wxXml");
|
|
|
- clueService.wxCreate(wxMessage);
|
|
|
+ log.info("xml {}", wxMessage);
|
|
|
+ System.out.println(wxMessage);
|
|
|
response.getWriter().write("OK");
|
|
|
|
|
|
}
|