|  |  | 
 |  |  | import com.doumee.core.model.PageData; | 
 |  |  | import com.doumee.core.model.PageWrap; | 
 |  |  | import com.doumee.dao.business.model.Locks; | 
 |  |  | import com.doumee.service.business.DeviceService; | 
 |  |  | import com.doumee.service.business.LocksService; | 
 |  |  | import io.swagger.annotations.Api; | 
 |  |  | import io.swagger.annotations.ApiOperation; | 
 |  |  | 
 |  |  |  | 
 |  |  |     @Autowired | 
 |  |  |     private LocksService locksService; | 
 |  |  |     @Autowired | 
 |  |  |     private DeviceService deviceService; | 
 |  |  |  | 
 |  |  |     @PreventRepeat | 
 |  |  |     @ApiOperation("新建") | 
 |  |  | 
 |  |  |     @GetMapping("/delete/batch") | 
 |  |  |     @RequiresPermissions("business:locks:delete") | 
 |  |  |     public ApiResponse deleteByIdInBatch(@RequestParam String ids) { | 
 |  |  |         String [] idArray = ids.split(","); | 
 |  |  |         String[] idArray = ids.split(","); | 
 |  |  |         List<String> idList = new ArrayList<>(); | 
 |  |  |         for (String id : idArray) { | 
 |  |  |             idList.add(id); | 
 |  |  | 
 |  |  |         return ApiResponse.success(null); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @ApiOperation("分页查询") | 
 |  |  |     @ApiOperation("实时车位信息-分页查询") | 
 |  |  |     @PostMapping("/page") | 
 |  |  |     @RequiresPermissions("business:locks:query") | 
 |  |  |     public ApiResponse<PageData<Locks>> findPage (@RequestBody PageWrap<Locks> pageWrap) { | 
 |  |  |     public ApiResponse<PageData<Locks>> findPage(@RequestBody PageWrap<Locks> pageWrap) { | 
 |  |  |         return ApiResponse.success(locksService.findPage(pageWrap)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @ApiOperation("导出Excel") | 
 |  |  |     @PostMapping("/exportExcel") | 
 |  |  |     @RequiresPermissions("business:locks:exportExcel") | 
 |  |  |     public void exportExcel (@RequestBody PageWrap<Locks> pageWrap, HttpServletResponse response) { | 
 |  |  |     public void exportExcel(@RequestBody PageWrap<Locks> pageWrap, HttpServletResponse response) { | 
 |  |  |         ExcelExporter.build(Locks.class).export(locksService.findPage(pageWrap).getRecords(), "锁头信息表", response); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | 
 |  |  |     public ApiResponse findById(@PathVariable String id) { | 
 |  |  |         return ApiResponse.success(locksService.findById(id)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @ApiOperation("测试mqtt消息发送") | 
 |  |  |     @PostMapping("/testMqtt") | 
 |  |  |     public ApiResponse  testMqtt(@RequestBody  Locks locks) { | 
 |  |  |         return ApiResponse.success(deviceService.openLock(locks)); | 
 |  |  |     } | 
 |  |  | } |