| | |
| | | import com.zt.life.modules.mainPart.taskReliability.model.ModelLine; |
| | | import com.zt.life.modules.mainPart.taskReliability.model.ModelRbd; |
| | | import com.zt.life.modules.mainPart.taskReliability.service.ModelLineService; |
| | | import com.zt.life.modules.mainPart.taskReliability.service.ModelRbdNodeService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | private ModelLineService modelLineService; |
| | | |
| | | @Autowired |
| | | private ModelRbdNodeService modelRbdNodeService; |
| | | |
| | | @Autowired |
| | | private PythonLib pythonLib; |
| | | |
| | | /* |
| | | @GetMapping("callPythonCalc") |
| | | @ApiOperation("信息") |
| | | public Result callPythonCalc() { |
| | |
| | | |
| | | return result; |
| | | } |
| | | */ |
| | | |
| | | /* |
| | | @GetMapping("getPythonCalcResult") |
| | | @ApiOperation("信息") |
| | | public Result<String> getPythonCalcResult() { |
| | |
| | | |
| | | return Result.ok(result); |
| | | } |
| | | */ |
| | | |
| | | @GetMapping("page") |
| | | @ApiOperation("分页") |
| | |
| | | ValidatorUtils.validateEntity(modelRbd, AddGroup.class, DefaultGroup.class); |
| | | modelRbd.setContent(modelRbd.getContent().replace(modelRbd.getUrlPref(), URL_REPLACE_STR)); |
| | | modelRbd.setContent(modelRbd.getContent().replaceAll(TOKEN_REPLACE_REGEX, TOKEN_REPLACE_STR)); |
| | | modelRbdNodeService.saveNodeArr(modelRbd); |
| | | modelLineService.insert(modelRbd); |
| | | |
| | | return Result.ok(); |
| | | } |
| | | |
| | |
| | | ValidatorUtils.validateEntity(modelRbd, UpdateGroup.class, DefaultGroup.class); |
| | | modelRbd.setContent(modelRbd.getContent().replace(modelRbd.getUrlPref(), URL_REPLACE_STR)); |
| | | modelRbd.setContent(modelRbd.getContent().replaceAll(TOKEN_REPLACE_REGEX, TOKEN_REPLACE_STR)); |
| | | modelRbdNodeService.saveNodeArr(modelRbd); |
| | | modelLineService.update(modelRbd); |
| | | |
| | | return Result.ok(); |
| | |
| | | @ApiOperation("解析") |
| | | @LogOperation("解析") |
| | | public Result analyze(@RequestBody ModelRbd modelRbd) { |
| | | modelLineService.update(modelRbd); |
| | | update(modelRbd); |
| | | boolean result = modelLineService.analyze(modelRbd); |
| | | return result ? Result.ok() : Result.error("解析失败"); |
| | | } |