AsmxProxyController.java 1.3 KB

12345678910111213141516171819202122232425262728
  1. package com.goldenwater.slgc.controller.proxy;
  2. import jakarta.servlet.http.HttpServletRequest;
  3. import org.springframework.web.bind.annotation.GetMapping;
  4. import org.springframework.web.bind.annotation.PathVariable;
  5. import org.springframework.web.bind.annotation.RequestMapping;
  6. import org.springframework.web.bind.annotation.RestController;
  7. import com.goldenwater.common.core.controller.BaseController;
  8. import com.goldenwater.common.core.domain.AjaxResult;
  9. import io.swagger.v3.oas.annotations.Operation;
  10. import io.swagger.v3.oas.annotations.tags.Tag;
  11. @Tag(name = "28. 通用ASMX代理")
  12. @RestController
  13. @RequestMapping("/slgc/asmx")
  14. public class AsmxProxyController extends BaseController {
  15. private static final String YJZH_BASE = "http://10.8.4.171:816";
  16. private static final String NEWGQ_BASE = "http://10.8.40.222/WebService";
  17. @Operation(summary = "28.01 通用ASMX代理转发")
  18. @GetMapping("/{type}/{fun}")
  19. public AjaxResult proxy(@PathVariable String type, @PathVariable String fun, HttpServletRequest request) {
  20. String query = request.getQueryString();
  21. String base = "NewGQ".equals(type) ? NEWGQ_BASE : YJZH_BASE;
  22. return success(ProxyHelper.fetchSoapXmlToJson(base + "/" + type + ".asmx/" + fun + (query != null ? "?" + query : "")));
  23. }
  24. }