Skip to content

Commit 304d1c4

Browse files
author
liyan.90210
committed
feat auto update sdk
1 parent 552558c commit 304d1c4

34 files changed

+5396
-1545
lines changed

Changelog

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
Change log
22

3+
2025-05-15 Bumped to version v1.0.221
4+
- Updated apis for vikingDB/vod
5+
36
2025-05-08 Bumped to version v1.0.220
47
- Updated apis for imagex/sms
58

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// Code generated by protoc-gen-volcengine-sdk
2+
// source: createHlsDecryptionKey
3+
// DO NOT EDIT!
4+
5+
package com.volcengine.example.vod.play;
6+
7+
import com.volcengine.service.vod.IVodService;
8+
import com.volcengine.service.vod.impl.VodServiceImpl;
9+
public class VodCreateHlsDecryptionKeyDemo {
10+
11+
public static void main(String[] args) throws Exception {
12+
// Create a VOD instance in the specified region.
13+
// IVodService vodService = VodServiceImpl.getInstance("cn-north-1");
14+
IVodService vodService = VodServiceImpl.getInstance();
15+
16+
// Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65641.
17+
// The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed.
18+
// During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account.
19+
// vodService.setAccessKey("your ak");
20+
// vodService.setSecretKey("your sk");
21+
22+
try {
23+
com.volcengine.service.vod.model.request.VodCreateHlsDecryptionKeyRequest.Builder reqBuilder = com.volcengine.service.vod.model.request.VodCreateHlsDecryptionKeyRequest.newBuilder();
24+
reqBuilder.setSpaceName("your SpaceName");
25+
26+
com.volcengine.service.vod.model.response.VodCreateHlsDecryptionKeyResponse resp = vodService.createHlsDecryptionKey(reqBuilder.build());
27+
if (resp.getResponseMetadata().hasError()) {
28+
System.out.println(resp.getResponseMetadata().getError());
29+
System.exit(-1);
30+
}
31+
System.out.println(resp);
32+
} catch (Exception e) {
33+
e.printStackTrace();
34+
}
35+
}
36+
}

example/src/main/java/com/volcengine/example/vod/play/VodGetPlayInfoDemo.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ public static void main(String[] args) throws Exception {
4343
reqBuilder.setGetAll(false);
4444
reqBuilder.setDigitalWatermarkType("your DigitalWatermarkType");
4545
reqBuilder.setUserToken("your UserToken");
46+
reqBuilder.setDrmKEK("your DrmKEK");
47+
reqBuilder.setJSPlayer("your JSPlayer");
4648

4749
com.volcengine.service.vod.model.response.VodGetPlayInfoResponse resp = vodService.getPlayInfo(reqBuilder.build());
4850
if (resp.getResponseMetadata().hasError()) {

volc-sdk-java/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<modelVersion>4.0.0</modelVersion>
66
<groupId>com.volcengine</groupId>
7-
<version>1.0.220</version>
7+
<version>1.0.221</version>
88
<artifactId>volc-sdk-java</artifactId>
99

1010
<name>volc-sdk-java</name>

volc-sdk-java/src/main/java/com/volcengine/model/response/ImageRiskDetectionResponse.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ public static class ImageDetectionData {
4040
private List<ImageContentFrameDetail> ocrDetails;
4141
@JSONField(name = "QrcodeDetails")
4242
private List<QrcodeData> qrcodeDetails;
43+
@JSONField(name = "PassThrough")
44+
private String passThrough;
4345
}
4446

4547
@Data

volc-sdk-java/src/main/java/com/volcengine/service/vikingDB/Index.java

Lines changed: 112 additions & 114 deletions
Large diffs are not rendered by default.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package com.volcengine.service.vikingDB.common;
2+
3+
import com.volcengine.service.vikingDB.VikingDBException;
4+
import lombok.Data;
5+
6+
import java.util.HashMap;
7+
import java.util.List;
8+
9+
@Data
10+
public class PageDataObject {
11+
private List<DataObject> items = null;
12+
private HashMap<String, Object> pagination = null;
13+
private Integer isBuild = 0;
14+
15+
public PageDataObject() {
16+
}
17+
18+
public PageDataObject setItems(List<DataObject> items) {
19+
this.items = items;
20+
return this;
21+
}
22+
23+
public PageDataObject setPagination(HashMap<String, Object> pagination) {
24+
this.pagination = pagination;
25+
return this;
26+
}
27+
28+
public PageDataObject build() throws Exception {
29+
VikingDBException vikingDBException = new VikingDBException(1000030, null, "Params does not exist");
30+
if (this.items == null) {
31+
throw vikingDBException.getErrorCodeException(1000030, null, "items does not exist");
32+
} else {
33+
this.isBuild = 1;
34+
return this;
35+
}
36+
}
37+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package com.volcengine.service.vikingDB.common;
2+
import lombok.Data;
3+
4+
@Data
5+
public class RawOrderParam {
6+
private String text;
7+
private String image; // 或 String base64Image;
8+
private Boolean needInstruction;
9+
// 其他 SearchWithMultiModalParam 和 SearchByTextParam 共有的字段也可以考虑放在这里
10+
}

volc-sdk-java/src/main/java/com/volcengine/service/vikingDB/common/SearchByIdParam.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
import com.volcengine.service.vikingDB.VikingDBException;
44
import lombok.Data;
55

6+
import java.util.ArrayList;
7+
import java.util.Collections;
8+
import java.util.HashMap;
69
import java.util.List;
710
import java.util.Map;
811

@@ -86,4 +89,26 @@ public SearchByIdParam build() throws Exception {
8689
return this;
8790
}
8891
}
92+
93+
public HashMap<String, Object> toMap() {
94+
HashMap<String, Object> map = new HashMap<>();
95+
List<Object> idList = new ArrayList<>();
96+
idList.add(id);
97+
HashMap<String, Object> orderById = new HashMap<>();
98+
orderById.put("primary_keys", idList);
99+
map.put("order_by_vector", orderById);
100+
101+
// 通用字段处理
102+
map.put("limit", limit);
103+
map.put("partition", partition);
104+
if (primaryKeyIn != null) map.put("primary_key_in", primaryKeyIn);
105+
if (primaryKeyNotIn != null) map.put("primary_key_not_in", primaryKeyNotIn);
106+
if (postProcessInputLimit != null) map.put("post_process_input_limit", postProcessInputLimit);
107+
if (postProcessOps != null) map.put("post_process_ops", postProcessOps);
108+
if (outputFields != null) map.put("output_fields", outputFields);
109+
if (filter != null) map.put("filter", filter);
110+
if (denseWeight != null) map.put("dense_weight", denseWeight);
111+
112+
return map;
113+
}
89114
}

volc-sdk-java/src/main/java/com/volcengine/service/vikingDB/common/SearchByTextParam.java

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import com.volcengine.service.vikingDB.VikingDBException;
44
import lombok.Data;
55

6+
import java.util.HashMap;
67
import java.util.List;
78
import java.util.Map;
89

@@ -91,4 +92,46 @@ public SearchByTextParam build() throws Exception {
9192
return this;
9293
}
9394
}
95+
96+
public HashMap<String, Object> toMap() {
97+
HashMap<String, Object> search = new HashMap<>();
98+
HashMap<String, Object> orderByRaw = new HashMap<>();
99+
100+
// 假设 getText() 返回一个包含文本的对象,而实际文本通过该对象的某个方法获取
101+
// 如果 getText() 直接返回 String,则直接使用 this.getText()
102+
orderByRaw.put("text", this.getText().getText());
103+
// 如果 SearchByTextParam 直接持有图片信息,也应在此处添加
104+
// 例如: if (this.getImage() != null) { orderByRaw.put("image", this.getImage()); }
105+
// 目前的 searchByTextParam 似乎只处理文本,与 searchWithMultiModalParam 不同
106+
107+
search.put("order_by_raw", orderByRaw);
108+
search.put("limit", this.getLimit());
109+
search.put("partition", this.getPartition());
110+
111+
if (this.getOutputFields() != null) {
112+
search.put("output_fields", this.getOutputFields());
113+
}
114+
if (this.getFilter() != null) {
115+
search.put("filter", this.getFilter());
116+
}
117+
if (this.getDenseWeight() != null) {
118+
search.put("dense_weight", this.getDenseWeight());
119+
}
120+
if (this.getNeedInstruction() != null) {
121+
search.put("need_instruction", this.getNeedInstruction());
122+
}
123+
if (this.getPrimaryKeyIn() != null) {
124+
search.put("primary_key_in", this.getPrimaryKeyIn());
125+
}
126+
if (this.getPrimaryKeyNotIn() != null) {
127+
search.put("primary_key_not_in", this.getPrimaryKeyNotIn());
128+
}
129+
if (this.getPostProcessInputLimit() != null) {
130+
search.put("post_process_input_limit", this.getPostProcessInputLimit());
131+
}
132+
if (this.getPostProcessOps() != null) {
133+
search.put("post_process_ops", this.getPostProcessOps());
134+
}
135+
return search;
136+
}
94137
}

0 commit comments

Comments
 (0)