| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/12/22 14:58 |
| | | */ |
| | | @Api(tags = "设备保养定时任务管理") |
| | | @Api(tags = "Maintenance Timing Task") |
| | | @RestController |
| | | @RequestMapping("/deviceMaintenanceTask") |
| | | public class MaintenanceTaskController extends BaseController { |
| | | |
| | | |
| | | @Autowired |
| | | private MaintenanceTaskService maintenanceTaskService; |
| | | |
| | | |
| | | @GetMapping("/listPage") |
| | | @ApiOperation(value = "设备保养定时任务列表") |
| | | @ApiOperation(value = "Maintenance timing task list") |
| | | public AjaxResult listPage(Page page, MaintenanceTask maintenanceTask) { |
| | | return maintenanceTaskService.listPage(page,maintenanceTask); |
| | | return maintenanceTaskService.listPage(page, maintenanceTask); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/add") |
| | | @ApiOperation(value = "添加设备保养定时任务") |
| | | @Log(title = "设备保养定时任务", businessType = BusinessType.INSERT) |
| | | @ApiOperation(value = "Create maintenance timing task") |
| | | @Log(title = "Maintenance Timing Task", businessType = BusinessType.INSERT) |
| | | public AjaxResult add(@RequestBody MaintenanceTask maintenanceTask) { |
| | | return maintenanceTaskService.add(maintenanceTask); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @ApiOperation(value = "修改设备保养定时任务") |
| | | @Log(title = "设备保养定时任务", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "Update maintenance timing task") |
| | | @Log(title = "Maintenance Timing Task", businessType = BusinessType.UPDATE) |
| | | public AjaxResult update(@RequestBody MaintenanceTask maintenanceTask) { |
| | | return maintenanceTaskService.updateByMaintenanceTaskId(maintenanceTask); |
| | | } |
| | | |
| | | @PostMapping("/changeEnable") |
| | | @ApiOperation(value = "Change enable status") |
| | | @Log(title = "Maintenance Timing Task", businessType = BusinessType.UPDATE) |
| | | public AjaxResult changeEnable(@RequestBody MaintenanceTask maintenanceTask) { |
| | | if (maintenanceTask.getId() == null || maintenanceTask.getIsEnabled() == null) { |
| | | return AjaxResult.error("id and isEnabled are required"); |
| | | } |
| | | return maintenanceTaskService.changeEnable(maintenanceTask.getId(), maintenanceTask.getIsEnabled()); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @ApiOperation(value = "删除设备保养定时任务") |
| | | @Log(title = "设备保养定时任务", businessType = BusinessType.DELETE) |
| | | @ApiOperation(value = "Delete maintenance timing tasks") |
| | | @Log(title = "Maintenance Timing Task", businessType = BusinessType.DELETE) |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | return maintenanceTaskService.delete(ids); |
| | | } |
| | | |
| | | |
| | | } |