- SystemUpdateService: split runUpdate() (pull+recreate) and runReset() (recreate only) - SystemUpdateController: add POST /api/system/reset endpoint - SdkAppProvisioningService: remove ensureBootstrapApp/ensureApp/ensureFeatureDefaults; resolveApp now throws 404 instead of auto-creating - SdkAppInitializer: remove ensureBootstrapApp call; only runs one-time migration marking existing system apps as isDefault=true - PrivateTenantBootstrapInitializer: remove bootstrap app creation; only ensures admin tenant account exists Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
25 行
783 B
Java
25 行
783 B
Java
package com.xuqm.tenant.service;
|
|
|
|
import com.xuqm.common.exception.BusinessException;
|
|
import com.xuqm.tenant.entity.AppEntity;
|
|
import com.xuqm.tenant.repository.AppRepository;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
@Service
|
|
public class SdkAppProvisioningService {
|
|
|
|
private final AppRepository appRepository;
|
|
|
|
public SdkAppProvisioningService(AppRepository appRepository) {
|
|
this.appRepository = appRepository;
|
|
}
|
|
|
|
@Transactional
|
|
public AppEntity resolveApp(String appKey) {
|
|
return appRepository.findByAppKey(appKey)
|
|
.or(() -> appRepository.findById(appKey))
|
|
.orElseThrow(() -> new BusinessException(404, "App not found: " + appKey));
|
|
}
|
|
}
|