Kaynağa Gözat

fix 移除无用模块

jay 10 ay önce
ebeveyn
işleme
3e26e894b6

+ 5 - 5
iot-module/iot-manager/pom.xml

@@ -29,10 +29,10 @@
             <artifactId>iot-rule-engine</artifactId>
         </dependency>
 
-        <dependency>
-            <groupId>cc.iotkit</groupId>
-            <artifactId>iot-screen</artifactId>
-        </dependency>
+<!--        <dependency>-->
+<!--            <groupId>cc.iotkit</groupId>-->
+<!--            <artifactId>iot-screen</artifactId>-->
+<!--        </dependency>-->
 
         <dependency>
             <groupId>cc.iotkit</groupId>
@@ -139,4 +139,4 @@
         </plugins>
     </build>
 
-</project>
+</project>

+ 174 - 174
iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/ScreenController.java

@@ -1,174 +1,174 @@
-/*
- *
- *  * | Licensed 未经许可不能去掉「OPENIITA」相关版权
- *  * +----------------------------------------------------------------------
- *  * | Author: xw2sy@163.com
- *  * +----------------------------------------------------------------------
- *
- *  Copyright [2024] [OPENIITA]
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- * /
- */
-
-package cc.iotkit.manager.controller;
-
-import cc.iotkit.common.api.PageRequest;
-import cc.iotkit.common.api.Paging;
-import cc.iotkit.common.api.Request;
-import cc.iotkit.common.enums.ErrCode;
-import cc.iotkit.common.exception.BizException;
-import cc.iotkit.manager.dto.bo.screen.DebugChangeBo;
-import cc.iotkit.manager.dto.bo.screen.PublishChangeBo;
-import cc.iotkit.manager.service.IScreenService;
-import cc.iotkit.model.screen.Screen;
-import cc.iotkit.model.screen.ScreenApi;
-import cn.dev33.satoken.annotation.SaCheckPermission;
-import cn.hutool.core.util.ObjectUtil;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.MultipartFile;
-
-import java.util.List;
-
-/**
- * @Author:tfd
- * @Date:2023/6/25 14:56
- */
-@Api(tags = {"大屏接口"})
-@Slf4j
-@RestController
-@RequestMapping("/screen")
-public class ScreenController {
-
-    @Autowired
-    private IScreenService screenService;
-
-    @ApiOperation(value = "获取大屏列表", httpMethod = "POST")
-    @SaCheckPermission("iot:screen:list")
-    @PostMapping("/getScreens")
-    public Paging<Screen> getBigScreens(@Validated @RequestBody PageRequest<Screen> request) {
-        return screenService.getBigScreens(request);
-    }
-
-    @ApiOperation(value = "上传大屏资源包")
-    @SaCheckPermission("iot:screen:add")
-    @PostMapping("/uploadResourceFile")
-    public Long uploadResourceFile(@RequestParam("file") MultipartFile file,
-                                   @RequestBody @Validated Request<Long> id){
-        if (file == null) {
-            throw new BizException(ErrCode.PARAMS_EXCEPTION);
-        }
-        log.info("saving upload resource file:{}", file.getName());
-        return screenService.uploadResourceFile(file,id.getData());
-    }
-
-    @ApiOperation(value = "获取大屏接口")
-    @SaCheckPermission("iot:screen:list")
-    @PostMapping("/getScreenApis")
-    public List<ScreenApi> getScreenApis(@RequestBody @Validated Request<Long> id) {
-        if (ObjectUtil.isEmpty(id.getData())) {
-            throw new BizException(ErrCode.ID_BLANK);
-        }
-        return screenService.findByScreenId(id.getData());
-    }
-
-    @ApiOperation(value = "获取默认大屏")
-    @SaCheckPermission("iot:screen:query")
-    @PostMapping("/getDefaultScreen")
-    public Screen getDefaultScreen() {
-        return screenService.getDefaultScreen();
-    }
-
-    @ApiOperation(value = "同步资源包接口")
-    @SaCheckPermission("iot:screen:query")
-    @PostMapping("/syncResourceApis")
-    public List<ScreenApi> syncResourceApis(@RequestBody @Validated Request<Long> id) {
-        if (ObjectUtil.isEmpty(id.getData())) {
-            throw new BizException(ErrCode.ID_BLANK);
-        }
-        return screenService.syncResourceApis(id.getData());
-    }
-
-    @ApiOperation(value = "预览接口")
-    @SaCheckPermission("iot:screen:query")
-    @PostMapping("/previewApis")
-    public void previewApis(@RequestBody  @Validated Request<List<ScreenApi>> screenApis) {
-        if (ObjectUtil.isNull(screenApis.getData()) || screenApis.getData().isEmpty()) {
-            throw new BizException(ErrCode.API_LIST_BLANK);
-        }
-        screenService.previewApis(screenApis.getData());
-    }
-
-    @ApiOperation(value = "保存大屏接口")
-    @SaCheckPermission("iot:screen:edit")
-    @PostMapping("/saveScreenApis")
-    public void saveScreenApis(@RequestBody @Validated Request<List<ScreenApi>> screenApis) {
-        if (ObjectUtil.isNull(screenApis.getData()) || screenApis.getData().isEmpty()) {
-            throw new BizException(ErrCode.API_LIST_BLANK);
-        }
-        screenService.saveScreenApis(screenApis.getData());
-    }
-
-    @ApiOperation(value = "调试模式转换")
-    @SaCheckPermission("iot:screen:edit")
-    @PostMapping("/debugModeChange")
-    public void debugMode(@RequestBody @Validated Request<DebugChangeBo> debugChange) {
-        screenService.debugModeChange(debugChange.getData());
-    }
-
-    @ApiOperation(value = "添加大屏")
-    @SaCheckPermission("iot:screen:add")
-    @PostMapping("/addScreen")
-    public void addScreen(@RequestBody @Validated Request<Screen> screen) {
-        screenService.addBigScreen(screen.getData());
-    }
-
-    @ApiOperation(value = "保存大屏")
-    @SaCheckPermission("iot:screen:edit")
-    @PostMapping("/saveScreen")
-    public void saveScreen(@RequestBody @Validated Request<Screen> screen) {
-        screenService.saveBigScreen(screen.getData());
-    }
-
-    @ApiOperation(value = "发布状态改变")
-    @SaCheckPermission("iot:screen:edit")
-    @PostMapping("/publishStatusChange")
-    public void publishStatusChange(@RequestBody @Validated Request<PublishChangeBo> req) {
-        screenService.publishStatusChange(req.getData());
-    }
-
-    @ApiOperation(value = "设置默认大屏")
-    @SaCheckPermission("iot:screen:edit")
-    @PostMapping("/setDefaultScreen")
-    public void setDefaultScreen(@RequestBody @Validated Request<Long> id) {
-        if (ObjectUtil.isEmpty(id.getData())) {
-            throw new BizException(ErrCode.ID_BLANK);
-        }
-        screenService.setDefaultScreen(id.getData());
-    }
-
-    @ApiOperation(value = "删除大屏", httpMethod = "POST")
-    @SaCheckPermission("iot:screen:remove")
-    @PostMapping("/deleteScreen")
-    public void deleteScreen(@RequestBody @Validated Request<Long> id) {
-        if (ObjectUtil.isEmpty(id.getData())) {
-            throw new BizException(ErrCode.ID_BLANK);
-        }
-        screenService.deleteScreen(id.getData());
-    }
-}
+///*
+// *
+// *  * | Licensed 未经许可不能去掉「OPENIITA」相关版权
+// *  * +----------------------------------------------------------------------
+// *  * | Author: xw2sy@163.com
+// *  * +----------------------------------------------------------------------
+// *
+// *  Copyright [2024] [OPENIITA]
+// *
+// *  Licensed under the Apache License, Version 2.0 (the "License");
+// *  you may not use this file except in compliance with the License.
+// *  You may obtain a copy of the License at
+// *
+// *     http://www.apache.org/licenses/LICENSE-2.0
+// *
+// *  Unless required by applicable law or agreed to in writing, software
+// *  distributed under the License is distributed on an "AS IS" BASIS,
+// *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// *  See the License for the specific language governing permissions and
+// *  limitations under the License.
+// * /
+// */
+//
+//package cc.iotkit.manager.controller;
+//
+//import cc.iotkit.common.api.PageRequest;
+//import cc.iotkit.common.api.Paging;
+//import cc.iotkit.common.api.Request;
+//import cc.iotkit.common.enums.ErrCode;
+//import cc.iotkit.common.exception.BizException;
+//import cc.iotkit.manager.dto.bo.screen.DebugChangeBo;
+//import cc.iotkit.manager.dto.bo.screen.PublishChangeBo;
+//import cc.iotkit.manager.service.IScreenService;
+//import cc.iotkit.model.screen.Screen;
+//import cc.iotkit.model.screen.ScreenApi;
+//import cn.dev33.satoken.annotation.SaCheckPermission;
+//import cn.hutool.core.util.ObjectUtil;
+//import io.swagger.annotations.Api;
+//import io.swagger.annotations.ApiOperation;
+//import lombok.extern.slf4j.Slf4j;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.validation.annotation.Validated;
+//import org.springframework.web.bind.annotation.*;
+//import org.springframework.web.multipart.MultipartFile;
+//
+//import java.util.List;
+//
+///**
+// * @Author:tfd
+// * @Date:2023/6/25 14:56
+// */
+//@Api(tags = {"大屏接口"})
+//@Slf4j
+//@RestController
+//@RequestMapping("/screen")
+//public class ScreenController {
+//
+//    @Autowired
+//    private IScreenService screenService;
+//
+//    @ApiOperation(value = "获取大屏列表", httpMethod = "POST")
+//    @SaCheckPermission("iot:screen:list")
+//    @PostMapping("/getScreens")
+//    public Paging<Screen> getBigScreens(@Validated @RequestBody PageRequest<Screen> request) {
+//        return screenService.getBigScreens(request);
+//    }
+//
+//    @ApiOperation(value = "上传大屏资源包")
+//    @SaCheckPermission("iot:screen:add")
+//    @PostMapping("/uploadResourceFile")
+//    public Long uploadResourceFile(@RequestParam("file") MultipartFile file,
+//                                   @RequestBody @Validated Request<Long> id){
+//        if (file == null) {
+//            throw new BizException(ErrCode.PARAMS_EXCEPTION);
+//        }
+//        log.info("saving upload resource file:{}", file.getName());
+//        return screenService.uploadResourceFile(file,id.getData());
+//    }
+//
+//    @ApiOperation(value = "获取大屏接口")
+//    @SaCheckPermission("iot:screen:list")
+//    @PostMapping("/getScreenApis")
+//    public List<ScreenApi> getScreenApis(@RequestBody @Validated Request<Long> id) {
+//        if (ObjectUtil.isEmpty(id.getData())) {
+//            throw new BizException(ErrCode.ID_BLANK);
+//        }
+//        return screenService.findByScreenId(id.getData());
+//    }
+//
+//    @ApiOperation(value = "获取默认大屏")
+//    @SaCheckPermission("iot:screen:query")
+//    @PostMapping("/getDefaultScreen")
+//    public Screen getDefaultScreen() {
+//        return screenService.getDefaultScreen();
+//    }
+//
+//    @ApiOperation(value = "同步资源包接口")
+//    @SaCheckPermission("iot:screen:query")
+//    @PostMapping("/syncResourceApis")
+//    public List<ScreenApi> syncResourceApis(@RequestBody @Validated Request<Long> id) {
+//        if (ObjectUtil.isEmpty(id.getData())) {
+//            throw new BizException(ErrCode.ID_BLANK);
+//        }
+//        return screenService.syncResourceApis(id.getData());
+//    }
+//
+//    @ApiOperation(value = "预览接口")
+//    @SaCheckPermission("iot:screen:query")
+//    @PostMapping("/previewApis")
+//    public void previewApis(@RequestBody  @Validated Request<List<ScreenApi>> screenApis) {
+//        if (ObjectUtil.isNull(screenApis.getData()) || screenApis.getData().isEmpty()) {
+//            throw new BizException(ErrCode.API_LIST_BLANK);
+//        }
+//        screenService.previewApis(screenApis.getData());
+//    }
+//
+//    @ApiOperation(value = "保存大屏接口")
+//    @SaCheckPermission("iot:screen:edit")
+//    @PostMapping("/saveScreenApis")
+//    public void saveScreenApis(@RequestBody @Validated Request<List<ScreenApi>> screenApis) {
+//        if (ObjectUtil.isNull(screenApis.getData()) || screenApis.getData().isEmpty()) {
+//            throw new BizException(ErrCode.API_LIST_BLANK);
+//        }
+//        screenService.saveScreenApis(screenApis.getData());
+//    }
+//
+//    @ApiOperation(value = "调试模式转换")
+//    @SaCheckPermission("iot:screen:edit")
+//    @PostMapping("/debugModeChange")
+//    public void debugMode(@RequestBody @Validated Request<DebugChangeBo> debugChange) {
+//        screenService.debugModeChange(debugChange.getData());
+//    }
+//
+//    @ApiOperation(value = "添加大屏")
+//    @SaCheckPermission("iot:screen:add")
+//    @PostMapping("/addScreen")
+//    public void addScreen(@RequestBody @Validated Request<Screen> screen) {
+//        screenService.addBigScreen(screen.getData());
+//    }
+//
+//    @ApiOperation(value = "保存大屏")
+//    @SaCheckPermission("iot:screen:edit")
+//    @PostMapping("/saveScreen")
+//    public void saveScreen(@RequestBody @Validated Request<Screen> screen) {
+//        screenService.saveBigScreen(screen.getData());
+//    }
+//
+//    @ApiOperation(value = "发布状态改变")
+//    @SaCheckPermission("iot:screen:edit")
+//    @PostMapping("/publishStatusChange")
+//    public void publishStatusChange(@RequestBody @Validated Request<PublishChangeBo> req) {
+//        screenService.publishStatusChange(req.getData());
+//    }
+//
+//    @ApiOperation(value = "设置默认大屏")
+//    @SaCheckPermission("iot:screen:edit")
+//    @PostMapping("/setDefaultScreen")
+//    public void setDefaultScreen(@RequestBody @Validated Request<Long> id) {
+//        if (ObjectUtil.isEmpty(id.getData())) {
+//            throw new BizException(ErrCode.ID_BLANK);
+//        }
+//        screenService.setDefaultScreen(id.getData());
+//    }
+//
+//    @ApiOperation(value = "删除大屏", httpMethod = "POST")
+//    @SaCheckPermission("iot:screen:remove")
+//    @PostMapping("/deleteScreen")
+//    public void deleteScreen(@RequestBody @Validated Request<Long> id) {
+//        if (ObjectUtil.isEmpty(id.getData())) {
+//            throw new BizException(ErrCode.ID_BLANK);
+//        }
+//        screenService.deleteScreen(id.getData());
+//    }
+//}

+ 66 - 66
iot-module/iot-manager/src/main/java/cc/iotkit/manager/service/IScreenService.java

@@ -1,66 +1,66 @@
-/*
- *
- *  * | Licensed 未经许可不能去掉「OPENIITA」相关版权
- *  * +----------------------------------------------------------------------
- *  * | Author: xw2sy@163.com
- *  * +----------------------------------------------------------------------
- *
- *  Copyright [2024] [OPENIITA]
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- * /
- */
-
-package cc.iotkit.manager.service;
-
-import cc.iotkit.common.api.PageRequest;
-import cc.iotkit.common.api.Paging;
-import cc.iotkit.manager.dto.bo.screen.DebugChangeBo;
-import cc.iotkit.manager.dto.bo.screen.PublishChangeBo;
-import cc.iotkit.model.screen.Screen;
-import cc.iotkit.model.screen.ScreenApi;
-import org.springframework.web.multipart.MultipartFile;
-
-import java.util.List;
-
-/**
- * @Author:tfd
- * @Date:2023/6/25 15:14
- */
-public interface IScreenService {
-    Long uploadResourceFile(MultipartFile file, Long id);
-
-    List<ScreenApi> findByScreenId(Long id);
-
-    Screen getDefaultScreen();
-
-    List<ScreenApi> syncResourceApis(Long id);
-
-    void previewApis(List<ScreenApi> screenApis);
-
-    void saveScreenApis(List<ScreenApi> screenApis);
-
-    void debugModeChange(DebugChangeBo debugChange);
-
-    void addBigScreen(Screen screen);
-
-    void saveBigScreen(Screen screen);
-
-    void publishStatusChange(PublishChangeBo data);
-
-    void setDefaultScreen(Long id);
-
-    void deleteScreen(Long id);
-
-    Paging<Screen> getBigScreens(PageRequest<Screen> request);
-}
+///*
+// *
+// *  * | Licensed 未经许可不能去掉「OPENIITA」相关版权
+// *  * +----------------------------------------------------------------------
+// *  * | Author: xw2sy@163.com
+// *  * +----------------------------------------------------------------------
+// *
+// *  Copyright [2024] [OPENIITA]
+// *
+// *  Licensed under the Apache License, Version 2.0 (the "License");
+// *  you may not use this file except in compliance with the License.
+// *  You may obtain a copy of the License at
+// *
+// *     http://www.apache.org/licenses/LICENSE-2.0
+// *
+// *  Unless required by applicable law or agreed to in writing, software
+// *  distributed under the License is distributed on an "AS IS" BASIS,
+// *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// *  See the License for the specific language governing permissions and
+// *  limitations under the License.
+// * /
+// */
+//
+//package cc.iotkit.manager.service;
+//
+//import cc.iotkit.common.api.PageRequest;
+//import cc.iotkit.common.api.Paging;
+//import cc.iotkit.manager.dto.bo.screen.DebugChangeBo;
+//import cc.iotkit.manager.dto.bo.screen.PublishChangeBo;
+//import cc.iotkit.model.screen.Screen;
+//import cc.iotkit.model.screen.ScreenApi;
+//import org.springframework.web.multipart.MultipartFile;
+//
+//import java.util.List;
+//
+///**
+// * @Author:tfd
+// * @Date:2023/6/25 15:14
+// */
+//public interface IScreenService {
+//    Long uploadResourceFile(MultipartFile file, Long id);
+//
+//    List<ScreenApi> findByScreenId(Long id);
+//
+//    Screen getDefaultScreen();
+//
+//    List<ScreenApi> syncResourceApis(Long id);
+//
+//    void previewApis(List<ScreenApi> screenApis);
+//
+//    void saveScreenApis(List<ScreenApi> screenApis);
+//
+//    void debugModeChange(DebugChangeBo debugChange);
+//
+//    void addBigScreen(Screen screen);
+//
+//    void saveBigScreen(Screen screen);
+//
+//    void publishStatusChange(PublishChangeBo data);
+//
+//    void setDefaultScreen(Long id);
+//
+//    void deleteScreen(Long id);
+//
+//    Paging<Screen> getBigScreens(PageRequest<Screen> request);
+//}

+ 237 - 237
iot-module/iot-manager/src/main/java/cc/iotkit/manager/service/impl/ScreenServiceImpl.java

@@ -1,237 +1,237 @@
-/*
- *
- *  * | Licensed 未经许可不能去掉「OPENIITA」相关版权
- *  * +----------------------------------------------------------------------
- *  * | Author: xw2sy@163.com
- *  * +----------------------------------------------------------------------
- *
- *  Copyright [2024] [OPENIITA]
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- * /
- */
-
-package cc.iotkit.manager.service.impl;
-
-import cc.iotkit.common.api.PageRequest;
-import cc.iotkit.common.api.Paging;
-import cc.iotkit.common.enums.ErrCode;
-import cc.iotkit.common.exception.BizException;
-import cc.iotkit.common.utils.ReflectUtil;
-import cc.iotkit.data.manager.IScreenApiData;
-import cc.iotkit.data.manager.IScreenData;
-import cc.iotkit.manager.dto.bo.screen.DebugChangeBo;
-import cc.iotkit.manager.dto.bo.screen.PublishChangeBo;
-import cc.iotkit.manager.service.DataOwnerService;
-import cc.iotkit.manager.service.IScreenService;
-import cc.iotkit.model.screen.Screen;
-import cc.iotkit.model.screen.ScreenApi;
-import cc.iotkit.screen.ScreenManager;
-import cc.iotkit.screen.config.ScreenConfig;
-import cn.hutool.core.util.ObjectUtil;
-import cn.hutool.core.util.ZipUtil;
-import com.github.yitter.idgen.YitIdHelper;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.io.FileUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.util.StringUtils;
-import org.springframework.web.multipart.MultipartFile;
-
-import java.io.File;
-import java.io.IOException;
-import java.nio.file.*;
-import java.util.List;
-import java.util.Objects;
-
-/**
- * @Author:tfd
- * @Date:2023/6/25 15:15
- */
-@Service
-@Slf4j
-public class ScreenServiceImpl implements IScreenService {
-    @Autowired
-    private IScreenData screenData;
-    @Autowired
-    private IScreenApiData screenApiData;
-    @Autowired
-    private DataOwnerService dataOwnerService;
-    @Autowired
-    private ScreenConfig screenConfig;
-    @Autowired
-    private ScreenManager screenManager;
-
-    @Override
-    public Long uploadResourceFile(MultipartFile file, Long id) {
-        String fileName = StringUtils.cleanPath(Objects.requireNonNull(file.getOriginalFilename()));
-        try {
-            if (ObjectUtil.isNotNull(id)) {
-                getAndCheckBigScreen(id);
-            } else {
-                id = YitIdHelper.nextId();
-            }
-            Path filePath = screenConfig.getBigScreenFilePath(String.valueOf(id));
-            Files.createDirectories(filePath);
-            Path targetLocation = filePath.resolve(fileName);
-            Files.copy(file.getInputStream(), targetLocation, StandardCopyOption.REPLACE_EXISTING);
-            ZipUtil.unzip(filePath.toString()+"/"+fileName);
-            return id;
-        } catch (IOException ex) {
-            throw new BizException(ErrCode.UPLOAD_FILE_ERROR, ex);
-        }
-    }
-
-    @Override
-    public List<ScreenApi> findByScreenId(Long id) {
-        return screenApiData.findByScreenId(id);
-    }
-
-    @Override
-    public Screen getDefaultScreen() {
-        return screenData.findByIsDefault(true);
-    }
-
-    @Override
-    public List<ScreenApi> syncResourceApis(Long id) {
-        Screen screen = getAndCheckBigScreen(id);
-        return screenManager.getScreenApis(screen);
-    }
-
-    @Override
-    public void previewApis(List<ScreenApi> screenApis) {
-        Screen screen = getAndCheckBigScreen(screenApis.get(0).getScreenId());
-        screenManager.previewApis(screen,screenApis);
-    }
-
-    @Override
-    public void saveScreenApis(List<ScreenApi> screenApis) {
-        Screen screen = getAndCheckBigScreen(screenApis.get(0).getScreenId());
-        screenApiData.deleteByScreenId(screen.getId());
-        screenApiData.batchSave(screenApis);
-    }
-
-    @Override
-    public void debugModeChange(DebugChangeBo debugChange) {
-        Screen screen = getAndCheckBigScreen(debugChange.getId());
-        screenManager.debugMode(screen,debugChange.getState());
-    }
-
-    @Override
-    public void addBigScreen(Screen screen) {
-        String id = String.valueOf(screen.getId());
-        if (!StringUtils.hasLength(id)) {
-            throw new BizException(ErrCode.ID_BLANK);
-        }
-        Path resPath = screenConfig.getBigScreenFilePath(id);
-        if (!resPath.resolve(screen.getResourceFile()).toFile().exists()) {
-            throw new BizException(ErrCode.RESOURCE_FILE_NOT_FOUND);
-        }
-        Screen s = screenData.findById(screen.getId());
-        if (s != null) {
-            throw new BizException(ErrCode.BIG_SCREEN_ALREADY);
-        }
-        try {
-            screen.setCreateAt(System.currentTimeMillis());
-            screen.setIsDefault(false);
-            screenData.save(screen);
-        } catch (Throwable e) {
-            throw new BizException(ErrCode.ADD_BIG_SCREEN_ERROR, e);
-        }
-    }
-
-    @Override
-    public void saveBigScreen(Screen screen) {
-        String id = String.valueOf(screen.getId());
-        if (!StringUtils.hasLength(id)) {
-            throw new BizException(ErrCode.ID_BLANK);
-        }
-        Path jarPath = screenConfig.getBigScreenFilePath(id);
-        if (!jarPath.resolve(screen.getResourceFile()).toFile().exists()) {
-            throw new BizException(ErrCode.RESOURCE_FILE_NOT_FOUND);
-        }
-        Screen oldScreen = getAndCheckBigScreen(screen.getId());
-        screen = ReflectUtil.copyNoNulls(screen, oldScreen);
-        try {
-            screenData.save(screen);
-        } catch (Throwable e) {
-            throw new BizException(ErrCode.ADD_BIG_SCREEN_ERROR, e);
-        }
-    }
-
-    @Override
-    public void publishStatusChange(PublishChangeBo data) {
-        Screen screen = getAndCheckBigScreen(data.getId());
-        if (Screen.STATE_RUNNING.equals(data.getState())) {//发布状态
-            List<ScreenApi> screenApis=screenApiData.findByScreenId(screen.getId());
-            if(screenApis==null||screenApis.size()==0){
-                throw new BizException(ErrCode.API_LIST_BLANK);
-            }
-            screen.setState(Screen.STATE_RUNNING);
-            screenManager.register(screen);
-            screenManager.publish(screen);
-        } else {//取消发布
-            screen.setState(Screen.STATE_STOPPED);
-            screenManager.unPublish(screen);
-        }
-        screenData.save(screen);
-    }
-
-    @Override
-    public void setDefaultScreen(Long id) {
-        Screen screen = getAndCheckBigScreen(id);
-        Screen oldScreen=screenData.findByIsDefault(true);
-        if(oldScreen!=null){
-            oldScreen.setIsDefault(false);
-        }
-        screenData.save(oldScreen);
-        screen.setIsDefault(true);
-        screenData.save(screen);
-    }
-
-    @Override
-    public void deleteScreen(Long id) {
-        Screen screen = getAndCheckBigScreen(id);
-        try {
-            Path path = Paths.get(String.format("%s/%s", screenConfig.getScreenDir(), id))
-                    .toAbsolutePath().normalize();
-            File file = path.toFile();
-            try {
-                if (file.isDirectory()) {
-                    FileUtils.deleteDirectory(file);
-                } else {
-                    FileUtils.delete(file);
-                }
-            } catch (NoSuchFileException e) {
-                log.warn("delete big screen resource error", e);
-            }
-            screenData.deleteById(screen.getId());
-        } catch (Throwable e) {
-            throw new BizException(ErrCode.DELETE_BIG_SCREEN_ERROR, e);
-        }
-    }
-
-    @Override
-    public Paging<Screen> getBigScreens(PageRequest<Screen> request) {
-        return screenData.findAll(request);
-    }
-
-    private Screen getAndCheckBigScreen(Long id) {
-        Screen oldBigScreen = screenData.findById(id);
-        if (oldBigScreen == null) {
-            throw new BizException(ErrCode.BIG_SCREEN_NOT_FOUND);
-        }
-        dataOwnerService.checkOwner(oldBigScreen);
-        return oldBigScreen;
-    }
-}
+///*
+// *
+// *  * | Licensed 未经许可不能去掉「OPENIITA」相关版权
+// *  * +----------------------------------------------------------------------
+// *  * | Author: xw2sy@163.com
+// *  * +----------------------------------------------------------------------
+// *
+// *  Copyright [2024] [OPENIITA]
+// *
+// *  Licensed under the Apache License, Version 2.0 (the "License");
+// *  you may not use this file except in compliance with the License.
+// *  You may obtain a copy of the License at
+// *
+// *     http://www.apache.org/licenses/LICENSE-2.0
+// *
+// *  Unless required by applicable law or agreed to in writing, software
+// *  distributed under the License is distributed on an "AS IS" BASIS,
+// *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// *  See the License for the specific language governing permissions and
+// *  limitations under the License.
+// * /
+// */
+//
+//package cc.iotkit.manager.service.impl;
+//
+//import cc.iotkit.common.api.PageRequest;
+//import cc.iotkit.common.api.Paging;
+//import cc.iotkit.common.enums.ErrCode;
+//import cc.iotkit.common.exception.BizException;
+//import cc.iotkit.common.utils.ReflectUtil;
+//import cc.iotkit.data.manager.IScreenApiData;
+//import cc.iotkit.data.manager.IScreenData;
+//import cc.iotkit.manager.dto.bo.screen.DebugChangeBo;
+//import cc.iotkit.manager.dto.bo.screen.PublishChangeBo;
+//import cc.iotkit.manager.service.DataOwnerService;
+//import cc.iotkit.manager.service.IScreenService;
+//import cc.iotkit.model.screen.Screen;
+//import cc.iotkit.model.screen.ScreenApi;
+//import cc.iotkit.screen.ScreenManager;
+//import cc.iotkit.screen.config.ScreenConfig;
+//import cn.hutool.core.util.ObjectUtil;
+//import cn.hutool.core.util.ZipUtil;
+//import com.github.yitter.idgen.YitIdHelper;
+//import lombok.extern.slf4j.Slf4j;
+//import org.apache.commons.io.FileUtils;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.stereotype.Service;
+//import org.springframework.util.StringUtils;
+//import org.springframework.web.multipart.MultipartFile;
+//
+//import java.io.File;
+//import java.io.IOException;
+//import java.nio.file.*;
+//import java.util.List;
+//import java.util.Objects;
+//
+///**
+// * @Author:tfd
+// * @Date:2023/6/25 15:15
+// */
+//@Service
+//@Slf4j
+//public class ScreenServiceImpl implements IScreenService {
+//    @Autowired
+//    private IScreenData screenData;
+//    @Autowired
+//    private IScreenApiData screenApiData;
+//    @Autowired
+//    private DataOwnerService dataOwnerService;
+//    @Autowired
+//    private ScreenConfig screenConfig;
+//    @Autowired
+//    private ScreenManager screenManager;
+//
+//    @Override
+//    public Long uploadResourceFile(MultipartFile file, Long id) {
+//        String fileName = StringUtils.cleanPath(Objects.requireNonNull(file.getOriginalFilename()));
+//        try {
+//            if (ObjectUtil.isNotNull(id)) {
+//                getAndCheckBigScreen(id);
+//            } else {
+//                id = YitIdHelper.nextId();
+//            }
+//            Path filePath = screenConfig.getBigScreenFilePath(String.valueOf(id));
+//            Files.createDirectories(filePath);
+//            Path targetLocation = filePath.resolve(fileName);
+//            Files.copy(file.getInputStream(), targetLocation, StandardCopyOption.REPLACE_EXISTING);
+//            ZipUtil.unzip(filePath.toString()+"/"+fileName);
+//            return id;
+//        } catch (IOException ex) {
+//            throw new BizException(ErrCode.UPLOAD_FILE_ERROR, ex);
+//        }
+//    }
+//
+//    @Override
+//    public List<ScreenApi> findByScreenId(Long id) {
+//        return screenApiData.findByScreenId(id);
+//    }
+//
+//    @Override
+//    public Screen getDefaultScreen() {
+//        return screenData.findByIsDefault(true);
+//    }
+//
+//    @Override
+//    public List<ScreenApi> syncResourceApis(Long id) {
+//        Screen screen = getAndCheckBigScreen(id);
+//        return screenManager.getScreenApis(screen);
+//    }
+//
+//    @Override
+//    public void previewApis(List<ScreenApi> screenApis) {
+//        Screen screen = getAndCheckBigScreen(screenApis.get(0).getScreenId());
+//        screenManager.previewApis(screen,screenApis);
+//    }
+//
+//    @Override
+//    public void saveScreenApis(List<ScreenApi> screenApis) {
+//        Screen screen = getAndCheckBigScreen(screenApis.get(0).getScreenId());
+//        screenApiData.deleteByScreenId(screen.getId());
+//        screenApiData.batchSave(screenApis);
+//    }
+//
+//    @Override
+//    public void debugModeChange(DebugChangeBo debugChange) {
+//        Screen screen = getAndCheckBigScreen(debugChange.getId());
+//        screenManager.debugMode(screen,debugChange.getState());
+//    }
+//
+//    @Override
+//    public void addBigScreen(Screen screen) {
+//        String id = String.valueOf(screen.getId());
+//        if (!StringUtils.hasLength(id)) {
+//            throw new BizException(ErrCode.ID_BLANK);
+//        }
+//        Path resPath = screenConfig.getBigScreenFilePath(id);
+//        if (!resPath.resolve(screen.getResourceFile()).toFile().exists()) {
+//            throw new BizException(ErrCode.RESOURCE_FILE_NOT_FOUND);
+//        }
+//        Screen s = screenData.findById(screen.getId());
+//        if (s != null) {
+//            throw new BizException(ErrCode.BIG_SCREEN_ALREADY);
+//        }
+//        try {
+//            screen.setCreateAt(System.currentTimeMillis());
+//            screen.setIsDefault(false);
+//            screenData.save(screen);
+//        } catch (Throwable e) {
+//            throw new BizException(ErrCode.ADD_BIG_SCREEN_ERROR, e);
+//        }
+//    }
+//
+//    @Override
+//    public void saveBigScreen(Screen screen) {
+//        String id = String.valueOf(screen.getId());
+//        if (!StringUtils.hasLength(id)) {
+//            throw new BizException(ErrCode.ID_BLANK);
+//        }
+//        Path jarPath = screenConfig.getBigScreenFilePath(id);
+//        if (!jarPath.resolve(screen.getResourceFile()).toFile().exists()) {
+//            throw new BizException(ErrCode.RESOURCE_FILE_NOT_FOUND);
+//        }
+//        Screen oldScreen = getAndCheckBigScreen(screen.getId());
+//        screen = ReflectUtil.copyNoNulls(screen, oldScreen);
+//        try {
+//            screenData.save(screen);
+//        } catch (Throwable e) {
+//            throw new BizException(ErrCode.ADD_BIG_SCREEN_ERROR, e);
+//        }
+//    }
+//
+//    @Override
+//    public void publishStatusChange(PublishChangeBo data) {
+//        Screen screen = getAndCheckBigScreen(data.getId());
+//        if (Screen.STATE_RUNNING.equals(data.getState())) {//发布状态
+//            List<ScreenApi> screenApis=screenApiData.findByScreenId(screen.getId());
+//            if(screenApis==null||screenApis.size()==0){
+//                throw new BizException(ErrCode.API_LIST_BLANK);
+//            }
+//            screen.setState(Screen.STATE_RUNNING);
+//            screenManager.register(screen);
+//            screenManager.publish(screen);
+//        } else {//取消发布
+//            screen.setState(Screen.STATE_STOPPED);
+//            screenManager.unPublish(screen);
+//        }
+//        screenData.save(screen);
+//    }
+//
+//    @Override
+//    public void setDefaultScreen(Long id) {
+//        Screen screen = getAndCheckBigScreen(id);
+//        Screen oldScreen=screenData.findByIsDefault(true);
+//        if(oldScreen!=null){
+//            oldScreen.setIsDefault(false);
+//        }
+//        screenData.save(oldScreen);
+//        screen.setIsDefault(true);
+//        screenData.save(screen);
+//    }
+//
+//    @Override
+//    public void deleteScreen(Long id) {
+//        Screen screen = getAndCheckBigScreen(id);
+//        try {
+//            Path path = Paths.get(String.format("%s/%s", screenConfig.getScreenDir(), id))
+//                    .toAbsolutePath().normalize();
+//            File file = path.toFile();
+//            try {
+//                if (file.isDirectory()) {
+//                    FileUtils.deleteDirectory(file);
+//                } else {
+//                    FileUtils.delete(file);
+//                }
+//            } catch (NoSuchFileException e) {
+//                log.warn("delete big screen resource error", e);
+//            }
+//            screenData.deleteById(screen.getId());
+//        } catch (Throwable e) {
+//            throw new BizException(ErrCode.DELETE_BIG_SCREEN_ERROR, e);
+//        }
+//    }
+//
+//    @Override
+//    public Paging<Screen> getBigScreens(PageRequest<Screen> request) {
+//        return screenData.findAll(request);
+//    }
+//
+//    private Screen getAndCheckBigScreen(Long id) {
+//        Screen oldBigScreen = screenData.findById(id);
+//        if (oldBigScreen == null) {
+//            throw new BizException(ErrCode.BIG_SCREEN_NOT_FOUND);
+//        }
+//        dataOwnerService.checkOwner(oldBigScreen);
+//        return oldBigScreen;
+//    }
+//}

+ 2 - 2
iot-module/pom.xml

@@ -15,7 +15,7 @@
         <module>iot-system</module>
         <module>iot-rule-engine</module>
         <module>iot-message-notify</module>
-        <module>iot-screen</module>
+<!--        <module>iot-screen</module>-->
         <module>iot-openapi</module>
         <module>iot-plugin</module>
         <module>iot-manager</module>
@@ -23,4 +23,4 @@
         <module>iot-generator</module>
     </modules>
 
-</project>
+</project>

+ 5 - 5
pom.xml

@@ -355,11 +355,11 @@
                 <version>${project.version}</version>
             </dependency>
 
-            <dependency>
-                <groupId>cc.iotkit</groupId>
-                <artifactId>iot-screen</artifactId>
-                <version>${project.version}</version>
-            </dependency>
+<!--            <dependency>-->
+<!--                <groupId>cc.iotkit</groupId>-->
+<!--                <artifactId>iot-screen</artifactId>-->
+<!--                <version>${project.version}</version>-->
+<!--            </dependency>-->
 
             <dependency>
                 <groupId>cc.iotkit</groupId>