Skip to content

Commit 88a4472

Browse files
author
wicked_tc130
committed
update version to 3.7.8.
1 parent 48578be commit 88a4472

File tree

2 files changed

+15
-225
lines changed

2 files changed

+15
-225
lines changed

pom.xml

+1-223
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,12 @@
33

44
<groupId>cn.jpush.api</groupId>
55
<artifactId>jpush-client</artifactId>
6-
<version>3.7.7</version>
6+
<version>3.7.8</version>
77
<packaging>jar</packaging>
88
<url>https://github.com/jpush/jpush-api-java-client</url>
99
<name>JPush API Java Client</name>
1010
<description>JPush's officially supported Java client library for accessing JPush APIs.</description>
1111

12-
<licenses>
13-
<license>
14-
<name>The Apache Software License, Version 2.0</name>
15-
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
16-
<distribution>repo</distribution>
17-
</license>
18-
</licenses>
19-
2012
<properties>
2113
<github.global.server>github</github.global.server>
2214
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -131,218 +123,4 @@
131123
</dependency>
132124
</dependencies>
133125

134-
<build>
135-
<plugins>
136-
<plugin>
137-
<artifactId>maven-compiler-plugin</artifactId>
138-
<version>3.1</version>
139-
<configuration>
140-
<source>${jdkVersion}</source>
141-
<target>${jdkVersion}</target>
142-
<compilerVersion>1.5</compilerVersion>
143-
<showDeprecation>true</showDeprecation>
144-
<showWarnings>true</showWarnings>
145-
<debug>true</debug>
146-
<fork>true</fork>
147-
<compilerArgs>
148-
<arg>-Xlint:unchecked</arg>
149-
</compilerArgs>
150-
</configuration>
151-
</plugin>
152-
153-
<plugin>
154-
<groupId>org.apache.maven.plugins</groupId>
155-
<artifactId>maven-release-plugin</artifactId>
156-
<version>2.5.1</version>
157-
<dependencies>
158-
<dependency>
159-
<groupId>org.apache.maven.plugins</groupId>
160-
<artifactId>maven-scm-plugin</artifactId>
161-
<version>1.9.2</version>
162-
</dependency>
163-
</dependencies>
164-
<configuration>
165-
<goals>deploy,site</goals>
166-
<pushChanges>false</pushChanges>
167-
<localCheckout>true</localCheckout>
168-
<commitByProject>true</commitByProject>
169-
<tagNameFormat>v@{project.version}</tagNameFormat>
170-
</configuration>
171-
</plugin>
172-
173-
<plugin>
174-
<groupId>com.github.github</groupId>
175-
<artifactId>site-maven-plugin</artifactId>
176-
<version>0.9</version>
177-
<configuration>
178-
<message>Creating site for ${project.version}</message>
179-
<server>github</server>
180-
</configuration>
181-
<executions>
182-
<execution>
183-
<goals>
184-
<goal>site</goal>
185-
</goals>
186-
<phase>site</phase>
187-
</execution>
188-
</executions>
189-
</plugin>
190-
191-
<plugin>
192-
<groupId>org.apache.maven.plugins</groupId>
193-
<artifactId>maven-surefire-plugin</artifactId>
194-
<version>2.17</version>
195-
<configuration>
196-
<groups>cn.jpush.api.FastTests</groups>
197-
<argLine>-Dfile.encoding=UTF-8</argLine>
198-
<excludes>
199-
<exclude>**/mock/*Test.java</exclude>
200-
</excludes>
201-
</configuration>
202-
<dependencies>
203-
<dependency>
204-
<groupId>org.apache.maven.surefire</groupId>
205-
<artifactId>surefire-junit47</artifactId>
206-
<version>2.17</version>
207-
</dependency>
208-
</dependencies>
209-
</plugin>
210-
211-
<plugin>
212-
<groupId>org.apache.maven.plugins</groupId>
213-
<artifactId>maven-failsafe-plugin</artifactId>
214-
<version>2.17</version>
215-
<configuration>
216-
<encoding>UTF-8</encoding>
217-
<groups>cn.jpush.api.SlowTests</groups>
218-
<argLine>-Dfile.encoding=UTF-8</argLine>
219-
<excludes>
220-
<exclude>**/mock/*Test.java</exclude>
221-
</excludes>
222-
</configuration>
223-
<executions>
224-
<execution>
225-
<goals>
226-
<goal>integration-test</goal>
227-
<goal>verify</goal>
228-
</goals>
229-
<configuration>
230-
<includes>
231-
<include>**/*.class</include>
232-
</includes>
233-
</configuration>
234-
</execution>
235-
</executions>
236-
<dependencies>
237-
<dependency>
238-
<groupId>org.apache.maven.surefire</groupId>
239-
<artifactId>surefire-junit47</artifactId>
240-
<version>2.17</version>
241-
</dependency>
242-
</dependencies>
243-
</plugin>
244-
245-
<!-- 参考 https://docs.github.com/cn/actions/language-and-framework-guides/publishing-java-packages-with-maven#about-package-configuration -->
246-
<!-- 参考 https://github.com/actions/setup-java -->
247-
<!-- 参考 https://central.sonatype.org/pages/apache-maven.html -->
248-
249-
<!-- Javadoc和源代码附件 -->
250-
<plugin>
251-
<groupId>org.apache.maven.plugins</groupId>
252-
<artifactId>maven-source-plugin</artifactId>
253-
<version>2.2.1</version>
254-
<executions>
255-
<execution>
256-
<id>attach-sources</id>
257-
<goals>
258-
<goal>jar-no-fork</goal>
259-
</goals>
260-
</execution>
261-
</executions>
262-
</plugin>
263-
<plugin>
264-
<groupId>org.apache.maven.plugins</groupId>
265-
<artifactId>maven-javadoc-plugin</artifactId>
266-
<version>2.9.1</version>
267-
<executions>
268-
<execution>
269-
<id>attach-javadocs</id>
270-
<goals>
271-
<goal>jar</goal>
272-
</goals>
273-
</execution>
274-
</executions>
275-
</plugin>
276-
277-
<!-- GPG签名组件 -->
278-
<plugin>
279-
<groupId>org.apache.maven.plugins</groupId>
280-
<artifactId>maven-gpg-plugin</artifactId>
281-
<version>1.5</version>
282-
<executions>
283-
<execution>
284-
<id>sign-artifacts</id>
285-
<phase>verify</phase>
286-
<goals>
287-
<goal>sign</goal>
288-
</goals>
289-
</execution>
290-
</executions>
291-
</plugin>
292-
293-
<!-- Nexus Staging Maven插件,用于部署和发布 -->
294-
<plugin>
295-
<groupId>org.sonatype.plugins</groupId>
296-
<artifactId>nexus-staging-maven-plugin</artifactId>
297-
<version>1.6.7</version>
298-
<extensions>true</extensions>
299-
<configuration>
300-
<serverId>ossrh</serverId>
301-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
302-
<!-- 自动release -->
303-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
304-
</configuration>
305-
</plugin>
306-
307-
</plugins>
308-
</build>
309-
<distributionManagement>
310-
<snapshotRepository>
311-
<id>ossrh</id>
312-
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
313-
</snapshotRepository>
314-
<repository>
315-
<id>ossrh</id>
316-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
317-
</repository>
318-
</distributionManagement>
319-
320-
<reporting>
321-
<plugins>
322-
<plugin>
323-
<groupId>org.apache.maven.plugins</groupId>
324-
<artifactId>maven-project-info-reports-plugin</artifactId>
325-
<version>2.8</version>
326-
<reportSets>
327-
<reportSet>
328-
<reports>
329-
<report>dependencies</report>
330-
<report>license</report>
331-
<report>scm</report>
332-
</reports>
333-
</reportSet>
334-
</reportSets>
335-
</plugin>
336-
<plugin>
337-
<groupId>org.apache.maven.plugins</groupId>
338-
<artifactId>maven-javadoc-plugin</artifactId>
339-
<version>2.10.3</version>
340-
<configuration>
341-
<overview>resources/javadoc-overview.html</overview>
342-
</configuration>
343-
</plugin>
344-
</plugins>
345-
</reporting>
346-
347-
348126
</project>

src/main/java/cn/jpush/api/push/model/Message.java

+14-2
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,20 @@ public class Message implements PushModel {
2222
private static final String MSG_CONTENT = "msg_content";
2323
private static final String TITLE = "title";
2424
private static final String CONTENT_TYPE = "content_type";
25+
private static final String TEST_MESSAGE = "test_message";
2526
private static final String EXTRAS = "extras";
2627

2728
private final String msgContent;
2829
private final String title;
2930
private final String contentType;
31+
private final Boolean testMessage;
3032
private final Map<String, String> extras;
3133
private final Map<String, Number> numberExtras;
3234
private final Map<String, Boolean> booleanExtras;
3335
private final Map<String, JsonObject> jsonExtras;
3436
private final Map<String, JsonPrimitive> customData;
3537

36-
private Message(String title, String msgContent, String contentType,
38+
private Message(String title, String msgContent, String contentType, Boolean testMessage,
3739
Map<String, String> extras,
3840
Map<String, Number> numberExtras,
3941
Map<String, Boolean> booleanExtras,
@@ -42,6 +44,7 @@ private Message(String title, String msgContent, String contentType,
4244
this.title = title;
4345
this.msgContent = msgContent;
4446
this.contentType = contentType;
47+
this.testMessage = testMessage;
4548
this.extras = extras;
4649
this.numberExtras = numberExtras;
4750
this.booleanExtras = booleanExtras;
@@ -69,6 +72,9 @@ public JsonElement toJSON() {
6972
if (null != contentType) {
7073
json.add(CONTENT_TYPE, new JsonPrimitive(contentType));
7174
}
75+
if (null != testMessage) {
76+
json.add(TEST_MESSAGE, new JsonPrimitive(testMessage));
77+
}
7278

7379
JsonObject extrasObject = null;
7480
if (null != extras || null != numberExtras || null != booleanExtras || null != jsonExtras) {
@@ -118,6 +124,7 @@ public static class Builder {
118124
private String title;
119125
private String msgContent;
120126
private String contentType;
127+
private Boolean testMessage;
121128
private Map<String, String> extrasBuilder;
122129
private Map<String, Number> numberExtrasBuilder;
123130
private Map<String, Boolean> booleanExtrasBuilder;
@@ -139,6 +146,11 @@ public Builder setContentType(String contentType) {
139146
return this;
140147
}
141148

149+
public Builder setTestMessage(Boolean testMessage) {
150+
this.testMessage = testMessage;
151+
return this;
152+
}
153+
142154
public Builder addExtra(String key, String value) {
143155
Preconditions.checkArgument(!(null == key || null == value), "Key/Value should not be null.");
144156
if (null == extrasBuilder) {
@@ -226,7 +238,7 @@ public Builder addCustom(String key, Boolean value) {
226238
public Message build() {
227239
Preconditions.checkArgument(!(null == msgContent),
228240
"msgContent should be set");
229-
return new Message(title, msgContent, contentType,
241+
return new Message(title, msgContent, contentType, testMessage,
230242
extrasBuilder, numberExtrasBuilder, booleanExtrasBuilder, jsonExtrasBuilder, customData);
231243
}
232244
}

0 commit comments

Comments
 (0)