| | |
| | | package com.ruoyi.sy.controller; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.uuid.IdUtils; |
| | | import com.ruoyi.utils.result.Results; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | |
| | | * 电磁锁Controller |
| | | * |
| | | * @author ard |
| | | * @date 2024-06-29 |
| | | * @date 2024-07-01 |
| | | */ |
| | | @Api(tags = "电磁锁") |
| | | @RestController |
| | |
| | | @Log(title = "电磁锁" , businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody ArdTankLock ardTankLock) { |
| | | String id = IdUtils.simpleUUID(); |
| | | ardTankLock.setId(id); |
| | | return toAjax(ardTankLockService.insertArdTankLock(ardTankLock)); |
| | | } |
| | | |
| | |
| | | /** |
| | | * 删除电磁锁 |
| | | */ |
| | | @ApiOperation("删除电磁锁") |
| | | /*@ApiOperation("删除电磁锁") |
| | | @PreAuthorize("@ss.hasPermi('sy:lock:remove')") |
| | | @Log(title = "电磁锁" , businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable String[] ids) { |
| | | return toAjax(ardTankLockService.deleteArdTankLockByIds(ids)); |
| | | }*/ |
| | | |
| | | /** |
| | | * 删除电磁锁 |
| | | */ |
| | | @ApiOperation("删除单一电磁锁") |
| | | @PreAuthorize("@ss.hasPermi('sy:lock:remove')") |
| | | @Log(title = "电磁锁" , businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{id}") |
| | | public AjaxResult remove(@PathVariable String id) { |
| | | return toAjax(ardTankLockService.deleteArdTankLockById(id)); |
| | | } |
| | | |
| | | @ApiOperation("查询全部电磁锁") |
| | | @PreAuthorize("@ss.hasPermi('sy:lock:getAll')") |
| | | @GetMapping("/getAll") |
| | | public Results getAll() { |
| | | String userId = SecurityUtils.getUserId(); |
| | | Results result = ardTankLockService.getAll(userId); |
| | | return result; |
| | | } |
| | | } |