Search in sources :

Example 1 with EcReptileDynamicBeanBO

use of com.easy.cloud.core.reptile.dynamicbean.pojo.bo.EcReptileDynamicBeanBO in project dq-easy-cloud by dq-open-cloud.

the class EcReptileDynamicBeanServiceImpl method saveReptileDynamicBean.

@Override
public EcBaseServiceResult saveReptileDynamicBean(EcReptileDynamicBeanDTO dynamicBeanDTO) {
    // 1 创建爬虫动态bean逻辑对象
    EcReptileDynamicBeanBO dynamicBeanBO = new EcReptileDynamicBeanBO(dynamicBeanDTO);
    // 2 初始化
    dynamicBeanBO.initSaveReptileDynamicBeanData();
    // 3 数据校验
    dynamicBeanBO.verifySaveReptileDynamicBeanData();
    // 4 数据转换
    EcReptileDynamicBeanEntity dynamicBeanEntity = EcJSONUtils.parseObject(dynamicBeanBO.getReptileDynamicBeanDTO(), EcReptileDynamicBeanEntity.class);
    // 保存
    reptileDynamicBeanDAO.save(dynamicBeanEntity);
    // 返回结果
    return EcBaseServiceResult.newInstanceOfSucResult(dynamicBeanEntity);
}
Also used : EcReptileDynamicBeanBO(com.easy.cloud.core.reptile.dynamicbean.pojo.bo.EcReptileDynamicBeanBO) EcReptileDynamicBeanEntity(com.easy.cloud.core.reptile.dynamicbean.pojo.entity.EcReptileDynamicBeanEntity)

Example 2 with EcReptileDynamicBeanBO

use of com.easy.cloud.core.reptile.dynamicbean.pojo.bo.EcReptileDynamicBeanBO in project dq-easy-cloud by dq-open-cloud.

the class EcReptileDynamicBeanServiceImpl method updateReptileDynamicBean.

@Override
public EcBaseServiceResult updateReptileDynamicBean(EcReptileDynamicBeanDTO dynamicBeanDTO) {
    // 1 创建爬虫动态bean逻辑对象
    EcReptileDynamicBeanBO dynamicBeanBO = new EcReptileDynamicBeanBO(dynamicBeanDTO);
    // 2 初始化
    dynamicBeanBO.initUpdateReptileDynamicBeanData();
    // 3 数据校验
    dynamicBeanBO.verifyUpdateReptileDynamicBeanData();
    EcReptileDynamicBeanEntity reptileDynamicBeanEntity = reptileDynamicBeanDAO.findById(dynamicBeanDTO.getId());
    // 校验
    EcAssert.verifyDataNotExistent(reptileDynamicBeanEntity, "reptileDynamicBeanEntity");
    // 设置
    reptileDynamicBeanEntity.setMatchUrls(dynamicBeanDTO.getMatchUrls());
    // 更新
    reptileDynamicBeanDAO.update(reptileDynamicBeanEntity);
    // 返回结果
    return EcBaseServiceResult.newInstanceOfSucResult(reptileDynamicBeanEntity);
}
Also used : EcReptileDynamicBeanBO(com.easy.cloud.core.reptile.dynamicbean.pojo.bo.EcReptileDynamicBeanBO) EcReptileDynamicBeanEntity(com.easy.cloud.core.reptile.dynamicbean.pojo.entity.EcReptileDynamicBeanEntity)

Aggregations

EcReptileDynamicBeanBO (com.easy.cloud.core.reptile.dynamicbean.pojo.bo.EcReptileDynamicBeanBO)2 EcReptileDynamicBeanEntity (com.easy.cloud.core.reptile.dynamicbean.pojo.entity.EcReptileDynamicBeanEntity)2