From 613a6c5414c5294c8078cabb1d9d818be62c12e6 Mon Sep 17 00:00:00 2001 From: yuxc <yuxc@vci-tech.com> Date: 星期五, 26 七月 2024 16:10:53 +0800 Subject: [PATCH] 新增平台链接类型的删除,一致性检查,修复,创建视图接口 --- Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsLinkTypeController.java | 117 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 113 insertions(+), 4 deletions(-) diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsLinkTypeController.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsLinkTypeController.java index 2ab88b8..6400b16 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsLinkTypeController.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsLinkTypeController.java @@ -1,5 +1,7 @@ package com.vci.web.controller; +import com.vci.corba.common.PLException; +import com.vci.corba.omd.ltm.LinkType; import com.vci.pagemodel.OsBtmTypeAttributeVO; import com.vci.pagemodel.OsLinkTypeAttributeVO; import com.vci.pagemodel.OsLinkTypeVO; @@ -14,12 +16,13 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.CollectionUtils; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.stream.Collectors; /** @@ -119,4 +122,110 @@ return BaseResult.success(); } } + + + /** + * 閾炬帴绫诲瀷鐨勫垪琛� + * + * @return 閾炬帴绫诲瀷鐨勬樉绀哄璞� + */ + @GetMapping("/gridLink") + public BaseResult<List<LinkType>> gridLink(){ + try { + return linkTypeService.gridLink(); + } catch (PLException e) { + BaseResult objectBaseResult = new BaseResult<>(); + objectBaseResult.setCode(Integer.parseInt(e.code)); + objectBaseResult.setMsg(Arrays.toString(e.messages)); + return objectBaseResult; + } + } + + /** + * 閾炬帴绫诲瀷淇濆瓨 + * linkType 閾炬帴绫诲瀷鐨勪繚瀛樺璞� + * addFlag 鏄惁涓烘柊澧� true鏂板锛宖alse淇敼 + * @return 淇濆瓨缁撴灉 + */ + @GetMapping("/addAndEditLink") + public BaseResult addAndEditLink(@RequestBody LinkType linkType, Boolean addFlag){ + try { + return linkTypeService.addAndEditLink(linkType, addFlag); + } catch (PLException e) { + BaseResult objectBaseResult = new BaseResult<>(); + objectBaseResult.setCode(Integer.parseInt(e.code)); + objectBaseResult.setMsg(Arrays.toString(e.messages)); + return objectBaseResult; + } + } + /** + * 閾炬帴绫诲瀷鍒犻櫎 + * linkType 閾炬帴绫诲瀷瀵硅薄 + * @return 鍒犻櫎缁撴灉 + */ + @DeleteMapping("/deleteLink") + public BaseResult deleteLink(@RequestBody LinkType linkType){ + try { + return linkTypeService.deleteLink(linkType); + } catch (PLException e) { + BaseResult objectBaseResult = new BaseResult<>(); + objectBaseResult.setCode(Integer.parseInt(e.code)); + objectBaseResult.setMsg(Arrays.toString(e.messages)); + return objectBaseResult; + } + } + + /** + * 涓�鑷存�ф鏌� + * @return 鍒犻櫎缁撴灉 + */ + @GetMapping("/checkLinkType") + public BaseResult checkLinkType(){ + try { + return linkTypeService.checkLinkType(); + } catch (PLException e) { + BaseResult objectBaseResult = new BaseResult<>(); + objectBaseResult.setCode(Integer.parseInt(e.code)); + objectBaseResult.setMsg(Arrays.toString(e.messages)); + return objectBaseResult; + } + } + + /** + * 涓�鑷存�ф鏌ヤ慨澶嶆暟鎹簱琛� + * repairData 闇�瑕佷慨澶嶇殑鏁版嵁 + * @return 淇缁撴灉 + */ + @PostMapping("/repairTable") + public BaseResult repairTable(@RequestBody String repairData){ + try { + return linkTypeService.repairTable(repairData); + } catch (PLException e) { + BaseResult objectBaseResult = new BaseResult<>(); + objectBaseResult.setCode(Integer.parseInt(e.code)); + objectBaseResult.setMsg(Arrays.toString(e.messages)); + return objectBaseResult; + } catch (IOException e) { + BaseResult objectBaseResult = new BaseResult<>(); + objectBaseResult.setCode(500); + objectBaseResult.setMsg(e.getMessage()); + return objectBaseResult; + } + } + + /** + * 鍒涘缓瑙嗗浘 + * @return 鍒涘缓缁撴灉 + */ + @PostMapping("/createView") + public BaseResult createView(){ + try { + return linkTypeService.createView(); + } catch (PLException e) { + BaseResult objectBaseResult = new BaseResult<>(); + objectBaseResult.setCode(Integer.parseInt(e.code)); + objectBaseResult.setMsg(Arrays.toString(e.messages)); + return objectBaseResult; + } + } } -- Gitblit v1.9.3