Skip to content

Commit e04dd27

Browse files
author
fengyikai
committed
Merge branch 'feature/migrate-common-internal' into trunk
2 parents 1a887c5 + b8dc4e3 commit e04dd27

3,879 files changed

Lines changed: 939986 additions & 17143 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,28 @@ secretKey, secretId 是用于标识 API 调用者的身份,secretKey 是用
3333

3434
# 示例
3535

36-
```js
36+
```java
3737
public static void main(String[] args) {
38-
//证书
39-
Credential credential = new Credential("secretKey", "signStr", "region");
40-
ListUsersClient client = new ListUsersClient(credential);
41-
ListUsersRequest request = new ListUsersRequest();
42-
request.setMaxItems(20);
43-
38+
// 创建凭证
39+
Credential credential = new Credential("YOUR_SECRET_KEY", "YOUR_SIGN_STR", "YOUR_REGION");
40+
41+
// 创建客户端
42+
AssumeRoleClient client = new AssumeRoleClient(credential);
43+
44+
// 创建请求对象
45+
AssumeRoleRequest request = new AssumeRoleRequest();
46+
// 设置请求参数
47+
request.setRoleSessionName("Test");
4448
try {
45-
ListUsersResponse ListUsersResponse = client.doGet("iam.api.ksyun.com", request);
46-
log.info("ListUsers result:{}", JSON.toJSON(ListUsersResponse));
47-
} catch (Exception e) {
48-
log.error("ListUsers occur error", e);
49+
AssumeRoleResponse response = client.doPostSend("sts.api.ksyun.com", request);
50+
if (response != null) {
51+
System.out.println("请求成功: " + JSON.toJSON(response));
52+
} else {
53+
System.out.println("响应为空");
54+
}
55+
} catch (RuntimeException e) {
56+
// SDK 已经格式化好错误信息,直接输出即可
57+
System.err.println(e.getMessage());
4958
}
5059
}
5160
```

pom.xml

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,16 @@
7272
<version>2.12.2</version>
7373
</dependency>
7474

75+
<dependency>
76+
<groupId>com.fasterxml.jackson.core</groupId>
77+
<artifactId>jackson-databind</artifactId>
78+
<version>2.12.2</version>
79+
</dependency>
80+
7581
<dependency>
7682
<groupId>org.projectlombok</groupId>
7783
<artifactId>lombok</artifactId>
78-
<version>1.16.16</version>
84+
<version>1.18.30</version>
7985
</dependency>
8086
<dependency>
8187
<groupId>commons-codec</groupId>
@@ -117,28 +123,11 @@
117123
<version>3.5</version>
118124
</dependency>
119125

120-
<dependency>
121-
<groupId>com.ksyun</groupId>
122-
<artifactId>ksc-sdk-java-core</artifactId>
123-
<version>0.3.31</version>
124-
</dependency>
125-
126-
<dependency>
127-
<groupId>com.ksyun</groupId>
128-
<artifactId>ksyun-sdk-java-common</artifactId>
129-
<version>0.0.13</version>
130-
</dependency>
131-
132-
<dependency>
133-
<groupId>com.amazonaws</groupId>
134-
<artifactId>aws-java-sdk-core</artifactId>
135-
<version>1.12.783</version>
136-
</dependency>
137-
126+
<!-- AWS SDK v2 - 升级到最新稳定版本 -->
138127
<dependency>
139128
<groupId>software.amazon.awssdk</groupId>
140129
<artifactId>aws-core</artifactId>
141-
<version>2.20.0</version>
130+
<version>2.40.12</version>
142131
</dependency>
143132

144133
</dependencies>
@@ -158,6 +147,13 @@
158147
<configuration>
159148
<source>8</source>
160149
<target>8</target>
150+
<annotationProcessorPaths>
151+
<path>
152+
<groupId>org.projectlombok</groupId>
153+
<artifactId>lombok</artifactId>
154+
<version>1.18.30</version>
155+
</path>
156+
</annotationProcessorPaths>
161157
</configuration>
162158
</plugin>
163159

0 commit comments

Comments
 (0)