| | |
| | | @Autowired |
| | | private ITTestService testService; |
| | | |
| | | @PreAuthorize("@ss.hasAnyPermi('system:test:add,system:test:edit')") |
| | | @GetMapping("/options") |
| | | public AjaxResult options() |
| | | { |
| | | return success(testService.selectConfigurationOptions()); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('system:test:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(TTest test) |
| | |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody TTest test) |
| | | { |
| | | test.setOperatorId(getUserId()); |
| | | test.setCreatorId(getUserId()); |
| | | test.setCreateBy(getUsername()); |
| | | return toAjax(testService.insertTest(test)); |
| | | Long testId = testService.createTest(test); |
| | | return success(testService.selectTestById(testId)); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('system:test:edit')") |
| | |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody TTest test) |
| | | { |
| | | test.setOperatorId(getUserId()); |
| | | test.setUpdateBy(getUsername()); |
| | | return toAjax(testService.updateTest(test)); |
| | | testService.updateTest(test); |
| | | return success(testService.selectTestById(test.getTestId())); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('system:test:start')") |
| | |
| | | @PutMapping("/start") |
| | | public AjaxResult start(@RequestParam Long testId) |
| | | { |
| | | return toAjax(testService.startTest(testId, getUsername())); |
| | | testService.startReception(testId, getUserId(), getUsername()); |
| | | return success(testService.selectTestById(testId)); |
| | | } |
| | | |
| | | /** 独立的开始接收动作;只改变系统数据归属,不向设备发送控制命令。 */ |
| | | @PreAuthorize("@ss.hasPermi('system:test:start')") |
| | | @Log(title = "测试数据接收", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/{testId}/reception/start") |
| | | public AjaxResult startReception(@PathVariable Long testId) |
| | | { |
| | | testService.startReception(testId, getUserId(), getUsername()); |
| | | return success(testService.selectTestById(testId)); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('system:test:remove')") |
| | |
| | | @DeleteMapping("/{testIds}") |
| | | public AjaxResult remove(@PathVariable Long[] testIds) |
| | | { |
| | | return toAjax(testService.deleteTestByIds(testIds, getUsername())); |
| | | return toAjax(testService.deleteTestByIds(testIds, getUserId(), getUsername())); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('system:test:query')") |