feat: remove Update methods from Java SDK, keep only IM and Push
这个提交包含在:
父节点
316ecfcd38
当前提交
f977934f5a
@ -41,7 +41,6 @@ public final class XuqmImServerSdk {
|
|||||||
private final ObjectMapper objectMapper;
|
private final ObjectMapper objectMapper;
|
||||||
private final String baseUrl;
|
private final String baseUrl;
|
||||||
private final String pushBaseUrl;
|
private final String pushBaseUrl;
|
||||||
private final String updateBaseUrl;
|
|
||||||
private final String appKey;
|
private final String appKey;
|
||||||
private final String appSecret;
|
private final String appSecret;
|
||||||
private final Supplier<String> bearerTokenSupplier;
|
private final Supplier<String> bearerTokenSupplier;
|
||||||
@ -53,7 +52,6 @@ public final class XuqmImServerSdk {
|
|||||||
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||||
this.baseUrl = trimTrailingSlash(builder.baseUrl);
|
this.baseUrl = trimTrailingSlash(builder.baseUrl);
|
||||||
this.pushBaseUrl = trimTrailingSlash(builder.pushBaseUrl == null ? builder.baseUrl : builder.pushBaseUrl);
|
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.appKey = Objects.requireNonNull(builder.appKey, "appKey");
|
||||||
this.appSecret = Objects.requireNonNull(builder.appSecret, "appSecret");
|
this.appSecret = Objects.requireNonNull(builder.appSecret, "appSecret");
|
||||||
this.bearerTokenSupplier = builder.bearerTokenSupplier;
|
this.bearerTokenSupplier = builder.bearerTokenSupplier;
|
||||||
@ -553,202 +551,6 @@ public final class XuqmImServerSdk {
|
|||||||
return response.data();
|
return response.data();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> checkAppUpdate(String platform, int currentVersionCode) {
|
|
||||||
ApiResponse<Map<String, Object>> 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<String, String> 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<AppVersionView> 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<String, Path> files) {
|
|
||||||
Map<String, String> 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<UnifiedReleaseResult> 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<AppVersionView> 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<AppVersionView> 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<String, Object> body = new LinkedHashMap<>();
|
|
||||||
body.put("enabled", enabled);
|
|
||||||
body.put("percent", percent);
|
|
||||||
ApiResponse<AppVersionView> response = request(
|
|
||||||
"POST",
|
|
||||||
buildUri(updateBaseUrl, "/api/v1/updates/app/" + encode(id) + "/gray", Map.of()),
|
|
||||||
body,
|
|
||||||
authorizedHeaders(),
|
|
||||||
new TypeReference<>() {}
|
|
||||||
);
|
|
||||||
return response.data();
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<AppVersionView> listAppVersions(String platform) {
|
|
||||||
ApiResponse<List<AppVersionView>> 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<RnBundleView> 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<String, String> 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<RnBundleView> 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<RnBundleView> 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<RnBundleView> response = request(
|
|
||||||
"POST",
|
|
||||||
buildUri(updateBaseUrl, "/api/v1/rn/" + encode(id) + "/unpublish", Map.of()),
|
|
||||||
null,
|
|
||||||
authorizedHeaders(),
|
|
||||||
new TypeReference<>() {}
|
|
||||||
);
|
|
||||||
return response.data();
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<RnBundleView> listRnBundles(String moduleId, String platform) {
|
|
||||||
Map<String, String> query = new LinkedHashMap<>();
|
|
||||||
query.put("appKey", appKey);
|
|
||||||
if (moduleId != null) {
|
|
||||||
query.put("moduleId", moduleId);
|
|
||||||
}
|
|
||||||
if (platform != null) {
|
|
||||||
query.put("platform", platform);
|
|
||||||
}
|
|
||||||
ApiResponse<List<RnBundleView>> response = request(
|
|
||||||
"GET",
|
|
||||||
buildUri(updateBaseUrl, "/api/v1/rn/list", query),
|
|
||||||
null,
|
|
||||||
publicHeaders(),
|
|
||||||
new TypeReference<>() {}
|
|
||||||
);
|
|
||||||
return response.data();
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<String> listFriends() {
|
public List<String> listFriends() {
|
||||||
ApiResponse<List<String>> response = request(
|
ApiResponse<List<String>> response = request(
|
||||||
"GET",
|
"GET",
|
||||||
@ -1867,7 +1669,6 @@ public final class XuqmImServerSdk {
|
|||||||
public static final class Builder {
|
public static final class Builder {
|
||||||
private String baseUrl = DEFAULT_BASE_URL;
|
private String baseUrl = DEFAULT_BASE_URL;
|
||||||
private String pushBaseUrl;
|
private String pushBaseUrl;
|
||||||
private String updateBaseUrl;
|
|
||||||
private String appKey;
|
private String appKey;
|
||||||
private String appSecret;
|
private String appSecret;
|
||||||
private Supplier<String> bearerTokenSupplier;
|
private Supplier<String> bearerTokenSupplier;
|
||||||
@ -1884,11 +1685,6 @@ public final class XuqmImServerSdk {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder updateBaseUrl(String updateBaseUrl) {
|
|
||||||
this.updateBaseUrl = updateBaseUrl;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Builder appKey(String appKey) {
|
public Builder appKey(String appKey) {
|
||||||
this.appKey = appKey;
|
this.appKey = appKey;
|
||||||
return this;
|
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(
|
public record HistoryQuery(
|
||||||
String msgType,
|
String msgType,
|
||||||
String keyword,
|
String keyword,
|
||||||
@ -2215,36 +1978,6 @@ public final class XuqmImServerSdk {
|
|||||||
List<String> messageIds
|
List<String> messageIds
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public record UnifiedReleaseManifest(
|
|
||||||
List<AppUploadItem> appVersions,
|
|
||||||
List<RnBundleUploadItem> 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<AppVersionView> appVersions,
|
|
||||||
List<RnBundleView> rnBundles
|
|
||||||
) {}
|
|
||||||
|
|
||||||
public record CreateGroupRequest(
|
public record CreateGroupRequest(
|
||||||
String name,
|
String name,
|
||||||
List<String> memberIds,
|
List<String> memberIds,
|
||||||
|
|||||||
正在加载...
在新工单中引用
屏蔽一个用户