Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
SiEn
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hewei
SiEn
Commits
2811e6e3
Commit
2811e6e3
authored
Oct 30, 2020
by
giaogiao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
友盟推送相关,添加或修改推送token
parent
78a5c302
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
39 additions
and
39 deletions
+39
-39
api-app/src/main/java/com/jumeirah/api/app/controller/AppUserController.java
+12
-20
common/pom.xml
+13
-15
common/src/main/java/com/jumeirah/common/entity/Stroke.java
+1
-1
common/src/main/java/com/jumeirah/common/param/app/DeviceTokenParam.java
+5
-0
common/src/main/java/com/jumeirah/common/push/Demo.java
+8
-3
common/src/main/java/com/jumeirah/common/push/jiguang/PushExample.java
+0
-0
No files found.
api-app/src/main/java/com/jumeirah/api/app/controller/AppUserController.java
View file @
2811e6e3
...
...
@@ -20,7 +20,12 @@ import io.swagger.annotations.ApiOperation;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestHeader
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* APP用户 控制器
...
...
@@ -42,26 +47,13 @@ public class AppUserController extends BaseController {
private
AppUserApiService
appUserApiService
;
/**
*
ios-
添加或修改推送token
* 添加或修改推送token
*/
@PostMapping
(
"/iosDeviceToken"
)
@OperationLog
(
name
=
"ios-添加或修改推送token"
,
type
=
OperationLogType
.
ADD
)
@ApiOperation
(
value
=
"ios-添加或修改推送token"
,
notes
=
"添加和修改都调用此接口"
,
response
=
ApiResult
.
class
)
public
ApiResult
<
Boolean
>
addIosAppDeviceToken
(
@RequestBody
DeviceTokenParam
deviceTokenParam
)
throws
Exception
{
boolean
flag
=
appUserService
.
updateDeviceToken
(
deviceTokenParam
,
2
);
return
ApiResult
.
result
(
flag
);
}
/**
* android-添加或修改推送token
*/
@PostMapping
(
"/androidDeviceToken"
)
@OperationLog
(
name
=
"android-添加或修改推送token"
,
type
=
OperationLogType
.
ADD
)
@ApiOperation
(
value
=
"android-添加或修改推送token"
,
notes
=
"添加和修改都调用此接口"
,
response
=
ApiResult
.
class
)
public
ApiResult
<
Boolean
>
addAppDeviceToken
(
@RequestBody
DeviceTokenParam
deviceTokenParam
)
throws
Exception
{
boolean
flag
=
appUserService
.
updateDeviceToken
(
deviceTokenParam
,
1
);
@PostMapping
(
"/addDeviceToken"
)
@OperationLog
(
name
=
"添加或修改推送token"
,
type
=
OperationLogType
.
ADD
)
@ApiOperation
(
value
=
"添加或修改推送token"
,
notes
=
"添加和修改都调用此接口"
,
response
=
ApiResult
.
class
)
public
ApiResult
<
Boolean
>
addDeviceToken
(
@RequestBody
DeviceTokenParam
deviceTokenParam
)
throws
Exception
{
boolean
flag
=
appUserService
.
updateDeviceToken
(
deviceTokenParam
,
deviceTokenParam
.
getDeviceType
());
return
ApiResult
.
result
(
flag
);
}
...
...
common/pom.xml
View file @
2811e6e3
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2019-2029 geekidea(https://github.com/geekidea)
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<project
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns=
"http://maven.apache.org/POM/4.0.0"
...
...
@@ -35,6 +20,7 @@
<groupId>
io.geekidea.springbootplus
</groupId>
<artifactId>
framework
</artifactId>
</dependency>
<!-- 友盟 start -->
<dependency>
<groupId>
org.json
</groupId>
...
...
@@ -47,6 +33,17 @@
<artifactId>
httpclient
</artifactId>
<version>
4.3.5
</version>
</dependency>
<!-- 友盟 end -->
<!-- 极光 start -->
<dependency>
<groupId>
cn.jpush.api
</groupId>
<artifactId>
jpush-client
</artifactId>
<version>
3.4.7
</version>
</dependency>
<!-- 极光 end -->
</dependencies>
</project>
\ No newline at end of file
common/src/main/java/com/jumeirah/common/entity/Stroke.java
View file @
2811e6e3
...
...
@@ -144,7 +144,7 @@ public class Stroke extends BaseEntity {
private
String
choosePlainType
;
@NotNull
(
message
=
"付款状态不能为空"
)
@ApiModelProperty
(
"付款状态,0-未付款,1-
付款中,2-已付款
,3-退款中,99-已退款"
)
@ApiModelProperty
(
"付款状态,0-未付款,1-
用户已付款,待审核,2-用户已付款,审核通过
,3-退款中,99-已退款"
)
private
Integer
paymentStatus
;
@NotNull
(
message
=
"审核状态不能为空"
)
...
...
common/src/main/java/com/jumeirah/common/param/app/DeviceTokenParam.java
View file @
2811e6e3
package
com
.
jumeirah
.
common
.
param
.
app
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
...
...
@@ -7,4 +8,8 @@ import java.io.Serializable;
@Data
public
class
DeviceTokenParam
implements
Serializable
{
private
String
deviceToken
;
@ApiModelProperty
(
"ios=2, android=1"
)
private
int
deviceType
;
}
common/src/main/java/com/jumeirah/common/push/Demo.java
View file @
2811e6e3
...
...
@@ -43,7 +43,7 @@ public class Demo {
// Demo demo = new Demo("your appkey", "your master secret");
Demo
demo
=
new
Demo
(
"5f963f3ea1491772a2aef713"
,
"ti5gomxtvmkgehmwgtbq9rtsfhy0khsi"
);
try
{
demo
.
sendAndroidUnicast
();
demo
.
sendAndroidUnicast
(
"As3YYnUpKwDLFVzc35_syVTNSctGjkDNfFLwPHGbXtm_"
);
//demo.sendIOSUnicast();
/* TODO these methods are all available, just fill in some fields and do the test
* demo.sendAndroidCustomizedcastFile();
...
...
@@ -81,10 +81,15 @@ public class Demo {
client
.
send
(
broadcast
);
}
public
void
sendAndroidUnicast
()
throws
Exception
{
/**
* 发送安卓单推
*
* @throws Exception
*/
public
void
sendAndroidUnicast
(
String
token
)
throws
Exception
{
AndroidUnicast
unicast
=
new
AndroidUnicast
(
appkey
,
appMasterSecret
);
// TODO Set your device token
unicast
.
setDeviceToken
(
"AszgEnfwpKppOH8Up1EiyXMJ1ParFCPkqYkqIrCpL9ph"
);
unicast
.
setDeviceToken
(
token
);
unicast
.
setTicker
(
"Android unicast ticker"
);
unicast
.
setTitle
(
"api 中文的title"
);
unicast
.
setText
(
"Android unicast text"
);
...
...
common/src/main/java/com/jumeirah/common/push/jiguang/PushExample.java
0 → 100644
View file @
2811e6e3
This diff is collapsed.
Click to expand it.
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