src/main/java/org/edgegallery/appstore/application/inner/AppService.java
@Transactional(rollbackFor = Exception.class)
    public RegisterRespDto registerApp(Release release) {

        Optional<App> existedApp = appRepository.findByAppNameAndProvider(release.getAppBasicInfo().getAppName(),
            release.getAppBasicInfo().getProvider());
        App app;
        if (existedApp.isPresent()) {
            app = existedApp.get();
            app.checkReleases(release);
            app.upload(release);
        } else {
            String appId = appRepository.generateAppId();
            app = new App(appId, release);
        }
        release.setAppIdValue(app.getAppId());
        appRepository.store(app);
        packageRepository.storeRelease(release);
        return RegisterRespDto.builder().appName(release.getAppBasicInfo().getAppName()).appId(app.getAppId())
            .packageId(release.getPackageId()).provider(app.getProvider())
            .version(release.getAppBasicInfo().getVersion()).build();
    }
/**
     * register app.
     *
     * @param release use object of release to register.
     */
register app.
@param release use object of release to register.
register app . @param release use object of release to register .
@Transactional(rollbackFor = Exception.class)
    public RegisterRespDto registerApp(Release release) {
        Optional<App> existedApp = appRepository.findByAppNameAndProvider(release.getAppBasicInfo().getAppName(),
            release.getAppBasicInfo().getProvider());
        App app;
        if (existedApp.isPresent()) {
            app = existedApp.get();
            app.checkReleases(release);
            app.upload(release);
        } else {
            String appId = appRepository.generateAppId();
            app = new App(appId, release);
        }
        release.setAppIdValue(app.getAppId());
        appRepository.store(app);
        packageRepository.storeRelease(release);
        return RegisterRespDto.builder().appName(release.getAppBasicInfo().getAppName()).appId(app.getAppId())
            .packageId(release.getPackageId()).provider(app.getProvider())
            .version(release.getAppBasicInfo().getVersion()).build();
    }
@ Transactional ( rollbackFor = Exception . class ) public RegisterRespDto registerApp ( Release release ) { Optional < App > existedApp = appRepository . findByAppNameAndProvider ( release . getAppBasicInfo ( ) . getAppName ( ) , release . getAppBasicInfo ( ) . getProvider ( ) ) ; App app ; if ( existedApp . isPresent ( ) ) { app = existedApp . get ( ) ; app . checkReleases ( release ) ; app . upload ( release ) ; } else { String appId = appRepository . generateAppId ( ) ; app = new App ( appId , release ) ; } release . setAppIdValue ( app . getAppId ( ) ) ; appRepository . store ( app ) ; packageRepository . storeRelease ( release ) ; return RegisterRespDto . builder ( ) . appName ( release . getAppBasicInfo ( ) . getAppName ( ) ) . appId ( app . getAppId ( ) ) . packageId ( release . getPackageId ( ) ) . provider ( app . getProvider ( ) ) . version ( release . getAppBasicInfo ( ) . getVersion ( ) ) . build ( ) ; }
register app.
register app .