Просмотр исходного кода

协议添加python 报错提示

785834757 2 лет назад
Родитель
Сommit
aa7ad294ed

+ 4 - 0
src/main/java/com/ydtech/modules/protocol/service/impl/PtlCrawlerApiServiceImpl.java

@@ -2,6 +2,7 @@ package com.ydtech.modules.protocol.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ydtech.exception.SystemException;
 import com.ydtech.modules.protocol.dao.PtlCrawlerApiMapper;
 import com.ydtech.modules.protocol.entity.constants.PtlCrawlerApiType;
 import com.ydtech.modules.protocol.entity.po.PtlCrawlerApi;
@@ -34,6 +35,9 @@ public class PtlCrawlerApiServiceImpl extends ServiceImpl<PtlCrawlerApiMapper, P
                 .eq(PtlCrawlerApi::getTemplateId, templateId)
                 .eq(PtlCrawlerApi::getApiType, ptlCrawlerApiType.getCode());
         PtlCrawlerApi one = getOne(w);
+        if(one == null){
+            throw new SystemException("没有找到python Api 模版");
+        }
         return one.getUrl();
     }