Java调本地接口重定向

/**
 * 通用接口
 */
@PostMapping("/deviceToService/up")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "通用接口", notes = "传入requestDTO")
public Object detail(@RequestBody RequestDTO requestDTO) {

	Instructions detail = instructionsService.getOne(Wrappers.lambdaQuery()
			.eq(Instructions::getMethod,requestDTO.getHeader().getMethod())
	);
	HashMap paramMap = new HashMap<>();
	paramMap.put("params", JSONObject.toJSONString(requestDTO));
	String url="redirect:http://127.0.0.1:"+port+detail.getUrl();
	return new ModelAndView(url,paramMap);
}
/**
 * 业务接口/bim
 */
@RequestMapping("/{open}/up")
@ApiOperationSupport(order = 5)
@ApiOperation(value = "bim", notes = "传入requestDTO")
public VoiceR openView(@PathVariable("open") String open,@ModelAttribute("params") String message) {

你可能感兴趣的:(java,json,开发语言)