XuqmGroup-Server/tenant-service/src/main/java/com/xuqm/tenant/service/SdkAppProvisioningService.java
XuqmGroup 32aa3c0eef feat(tenant): split update/reset ops, remove bootstrap app auto-creation
- 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>
2026-05-22 15:33:20 +08:00

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));
}
}