¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.lf.server.controller.show; |
| | | |
| | | import com.lf.server.annotation.SysLog; |
| | | import com.lf.server.controller.all.BaseController; |
| | | import com.lf.server.entity.all.ResponseMsg; |
| | | import com.lf.server.entity.all.StaticData; |
| | | import com.lf.server.entity.show.PipelineEntity; |
| | | import com.lf.server.service.show.PipelineService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 管éåæ |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "综åå±ç¤º\\管éåæ") |
| | | @RestController |
| | | @RequestMapping("/pipeline") |
| | | public class PipelineController extends BaseController { |
| | | @Autowired |
| | | PipelineService pipelineService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ç®¡æ®µ") |
| | | @GetMapping(value = "/selectSegNames") |
| | | public ResponseMsg<Object> selectSegNames() { |
| | | try { |
| | | List<PipelineEntity> rs = pipelineService.selectSegNames(); |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ç®¡çº¿åæ") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "pe", value = "管éåæå®ä½ç±»", dataType = "PipelineEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/selectPipeAnalysis") |
| | | public ResponseMsg<Object> selectPipeAnalysis(@RequestBody PipelineEntity pe) { |
| | | try { |
| | | if (null == pe.getGid() || pe.getGid() < 1) { |
| | | return fail("请è¾å
¥ç®¡æ®µID"); |
| | | } |
| | | if (null == pe.getTabs() || 0 == pe.getTabs().size()) { |
| | | return fail("请è¾å
¥è¡¨å"); |
| | | } |
| | | if (!checkTabs(pe.getTabs())) { |
| | | return fail("åå¨éæ³è¡¨å"); |
| | | } |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | for (String tab : pe.getTabs()) { |
| | | List<PipelineEntity> rs = pipelineService.selectPipeAnalysis(tab, pe.getGid()); |
| | | map.put(tab, rs); |
| | | } |
| | | |
| | | return success(map); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ£æ¥è¡¨å |
| | | */ |
| | | private boolean checkTabs(List<String> tabs) { |
| | | for (String tab : tabs) { |
| | | if (!StaticData.PIPE_ANALYSIS_TABS.contains(tab)) { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | } |