Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cash-loan-flow-boss
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QG
cash-loan-flow-boss
Commits
ca144c25
Commit
ca144c25
authored
Mar 06, 2020
by
王向伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加权限接口
parent
92d62da3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
12 deletions
+54
-12
PermissionController.java
...api/permissionmodule/controller/PermissionController.java
+9
-6
IPermissionService.java
...boss/api/permissionmodule/service/IPermissionService.java
+15
-0
PermissionServiceImpl.java
...s/api/permissionmodule/service/PermissionServiceImpl.java
+25
-0
UserServiceImpl.java
...up/cashloanflowboss/api/user/service/UserServiceImpl.java
+5
-6
No files found.
src/main/java/cn/quantgroup/cashloanflowboss/api/permissionmodule/controller/PermissionController.java
View file @
ca144c25
package
cn
.
quantgroup
.
cashloanflowboss
.
api
.
permissionmodule
.
controller
;
package
cn
.
quantgroup
.
cashloanflowboss
.
api
.
permissionmodule
.
controller
;
import
cn.quantgroup.cashloanflowboss.api.permissionmodule.model.PermissionVO
;
import
cn.quantgroup.cashloanflowboss.api.permissionmodule.model.PermissionVO
;
import
cn.quantgroup.cashloanflowboss.api.permissionmodule.service.IPermissionService
;
import
cn.quantgroup.cashloanflowboss.component.security.annotiation.Security
;
import
cn.quantgroup.cashloanflowboss.component.security.annotiation.Security
;
import
cn.quantgroup.cashloanflowboss.core.base.Result
;
import
cn.quantgroup.cashloanflowboss.core.base.Result
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
@@ -19,6 +21,8 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -19,6 +21,8 @@ import org.springframework.web.bind.annotation.RestController;
public
class
PermissionController
{
public
class
PermissionController
{
@Autowired
private
IPermissionService
permissionService
;
/**
/**
* 角色 未拥有的权限
* 角色 未拥有的权限
* @param roleId
* @param roleId
...
@@ -33,14 +37,13 @@ public class PermissionController {
...
@@ -33,14 +37,13 @@ public class PermissionController {
/**
/**
* 权限列表
* 权限列表
* @param permissionVO
* @return
* @return
*/
*/
@GetMapping
(
"
list
"
)
@GetMapping
(
"
all
"
)
@Security
(
authorityId
=
"Permission.permissionList"
)
//
@Security(authorityId = "Permission.permissionList")
public
Result
permissionList
(
PermissionVO
permissionVO
)
{
public
Result
permissionList
()
{
// 分页查询
return
null
;
return
permissionService
.
getAll
()
;
}
}
/**
/**
...
...
src/main/java/cn/quantgroup/cashloanflowboss/api/permissionmodule/service/IPermissionService.java
0 → 100644
View file @
ca144c25
package
cn
.
quantgroup
.
cashloanflowboss
.
api
.
permissionmodule
.
service
;
import
cn.quantgroup.cashloanflowboss.api.permissionmodule.entity.Permission
;
import
cn.quantgroup.cashloanflowboss.core.base.Result
;
import
java.util.List
;
/**
* @author Wang Xiangwei
* @version 2020/3/6
*/
public
interface
IPermissionService
{
Result
<
List
<
Permission
>>
getAll
();
}
src/main/java/cn/quantgroup/cashloanflowboss/api/permissionmodule/service/PermissionServiceImpl.java
0 → 100644
View file @
ca144c25
package
cn
.
quantgroup
.
cashloanflowboss
.
api
.
permissionmodule
.
service
;
import
cn.quantgroup.cashloanflowboss.api.permissionmodule.entity.Permission
;
import
cn.quantgroup.cashloanflowboss.api.permissionmodule.repository.PermissionRepository
;
import
cn.quantgroup.cashloanflowboss.core.base.Result
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* @author Wang Xiangwei
* @version 2020/3/6
*/
@Service
public
class
PermissionServiceImpl
implements
IPermissionService
{
@Autowired
private
PermissionRepository
permissionRepository
;
@Override
public
Result
<
List
<
Permission
>>
getAll
()
{
List
<
Permission
>
permissionList
=
permissionRepository
.
findAll
();
return
Result
.
buildSuccess
(
permissionList
);
}
}
src/main/java/cn/quantgroup/cashloanflowboss/api/user/service/UserServiceImpl.java
View file @
ca144c25
...
@@ -231,7 +231,6 @@ public class UserServiceImpl implements UserService {
...
@@ -231,7 +231,6 @@ public class UserServiceImpl implements UserService {
return
Result
.
buildFail
(
username
+
" 账户已存在"
);
return
Result
.
buildFail
(
username
+
" 账户已存在"
);
}
}
Long
roleId
=
userModelVo
.
getRoleId
();
Long
roleId
=
userModelVo
.
getRoleId
();
Role
role
=
null
;
Role
role
=
null
;
if
(
roleId
!=
null
)
{
if
(
roleId
!=
null
)
{
...
@@ -246,14 +245,13 @@ public class UserServiceImpl implements UserService {
...
@@ -246,14 +245,13 @@ public class UserServiceImpl implements UserService {
//渠道检查
//渠道检查
Long
channelId
=
user
.
getChannelId
();
Long
channelId
=
user
.
getChannelId
();
if
(
channelId
!=
null
)
{
if
(
channelId
!=
null
)
{
if
(!
clfChannelConfigurationRepository
.
exists
(
channelId
))
{
ClfChannelConfiguration
configuration
=
clfChannelConfigurationRepository
.
findByRegisteredFrom
(
channelId
);
if
(
configuration
==
null
){
log
.
error
(
"{},渠道不存在 channelId={}"
,
LOG_PRE
,
channelId
);
log
.
error
(
"{},渠道不存在 channelId={}"
,
LOG_PRE
,
channelId
);
return
Result
.
buildFail
(
"channelId="
+
channelId
+
"的渠道不存在"
);
return
Result
.
buildFail
(
"channelId="
+
channelId
+
"的渠道不存在"
);
}
}
ClfChannelConfiguration
configuration
=
clfChannelConfigurationRepository
.
findOne
(
channelId
);
user
.
setChannelName
(
configuration
.
getChannelName
());
user
.
setChannelName
(
configuration
.
getChannelName
());
}
}
userRepository
.
save
(
user
);
userRepository
.
save
(
user
);
return
Result
.
buildSuccess
(
true
);
return
Result
.
buildSuccess
(
true
);
}
}
...
@@ -296,12 +294,13 @@ public class UserServiceImpl implements UserService {
...
@@ -296,12 +294,13 @@ public class UserServiceImpl implements UserService {
Long
channelId
=
exist
.
getChannelId
();
Long
channelId
=
exist
.
getChannelId
();
//渠道检查
if
(
channelId
!=
null
)
{
if
(
channelId
!=
null
)
{
if
(!
clfChannelConfigurationRepository
.
exists
(
channelId
))
{
ClfChannelConfiguration
configuration
=
clfChannelConfigurationRepository
.
findByRegisteredFrom
(
channelId
);
if
(
configuration
==
null
){
log
.
error
(
"{},渠道不存在 channelId={}"
,
LOG_PRE
,
channelId
);
log
.
error
(
"{},渠道不存在 channelId={}"
,
LOG_PRE
,
channelId
);
return
Result
.
buildFail
(
"channelId="
+
channelId
+
"的渠道不存在"
);
return
Result
.
buildFail
(
"channelId="
+
channelId
+
"的渠道不存在"
);
}
}
ClfChannelConfiguration
configuration
=
clfChannelConfigurationRepository
.
findOne
(
channelId
);
exist
.
setChannelName
(
configuration
.
getChannelName
());
exist
.
setChannelName
(
configuration
.
getChannelName
());
}
}
...
...
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