From f977934f5a42e87dbfc3387316372bb71cf07803 Mon Sep 17 00:00:00 2001 From: XuqmGroup Date: Sat, 16 May 2026 12:10:07 +0800 Subject: [PATCH] feat: remove Update methods from Java SDK, keep only IM and Push --- .../java/com/xuqm/im/sdk/XuqmImServerSdk.java | 267 ------------------ 1 file changed, 267 deletions(-) diff --git a/im-sdk/src/main/java/com/xuqm/im/sdk/XuqmImServerSdk.java b/im-sdk/src/main/java/com/xuqm/im/sdk/XuqmImServerSdk.java index 64448e2..08084bb 100644 --- a/im-sdk/src/main/java/com/xuqm/im/sdk/XuqmImServerSdk.java +++ b/im-sdk/src/main/java/com/xuqm/im/sdk/XuqmImServerSdk.java @@ -41,7 +41,6 @@ public final class XuqmImServerSdk { private final ObjectMapper objectMapper; private final String baseUrl; private final String pushBaseUrl; - private final String updateBaseUrl; private final String appKey; private final String appSecret; private final Supplier bearerTokenSupplier; @@ -53,7 +52,6 @@ public final class XuqmImServerSdk { .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); this.baseUrl = trimTrailingSlash(builder.baseUrl); this.pushBaseUrl = trimTrailingSlash(builder.pushBaseUrl == null ? builder.baseUrl : builder.pushBaseUrl); - this.updateBaseUrl = trimTrailingSlash(builder.updateBaseUrl == null ? builder.baseUrl : builder.updateBaseUrl); this.appKey = Objects.requireNonNull(builder.appKey, "appKey"); this.appSecret = Objects.requireNonNull(builder.appSecret, "appSecret"); this.bearerTokenSupplier = builder.bearerTokenSupplier; @@ -553,202 +551,6 @@ public final class XuqmImServerSdk { return response.data(); } - public Map checkAppUpdate(String platform, int currentVersionCode) { - ApiResponse> response = request( - "GET", - buildUri(updateBaseUrl, "/api/v1/updates/app/check", Map.of( - "appKey", appKey, - "platform", platform, - "currentVersionCode", String.valueOf(currentVersionCode) - )), - null, - publicHeaders(), - new TypeReference<>() {} - ); - return response.data(); - } - - public AppVersionView uploadAppVersion( - String platform, - String versionName, - int versionCode, - String changeLog, - boolean forceUpdate, - Path apkFile) { - Map form = new LinkedHashMap<>(); - form.put("appKey", appKey); - form.put("platform", platform); - form.put("versionName", versionName); - form.put("versionCode", String.valueOf(versionCode)); - if (changeLog != null) { - form.put("changeLog", changeLog); - } - form.put("forceUpdate", String.valueOf(forceUpdate)); - ApiResponse response = multipartRequest( - "POST", - buildUri(updateBaseUrl, "/api/v1/updates/app/upload", Map.of()), - form, - "apkFile", - apkFile, - authorizedHeaders(), - new TypeReference<>() {} - ); - return response.data(); - } - - public UnifiedReleaseResult uploadUnifiedRelease(UnifiedReleaseManifest manifest, Map files) { - Map form = new LinkedHashMap<>(); - form.put("appKey", appKey); - try { - form.put("manifest", objectMapper.writeValueAsString(manifest)); - } catch (JsonProcessingException e) { - throw new ImSdkException("Failed to serialize unified release manifest", e); - } - ApiResponse response = multipartRequest( - "POST", - buildUri(updateBaseUrl, "/api/v1/updates/unified/upload", Map.of()), - form, - files, - authorizedHeaders(), - new TypeReference<>() {} - ); - return response.data(); - } - - public AppVersionView publishAppVersion(String id) { - ApiResponse response = request( - "POST", - buildUri(updateBaseUrl, "/api/v1/updates/app/" + encode(id) + "/publish", Map.of()), - null, - authorizedHeaders(), - new TypeReference<>() {} - ); - return response.data(); - } - - public AppVersionView unpublishAppVersion(String id) { - ApiResponse response = request( - "POST", - buildUri(updateBaseUrl, "/api/v1/updates/app/" + encode(id) + "/unpublish", Map.of()), - null, - authorizedHeaders(), - new TypeReference<>() {} - ); - return response.data(); - } - - public AppVersionView grayAppVersion(String id, boolean enabled, int percent) { - Map body = new LinkedHashMap<>(); - body.put("enabled", enabled); - body.put("percent", percent); - ApiResponse response = request( - "POST", - buildUri(updateBaseUrl, "/api/v1/updates/app/" + encode(id) + "/gray", Map.of()), - body, - authorizedHeaders(), - new TypeReference<>() {} - ); - return response.data(); - } - - public List listAppVersions(String platform) { - ApiResponse> response = request( - "GET", - buildUri(updateBaseUrl, "/api/v1/updates/app/list", Map.of("appKey", appKey, "platform", platform)), - null, - publicHeaders(), - new TypeReference<>() {} - ); - return response.data(); - } - - public RnBundleView checkRnUpdate(String moduleId, String platform, String currentVersion) { - ApiResponse response = request( - "GET", - buildUri(updateBaseUrl, "/api/v1/rn/update/check", Map.of( - "appKey", appKey, - "moduleId", moduleId, - "platform", platform, - "currentVersion", currentVersion - )), - null, - publicHeaders(), - new TypeReference<>() {} - ); - return response.data(); - } - - public RnBundleView uploadRnBundle( - String moduleId, - String platform, - String version, - String minCommonVersion, - String note, - Path bundle) { - Map form = new LinkedHashMap<>(); - form.put("appKey", appKey); - form.put("moduleId", moduleId); - form.put("platform", platform); - form.put("version", version); - if (minCommonVersion != null) { - form.put("minCommonVersion", minCommonVersion); - } - if (note != null) { - form.put("note", note); - } - ApiResponse response = multipartRequest( - "POST", - buildUri(updateBaseUrl, "/api/v1/rn/upload", Map.of()), - form, - "bundle", - bundle, - authorizedHeaders(), - new TypeReference<>() {} - ); - return response.data(); - } - - public RnBundleView publishRnBundle(String id) { - ApiResponse response = request( - "POST", - buildUri(updateBaseUrl, "/api/v1/rn/" + encode(id) + "/publish", Map.of()), - null, - authorizedHeaders(), - new TypeReference<>() {} - ); - return response.data(); - } - - public RnBundleView unpublishRnBundle(String id) { - ApiResponse response = request( - "POST", - buildUri(updateBaseUrl, "/api/v1/rn/" + encode(id) + "/unpublish", Map.of()), - null, - authorizedHeaders(), - new TypeReference<>() {} - ); - return response.data(); - } - - public List listRnBundles(String moduleId, String platform) { - Map query = new LinkedHashMap<>(); - query.put("appKey", appKey); - if (moduleId != null) { - query.put("moduleId", moduleId); - } - if (platform != null) { - query.put("platform", platform); - } - ApiResponse> response = request( - "GET", - buildUri(updateBaseUrl, "/api/v1/rn/list", query), - null, - publicHeaders(), - new TypeReference<>() {} - ); - return response.data(); - } - public List listFriends() { ApiResponse> response = request( "GET", @@ -1867,7 +1669,6 @@ public final class XuqmImServerSdk { public static final class Builder { private String baseUrl = DEFAULT_BASE_URL; private String pushBaseUrl; - private String updateBaseUrl; private String appKey; private String appSecret; private Supplier bearerTokenSupplier; @@ -1884,11 +1685,6 @@ public final class XuqmImServerSdk { return this; } - public Builder updateBaseUrl(String updateBaseUrl) { - this.updateBaseUrl = updateBaseUrl; - return this; - } - public Builder appKey(String appKey) { this.appKey = appKey; return this; @@ -2069,39 +1865,6 @@ public final class XuqmImServerSdk { } } - public record AppVersionView( - String id, - String appKey, - String platform, - String versionName, - int versionCode, - String downloadUrl, - String changeLog, - boolean forceUpdate, - String publishStatus, - String appStoreUrl, - String marketUrl, - boolean grayEnabled, - int grayPercent, - Long createdAt - ) {} - - public record RnBundleView( - String id, - String appKey, - String moduleId, - String platform, - String version, - String bundleUrl, - String md5, - String minCommonVersion, - String note, - String publishStatus, - boolean grayEnabled, - int grayPercent, - Long createdAt - ) {} - public record HistoryQuery( String msgType, String keyword, @@ -2215,36 +1978,6 @@ public final class XuqmImServerSdk { List messageIds ) {} - public record UnifiedReleaseManifest( - List appVersions, - List rnBundles - ) {} - - public record AppUploadItem( - String fileKey, - String platform, - String versionName, - int versionCode, - String changeLog, - boolean forceUpdate, - String appStoreUrl, - String marketUrl - ) {} - - public record RnBundleUploadItem( - String fileKey, - String moduleId, - String platform, - String version, - String minCommonVersion, - String note - ) {} - - public record UnifiedReleaseResult( - List appVersions, - List rnBundles - ) {} - public record CreateGroupRequest( String name, List memberIds,