| | |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.models.auth.In; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | @ApiImplicitParam(name="query", value = "查询内容", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name="online", value = "是否在线", dataTypeClass = Boolean.class), |
| | | }) |
| | | @RequestMapping(value = "/list") |
| | | @GetMapping(value = "/list") |
| | | @ResponseBody |
| | | public PageInfo<StreamProxyItem> list(@RequestParam(required = false)Integer page, |
| | | @RequestParam(required = false)Integer count, |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "param", value = "代理参数", dataTypeClass = StreamProxyItem.class), |
| | | }) |
| | | @RequestMapping(value = "/save") |
| | | @PostMapping(value = "/save") |
| | | @ResponseBody |
| | | public Object save(@RequestBody StreamProxyItem param){ |
| | | logger.info("添加代理: " + JSONObject.toJSONString(param)); |
| | |
| | | @ApiImplicitParam(name = "app", value = "应用名", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "stream", value = "流ID", dataTypeClass = String.class), |
| | | }) |
| | | @RequestMapping(value = "/del") |
| | | @DeleteMapping(value = "/del") |
| | | @ResponseBody |
| | | public Object del(String app, String stream){ |
| | | logger.info("移除代理: " + app + "/" + stream); |
| | |
| | | @ApiImplicitParam(name = "app", value = "应用名", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "stream", value = "流ID", dataTypeClass = String.class), |
| | | }) |
| | | @RequestMapping(value = "/start") |
| | | @GetMapping(value = "/start") |
| | | @ResponseBody |
| | | public Object start(String app, String stream){ |
| | | logger.info("启用代理: " + app + "/" + stream); |
| | |
| | | @ApiImplicitParam(name = "app", value = "应用名", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "stream", value = "流ID", dataTypeClass = String.class), |
| | | }) |
| | | @RequestMapping(value = "/stop") |
| | | @GetMapping(value = "/stop") |
| | | @ResponseBody |
| | | public Object stop(String app, String stream){ |
| | | logger.info("停用代理: " + app + "/" + stream); |
| | | boolean result = streamProxyService.stop(app, stream); |
| | | return "success"; |
| | | return result?"success":"fail"; |
| | | } |
| | | } |