src/main/java/org/edgegallery/appstore/infrastructure/persistence/apackage/PushablePackageRepository.java
public void updateOrSavePushLog(PushablePackageDto packagePo) {
        PushablePackagePo po = pushablePackageMapper.findPushTableByPackageId(packagePo.getPackageId());
        if (po == null) {
            po = new PushablePackagePo(packagePo.getPackageId(), packagePo.getAtpTestReportUrl(), new Date(),
                packagePo.getPushTimes() + 1, packagePo.getSourcePlatform());
            pushablePackageMapper.savePushTable(po);
        } else {
            po.setPushTimes(po.getPushTimes() + 1);
            po.setLatestPushTime(Timestamp.valueOf(
                    new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.SIMPLIFIED_CHINESE).format(new Date())));
            po.setSourcePlatform(packagePo.getSourcePlatform());
            pushablePackageMapper.updatePushTable(po);
        }
    }
/**
     * to save or update push log.
     */
to save or update push log.
to save or update push log .
public void updateOrSavePushLog(PushablePackageDto packagePo) {
        PushablePackagePo po = pushablePackageMapper.findPushTableByPackageId(packagePo.getPackageId());
        if (po == null) {
            po = new PushablePackagePo(packagePo.getPackageId(), packagePo.getAtpTestReportUrl(), new Date(),
                packagePo.getPushTimes() + 1, packagePo.getSourcePlatform());
            pushablePackageMapper.savePushTable(po);
        } else {
            po.setPushTimes(po.getPushTimes() + 1);
            po.setLatestPushTime(Timestamp.valueOf(
                    new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.SIMPLIFIED_CHINESE).format(new Date())));
            po.setSourcePlatform(packagePo.getSourcePlatform());
            pushablePackageMapper.updatePushTable(po);
        }
    }
public void updateOrSavePushLog ( PushablePackageDto packagePo ) { PushablePackagePo po = pushablePackageMapper . findPushTableByPackageId ( packagePo . getPackageId ( ) ) ; if ( po == null ) { po = new PushablePackagePo ( packagePo . getPackageId ( ) , packagePo . getAtpTestReportUrl ( ) , new Date ( ) , packagePo . getPushTimes ( ) + 1 , packagePo . getSourcePlatform ( ) ) ; pushablePackageMapper . savePushTable ( po ) ; } else { po . setPushTimes ( po . getPushTimes ( ) + 1 ) ; po . setLatestPushTime ( Timestamp . valueOf ( new SimpleDateFormat ( "yyyy-MM-dd HH:mm:ss" , Locale . SIMPLIFIED_CHINESE ) . format ( new Date ( ) ) ) ) ; po . setSourcePlatform ( packagePo . getSourcePlatform ( ) ) ; pushablePackageMapper . updatePushTable ( po ) ; } }
to save or update push log.
to save or update push log .