管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2023-03-21 261d8ff65cfcd475aa67ed20022570b8f5c45f40
src/main/java/com/lf/server/controller/data/PublishController.java
@@ -136,8 +136,8 @@
    @ApiImplicitParams({
            @ApiImplicitParam(name = "entity", value = "实体类", dataType = "PubEntity", paramType = "body")
    })
    @PostMapping(value = "/insert", produces = "application/json; charset=UTF-8")
    public ResponseMsg<Integer> insertForPub(@RequestBody PubEntity entity, HttpServletRequest req) {
    @PostMapping(value = "/insertForPub", produces = "application/json; charset=UTF-8")
    public ResponseMsg<Object> insertForPub(@RequestBody PubEntity entity, HttpServletRequest req) {
        try {
            if (null == entity || null == entity.getIds() || entity.getIds().isEmpty()) {
                return fail("实体类为空或找不到元数据ID", 0);
@@ -152,7 +152,8 @@
                entity.setToken(WebHelper.getToken(req));
            }
            int count = publishService.insertForPub(entity);
            String method = getConvertMethod(entity.getType());
            long count = publishService.postForPub(entity, method, req);
            return success(count);
        } catch (Exception ex) {
@@ -160,6 +161,23 @@
        }
    }
    /**
     * 获取转换方法
     */
    private String getConvertMethod(String type) throws Exception {
        switch (type) {
            case "DOM":
                return "/Convert/ToTiles";
            case "MPT":
            case "3DML":
                return "/Convert/ToSG";
            case "BIM":
                return "/Convert/ToTileset";
            default:
                throw new Exception("数据类型不匹配");
        }
    }
    @SysLog()
    @ApiOperation(value = "删除多条")
    @ApiImplicitParams({