Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
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
youjj
cloud-platform
Commits
a4d283cf
Commit
a4d283cf
authored
Sep 04, 2019
by
hezhen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'hz_dev' into base-modify
parents
2d78b8a3
69d6a838
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
115 additions
and
3 deletions
+115
-3
Menu.java
...n/java/com/github/wxiaoqi/security/admin/entity/Menu.java
+16
-0
UserController.java
...om/github/wxiaoqi/security/admin/rest/UserController.java
+2
-2
PermissionService.java
...wxiaoqi/security/admin/rpc/service/PermissionService.java
+2
-1
MenuMapper.xml
...odules/ace-admin/src/main/resources/mapper/MenuMapper.xml
+1
-0
pom.xml
xx-universal/xx-universal-api/pom.xml
+11
-0
JPushBiz.java
...c/main/java/com/xxfc/platform/universal/biz/JPushBiz.java
+52
-0
JPushController.java
...m/xxfc/platform/universal/controller/JPushController.java
+31
-0
No files found.
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/entity/Menu.java
View file @
a4d283cf
...
@@ -25,6 +25,8 @@ public class Menu {
...
@@ -25,6 +25,8 @@ public class Menu {
private
String
type
;
private
String
type
;
private
String
state
;
private
String
description
;
private
String
description
;
@Column
(
name
=
"crt_time"
)
@Column
(
name
=
"crt_time"
)
...
@@ -167,6 +169,20 @@ public class Menu {
...
@@ -167,6 +169,20 @@ public class Menu {
this
.
type
=
type
;
this
.
type
=
type
;
}
}
/**
* @return state
*/
public
String
getState
()
{
return
state
;
}
/**
* @param state
*/
public
void
setState
(
String
state
)
{
this
.
state
=
state
;
}
/**
/**
* @return description
* @return description
*/
*/
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/UserController.java
View file @
a4d283cf
...
@@ -120,8 +120,8 @@ public class UserController extends CommonBaseController {
...
@@ -120,8 +120,8 @@ public class UserController extends CommonBaseController {
@RequestMapping
(
value
=
"/front/menus"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/front/menus"
,
method
=
RequestMethod
.
GET
)
public
@ResponseBody
public
@ResponseBody
List
<
MenuTree
>
getMenusByUsername
(
String
token
)
throws
Exception
{
List
<
MenuTree
>
getMenusByUsername
(
String
token
,
String
state
)
throws
Exception
{
return
permissionService
.
getMenusByUsername
(
token
);
return
permissionService
.
getMenusByUsername
(
token
,
state
);
}
}
@RequestMapping
(
value
=
"/front/menu/all"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/front/menu/all"
,
method
=
RequestMethod
.
GET
)
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rpc/service/PermissionService.java
View file @
a4d283cf
...
@@ -170,13 +170,14 @@ public class PermissionService {
...
@@ -170,13 +170,14 @@ public class PermissionService {
return
frontUser
;
return
frontUser
;
}
}
public
List
<
MenuTree
>
getMenusByUsername
(
String
token
)
throws
Exception
{
public
List
<
MenuTree
>
getMenusByUsername
(
String
token
,
String
state
)
throws
Exception
{
String
username
=
userAuthUtil
.
getInfoFromToken
(
token
).
getUniqueName
();
String
username
=
userAuthUtil
.
getInfoFromToken
(
token
).
getUniqueName
();
if
(
username
==
null
)
{
if
(
username
==
null
)
{
return
null
;
return
null
;
}
}
User
user
=
userBiz
.
getUserByUsername
(
username
);
User
user
=
userBiz
.
getUserByUsername
(
username
);
List
<
Menu
>
menus
=
menuBiz
.
getUserAuthorityMenuByUserId
(
user
.
getId
());
List
<
Menu
>
menus
=
menuBiz
.
getUserAuthorityMenuByUserId
(
user
.
getId
());
menus
=
menus
.
stream
().
filter
(
a
->
state
.
contains
(
a
.
getState
())).
collect
(
Collectors
.
toList
());
return
getMenuTree
(
menus
,
AdminCommonConstant
.
ROOT
);
return
getMenuTree
(
menus
,
AdminCommonConstant
.
ROOT
);
}
}
}
}
ace-modules/ace-admin/src/main/resources/mapper/MenuMapper.xml
View file @
a4d283cf
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
<result
column=
"href"
jdbcType=
"VARCHAR"
property=
"href"
/>
<result
column=
"href"
jdbcType=
"VARCHAR"
property=
"href"
/>
<result
column=
"icon"
jdbcType=
"VARCHAR"
property=
"icon"
/>
<result
column=
"icon"
jdbcType=
"VARCHAR"
property=
"icon"
/>
<result
column=
"type"
jdbcType=
"CHAR"
property=
"type"
/>
<result
column=
"type"
jdbcType=
"CHAR"
property=
"type"
/>
<result
column=
"state"
jdbcType=
"INTEGER"
property=
"state"
/>
<result
column=
"description"
jdbcType=
"VARCHAR"
property=
"description"
/>
<result
column=
"description"
jdbcType=
"VARCHAR"
property=
"description"
/>
<result
column=
"crt_time"
jdbcType=
"DATE"
property=
"crtTime"
/>
<result
column=
"crt_time"
jdbcType=
"DATE"
property=
"crtTime"
/>
<result
column=
"crt_user"
jdbcType=
"VARCHAR"
property=
"crtUser"
/>
<result
column=
"crt_user"
jdbcType=
"VARCHAR"
property=
"crtUser"
/>
...
...
xx-universal/xx-universal-api/pom.xml
View file @
a4d283cf
...
@@ -72,6 +72,17 @@
...
@@ -72,6 +72,17 @@
<artifactId>
junrar
</artifactId>
<artifactId>
junrar
</artifactId>
<version>
0.7
</version>
<version>
0.7
</version>
</dependency>
</dependency>
<!-- jpush -->
<dependency>
<groupId>
cn.jpush.api
</groupId>
<artifactId>
jpush-client
</artifactId>
<version>
3.3.7
</version>
</dependency>
<dependency>
<groupId>
cn.jpush.api
</groupId>
<artifactId>
jiguang-common
</artifactId>
<version>
1.1.1
</version>
</dependency>
</dependencies>
</dependencies>
...
...
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/biz/JPushBiz.java
0 → 100644
View file @
a4d283cf
package
com
.
xxfc
.
platform
.
universal
.
biz
;
import
cn.jiguang.common.ClientConfig
;
import
cn.jiguang.common.resp.APIConnectionException
;
import
cn.jiguang.common.resp.APIRequestException
;
import
cn.jpush.api.JPushClient
;
import
cn.jpush.api.push.PushResult
;
import
cn.jpush.api.push.model.PushPayload
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.xxfc.platform.universal.service.SmsService
;
import
com.xxfc.platform.universal.utils.CCPRestSmsUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
@Service
@Slf4j
public
class
JPushBiz
{
@Value
(
"${universal.MASTER_SECRET}"
)
private
String
MASTER_SECRET
;
@Value
(
"${universal.APP_KEY}"
)
private
String
APP_KEY
;
//推送给所有平台设备
public
ObjectRestResponse
jpushToAllPlat
(
String
title
){
ClientConfig
clientConfig
=
ClientConfig
.
getInstance
();
final
JPushClient
jpushClient
=
new
JPushClient
(
MASTER_SECRET
,
APP_KEY
,
null
,
clientConfig
);
PushPayload
payload
=
PushPayload
.
alertAll
(
title
);
try
{
PushResult
result
=
jpushClient
.
sendPush
(
payload
);
log
.
debug
(
"\n推送结果:"
+
result
);
return
ObjectRestResponse
.
succ
();
}
catch
(
APIConnectionException
e
)
{
// Connection error, should retry later
log
.
debug
(
"\nConnection error, should retry later"
+
e
);
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
e
.
getMessage
());
}
catch
(
APIRequestException
e
)
{
// Should review the error, and fix the request
log
.
debug
(
"\nShould review the error, and fix the request"
+
e
);
log
.
debug
(
"\nHTTP Status: "
+
e
.
getStatus
());
log
.
debug
(
"\nError Code: "
+
e
.
getErrorCode
());
log
.
debug
(
"\nError Message: "
+
e
.
getErrorMessage
());
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
e
.
getMessage
());
}
}
}
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/controller/JPushController.java
0 → 100644
View file @
a4d283cf
package
com
.
xxfc
.
platform
.
universal
.
controller
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.xxfc.platform.universal.biz.JPushBiz
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
/**
* 极光推送
*/
@RestController
@RequestMapping
(
"jpush"
)
@IgnoreUserToken
public
class
JPushController
{
@Autowired
JPushBiz
jPushBiz
;
@RequestMapping
(
value
=
"/app/unauth/all"
,
method
=
RequestMethod
.
GET
)
//匹配的是href中的download请求
public
ObjectRestResponse
sendSms
(
@RequestParam
(
"title"
)
String
title
)
throws
Exception
{
return
jPushBiz
.
jpushToAllPlat
(
title
);
}
}
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