Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
znks
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王夏晖
znks
Commits
e00ffa1d
Commit
e00ffa1d
authored
Sep 07, 2018
by
张大伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加个推推送服务
parent
dec6dc50
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
85 additions
and
168 deletions
+85
-168
adc-da-main.iml
adc-da-main/adc-da-main.iml
+0
-168
pom.xml
adc-da-main/pom.xml
+37
-0
AppPushUtils.java
...main/src/main/java/com/adc/da/znks/util/AppPushUtils.java
+48
-0
gexin-rp-fastjson-1.0.0.1.jar
adc-da-main/src/main/lib/gexin-rp-fastjson-1.0.0.1.jar
+0
-0
gexin-rp-sdk-base-4.0.0.25.jar
adc-da-main/src/main/lib/gexin-rp-sdk-base-4.0.0.25.jar
+0
-0
gexin-rp-sdk-http-4.1.0.0.jar
adc-da-main/src/main/lib/gexin-rp-sdk-http-4.1.0.0.jar
+0
-0
gexin-rp-sdk-template-4.0.0.19.jar
adc-da-main/src/main/lib/gexin-rp-sdk-template-4.0.0.19.jar
+0
-0
protobuf-java-2.5.0.jar
adc-da-main/src/main/lib/protobuf-java-2.5.0.jar
+0
-0
No files found.
adc-da-main/adc-da-main.iml
View file @
e00ffa1d
This diff is collapsed.
Click to expand it.
adc-da-main/pom.xml
View file @
e00ffa1d
...
@@ -255,6 +255,43 @@
...
@@ -255,6 +255,43 @@
<artifactId>
netty-all
</artifactId>
<artifactId>
netty-all
</artifactId>
<version>
4.1.22.Final
</version>
<version>
4.1.22.Final
</version>
</dependency>
</dependency>
<dependency>
<groupId>
com.gexin.platform
</groupId>
<artifactId>
gexin-rp-sdk-http
</artifactId>
<version>
4.1.00
</version>
<scope>
system
</scope>
<systemPath>
${basedir}/src/main/lib/gexin-rp-sdk-http-4.1.0.0.jar
</systemPath>
</dependency>
<dependency>
<groupId>
com.gexin.platform
</groupId>
<artifactId>
gexin-rp-fastjson
</artifactId>
<version>
1.0.0.1
</version>
<scope>
system
</scope>
<systemPath>
${basedir}/src/main/lib/gexin-rp-fastjson-1.0.0.1.jar
</systemPath>
</dependency>
<dependency>
<groupId>
com.gexin.platform
</groupId>
<artifactId>
gexin-rp-sdk-base
</artifactId>
<version>
4.0.0.25
</version>
<scope>
system
</scope>
<systemPath>
${basedir}/src/main/lib/gexin-rp-sdk-base-4.0.0.25.jar
</systemPath>
</dependency>
<dependency>
<groupId>
com.gexin.platform
</groupId>
<artifactId>
gexin-rp-sdk-template
</artifactId>
<version>
4.0.0.19
</version>
<scope>
system
</scope>
<systemPath>
${basedir}/src/main/lib/gexin-rp-sdk-template-4.0.0.19.jar
</systemPath>
</dependency>
<dependency>
<groupId>
com.google.protobuf
</groupId>
<artifactId>
protobuf-java
</artifactId>
<version>
2.5.0
</version>
<scope>
system
</scope>
<systemPath>
${basedir}/src/main/lib/protobuf-java-2.5.0.jar
</systemPath>
</dependency>
</dependencies>
</dependencies>
<build>
<build>
<plugins>
<plugins>
...
...
adc-da-main/src/main/java/com/adc/da/znks/util/AppPushUtils.java
0 → 100644
View file @
e00ffa1d
package
com
.
adc
.
da
.
znks
.
util
;
import
com.gexin.rp.sdk.base.IPushResult
;
import
com.gexin.rp.sdk.base.impl.AppMessage
;
import
com.gexin.rp.sdk.http.IGtPush
;
import
com.gexin.rp.sdk.template.LinkTemplate
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* 个推推送服务工具类
* @author David
*/
public
class
AppPushUtils
{
private
static
String
appId
=
""
;
private
static
String
appKey
=
""
;
private
static
String
masterSecret
=
""
;
private
static
String
url
=
"http://sdk.open.api.igexin.com/apiex.htm"
;
public
static
void
push
(
String
msg
)
throws
IOException
{
IGtPush
push
=
new
IGtPush
(
url
,
appKey
,
masterSecret
);
// 定义"点击链接打开通知模板",并设置标题、内容、链接
LinkTemplate
template
=
new
LinkTemplate
();
template
.
setAppId
(
appId
);
template
.
setAppkey
(
appKey
);
template
.
setTitle
(
"智能家居提示"
);
template
.
setText
(
msg
);
List
<
String
>
appIds
=
new
ArrayList
<
String
>();
appIds
.
add
(
appId
);
// 定义"AppMessage"类型消息对象,设置消息内容模板、发送的目标App列表、是否支持离线发送、以及离线消息有效期(单位毫秒)
AppMessage
message
=
new
AppMessage
();
message
.
setData
(
template
);
message
.
setAppIdList
(
appIds
);
message
.
setOffline
(
true
);
message
.
setOfflineExpireTime
(
1000
*
600
);
IPushResult
ret
=
push
.
pushMessageToApp
(
message
);
System
.
out
.
println
(
ret
.
getResponse
().
toString
());
}
}
adc-da-main/src/main/lib/gexin-rp-fastjson-1.0.0.1.jar
0 → 100644
View file @
e00ffa1d
File added
adc-da-main/src/main/lib/gexin-rp-sdk-base-4.0.0.25.jar
0 → 100644
View file @
e00ffa1d
File added
adc-da-main/src/main/lib/gexin-rp-sdk-http-4.1.0.0.jar
0 → 100644
View file @
e00ffa1d
File added
adc-da-main/src/main/lib/gexin-rp-sdk-template-4.0.0.19.jar
0 → 100644
View file @
e00ffa1d
File added
adc-da-main/src/main/lib/protobuf-java-2.5.0.jar
0 → 100644
View file @
e00ffa1d
File added
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment