| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | | * 代理服务 |
| | | * @author WWW |
| | | * @date 2023-07-11 |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | @Api(tags = "运维管理\\代理服务") |
| | | @RestController |
| | | @RequestMapping("/proxy") |
| | |
| | | @RequestMapping(value = {"/{token}/{id}/**"}) |
| | | public void proxyUrl(@NotNull @PathVariable String token, @NotNull @PathVariable int id, HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | proxyService.proxyUrl(token, id, req, res); |
| | | proxyService.proxyUrl(token, id, false, req, res); |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | WebHelper.writeStr2Page(res, ex.getMessage()); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation(value = "URL代理", notes = "URL代理") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "token", value = "令牌", dataType = "String", paramType = "path", required = true, example = "1eb2ea8f-5cfd-4e6c-95c9-17ab0f7bce71"), |
| | | @ApiImplicitParam(name = "id", value = "ID", dataType = "int", paramType = "path", required = true, example = "1"), |
| | | }) |
| | | @RequestMapping(value = {"/rest/{token}/{id}/**"}) |
| | | public void proxyRestUrl(@NotNull @PathVariable String token, @NotNull @PathVariable int id, HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | proxyService.proxyUrl(token, id, true, req, res); |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | WebHelper.writeStr2Page(res, ex.getMessage()); |