Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
guns-vip
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
chenjunxiong
guns-vip
Commits
7cde7d54
Commit
7cde7d54
authored
May 05, 2017
by
fsn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码整理
parent
d9143243
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
79 additions
and
11 deletions
+79
-11
src/main/java/com/stylefeng/guns/modular/system/controller/MenuController.java
+5
-7
src/main/java/com/stylefeng/guns/modular/system/controller/RoleController.java
+1
-4
src/main/java/com/stylefeng/guns/modular/system/service/IMenuService.java
+18
-0
src/main/java/com/stylefeng/guns/modular/system/service/IRoleService.java
+8
-0
src/main/java/com/stylefeng/guns/modular/system/service/impl/MenuServiceImpl.java
+34
-0
src/main/java/com/stylefeng/guns/modular/system/service/impl/RoleServiceImpl.java
+13
-0
No files found.
src/main/java/com/stylefeng/guns/modular/system/controller/MenuController.java
View file @
7cde7d54
...
@@ -12,6 +12,7 @@ import com.stylefeng.guns.common.node.ZTreeNode;
...
@@ -12,6 +12,7 @@ import com.stylefeng.guns.common.node.ZTreeNode;
import
com.stylefeng.guns.core.log.LogObjectHolder
;
import
com.stylefeng.guns.core.log.LogObjectHolder
;
import
com.stylefeng.guns.core.util.ToolUtil
;
import
com.stylefeng.guns.core.util.ToolUtil
;
import
com.stylefeng.guns.modular.system.dao.MenuDao
;
import
com.stylefeng.guns.modular.system.dao.MenuDao
;
import
com.stylefeng.guns.modular.system.service.IMenuService
;
import
com.stylefeng.guns.modular.system.warpper.MenuWarpper
;
import
com.stylefeng.guns.modular.system.warpper.MenuWarpper
;
import
com.stylefeng.guns.persistence.dao.MenuMapper
;
import
com.stylefeng.guns.persistence.dao.MenuMapper
;
import
com.stylefeng.guns.persistence.model.Menu
;
import
com.stylefeng.guns.persistence.model.Menu
;
...
@@ -46,6 +47,9 @@ public class MenuController extends BaseController {
...
@@ -46,6 +47,9 @@ public class MenuController extends BaseController {
@Resource
@Resource
MenuDao
menuDao
;
MenuDao
menuDao
;
@Resource
IMenuService
menuService
;
/**
/**
* 跳转到菜单列表列表页面
* 跳转到菜单列表列表页面
*/
*/
...
@@ -128,13 +132,7 @@ public class MenuController extends BaseController {
...
@@ -128,13 +132,7 @@ public class MenuController extends BaseController {
if
(
ToolUtil
.
isEmpty
(
menuId
))
{
if
(
ToolUtil
.
isEmpty
(
menuId
))
{
throw
new
BussinessException
(
BizExceptionEnum
.
REQUEST_NULL
);
throw
new
BussinessException
(
BizExceptionEnum
.
REQUEST_NULL
);
}
}
this
.
menuService
.
delMenu
(
menuId
);
//删除菜单
this
.
menuMapper
.
deleteById
(
menuId
);
//删除关联的relation
this
.
menuDao
.
deleteRelationByMenu
(
menuId
);
return
SUCCESS_TIP
;
return
SUCCESS_TIP
;
}
}
...
...
src/main/java/com/stylefeng/guns/modular/system/controller/RoleController.java
View file @
7cde7d54
...
@@ -158,10 +158,7 @@ public class RoleController extends BaseController {
...
@@ -158,10 +158,7 @@ public class RoleController extends BaseController {
if
(
ToolUtil
.
isEmpty
(
roleId
))
{
if
(
ToolUtil
.
isEmpty
(
roleId
))
{
throw
new
BussinessException
(
BizExceptionEnum
.
REQUEST_NULL
);
throw
new
BussinessException
(
BizExceptionEnum
.
REQUEST_NULL
);
}
}
this
.
roleMapper
.
deleteById
(
roleId
);
this
.
roleService
.
delRoleById
(
roleId
);
// 删除该角色所有的权限
this
.
roleDao
.
deleteRolesById
(
roleId
);
//删除缓存
//删除缓存
CacheKit
.
removeAll
(
Cache
.
CONSTANT
);
CacheKit
.
removeAll
(
Cache
.
CONSTANT
);
...
...
src/main/java/com/stylefeng/guns/modular/system/service/IMenuService.java
0 → 100644
View file @
7cde7d54
package
com
.
stylefeng
.
guns
.
modular
.
system
.
service
;
/**
* 菜单服务
*
* @author fengshuonan
* @date 2017-05-05 22:19
*/
public
interface
IMenuService
{
/**
* 删除菜单
*
* @author stylefeng
* @Date 2017/5/5 22:20
*/
void
delMenu
(
Integer
menuId
);
}
src/main/java/com/stylefeng/guns/modular/system/service/IRoleService.java
View file @
7cde7d54
...
@@ -16,4 +16,12 @@ public interface IRoleService {
...
@@ -16,4 +16,12 @@ public interface IRoleService {
* @date 2017年2月13日 下午8:26:53
* @date 2017年2月13日 下午8:26:53
*/
*/
void
setAuthority
(
Integer
roleId
,
String
ids
);
void
setAuthority
(
Integer
roleId
,
String
ids
);
/**
* 删除角色
*
* @author stylefeng
* @Date 2017/5/5 22:24
*/
void
delRoleById
(
Integer
roleId
);
}
}
src/main/java/com/stylefeng/guns/modular/system/service/impl/MenuServiceImpl.java
0 → 100644
View file @
7cde7d54
package
com
.
stylefeng
.
guns
.
modular
.
system
.
service
.
impl
;
import
com.stylefeng.guns.modular.system.dao.MenuDao
;
import
com.stylefeng.guns.modular.system.service.IMenuService
;
import
com.stylefeng.guns.persistence.dao.MenuMapper
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
/**
* 菜单服务
*
* @author fengshuonan
* @date 2017-05-05 22:20
*/
@Service
public
class
MenuServiceImpl
implements
IMenuService
{
@Resource
MenuMapper
menuMapper
;
@Resource
MenuDao
menuDao
;
@Override
public
void
delMenu
(
Integer
menuId
)
{
//删除菜单
this
.
menuMapper
.
deleteById
(
menuId
);
//删除关联的relation
this
.
menuDao
.
deleteRelationByMenu
(
menuId
);
}
}
src/main/java/com/stylefeng/guns/modular/system/service/impl/RoleServiceImpl.java
View file @
7cde7d54
...
@@ -5,6 +5,7 @@ import com.stylefeng.guns.core.util.Convert;
...
@@ -5,6 +5,7 @@ import com.stylefeng.guns.core.util.Convert;
import
com.stylefeng.guns.modular.system.dao.RoleDao
;
import
com.stylefeng.guns.modular.system.dao.RoleDao
;
import
com.stylefeng.guns.modular.system.service.IRoleService
;
import
com.stylefeng.guns.modular.system.service.IRoleService
;
import
com.stylefeng.guns.persistence.dao.RelationMapper
;
import
com.stylefeng.guns.persistence.dao.RelationMapper
;
import
com.stylefeng.guns.persistence.dao.RoleMapper
;
import
com.stylefeng.guns.persistence.model.Relation
;
import
com.stylefeng.guns.persistence.model.Relation
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -15,6 +16,9 @@ import javax.annotation.Resource;
...
@@ -15,6 +16,9 @@ import javax.annotation.Resource;
public
class
RoleServiceImpl
implements
IRoleService
{
public
class
RoleServiceImpl
implements
IRoleService
{
@Resource
@Resource
RoleMapper
roleMapper
;
@Resource
RoleDao
roleDao
;
RoleDao
roleDao
;
@Resource
@Resource
...
@@ -37,4 +41,13 @@ public class RoleServiceImpl implements IRoleService {
...
@@ -37,4 +41,13 @@ public class RoleServiceImpl implements IRoleService {
}
}
}
}
@Override
public
void
delRoleById
(
Integer
roleId
)
{
//删除角色
this
.
roleMapper
.
deleteById
(
roleId
);
// 删除该角色所有的权限
this
.
roleDao
.
deleteRolesById
(
roleId
);
}
}
}
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