Skip to content

Commit 1a90a52

Browse files
authored
Merge pull request #55 from ZJUCJH/main
[feature] 1.鸿蒙离线支持payload;2.鸿蒙在线支持slotType;3.GtHttpClient支持设置maxConnTotal和maxConnPerRoute
2 parents 99298da + 29104ef commit 1a90a52

File tree

7 files changed

+56
-6
lines changed

7 files changed

+56
-6
lines changed

CHANGES.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Release Notes
22

3+
## 1.0.5.0
4+
5+
### update
6+
7+
* 鸿蒙厂商通道通知消息click_type新增支持payload
8+
* 鸿蒙个推通道通知消息支持设置通知渠道类型slotType
9+
* GtHttpClient支持设置maxConnTotal和maxConnPerRoute
10+
311
## 1.0.4.0
412

513
### update

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<dependency>
2323
<groupId>com.getui.push</groupId>
2424
<artifactId>restful-sdk</artifactId>
25-
<version>1.0.4.0</version>
25+
<version>1.0.5.0</version>
2626
</dependency>
2727
```
2828

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<groupId>com.getui.push</groupId>
88
<artifactId>restful-sdk</artifactId>
99
<packaging>jar</packaging>
10-
<version>1.0.4.0</version>
10+
<version>1.0.5.0</version>
1111
<url>https://github.com/GetuiLaboratory/getui-pushapi-java-client-v2</url>
1212
<name>Getui Push API Java Client</name>
1313
<description>Getui's officially supported Java client library for accessing Getui APIs.</description>

src/main/java/com/getui/push/v2/sdk/common/http/GtHttpClient.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import org.apache.http.util.EntityUtils;
2424
import org.slf4j.Logger;
2525
import org.slf4j.LoggerFactory;
26+
import org.springframework.util.StringUtils;
2627

2728
import javax.net.ssl.SSLContext;
2829
import javax.net.ssl.TrustManager;
@@ -80,6 +81,17 @@ public GtHttpClient(int connectTimeout,
8081
builder.setDefaultRequestConfig(config)
8182
.setConnectionTimeToLive(keepAliveSeconds, TimeUnit.SECONDS)
8283
.useSystemProperties();
84+
85+
final String maxConnTotal = System.getProperty("http.client.maxConnTotal");
86+
if (!StringUtils.isEmpty(maxConnTotal)) {
87+
builder.setMaxConnTotal(Integer.parseInt(maxConnTotal));
88+
}
89+
90+
final String maxConnPerRoute = System.getProperty("http.client.maxConnPerRoute");
91+
if (!StringUtils.isEmpty(maxConnPerRoute)) {
92+
builder.setMaxConnPerRoute(Integer.parseInt(maxConnPerRoute));
93+
}
94+
8395
this.httpclient = builder.build();
8496
}
8597

src/main/java/com/getui/push/v2/sdk/core/Configs.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public interface Configs {
1313

1414
String HEADER_DOMAIN_HASH_KEY = "domainHash";
1515
String HEADER_OPEN_STABLE_DOMAIN = "openStableDomain";
16-
String SDK_VERSION = "1.0.4.0";
16+
String SDK_VERSION = "1.0.5.0";
1717
/**
1818
* 预置域名列表
1919
*/

src/main/java/com/getui/push/v2/sdk/dto/req/message/android/GTNotification.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ public class GTNotification {
3030

3131
@SerializedName("channel_level")
3232
private String channelLevel;
33+
34+
/**
35+
* 鸿蒙通知渠道类型
36+
*/
37+
@SerializedName("slot_type")
38+
private String slotType;
3339
/**
3440
* @see CommonEnum.ClickTypeEnum
3541
* 点击通知后续动作,
@@ -183,6 +189,14 @@ public void setChannelLevel(String channelLevel) {
183189
this.channelLevel = channelLevel;
184190
}
185191

192+
public String getSlotType() {
193+
return slotType;
194+
}
195+
196+
public void setSlotType(String slotType) {
197+
this.slotType = slotType;
198+
}
199+
186200
public String getClickType() {
187201
return clickType;
188202
}
@@ -291,6 +305,7 @@ public String toString() {
291305
", channelId='" + channelId + '\'' +
292306
", channelName='" + channelName + '\'' +
293307
", channelLevel='" + channelLevel + '\'' +
308+
", slotType='" + slotType + '\'' +
294309
", clickType='" + clickType + '\'' +
295310
", intent='" + intent + '\'' +
296311
", want='" + want + '\'' +

src/main/java/com/getui/push/v2/sdk/dto/req/message/harmony/HarmonyNotification.java

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@ public class HarmonyNotification {
1919
/**
2020
* @see CommonEnum.HarmonyClickTypeEnum
2121
* 点击通知后续动作,
22-
* 目前支持2种后续动作
22+
* 目前支持3种后续动作
2323
* want:打开应用内特定页面,
2424
* startapp:打开应用首页
25+
* payload:通知扩展消息
2526
*/
2627
@SerializedName("click_type")
2728
private String clickType;
@@ -30,6 +31,11 @@ public class HarmonyNotification {
3031
* 示例:{"deviceId":"","bundleName":"com.getui.push","abilityName":"TestAbility","uri":"https://www.test.com:8080/push/test","action":"com.test.action","parameters":{"name":"Getui","age":12}}
3132
*/
3233
private String want;
34+
/**
35+
* 鸿蒙平台通知扩展消息(消息分类category参数必填,且设置“EXPRESS”,发送通知扩展消息前请先申请开通对应的消息自分类权益)
36+
* <a href="https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/push-noti-classification-0000001727885246#section0965171625420">自分类权益申请</a>
37+
*/
38+
private String payload;
3339

3440
public String getTitle() {
3541
return title;
@@ -71,14 +77,23 @@ public void setWant(String want) {
7177
this.want = want;
7278
}
7379

80+
public String getPayload() {
81+
return payload;
82+
}
83+
84+
public void setPayload(String payload) {
85+
this.payload = payload;
86+
}
87+
7488
@Override
7589
public String toString() {
7690
return "HarmonyNotification{" +
77-
"title='" + title + '\'' +
91+
"want='" + want + '\'' +
92+
", title='" + title + '\'' +
7893
", body='" + body + '\'' +
7994
", category='" + category + '\'' +
8095
", clickType='" + clickType + '\'' +
81-
", want='" + want + '\'' +
96+
", payload='" + payload + '\'' +
8297
'}';
8398
}
8499
}

0 commit comments

Comments
 (0)