wangmengzhao
2023-12-01 cbdf1e550c73c90c01ec0c792eb7bfe96dcc910f
wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/controller/SceneController.java
@@ -2,6 +2,7 @@
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;
@@ -23,14 +24,13 @@
/**
 * 场景联动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;
@@ -39,8 +39,7 @@
     */
    @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);
@@ -52,8 +51,7 @@
    @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, "场景联动数据");
@@ -64,8 +62,7 @@
     */
    @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));
    }
@@ -75,8 +72,7 @@
    @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));
    }
@@ -86,8 +82,7 @@
    @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));
    }
@@ -96,9 +91,8 @@
     */
    @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));
    }
}