Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
E
energyai_java
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
葛齐林
energyai_java
Commits
5fc75492
Commit
5fc75492
authored
Apr 01, 2021
by
co_dengxiongwen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口调整
parent
b0f184b0
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
19 additions
and
66 deletions
+19
-66
SysLoginController.java.rej
.../admin/modules/sys/controller/SysLoginController.java.rej
+0
-9
SysMenuController.java
...tform/admin/modules/sys/controller/SysMenuController.java
+4
-37
SysMenuService.java
...devplatform/admin/modules/sys/service/SysMenuService.java
+1
-2
SysMenuServiceImpl.java
...rm/admin/modules/sys/service/impl/SysMenuServiceImpl.java
+1
-6
SysMenuDao.xml
...ervice-admin/src/main/resources/mapper/sys/SysMenuDao.xml
+3
-6
bootstrap.yml
...ice-authorization-server/src/main/resources/bootstrap.yml
+1
-1
application-dev.yml
...vice-config-server/src/main/resources/application-dev.yml
+5
-1
application.yml
...oservice-config-server/src/main/resources/application.yml
+2
-2
bootstrap.yml
...service-discovery-eureka/src/main/resources/bootstrap.yml
+1
-1
bootstrap.yml
microservice-gateway-zuul/src/main/resources/bootstrap.yml
+1
-1
No files found.
microservice-admin/src/main/java/com/devplatform/admin/modules/sys/controller/SysLoginController.java.rej
deleted
100644 → 0
View file @
b0f184b0
diff a/microservice-admin/src/main/java/com/devplatform/admin/modules/sys/controller/SysLoginController.java b/microservice-admin/src/main/java/com/devplatform/admin/modules/sys/controller/SysLoginController.java (rejected hunks)
@@ -135,7 +135,6 @@
}
user.setRoleIdList(roleIdList);
String jwtToken = null;
- user.setSysSystem(sysSystem);
try {
jwtToken =
JwtUtil.createJwt("longingJWT", JwtUtil.generalSubject(user), 1000 * 60 * 60 * 24 * 7);
microservice-admin/src/main/java/com/devplatform/admin/modules/sys/controller/SysMenuController.java
View file @
5fc75492
...
@@ -16,22 +16,11 @@ import com.devplatform.common.util.R;
...
@@ -16,22 +16,11 @@ import com.devplatform.common.util.R;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
java.util.*
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
/**
/**
* 系统菜单
* 系统菜单
...
@@ -54,34 +43,12 @@ public class SysMenuController extends AbstractController {
...
@@ -54,34 +43,12 @@ public class SysMenuController extends AbstractController {
@GetMapping
(
"/nav"
)
@GetMapping
(
"/nav"
)
public
R
nav
(
String
stationId
)
{
public
R
nav
(
String
stationId
)
{
List
<
Map
<
String
,
Object
>>
menuList
=
List
<
Map
<
String
,
Object
>>
menuList
=
sysMenuService
.
getUserMenuList
(
getUserId
(),
stationId
,
null
);
sysMenuService
.
getUserMenuList
(
getUserId
(),
stationId
);
List
<
Map
<
String
,
Object
>>
nav
=
sysMenuService
.
getNav
(
getUserId
(),
stationId
);
List
<
Map
<
String
,
Object
>>
nav
=
sysMenuService
.
getNav
(
getUserId
(),
stationId
);
Set
<
String
>
permissions
=
shiroService
.
getUserPermissions
(
getUserId
());
Set
<
String
>
permissions
=
shiroService
.
getUserPermissions
(
getUserId
());
return
R
.
ok
().
put
(
"menuList"
,
menuList
).
put
(
"permissions"
,
permissions
).
put
(
"nav"
,
nav
);
return
R
.
ok
().
put
(
"menuList"
,
menuList
).
put
(
"permissions"
,
permissions
).
put
(
"nav"
,
nav
);
}
}
/** 导航菜单 */
@ApiOperation
(
value
=
"站点子系统获取导航菜单"
,
notes
=
"站点子系统获取导航菜单"
)
@GetMapping
(
"/nav1"
)
public
R
nav1
(
String
stationId
)
{
List
<
Map
<
String
,
Object
>>
menuList
=
sysMenuService
.
getUserMenuList
(
getUserId
(),
stationId
,
"1"
);
for
(
Map
<
String
,
Object
>
map1
:
menuList
)
{
ArrayList
<
Map
<
String
,
Object
>>
list
=
(
ArrayList
<
Map
<
String
,
Object
>>)
map1
.
get
(
"list"
);
Iterator
<
Map
<
String
,
Object
>>
iterator
=
list
.
iterator
();
while
(
iterator
.
hasNext
())
{
Map
<
String
,
Object
>
next
=
iterator
.
next
();
if
(
"/sys/takeover"
.
equals
(
String
.
valueOf
(
next
.
get
(
"path"
))))
{
iterator
.
remove
();
break
;
}
}
}
List
<
Map
<
String
,
Object
>>
nav
=
sysMenuService
.
getNav
(
"1"
,
stationId
);
Set
<
String
>
permissions
=
shiroService
.
getUserPermissions
(
"1"
);
return
R
.
ok
().
put
(
"menuList"
,
menuList
).
put
(
"permissions"
,
permissions
).
put
(
"nav"
,
nav
);
}
/** 所有菜单列表 */
/** 所有菜单列表 */
@ApiOperation
(
value
=
"根据条件获取分页数据列表"
,
notes
=
"根据条件获取分页数据列表"
)
@ApiOperation
(
value
=
"根据条件获取分页数据列表"
,
notes
=
"根据条件获取分页数据列表"
)
@ApiImplicitParam
(
@ApiImplicitParam
(
...
...
microservice-admin/src/main/java/com/devplatform/admin/modules/sys/service/SysMenuService.java
View file @
5fc75492
...
@@ -42,10 +42,9 @@ public interface SysMenuService extends MyBaseService<SysMenuEntity> {
...
@@ -42,10 +42,9 @@ public interface SysMenuService extends MyBaseService<SysMenuEntity> {
* 获取用户菜单列表
* 获取用户菜单列表
* @param userId
* @param userId
* @param stationId
* @param stationId
* @param isActive
* @return
* @return
*/
*/
List
<
Map
<
String
,
Object
>>
getUserMenuList
(
String
userId
,
String
stationId
,
String
isActive
);
List
<
Map
<
String
,
Object
>>
getUserMenuList
(
String
userId
,
String
stationId
);
/**
/**
* 删除
* 删除
...
...
microservice-admin/src/main/java/com/devplatform/admin/modules/sys/service/impl/SysMenuServiceImpl.java
View file @
5fc75492
...
@@ -53,19 +53,14 @@ public class SysMenuServiceImpl extends MyBaseServiceImpl<SysMenuDao, SysMenuEnt
...
@@ -53,19 +53,14 @@ public class SysMenuServiceImpl extends MyBaseServiceImpl<SysMenuDao, SysMenuEnt
@Override
@Override
public
List
<
Map
<
String
,
Object
>>
getUserMenuList
(
public
List
<
Map
<
String
,
Object
>>
getUserMenuList
(
String
userId
,
String
stationId
,
String
isActive
)
{
String
userId
,
String
stationId
)
{
List
<
Map
<
String
,
Object
>>
list
;
List
<
Map
<
String
,
Object
>>
list
;
// 系统管理员,拥有所有权限
// 系统管理员,拥有所有权限
if
(
Constant
.
SUPER_ADMIN
.
equals
(
userId
))
{
if
(
Constant
.
SUPER_ADMIN
.
equals
(
userId
))
{
list
=
baseMapper
.
getAllMenuListByUserId
(
null
,
stationId
);
list
=
baseMapper
.
getAllMenuListByUserId
(
null
,
stationId
);
}
else
{
}
else
{
if
(
isActive
!=
null
)
{
// 子系统查询
list
=
baseMapper
.
getAllMenuListByUserId1
(
userId
);
}
else
{
// 站点查询
// 站点查询
list
=
baseMapper
.
getAllMenuListByUserId
(
userId
,
stationId
);
list
=
baseMapper
.
getAllMenuListByUserId
(
userId
,
stationId
);
}
}
}
List
<
Map
<
String
,
Object
>>
result
=
new
ArrayList
<
Map
<
String
,
Object
>>();
List
<
Map
<
String
,
Object
>>
result
=
new
ArrayList
<
Map
<
String
,
Object
>>();
// 生成树结构
// 生成树结构
...
...
microservice-admin/src/main/resources/mapper/sys/SysMenuDao.xml
View file @
5fc75492
...
@@ -28,12 +28,11 @@
...
@@ -28,12 +28,11 @@
<if
test=
"stationId != null and stationId != ''"
>
<if
test=
"stationId != null and stationId != ''"
>
AND me.station_id = #{stationId}
AND me.station_id = #{stationId}
</if>
</if>
AND me.type = 2
--
AND me.type = 2
</select>
</select>
<select
id=
"getAllMenuListByUserId"
resultType=
"java.util.Map"
>
<select
id=
"getAllMenuListByUserId"
resultType=
"java.util.Map"
>
SELECT DISTINCT sm.menu_id AS menuId, sm.parent_id AS parentId, sm.name,sm.name AS title,sm.url, sm.url AS path,
SELECT DISTINCT sm.menu_id AS menuId, sm.parent_id AS parentId, sm.name,sm.name AS title,sm.url, sm.url AS path,
sm.perms, sm.type, sm.icon, sm.order_num AS orderNum, sm.is_system_menu AS isSystemMenu, sm.status, sm.sys_sign
sm.perms, sm.type, sm.icon, sm.order_num AS orderNum, sm.is_system_menu AS isSystemMenu, sm.status
AS sysSign
FROM sys_menu sm
FROM sys_menu sm
LEFT JOIN sys_role_menu srm ON sm.menu_id = srm.menu_id
LEFT JOIN sys_role_menu srm ON sm.menu_id = srm.menu_id
LEFT JOIN sys_user_role sur ON srm.role_id = sur.role_id
LEFT JOIN sys_user_role sur ON srm.role_id = sur.role_id
...
@@ -61,9 +60,7 @@
...
@@ -61,9 +60,7 @@
sm.icon,
sm.icon,
sm.order_num AS orderNum,
sm.order_num AS orderNum,
sm.is_system_menu AS isSystemMenu,
sm.is_system_menu AS isSystemMenu,
sm.status,
sm.status
sm.sys_sign
AS sysSign
FROM sys_menu sm
FROM sys_menu sm
LEFT JOIN rt_sys_role_menu srm ON sm.menu_id = srm.menu_id AND srm.byx1 = '2'
LEFT JOIN rt_sys_role_menu srm ON sm.menu_id = srm.menu_id AND srm.byx1 = '2'
LEFT JOIN rt_sys_user_role sur ON srm.role_id = sur.role_id
LEFT JOIN rt_sys_user_role sur ON srm.role_id = sur.role_id
...
...
microservice-authorization-server/src/main/resources/bootstrap.yml
View file @
5fc75492
...
@@ -16,7 +16,7 @@ eureka:
...
@@ -16,7 +16,7 @@ eureka:
healthcheck
:
healthcheck
:
enabled
:
true
enabled
:
true
serviceUrl
:
serviceUrl
:
defaultZone
:
http://user:password123@eureka:876
2
/eureka
defaultZone
:
http://user:password123@eureka:876
1
/eureka
instance
:
instance
:
lease-renewal-interval-in-seconds
:
4
lease-renewal-interval-in-seconds
:
4
lease-expiration-duration-in-seconds
:
12
lease-expiration-duration-in-seconds
:
12
...
...
microservice-config-server/src/main/resources/application-dev.yml
View file @
5fc75492
...
@@ -41,6 +41,7 @@ spring:
...
@@ -41,6 +41,7 @@ spring:
async
:
async
:
request-timeout
:
60000
request-timeout
:
60000
redis
:
redis
:
# host: 10.20.72.35
host
:
47.94.207.62
host
:
47.94.207.62
port
:
6379
port
:
6379
password
:
password
:
...
@@ -62,6 +63,9 @@ spring:
...
@@ -62,6 +63,9 @@ spring:
url
:
jdbc:mysql://47.94.207.62:3306/energy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&allowMultiQueries=true&serverTimezone=GMT%2B8&useSSL=false
url
:
jdbc:mysql://47.94.207.62:3306/energy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&allowMultiQueries=true&serverTimezone=GMT%2B8&useSSL=false
username
:
root
username
:
root
password
:
superAdmin&321
password
:
superAdmin&321
# url: jdbc:mysql://10.20.72.31:3306/energy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&allowMultiQueries=true&serverTimezone=GMT%2B8&useSSL=false
# username: root
# password: root
initialSize
:
5
initialSize
:
5
minIdle
:
0
minIdle
:
0
maxActive
:
1000
maxActive
:
1000
...
@@ -88,7 +92,7 @@ eureka:
...
@@ -88,7 +92,7 @@ eureka:
healthcheck
:
healthcheck
:
enabled
:
false
enabled
:
false
serviceUrl
:
serviceUrl
:
defaultZone
:
http://user:password123@eureka:876
2
/eureka
defaultZone
:
http://user:password123@eureka:876
1
/eureka
instance
:
instance
:
lease-renewal-interval-in-seconds
:
4
lease-renewal-interval-in-seconds
:
4
lease-expiration-duration-in-seconds
:
12
lease-expiration-duration-in-seconds
:
12
...
...
microservice-config-server/src/main/resources/application.yml
View file @
5fc75492
...
@@ -17,8 +17,8 @@ eureka:
...
@@ -17,8 +17,8 @@ eureka:
healthcheck
:
healthcheck
:
enabled
:
true
enabled
:
true
serviceUrl
:
serviceUrl
:
defaultZone
:
http://user:password123@eureka:8762/eureka
#
defaultZone: http://user:password123@eureka:8762/eureka
#
defaultZone: http://user:password123@eureka:8761/eureka
defaultZone
:
http://user:password123@eureka:8761/eureka
# defaultZone: http://user:password123@172.19.0.1:8761/eureka
# defaultZone: http://user:password123@172.19.0.1:8761/eureka
instance
:
instance
:
lease-renewal-interval-in-seconds
:
4
lease-renewal-interval-in-seconds
:
4
...
...
microservice-discovery-eureka/src/main/resources/bootstrap.yml
View file @
5fc75492
...
@@ -5,7 +5,7 @@ security:
...
@@ -5,7 +5,7 @@ security:
name
:
user
name
:
user
password
:
password123
password
:
password123
server
:
server
:
port
:
876
2
port
:
876
1
eureka
:
eureka
:
client
:
client
:
register-with-eureka
:
false
register-with-eureka
:
false
...
...
microservice-gateway-zuul/src/main/resources/bootstrap.yml
View file @
5fc75492
...
@@ -100,7 +100,7 @@ eureka:
...
@@ -100,7 +100,7 @@ eureka:
fetch-registry
:
true
fetch-registry
:
true
registry-fetch-interval-seconds
:
8
registry-fetch-interval-seconds
:
8
serviceUrl
:
serviceUrl
:
defaultZone
:
http://user:password123@eureka:876
2
/eureka
defaultZone
:
http://user:password123@eureka:876
1
/eureka
instance
:
instance
:
lease-renewal-interval-in-seconds
:
4
lease-renewal-interval-in-seconds
:
4
lease-expiration-duration-in-seconds
:
12
lease-expiration-duration-in-seconds
:
12
...
...
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