| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- package com.xunmei.system.controller;
- import com.xunmei.common.core.web.controller.BaseController;
- import com.xunmei.common.core.web.domain.AjaxResult;
- import com.xunmei.common.core.web.page.TableDataInfo;
- import com.xunmei.common.log.annotation.Log;
- import com.xunmei.common.log.enums.BusinessType;
- import com.xunmei.system.dto.server.SysServerEditDto;
- import com.xunmei.system.dto.server.SysServerPageDto;
- import com.xunmei.system.dto.server.TransferLogDto;
- import com.xunmei.system.service.ISysServerService;
- import com.xunmei.system.vo.server.SysServerPageVo;
- import io.swagger.annotations.Api;
- import io.swagger.annotations.ApiOperation;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.*;
- import javax.servlet.http.HttpServletResponse;
- import javax.validation.Valid;
- /**
- * 服务器维护Controller
- *
- * @author xunmei
- * @date 2024-09-29
- */
- @Api(tags = {"SysServer"})
- @RestController
- @RequestMapping("/server")
- public class SysServerController extends BaseController {
- @Autowired
- private ISysServerService sysServerService;
- @ApiOperation(value = "查询SysServer列表")
- //@RequiresPermissions("system:server:list")
- @GetMapping("/list")
- public TableDataInfo<SysServerPageVo> list(SysServerPageDto req) {
- return sysServerService.selectPage(req);
- }
- @ApiOperation(value = "获取SysServer详细信息")
- //@RequiresPermissions("system:server:query")
- @GetMapping(value = "/{id}")
- public AjaxResult getInfo(@PathVariable("id") Long id) {
- return success(sysServerService.selectSysServerById(id));
- }
- @ApiOperation(value = "新增SysServer")
- //@RequiresPermissions("system:server:add")
- @Log(title = "服务器维护", businessType = BusinessType.INSERT)
- @PostMapping
- public AjaxResult edit(@RequestBody @Valid SysServerEditDto req) {
- return toAjax(sysServerService.editSysServer(req));
- }
- @ApiOperation(value = "删除SysServer")
- //@RequiresPermissions("system:server:remove")
- @Log(title = "服务器删除", businessType = BusinessType.DELETE)
- @DeleteMapping("/{ids}")
- public AjaxResult remove(@PathVariable Long[] ids) {
- return toAjax(sysServerService.deleteSysServerByIds(ids));
- }
- @ApiOperation(value = "获取服务下的日志")
- @GetMapping("/getLogList/{serverId}/{checkId}")
- public AjaxResult getLogList(@PathVariable Long serverId, @PathVariable Long checkId) {
- Object logs = sysServerService.getLogList(serverId,checkId);
- return success(logs);
- }
- @ApiOperation(value = "转存目标服务器上的日志")
- @PostMapping("/transferLog")
- public AjaxResult transferLog(@RequestBody TransferLogDto req) {
- sysServerService.transferLog(req);
- return success();
- }
- @ApiOperation(value = "转存目标服务器上的日志")
- @PostMapping("/downloadLogData")
- public AjaxResult downloadLogData(TransferLogDto req, HttpServletResponse response) {
- sysServerService.downloadLogData(req,response);
- return success();
- }
- }
|