src/main/java/org/edgegallery/appstore/application/inner/PackageService.java
@Transactional(rollbackFor = Exception.class)
    public void publishAppAndPackage(String appId, Release release, PublishAppReqDto publishAppReq) {
        App app = appRepository.find(appId)
            .orElseThrow(() -> new EntityNotFoundException(App.class, appId, ResponseConst.RET_APP_NOT_FOUND));
        if (app.getStatus() != EnumAppStatus.Published) {
            app.setStatus(EnumAppStatus.Published);
            app.setFree(publishAppReq.isFree());
            app.setPrice(publishAppReq.getPrice());
            appRepository.store(app);
        }
        release.setStatus(EnumPackageStatus.Published);
        packageRepository.updateRelease(release);
    }
/**
     * update app and package to published status.
     *
     * @param appId app id
     * @param release a package
     * @param publishAppReq publish request body
     */
update app and package to published status.
@param appId app id
@param release a package
@param publishAppReq publish request body
update app and package to published status . @param appId app id @param release a package @param publishAppReq publish request body
@Transactional(rollbackFor = Exception.class)
    public void publishAppAndPackage(String appId, Release release, PublishAppReqDto publishAppReq) {
        App app = appRepository.find(appId)
            .orElseThrow(() -> new EntityNotFoundException(App.class, appId, ResponseConst.RET_APP_NOT_FOUND));
        if (app.getStatus() != EnumAppStatus.Published) {
            app.setStatus(EnumAppStatus.Published);
            app.setFree(publishAppReq.isFree());
            app.setPrice(publishAppReq.getPrice());
            appRepository.store(app);
        }
        release.setStatus(EnumPackageStatus.Published);
        packageRepository.updateRelease(release);
    }
@ Transactional ( rollbackFor = Exception . class ) public void publishAppAndPackage ( String appId , Release release , PublishAppReqDto publishAppReq ) { App app = appRepository . find ( appId ) . orElseThrow ( ( ) -> new EntityNotFoundException ( App . class , appId , ResponseConst . RET_APP_NOT_FOUND ) ) ; if ( app . getStatus ( ) != EnumAppStatus . Published ) { app . setStatus ( EnumAppStatus . Published ) ; app . setFree ( publishAppReq . isFree ( ) ) ; app . setPrice ( publishAppReq . getPrice ( ) ) ; appRepository . store ( app ) ; } release . setStatus ( EnumPackageStatus . Published ) ; packageRepository . updateRelease ( release ) ; }
update app and package to published status.
update app and package to published status .