whycxzp
2022-12-29 69d06a50a3bb3ede0bbf86752c147f9a7f44008b
台站单文件删除更新
2个文件已修改
10 ■■■■ 已修改文件
src/main/java/com/whyc/controller/StationInfoController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/StationInfoService.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/controller/StationInfoController.java
@@ -51,7 +51,7 @@
    @ApiOperation(value = "移除台站下文件(单个文件)")
    @GetMapping("delFileFromStation")
    public Response delFileFromStation(@RequestParam String stationName,@RequestParam(required = false) String FilePath){
        return service.delFileFromStation(stationName,FilePath);
    public Response delFileFromStation(@RequestParam String stationName,@RequestParam(required = false) Integer fileId){
        return service.delFileFromStation(stationName,fileId);
    }
}
src/main/java/com/whyc/service/StationInfoService.java
@@ -317,7 +317,7 @@
    }
    //移除台站下文件(单个文件)
    @Transactional
    public Response delFileFromStation(String stationName, String filePath) {
    public Response delFileFromStation(String stationName, Integer fileId) {
        //1.先查出机房的id
        Integer stationId=mapper.selectIdByName(stationName);
        if(stationId==null){
@@ -325,8 +325,8 @@
        }else if(stationId==0){
            return new Response().set(1,false,"机房下不存在文件");
        }else {
            //2.查出文件对应的文件id
            Integer fileId=infoMapper.selectFileId(stationId,filePath);
            /*//2.查出文件对应的文件id
            Integer fileId=infoMapper.selectFileId(stationId,filePath);*/
            if(fileId==null||fileId==0){
                return new Response().set(1,false,"文件不存在");
            }else{