| | |
| | | |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | |
| | | /** |
| | | * 场景联动Controller |
| | | * |
| | | * |
| | | * @author kerwincui |
| | | * @date 2022-01-13 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/iot/scene") |
| | | public class SceneController extends BaseController |
| | | { |
| | | public class SceneController extends BaseController { |
| | | @Autowired |
| | | private ISceneService sceneService; |
| | | |
| | |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('iot:scene:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(Scene scene) |
| | | { |
| | | public TableDataInfo list(Scene scene) { |
| | | startPage(); |
| | | List<Scene> list = sceneService.selectSceneList(scene); |
| | | return getDataTable(list); |
| | |
| | | @PreAuthorize("@ss.hasPermi('iot:scene:export')") |
| | | @Log(title = "场景联动", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, Scene scene) |
| | | { |
| | | public void export(HttpServletResponse response, Scene scene) { |
| | | List<Scene> list = sceneService.selectSceneList(scene); |
| | | ExcelUtil<Scene> util = new ExcelUtil<Scene>(Scene.class); |
| | | util.exportExcel(response, list, "场景联动数据"); |
| | |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('iot:scene:query')") |
| | | @GetMapping(value = "/{sceneId}") |
| | | public AjaxResult getInfo(@PathVariable("sceneId") Long sceneId) |
| | | { |
| | | public AjaxResult getInfo(@PathVariable("sceneId") Long sceneId) { |
| | | return AjaxResult.success(sceneService.selectSceneBySceneId(sceneId)); |
| | | } |
| | | |
| | |
| | | @PreAuthorize("@ss.hasPermi('iot:scene:add')") |
| | | @Log(title = "场景联动", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody Scene scene) |
| | | { |
| | | public AjaxResult add(@RequestBody Scene scene) { |
| | | return toAjax(sceneService.insertScene(scene)); |
| | | } |
| | | |
| | |
| | | @PreAuthorize("@ss.hasPermi('iot:scene:edit')") |
| | | @Log(title = "场景联动", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody Scene scene) |
| | | { |
| | | public AjaxResult edit(@RequestBody Scene scene) { |
| | | return toAjax(sceneService.updateScene(scene)); |
| | | } |
| | | |
| | |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('iot:scene:remove')") |
| | | @Log(title = "场景联动", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{sceneIds}") |
| | | public AjaxResult remove(@PathVariable Long[] sceneIds) |
| | | { |
| | | @DeleteMapping("/{sceneIds}") |
| | | public AjaxResult remove(@PathVariable Long[] sceneIds) { |
| | | return toAjax(sceneService.deleteSceneBySceneIds(sceneIds)); |
| | | } |
| | | } |