Compare commits
2 Commits
94e23b8f04
...
bb325bcfbf
| Author | SHA1 | Date | |
|---|---|---|---|
| bb325bcfbf | |||
| 7ca2f82ebe |
@@ -37,7 +37,6 @@ public class DeviceController extends BaseController {
|
||||
/**
|
||||
* 查询设备列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('video:device:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(Device device) {
|
||||
startPage();
|
||||
@@ -48,7 +47,6 @@ public class DeviceController extends BaseController {
|
||||
/**
|
||||
* 导出设备列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('video:device:export')")
|
||||
@Log(title = "设备", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, Device device) {
|
||||
@@ -60,7 +58,6 @@ public class DeviceController extends BaseController {
|
||||
/**
|
||||
* 获取设备详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('video:device:query')")
|
||||
@GetMapping(value = "/{deviceId}")
|
||||
public AjaxResult getInfo(@PathVariable("deviceId") Long deviceId) {
|
||||
return success(deviceService.selectDeviceByDeviceId(deviceId));
|
||||
@@ -69,7 +66,6 @@ public class DeviceController extends BaseController {
|
||||
/**
|
||||
* 新增设备
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('video:device:add')")
|
||||
@Log(title = "设备", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody Device device) {
|
||||
@@ -79,7 +75,6 @@ public class DeviceController extends BaseController {
|
||||
/**
|
||||
* 修改设备
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('video:device:edit')")
|
||||
@Log(title = "设备", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody Device device) {
|
||||
@@ -89,7 +84,6 @@ public class DeviceController extends BaseController {
|
||||
/**
|
||||
* 删除设备
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('video:device:remove')")
|
||||
@Log(title = "设备", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{deviceIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] deviceIds) {
|
||||
|
||||
@@ -32,7 +32,6 @@ public class InspectionTaskController extends BaseController {
|
||||
/**
|
||||
* 查询巡检任务列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('video:inspection:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(InspectionTask inspectionTask) {
|
||||
startPage();
|
||||
@@ -43,7 +42,6 @@ public class InspectionTaskController extends BaseController {
|
||||
/**
|
||||
* 导出巡检任务列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('video:inspection:export')")
|
||||
@Log(title = "巡检任务", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, InspectionTask inspectionTask) {
|
||||
@@ -55,7 +53,6 @@ public class InspectionTaskController extends BaseController {
|
||||
/**
|
||||
* 获取巡检任务详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('video:inspection:query')")
|
||||
@GetMapping(value = "/{taskId}")
|
||||
public AjaxResult getInfo(@PathVariable("taskId") Long taskId) {
|
||||
return success(inspectionTaskService.selectInspectionTaskById(taskId));
|
||||
@@ -64,7 +61,6 @@ public class InspectionTaskController extends BaseController {
|
||||
/**
|
||||
* 新增巡检任务
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('video:inspection:add')")
|
||||
@Log(title = "巡检任务", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody InspectionTask inspectionTask) {
|
||||
@@ -74,7 +70,6 @@ public class InspectionTaskController extends BaseController {
|
||||
/**
|
||||
* 修改巡检任务
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('video:inspection:edit')")
|
||||
@Log(title = "巡检任务", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody InspectionTask inspectionTask) {
|
||||
@@ -84,7 +79,6 @@ public class InspectionTaskController extends BaseController {
|
||||
/**
|
||||
* 删除巡检任务
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('video:inspection:remove')")
|
||||
@Log(title = "巡检任务", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{taskIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] taskIds) {
|
||||
@@ -94,7 +88,6 @@ public class InspectionTaskController extends BaseController {
|
||||
/**
|
||||
* 启动巡检任务
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('video:inspection:start')")
|
||||
@Log(title = "启动巡检任务", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/start/{taskId}")
|
||||
public AjaxResult start(@PathVariable Long taskId) {
|
||||
@@ -105,7 +98,6 @@ public class InspectionTaskController extends BaseController {
|
||||
/**
|
||||
* 停止巡检任务
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('video:inspection:stop')")
|
||||
@Log(title = "停止巡检任务", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/stop/{taskId}")
|
||||
public AjaxResult stop(@PathVariable Long taskId) {
|
||||
@@ -116,7 +108,6 @@ public class InspectionTaskController extends BaseController {
|
||||
/**
|
||||
* 手动执行巡检任务
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('video:inspection:execute')")
|
||||
@Log(title = "执行巡检任务", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/execute/{taskId}")
|
||||
public AjaxResult execute(@PathVariable Long taskId) {
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
package com.ruoyi.web.controller.video;
|
||||
package com.ruoyi.video.controller;
|
||||
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.video.domain.VModel;
|
||||
import com.ruoyi.video.service.IVModelService;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -16,7 +19,7 @@ import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/video/model")
|
||||
public class ModelController {
|
||||
public class ModelController extends BaseController {
|
||||
|
||||
private final IVModelService modelService;
|
||||
|
||||
@@ -25,6 +28,7 @@ public class ModelController {
|
||||
}
|
||||
|
||||
/** 新增模型(JSON) */
|
||||
@PreAuthorize("@ss.hasPermi('video:model:add')")
|
||||
@PostMapping
|
||||
public AjaxResult create(@RequestBody VModel model) {
|
||||
if (StringUtils.isEmpty(model.getModelName())) {
|
||||
@@ -41,6 +45,7 @@ public class ModelController {
|
||||
}
|
||||
|
||||
/** 根据ID查询 */
|
||||
@PreAuthorize("@ss.hasPermi('video:model:query')")
|
||||
@GetMapping("/{id}")
|
||||
public AjaxResult get(@PathVariable("id") Long id) {
|
||||
VModel model = modelService.selectById(id);
|
||||
@@ -48,21 +53,24 @@ public class ModelController {
|
||||
}
|
||||
|
||||
/** 列表查询(可选条件) */
|
||||
@PreAuthorize("@ss.hasPermi('video:model:list')")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(@RequestParam(value = "modelName", required = false) String modelName,
|
||||
@RequestParam(value = "framework", required = false) String framework,
|
||||
@RequestParam(value = "enabled", required = false) Integer enabled,
|
||||
@RequestParam(value = "keyword", required = false) String keyword) {
|
||||
public TableDataInfo list(@RequestParam(value = "modelName", required = false) String modelName,
|
||||
@RequestParam(value = "framework", required = false) String framework,
|
||||
@RequestParam(value = "enabled", required = false) Integer enabled,
|
||||
@RequestParam(value = "keyword", required = false) String keyword) {
|
||||
startPage();
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("modelName", modelName);
|
||||
params.put("framework", framework);
|
||||
params.put("enabled", enabled);
|
||||
params.put("keyword", keyword);
|
||||
List<VModel> list = modelService.selectList(params);
|
||||
return AjaxResult.success(list);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/** 删除 */
|
||||
@PreAuthorize("@ss.hasPermi('video:model:remove')")
|
||||
@DeleteMapping("/{id}")
|
||||
public AjaxResult delete(@PathVariable("id") Long id) {
|
||||
int rows = modelService.deleteById(id);
|
||||
@@ -70,6 +78,7 @@ public class ModelController {
|
||||
}
|
||||
|
||||
/** 启用/禁用 */
|
||||
@PreAuthorize("@ss.hasPermi('video:model:edit')")
|
||||
@PutMapping("/{id}/enable")
|
||||
public AjaxResult enable(@PathVariable("id") Long id,
|
||||
@RequestParam("enabled") Integer enabled) {
|
||||
@@ -81,6 +90,7 @@ public class ModelController {
|
||||
}
|
||||
|
||||
/** 下载:直接 302 重定向到模型URL,确保可点击下载 */
|
||||
@PreAuthorize("@ss.hasPermi('video:model:download')")
|
||||
@GetMapping("/download/{id}")
|
||||
public void download(@PathVariable("id") Long id, HttpServletResponse response) throws IOException {
|
||||
VModel model = modelService.selectById(id);
|
||||
Reference in New Issue
Block a user