| | |
| | | @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) { |
| | | public ResponseMsg<Object> insertForPub(@RequestBody PubEntity entity, HttpServletRequest req) { |
| | | try { |
| | | if (null == entity || null == entity.getIds() || entity.getIds().isEmpty()) { |
| | | return fail("实体类为空或找不到元数据ID", 0); |
| | |
| | | } |
| | | |
| | | String method = getConvertMethod(entity.getType()); |
| | | int count = publishService.postForPub(entity, method, req); |
| | | long count = publishService.postForPub(entity, method, req); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | |
| | | private String getConvertMethod(String type) throws Exception { |
| | | switch (type) { |
| | | case "DOM": |
| | | return "Convert/ToTiles"; |
| | | return "/Convert/ToTiles"; |
| | | case "MPT": |
| | | case "3DML": |
| | | return "Convert/ToSG"; |
| | | return "/Convert/ToSG"; |
| | | case "BIM": |
| | | return "Convert/ToTileset"; |
| | | return "/Convert/ToTileset"; |
| | | default: |
| | | throw new Exception("数据类型不匹配"); |
| | | } |