yuxc
2024-07-24 66a397414a20aa592ce24ecd622024bc7744b7a0
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;
@@ -10,11 +12,9 @@
import org.apache.commons.lang3.StringUtils;
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.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
@@ -93,4 +93,40 @@
            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新增,false修改
     * @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;
        }
    }
}