管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2022-11-25 64f3ca55961af31696b206a225ad0ee98247a8b2
src/main/java/com/lf/server/controller/all/BaseUploadController.java
@@ -7,8 +7,10 @@
import com.lf.server.entity.data.VerEntity;
import com.lf.server.entity.sys.DepEntity;
import com.lf.server.entity.sys.UserEntity;
import com.lf.server.helper.StringHelper;
import com.lf.server.service.all.BaseUploadService;
import com.lf.server.service.data.DirService;
import com.lf.server.service.data.MetaService;
import com.lf.server.service.data.VerService;
import com.lf.server.service.sys.DepService;
import com.lf.server.service.sys.TokenService;
@@ -16,10 +18,7 @@
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -38,6 +37,9 @@
    @Autowired
    VerService verService;
    @Autowired
    MetaService metaService;
    @Autowired
    protected TokenService tokenService;
@@ -156,4 +158,26 @@
            return fail(ex.getMessage(), null);
        }
    }
    @SysLog()
    @ApiOperation(value = "删除元数据")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "ids", value = "ID数组", dataType = "Integer", paramType = "query", example = "1,2")
    })
    @GetMapping(value = "/deleteMetas")
    public ResponseMsg<Integer> deleteMetas(@RequestParam List<Integer> ids) {
        try {
            if (ids == null || ids.isEmpty()) {
                return fail("id数组不能为空", -1);
            }
            // int count = metaService.deletes(ids)
            String idStr = StringHelper.join(ids, ",");
            int count = metaService.deleteCascade(idStr);
            return success(count);
        } catch (Exception ex) {
            return fail(ex.getMessage(), -1);
        }
    }
}