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
766a9386
Commit
766a9386
authored
Aug 06, 2019
by
王俊权
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/v1' into v1
parents
e20d6103
b14ffbc1
Changes
38
Hide whitespace changes
Inline
Side-by-side
Showing
38 changed files
with
815 additions
and
96 deletions
+815
-96
ChannelConfController.java
...lowboss/api/channel/controller/ChannelConfController.java
+20
-14
ChannelConf.java
...cashloanflowboss/api/channel/entity/boss/ChannelConf.java
+1
-1
ChannelListModel.java
.../cashloanflowboss/api/channel/model/ChannelListModel.java
+22
-0
ChannelConfRepository.java
...ss/api/channel/repository/boss/ChannelConfRepository.java
+4
-2
ChannelConfService.java
...hloanflowboss/api/channel/service/ChannelConfService.java
+51
-11
LogController.java
...up/cashloanflowboss/api/log/controller/LogController.java
+2
-1
LogService.java
...antgroup/cashloanflowboss/api/log/service/LogService.java
+5
-8
Permission.java
...oup/cashloanflowboss/api/role/entity/boss/Permission.java
+1
-1
Role.java
...uantgroup/cashloanflowboss/api/role/entity/boss/Role.java
+6
-3
RoleUser.java
...group/cashloanflowboss/api/role/entity/boss/RoleUser.java
+21
-0
RoleRepository.java
.../cashloanflowboss/api/role/repository/RoleRepository.java
+0
-10
RoleRepository.java
...loanflowboss/api/role/repository/boss/RoleRepository.java
+12
-0
RoleUserRepository.java
...flowboss/api/role/repository/boss/RoleUserRepository.java
+13
-0
RoleService.java
...tgroup/cashloanflowboss/api/role/service/RoleService.java
+36
-0
TestController.java
.../cashloanflowboss/api/test/controller/TestController.java
+24
-0
UserController.java
.../cashloanflowboss/api/user/controller/UserController.java
+0
-3
ChannelUser.java
...up/cashloanflowboss/api/user/entity/boss/ChannelUser.java
+18
-0
RoleInfo.java
.../quantgroup/cashloanflowboss/api/user/model/RoleInfo.java
+13
-0
UserInfo.java
.../quantgroup/cashloanflowboss/api/user/model/UserInfo.java
+13
-0
UserSessionInfo.java
...roup/cashloanflowboss/api/user/model/UserSessionInfo.java
+14
-0
ChannelUserRepository.java
...wboss/api/user/repository/boss/ChannelUserRepository.java
+15
-0
ChannelUserService.java
...cashloanflowboss/api/user/service/ChannelUserService.java
+21
-0
UserService.java
...tgroup/cashloanflowboss/api/user/service/UserService.java
+8
-0
UserSessionService.java
...cashloanflowboss/api/user/service/UserSessionService.java
+78
-0
Power.java
...quantgroup/cashloanflowboss/component/security/Power.java
+0
-23
RoleDataLoad.java
...tgroup/cashloanflowboss/core/annotation/RoleDataLoad.java
+18
-0
RoleDataLoadAspect.java
...roup/cashloanflowboss/core/aspect/RoleDataLoadAspect.java
+67
-0
BossPageImpl.java
...n/quantgroup/cashloanflowboss/core/base/BossPageImpl.java
+98
-0
Result.java
...java/cn/quantgroup/cashloanflowboss/core/base/Result.java
+29
-0
ApplicationExceptionConfiguration.java
...core/configuration/ApplicationExceptionConfiguration.java
+2
-13
ApplicationSecurityConfiguration.java
.../core/configuration/ApplicationSecurityConfiguration.java
+2
-2
BossDSConfig.java
...ashloanflowboss/core/configuration/data/BossDSConfig.java
+1
-1
ClfDSConfig.java
...cashloanflowboss/core/configuration/data/ClfDSConfig.java
+75
-0
ApplicationDictionary.java
...shloanflowboss/core/dictionary/ApplicationDictionary.java
+2
-0
ApplicationStatus.java
...p/cashloanflowboss/core/dictionary/ApplicationStatus.java
+3
-3
ChannelConfiguration.java
...cashloanflowboss/spi/clf/entity/ChannelConfiguration.java
+92
-0
EncType.java
...cn/quantgroup/cashloanflowboss/spi/clf/model/EncType.java
+16
-0
ChannelConfigurationRepository.java
...ss/spi/clf/repository/ChannelConfigurationRepository.java
+12
-0
No files found.
src/main/java/cn/quantgroup/cashloanflowboss/api/channel/controller/ChannelConfController.java
View file @
766a9386
package
cn
.
quantgroup
.
cashloanflowboss
.
api
.
channel
.
controller
;
import
cn.quantgroup.cashloanflowboss.api.channel.model.ChannelListModel
;
import
cn.quantgroup.cashloanflowboss.api.channel.util.ChannelConfUtil
;
import
cn.quantgroup.cashloanflowboss.core.annotation.RoleDataLoad
;
import
cn.quantgroup.cashloanflowboss.spi.clf.entity.ChannelConfiguration
;
import
cn.quantgroup.cashloanflowboss.api.channel.service.ChannelConfService
;
import
cn.quantgroup.cashloanflowboss.api.user.model.Pagination
;
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.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.data.domain.Page
;
import
org.springframework.web.bind.annotation.*
;
import
java
.util.Map
;
import
java
x.validation.Valid
;
/**
* Created with suntao on 2019/8/2
* @author suntao
*/
@RestController
@RequestMapping
(
"channel
/cfg
"
)
@RequestMapping
(
"channel"
)
public
class
ChannelConfController
{
...
...
@@ -22,16 +26,18 @@ public class ChannelConfController {
private
ChannelConfService
channelConfService
;
@GetMapping
(
"/info"
)
public
Result
channelConfInfo
(
Integer
channelId
)
{
@RoleDataLoad
@PostMapping
(
"/info"
)
public
Page
<
ChannelListModel
>
channelInfo
(
Long
channelId
,
Integer
pageNumber
,
Integer
pageSize
)
{
return
channelConfService
.
getChannelInfo
(
pageNumber
,
pageSize
,
channelId
);
}
Map
<
String
,
Object
>
channelConf
=
channelConfService
.
getChannelConf
(
channelId
);
if
(
channelConf
==
null
)
{
return
new
Result
();
}
else
{
// TODO
return
null
;
}
@GetMapping
(
"/cfg/info"
)
public
Result
channelConfInfo
(
Long
channelId
)
{
return
Result
.
buildSuccess
(
channelConfService
.
getChannelConf
(
channelId
),
"success"
);
}
}
src/main/java/cn/quantgroup/cashloanflowboss/api/channel/entity/boss/ChannelConf.java
View file @
766a9386
...
...
@@ -18,7 +18,7 @@ public class ChannelConf extends Primary {
* 渠道id
*/
@Column
(
name
=
"channel_id"
)
private
Integer
channelId
;
private
Long
channelId
;
/**
* 渠道code
...
...
src/main/java/cn/quantgroup/cashloanflowboss/api/channel/model/ChannelListModel.java
0 → 100644
View file @
766a9386
package
cn
.
quantgroup
.
cashloanflowboss
.
api
.
channel
.
model
;
import
lombok.Data
;
import
java.util.Date
;
/**
* function:
* date: 2019/8/6
*
* @author: suntao
*/
@Data
public
class
ChannelListModel
{
private
Long
channelId
;
private
String
channelName
;
private
String
channelCode
;
private
Integer
bizType
;
private
Date
createdAt
;
}
src/main/java/cn/quantgroup/cashloanflowboss/api/channel/repository/boss/ChannelConfRepository.java
View file @
766a9386
package
cn
.
quantgroup
.
cashloanflowboss
.
api
.
channel
.
repository
.
boss
;
import
cn.quantgroup.cashloanflowboss.api.channel.entity.boss.ChannelConf
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.stereotype.Repository
;
/**
* Created by suntao on 2019/7/22.
* @author suntao
*/
@Repository
public
interface
ChannelConfRepository
{
public
interface
ChannelConfRepository
extends
JpaRepository
<
ChannelConf
,
Long
>
{
/**
* 获取用户
...
...
@@ -16,7 +18,7 @@ public interface ChannelConfRepository {
* @param channelId 用户名
* @return
*/
ChannelConf
getByChannelId
(
Integer
channelId
);
ChannelConf
getByChannelId
(
Long
channelId
);
}
src/main/java/cn/quantgroup/cashloanflowboss/api/channel/service/ChannelConfService.java
View file @
766a9386
package
cn
.
quantgroup
.
cashloanflowboss
.
api
.
channel
.
service
;
import
java.util.*
;
import
cn.quantgroup.cashloanflowboss.api.channel.entity.boss.ChannelConf
;
import
cn.quantgroup.cashloanflowboss.api.channel.model.ChannelListModel
;
import
cn.quantgroup.cashloanflowboss.spi.clf.entity.ChannelConfiguration
;
import
cn.quantgroup.cashloanflowboss.api.channel.repository.boss.ChannelConfRepository
;
import
cn.quantgroup.cashloanflowboss.spi.clf.repository.ChannelConfigurationRepository
;
import
cn.quantgroup.cashloanflowboss.api.channel.util.ChannelConfUtil
;
import
cn.quantgroup.cashloanflowboss.api.user.model.Pagination
;
import
cn.quantgroup.cashloanflowboss.core.base.Result
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.stereotype.Service
;
import
java
.util.Map
;
import
java
x.persistence.criteria.Predicate
;
/**
* function:
...
...
@@ -18,20 +26,52 @@ import java.util.Map;
@Service
public
class
ChannelConfService
{
//
@Autowired
//
private ChannelConfRepository channelConfRepository;
@Autowired
private
ChannelConfRepository
channelConfRepository
;
@Autowired
private
ChannelConfigurationRepository
clfChannelConfigurationRepository
;
public
Map
<
String
,
Object
>
getChannelConf
(
Integer
channelId
)
{
public
Page
<
ChannelListModel
>
getChannelInfo
(
Integer
pageNumber
,
Integer
pageSize
,
Long
channelId
)
{
// ChannelConf channelConf = channelConfRepository.getByChannelId(channelId);
// if (channelConf == null) {
// return null;
// }
//
// return ChannelConfUtil.channelConfConvertVOModel(channelConf);
return
null
;
Page
<
ChannelConfiguration
>
page
=
this
.
clfChannelConfigurationRepository
.
findAll
((
root
,
criteriaQuery
,
criteriaBuilder
)
->
{
List
<
Predicate
>
predicates
=
new
ArrayList
<>();
// 指定渠道号
if
(
Objects
.
nonNull
(
channelId
))
{
predicates
.
add
(
criteriaBuilder
.
equal
(
root
.
get
(
"registeredFrom"
),
channelId
.
longValue
()));
}
// 设置查询条件
criteriaQuery
.
where
(
criteriaBuilder
.
and
(
predicates
.
toArray
(
new
Predicate
[
predicates
.
size
()])));
// 指定排序
criteriaQuery
.
orderBy
(
criteriaBuilder
.
desc
(
root
.
get
(
"id"
)));
return
criteriaQuery
.
getRestriction
();
},
new
PageRequest
(
pageNumber
,
pageSize
));
Page
<
ChannelListModel
>
channelListModelPage
=
page
.
map
(
it
->
{
ChannelListModel
channelListModel
=
new
ChannelListModel
();
channelListModel
.
setChannelId
(
it
.
getRegisteredFrom
());
channelListModel
.
setChannelName
(
it
.
getChannelName
());
channelListModel
.
setChannelCode
(
it
.
getChannelCode
());
channelListModel
.
setBizType
(
1
);
channelListModel
.
setCreatedAt
(
it
.
getCreatedAt
());
return
channelListModel
;
});
return
channelListModelPage
;
}
public
Map
<
String
,
Object
>
getChannelConf
(
Long
channelId
)
{
ChannelConf
channelConf
=
channelConfRepository
.
getByChannelId
(
channelId
);
return
ChannelConfUtil
.
channelConfConvertVOModel
(
channelConf
);
}
}
src/main/java/cn/quantgroup/cashloanflowboss/api/log/controller/LogController.java
View file @
766a9386
...
...
@@ -2,6 +2,7 @@ package cn.quantgroup.cashloanflowboss.api.log.controller;
import
cn.quantgroup.cashloanflowboss.api.log.model.LoginFormModel
;
import
cn.quantgroup.cashloanflowboss.api.log.service.LogService
;
import
cn.quantgroup.cashloanflowboss.component.security.Authority
;
import
cn.quantgroup.cashloanflowboss.component.security.annotiation.Security
;
import
cn.quantgroup.cashloanflowboss.core.base.Result
;
import
cn.quantgroup.cashloanflowboss.core.dictionary.ApplicationStatus
;
...
...
@@ -38,8 +39,8 @@ public class LogController {
*
* @return
*/
@Security
(
authorityId
=
"Log.logout"
)
@DeleteMapping
(
"/logout"
)
@Security
(
authorityId
=
"Log.logout"
,
authorities
=
Authority
.
READ
)
public
Result
<
Boolean
>
logout
()
{
return
new
Result
<>(
ApplicationStatus
.
SUCCESS
,
this
.
logService
.
logout
());
}
...
...
src/main/java/cn/quantgroup/cashloanflowboss/api/log/service/LogService.java
View file @
766a9386
...
...
@@ -3,19 +3,16 @@ package cn.quantgroup.cashloanflowboss.api.log.service;
import
cn.quantgroup.cashloanflowboss.api.user.dictionary.UserStatus
;
import
cn.quantgroup.cashloanflowboss.api.user.entity.boss.User
;
import
cn.quantgroup.cashloanflowboss.api.user.service.UserService
;
import
cn.quantgroup.cashloanflowboss.
component.security.Authority
;
import
cn.quantgroup.cashloanflowboss.
api.user.service.UserSessionService
;
import
cn.quantgroup.cashloanflowboss.core.asserts.Assert
;
import
cn.quantgroup.cashloanflowboss.core.dictionary.ApplicationDictionary
;
import
cn.quantgroup.cashloanflowboss.core.dictionary.ApplicationStatus
;
import
cn.quantgroup.cashloanflowboss.utils.JSONTools
;
import
cn.quantgroup.cashloanflowboss.utils.MD5Tools
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpSession
;
import
java.util.HashMap
;
/**
* Created by WeiWei on 2019/7/22.
...
...
@@ -26,6 +23,8 @@ public class LogService {
@Autowired
private
UserService
userService
;
@Autowired
private
UserSessionService
userSessionService
;
@Autowired
private
HttpServletRequest
request
;
...
...
@@ -50,10 +49,8 @@ public class LogService {
// 检查密码是否正确
Assert
.
isFalse
(
user
.
getPassword
().
equalsIgnoreCase
(
MD5Tools
.
md5
(
password
)),
ApplicationStatus
.
USERNAME_OR_PASSWORD_ERROR
);
HttpSession
session
=
this
.
request
.
getSession
(
true
);
session
.
setAttribute
(
ApplicationDictionary
.
SECURITY_KEY
,
JSONTools
.
serialize
(
new
HashMap
<
String
,
Authority
>()
{{
put
(
"Log.logout"
,
Authority
.
CREATE
);
}}));
// set user session info
userSessionService
.
setUserSessionInfo
(
user
);
return
true
;
...
...
src/main/java/cn/quantgroup/cashloanflowboss/api/role/entity/Permission.java
→
src/main/java/cn/quantgroup/cashloanflowboss/api/role/entity/
boss/
Permission.java
View file @
766a9386
package
cn
.
quantgroup
.
cashloanflowboss
.
api
.
role
.
entity
;
package
cn
.
quantgroup
.
cashloanflowboss
.
api
.
role
.
entity
.
boss
;
import
cn.quantgroup.cashloanflowboss.component.security.Authority
;
import
lombok.Data
;
...
...
src/main/java/cn/quantgroup/cashloanflowboss/api/role/entity/Role.java
→
src/main/java/cn/quantgroup/cashloanflowboss/api/role/entity/
boss/
Role.java
View file @
766a9386
package
cn
.
quantgroup
.
cashloanflowboss
.
api
.
role
.
entity
;
package
cn
.
quantgroup
.
cashloanflowboss
.
api
.
role
.
entity
.
boss
;
import
cn.quantgroup.cashloanflowboss.
component.security.Authority
;
import
cn.quantgroup.cashloanflowboss.
api.role.entity.boss.Permission
;
import
cn.quantgroup.cashloanflowboss.core.persistence.Primary
;
import
lombok.Data
;
import
javax.persistence.Entity
;
import
javax.persistence.Table
;
import
javax.persistence.Transient
;
import
java.util.List
;
/**
...
...
@@ -29,6 +30,8 @@ public class Role extends Primary {
/**
* 授权列表
*/
private
List
<
Authority
>
authorities
;
@Transient
private
List
<
Permission
>
permissions
;
}
src/main/java/cn/quantgroup/cashloanflowboss/api/role/entity/boss/RoleUser.java
0 → 100644
View file @
766a9386
package
cn
.
quantgroup
.
cashloanflowboss
.
api
.
role
.
entity
.
boss
;
import
cn.quantgroup.cashloanflowboss.core.persistence.Primary
;
import
lombok.Data
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.Table
;
@Data
@Entity
@Table
(
name
=
"role_user"
)
public
class
RoleUser
extends
Primary
{
@Column
(
name
=
"role_id"
)
private
Long
roleId
;
@Column
(
name
=
"user_id"
)
private
Long
userId
;
}
src/main/java/cn/quantgroup/cashloanflowboss/api/role/repository/RoleRepository.java
deleted
100644 → 0
View file @
e20d6103
package
cn
.
quantgroup
.
cashloanflowboss
.
api
.
role
.
repository
;
import
org.springframework.stereotype.Repository
;
/**
* Created by WeiWei on 2019/7/30.
*/
@Repository
public
interface
RoleRepository
{
}
src/main/java/cn/quantgroup/cashloanflowboss/api/role/repository/boss/RoleRepository.java
0 → 100644
View file @
766a9386
package
cn
.
quantgroup
.
cashloanflowboss
.
api
.
role
.
repository
.
boss
;
import
cn.quantgroup.cashloanflowboss.api.role.entity.boss.Role
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.stereotype.Repository
;
/**
* Created by WeiWei on 2019/7/30.
*/
@Repository
public
interface
RoleRepository
extends
JpaRepository
<
Role
,
Long
>
{
}
src/main/java/cn/quantgroup/cashloanflowboss/api/role/repository/boss/RoleUserRepository.java
0 → 100644
View file @
766a9386
package
cn
.
quantgroup
.
cashloanflowboss
.
api
.
role
.
repository
.
boss
;
import
cn.quantgroup.cashloanflowboss.api.role.entity.boss.RoleUser
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.stereotype.Repository
;
@Repository
public
interface
RoleUserRepository
extends
JpaRepository
<
RoleUser
,
Long
>
{
RoleUser
findByUserId
(
Long
userId
);
}
src/main/java/cn/quantgroup/cashloanflowboss/api/role/service/RoleService.java
0 → 100644
View file @
766a9386
package
cn
.
quantgroup
.
cashloanflowboss
.
api
.
role
.
service
;
import
cn.quantgroup.cashloanflowboss.api.role.entity.boss.Role
;
import
cn.quantgroup.cashloanflowboss.api.role.entity.boss.RoleUser
;
import
cn.quantgroup.cashloanflowboss.api.role.repository.boss.RoleRepository
;
import
cn.quantgroup.cashloanflowboss.api.role.repository.boss.RoleUserRepository
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
@Slf4j
@Service
public
class
RoleService
{
@Autowired
private
RoleRepository
roleRepository
;
@Autowired
private
RoleUserRepository
roleUserRepository
;
public
Role
findRoleByUserId
(
Long
userId
)
{
RoleUser
roleUser
=
roleUserRepository
.
findByUserId
(
userId
);
if
(
null
==
roleUser
)
{
return
null
;
}
Long
roleId
=
roleUser
.
getRoleId
();
Role
role
=
findRoleByRoleId
(
roleId
);
return
role
;
}
public
Role
findRoleByRoleId
(
Long
roleId
)
{
return
roleRepository
.
findOne
(
roleId
);
}
}
src/main/java/cn/quantgroup/cashloanflowboss/api/test/controller/TestController.java
0 → 100644
View file @
766a9386
package
cn
.
quantgroup
.
cashloanflowboss
.
api
.
test
.
controller
;
import
cn.quantgroup.cashloanflowboss.api.user.model.UserSessionInfo
;
import
cn.quantgroup.cashloanflowboss.api.user.service.UserSessionService
;
import
cn.quantgroup.cashloanflowboss.core.base.Result
;
import
cn.quantgroup.cashloanflowboss.core.dictionary.ApplicationStatus
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
@RequestMapping
(
"/test"
)
public
class
TestController
{
@Autowired
private
UserSessionService
userSessionService
;
@GetMapping
(
"/user/info"
)
public
Result
findUserFromSession
()
{
UserSessionInfo
userSessionInfo
=
userSessionService
.
findUserSessionInfo
();
return
new
Result
<>(
ApplicationStatus
.
SUCCESS
,
userSessionInfo
);
}
}
src/main/java/cn/quantgroup/cashloanflowboss/api/user/controller/UserController.java
View file @
766a9386
...
...
@@ -4,9 +4,6 @@ import cn.quantgroup.cashloanflowboss.api.user.entity.boss.User;
import
cn.quantgroup.cashloanflowboss.api.user.model.Pagination
;
import
cn.quantgroup.cashloanflowboss.api.user.model.RegisterUserFormModel
;
import
cn.quantgroup.cashloanflowboss.api.user.service.UserService
;
import
cn.quantgroup.cashloanflowboss.component.security.Power
;
import
cn.quantgroup.cashloanflowboss.component.security.annotiation.Security
;
import
cn.quantgroup.cashloanflowboss.component.validator.constraints.NotEmpty
;
import
cn.quantgroup.cashloanflowboss.component.validator.constraints.NotEmpty
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
...
...
src/main/java/cn/quantgroup/cashloanflowboss/api/user/entity/boss/ChannelUser.java
0 → 100644
View file @
766a9386
package
cn
.
quantgroup
.
cashloanflowboss
.
api
.
user
.
entity
.
boss
;
import
cn.quantgroup.cashloanflowboss.core.persistence.Primary
;
import
lombok.Data
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.Table
;
@Data
@Entity
@Table
(
name
=
"channel_user"
)
public
class
ChannelUser
extends
Primary
{
@Column
(
name
=
"channel_id"
)
private
Long
channelId
;
@Column
(
name
=
"user_id"
)
private
Long
userId
;
}
src/main/java/cn/quantgroup/cashloanflowboss/api/user/model/RoleInfo.java
0 → 100644
View file @
766a9386
package
cn
.
quantgroup
.
cashloanflowboss
.
api
.
user
.
model
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
@Data
@Builder
@AllArgsConstructor
public
class
RoleInfo
{
private
Long
roleId
;
private
String
roleName
;
}
src/main/java/cn/quantgroup/cashloanflowboss/api/user/model/UserInfo.java
0 → 100644
View file @
766a9386
package
cn
.
quantgroup
.
cashloanflowboss
.
api
.
user
.
model
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
@Data
@Builder
@AllArgsConstructor
public
class
UserInfo
{
private
Long
userId
;
private
String
userName
;
}
src/main/java/cn/quantgroup/cashloanflowboss/api/user/model/UserSessionInfo.java
0 → 100644
View file @
766a9386
package
cn
.
quantgroup
.
cashloanflowboss
.
api
.
user
.
model
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
@Data
@Builder
@AllArgsConstructor
public
class
UserSessionInfo
{
private
UserInfo
userInfo
;
private
RoleInfo
roleInfo
;
private
Long
channelId
;
}
src/main/java/cn/quantgroup/cashloanflowboss/api/user/repository/boss/ChannelUserRepository.java
0 → 100644
View file @
766a9386
package
cn
.
quantgroup
.
cashloanflowboss
.
api
.
user
.
repository
.
boss
;
import
cn.quantgroup.cashloanflowboss.api.user.entity.boss.ChannelUser
;
import
org.springframework.data.repository.PagingAndSortingRepository
;
import
org.springframework.stereotype.Repository
;
/**
* Created by WeiWei on 2019/7/22.
*/
@Repository
public
interface
ChannelUserRepository
extends
PagingAndSortingRepository
<
ChannelUser
,
String
>
{
ChannelUser
findByUserId
(
Long
userId
);
}
src/main/java/cn/quantgroup/cashloanflowboss/api/user/service/ChannelUserService.java
0 → 100644
View file @
766a9386
package
cn
.
quantgroup
.
cashloanflowboss
.
api
.
user
.
service
;
import
cn.quantgroup.cashloanflowboss.api.user.entity.boss.ChannelUser
;
import
cn.quantgroup.cashloanflowboss.api.user.repository.boss.ChannelUserRepository
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
@Slf4j
@Service
public
class
ChannelUserService
{
@Autowired
private
ChannelUserRepository
channelUserRepository
;
public
ChannelUser
findChannelUserByUserId
(
Long
userId
)
{
return
channelUserRepository
.
findByUserId
(
userId
);
}
}
src/main/java/cn/quantgroup/cashloanflowboss/api/user/service/UserService.java
View file @
766a9386
...
...
@@ -2,16 +2,23 @@ package cn.quantgroup.cashloanflowboss.api.user.service;
import
cn.quantgroup.cashloanflowboss.api.user.dictionary.UserStatus
;
import
cn.quantgroup.cashloanflowboss.api.user.entity.boss.User
;
import
cn.quantgroup.cashloanflowboss.api.user.model.UserSessionInfo
;
import
cn.quantgroup.cashloanflowboss.api.user.repository.boss.UserRepository
;
import
cn.quantgroup.cashloanflowboss.core.asserts.Assert
;
import
cn.quantgroup.cashloanflowboss.core.dictionary.ApplicationDictionary
;
import
cn.quantgroup.cashloanflowboss.core.dictionary.ApplicationStatus
;
import
cn.quantgroup.cashloanflowboss.utils.JSONTools
;
import
cn.quantgroup.cashloanflowboss.utils.MD5Tools
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.context.request.RequestContextHolder
;
import
org.springframework.web.context.request.ServletRequestAttributes
;
import
javax.servlet.http.HttpSession
;
import
java.util.Objects
;
/**
...
...
@@ -130,4 +137,5 @@ public class UserService {
}
}
src/main/java/cn/quantgroup/cashloanflowboss/api/user/service/UserSessionService.java
0 → 100644
View file @
766a9386
package
cn
.
quantgroup
.
cashloanflowboss
.
api
.
user
.
service
;
import
cn.quantgroup.cashloanflowboss.api.role.entity.boss.Permission
;
import
cn.quantgroup.cashloanflowboss.api.role.entity.boss.Role
;
import
cn.quantgroup.cashloanflowboss.api.role.service.RoleService
;
import
cn.quantgroup.cashloanflowboss.api.user.entity.boss.ChannelUser
;
import
cn.quantgroup.cashloanflowboss.api.user.entity.boss.User
;
import
cn.quantgroup.cashloanflowboss.api.user.model.RoleInfo
;
import
cn.quantgroup.cashloanflowboss.api.user.model.UserInfo
;
import
cn.quantgroup.cashloanflowboss.api.user.model.UserSessionInfo
;
import
cn.quantgroup.cashloanflowboss.component.security.Authority
;
import
cn.quantgroup.cashloanflowboss.core.asserts.Assert
;
import
cn.quantgroup.cashloanflowboss.core.dictionary.ApplicationDictionary
;
import
cn.quantgroup.cashloanflowboss.core.dictionary.ApplicationStatus
;
import
cn.quantgroup.cashloanflowboss.utils.JSONTools
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.context.request.RequestContextHolder
;
import
org.springframework.web.context.request.ServletRequestAttributes
;
import
javax.servlet.http.HttpSession
;
import
java.util.Arrays
;
@Slf4j
@Service
public
class
UserSessionService
{
@Autowired
private
RoleService
roleService
;
@Autowired
private
ChannelUserService
channelUserService
;
public
void
setUserSessionInfo
(
User
user
)
{
//set user,role,channel or permission info
Role
role
=
roleService
.
findRoleByUserId
(
user
.
getId
());
String
roleName
=
null
,
userName
=
user
.
getUsername
();
Long
roleId
=
null
,
channelId
=
null
,
userId
=
user
.
getId
();
if
(
null
!=
role
)
{
roleName
=
role
.
getName
();
roleId
=
role
.
getId
();
}
ChannelUser
channelUser
=
channelUserService
.
findChannelUserByUserId
(
userId
);
if
(
null
!=
channelUser
)
{
channelId
=
channelUser
.
getChannelId
();
}
UserSessionInfo
userSessionInfo
=
UserSessionInfo
.
builder
()
.
roleInfo
(
RoleInfo
.
builder
().
roleId
(
roleId
).
roleName
(
roleName
).
build
())
.
userInfo
(
UserInfo
.
builder
().
userId
(
userId
).
userName
(
userName
).
build
())
.
channelId
(
channelId
)
.
build
();
HttpSession
session
=
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
().
getSession
();
session
.
setAttribute
(
ApplicationDictionary
.
USER_KEY
,
JSONTools
.
serialize
(
userSessionInfo
));
//todo permission后续放入UserSessionInfo结构中吧
Permission
permission
=
new
Permission
();
permission
.
setId
(
"Log.logout"
);
permission
.
setAuthorities
(
Arrays
.
asList
(
Authority
.
READ
));
session
.
setAttribute
(
ApplicationDictionary
.
SECURITY_KEY
,
JSONTools
.
serialize
(
Arrays
.
asList
(
permission
)));
}
public
UserSessionInfo
findUserSessionInfo
()
{
HttpSession
session
=
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
().
getSession
();
Assert
.
isNull
(
session
.
getAttribute
(
ApplicationDictionary
.
USER_KEY
),
ApplicationStatus
.
INVALID_USER
);
UserSessionInfo
userSessionInfo
=
JSONTools
.
deserialize
(
String
.
valueOf
(
session
.
getAttribute
(
ApplicationDictionary
.
USER_KEY
)),
new
TypeReference
<
UserSessionInfo
>()
{
});
return
userSessionInfo
;
}
}
src/main/java/cn/quantgroup/cashloanflowboss/component/security/Power.java
deleted
100644 → 0
View file @
e20d6103
package
cn
.
quantgroup
.
cashloanflowboss
.
component
.
security
;
/**
* Created by WeiWei on 2019/7/26.
*/
public
enum
Power
{
/**
* 新建
*/
CREATE
,
/**
* 更新
*/
UPDATE
,
/**
* 删除
*/
DELETE
}
src/main/java/cn/quantgroup/cashloanflowboss/core/annotation/RoleDataLoad.java
0 → 100644
View file @
766a9386
package
cn
.
quantgroup
.
cashloanflowboss
.
core
.
annotation
;
import
java.lang.annotation.Retention
;
import
java.lang.annotation.Target
;
import
static
java
.
lang
.
annotation
.
ElementType
.
METHOD
;
import
static
java
.
lang
.
annotation
.
RetentionPolicy
.
RUNTIME
;
/**
* function:
* date: 2019/8/6
*
* @author: suntao
*/
@Target
({
METHOD
})
@Retention
(
RUNTIME
)
public
@interface
RoleDataLoad
{
}
src/main/java/cn/quantgroup/cashloanflowboss/core/aspect/RoleDataLoadAspect.java
0 → 100644
View file @
766a9386
package
cn
.
quantgroup
.
cashloanflowboss
.
core
.
aspect
;
import
cn.quantgroup.cashloanflowboss.api.channel.model.ChannelListModel
;
import
cn.quantgroup.cashloanflowboss.api.user.model.UserSessionInfo
;
import
cn.quantgroup.cashloanflowboss.api.user.service.UserSessionService
;
import
cn.quantgroup.cashloanflowboss.core.annotation.RoleDataLoad
;
import
cn.quantgroup.cashloanflowboss.core.base.BossPageImpl
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.exception.ExceptionUtils
;
import
org.aspectj.lang.ProceedingJoinPoint
;
import
org.aspectj.lang.annotation.Around
;
import
org.aspectj.lang.annotation.Aspect
;
import
org.aspectj.lang.annotation.Pointcut
;
import
org.aspectj.lang.reflect.MethodSignature
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.core.Ordered
;
import
org.springframework.core.annotation.Order
;
import
org.springframework.core.convert.converter.Converter
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.domain.Sort
;
import
org.springframework.stereotype.Component
;
import
java.lang.reflect.Method
;
import
java.util.Iterator
;
import
java.util.List
;
/**
* function:
* date: 2019/8/6
*
* @author: suntao
*/
@Slf4j
@Component
@Aspect
@Order
(
Ordered
.
HIGHEST_PRECEDENCE
)
public
class
RoleDataLoadAspect
{
@Autowired
private
UserSessionService
userSessionService
;
@Pointcut
(
"execution(* cn.quantgroup.cashloanflowboss.api.channel.controller.*.*(..))"
)
private
void
channelRoleInit
()
{}
@Around
(
value
=
"channelRoleInit()"
)
public
Object
around
(
ProceedingJoinPoint
pjp
)
{
Object
[]
args
=
pjp
.
getArgs
();
MethodSignature
methodSignature
=
(
MethodSignature
)
pjp
.
getSignature
();
Method
method
=
methodSignature
.
getMethod
();
RoleDataLoad
annotation
=
method
.
getAnnotation
(
RoleDataLoad
.
class
);
UserSessionInfo
userSessionInfo
=
userSessionService
.
findUserSessionInfo
();
// todo channel_role 定义为常量吧
if
(
annotation
!=
null
&&
"channel_role"
.
equals
(
userSessionInfo
.
getRoleInfo
().
getRoleName
()))
{
args
[
0
]
=
userSessionInfo
.
getChannelId
();
}
try
{
return
pjp
.
proceed
(
args
);
}
catch
(
Throwable
throwable
)
{
log
.
error
(
"查询渠道列表错误e={}"
,
ExceptionUtils
.
getStackTrace
(
throwable
));
return
new
BossPageImpl
<>();
}
}
}
src/main/java/cn/quantgroup/cashloanflowboss/core/base/BossPageImpl.java
0 → 100644
View file @
766a9386
package
cn
.
quantgroup
.
cashloanflowboss
.
core
.
base
;
import
org.springframework.core.convert.converter.Converter
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.domain.Sort
;
import
java.util.Iterator
;
import
java.util.List
;
/**
* function:
* date: 2019/8/6
*
* @author: suntao
*/
public
class
BossPageImpl
<
T
>
implements
Page
{
@Override
public
int
getTotalPages
()
{
return
0
;
}
@Override
public
long
getTotalElements
()
{
return
0
;
}
@Override
public
Page
map
(
Converter
converter
)
{
return
null
;
}
@Override
public
int
getNumber
()
{
return
0
;
}
@Override
public
int
getSize
()
{
return
0
;
}
@Override
public
int
getNumberOfElements
()
{
return
0
;
}
@Override
public
List
getContent
()
{
return
null
;
}
@Override
public
boolean
hasContent
()
{
return
false
;
}
@Override
public
Sort
getSort
()
{
return
null
;
}
@Override
public
boolean
isFirst
()
{
return
false
;
}
@Override
public
boolean
isLast
()
{
return
false
;
}
@Override
public
boolean
hasNext
()
{
return
false
;
}
@Override
public
boolean
hasPrevious
()
{
return
false
;
}
@Override
public
Pageable
nextPageable
()
{
return
null
;
}
@Override
public
Pageable
previousPageable
()
{
return
null
;
}
@Override
public
Iterator
iterator
()
{
return
null
;
}
}
src/main/java/cn/quantgroup/cashloanflowboss/core/base/Result.java
View file @
766a9386
package
cn
.
quantgroup
.
cashloanflowboss
.
core
.
base
;
import
cn.quantgroup.cashloanflowboss.core.dictionary.ApplicationStatus
;
import
cn.quantgroup.cashloanflowboss.core.dictionary.Status
;
import
lombok.Data
;
...
...
@@ -50,4 +51,32 @@ public class Result<T> {
}
@SuppressWarnings
(
"unchecked"
)
public
static
<
T
>
Result
buildSuccess
(
T
data
)
{
return
new
Result
(
ApplicationStatus
.
SUCCESS
,
data
);
}
@SuppressWarnings
(
"unchecked"
)
public
static
<
T
>
Result
buildSuccess
(
T
data
,
String
message
)
{
return
new
Result
(
ApplicationStatus
.
SUCCESS
,
data
,
message
);
}
@SuppressWarnings
(
"unchecked"
)
public
static
<
T
>
Result
buildFial
(
T
data
)
{
return
new
Result
(
ApplicationStatus
.
FAILURE
,
data
);
}
@SuppressWarnings
(
"unchecked"
)
public
static
<
T
>
Result
buildFial
(
String
message
)
{
return
new
Result
(
ApplicationStatus
.
FAILURE
,
null
,
message
);
}
@SuppressWarnings
(
"unchecked"
)
public
static
<
T
>
Result
buildFial
(
T
data
,
String
message
)
{
return
new
Result
(
ApplicationStatus
.
FAILURE
,
data
,
message
);
}
}
src/main/java/cn/quantgroup/cashloanflowboss/core/configuration/ApplicationExceptionConfiguration.java
View file @
766a9386
...
...
@@ -36,7 +36,6 @@ public class ApplicationExceptionConfiguration {
*/
@ExceptionHandler
({
ApplicationException
.
class
})
public
Result
applicationExceptionHandler
(
ApplicationException
e
)
{
log
.
error
(
"程序员开小差了,系统异常信息:{}"
,
e
.
getMessage
());
return
new
Result
<>(
e
.
getStatus
(),
null
,
e
.
getStatus
().
getMessage
());
}
...
...
@@ -96,19 +95,9 @@ public class ApplicationExceptionConfiguration {
@ExceptionHandler
({
Throwable
.
class
})
public
Result
generalException
(
Throwable
e
)
{
Throwable
cause
=
e
;
log
.
error
(
e
.
getMessage
(),
e
)
;
while
((
cause
=
cause
.
getCause
())
!=
null
)
{
if
(
ApplicationException
.
class
.
isAssignableFrom
(
cause
.
getClass
()))
{
cause
=
cause
.
getCause
();
break
;
}
}
String
errorMessage
=
ApplicationException
.
class
.
isAssignableFrom
(
e
.
getClass
())
?
cause
.
getMessage
()
:
e
.
getMessage
();
log
.
error
(
"程序员开小差了,未明确的异常信息:{}"
,
errorMessage
);
return
new
Result
<>(
ApplicationStatus
.
INTERNAL_SERVICE_ERROR
,
ApplicationStatus
.
INTERNAL_SERVICE_ERROR
.
getMessage
());
return
new
Result
<>(
ApplicationStatus
.
INTERNAL_SERVICE_ERROR
);
}
...
...
src/main/java/cn/quantgroup/cashloanflowboss/core/configuration/ApplicationSecurityConfiguration.java
View file @
766a9386
package
cn
.
quantgroup
.
cashloanflowboss
.
core
.
configuration
;
import
cn.quantgroup.cashloanflowboss.api.role.entity.Permission
;
import
cn.quantgroup.cashloanflowboss.api.role.entity.
boss.
Permission
;
import
cn.quantgroup.cashloanflowboss.component.security.Authority
;
import
cn.quantgroup.cashloanflowboss.component.security.SecurityHandler
;
import
cn.quantgroup.cashloanflowboss.core.asserts.Assert
;
...
...
@@ -34,7 +34,7 @@ public class ApplicationSecurityConfiguration implements SecurityHandler {
HttpSession
session
=
this
.
request
.
getSession
(
false
);
// 检查是否已登录
Assert
.
is
Null
(
session
.
getAttribute
(
ApplicationDictionary
.
SECURITY_KEY
),
ApplicationStatus
.
AUTHENTICATION_FAILURE
);
Assert
.
is
True
((
Objects
.
isNull
(
session
)
||
Objects
.
isNull
(
session
.
getAttribute
(
ApplicationDictionary
.
SECURITY_KEY
))
),
ApplicationStatus
.
AUTHENTICATION_FAILURE
);
// 读取Session授权内容
List
<
Permission
>
permissions
=
JSONTools
.
deserialize
(
String
.
valueOf
(
session
.
getAttribute
(
ApplicationDictionary
.
SECURITY_KEY
)),
new
TypeReference
<
List
<
Permission
>>()
{});
...
...
src/main/java/cn/quantgroup/cashloanflowboss/core/configuration/data/BossDSConfig.java
View file @
766a9386
...
...
@@ -65,7 +65,7 @@ public class BossDSConfig {
public
LocalContainerEntityManagerFactoryBean
entityManager
(
EntityManagerFactoryBuilder
builder
)
{
return
builder
.
dataSource
(
createDataSource
())
.
packages
(
"cn.quantgroup.cashloanflowboss.api.
user
.entity.boss"
)
.
packages
(
"cn.quantgroup.cashloanflowboss.api.
*
.entity.boss"
)
.
persistenceUnit
(
uniquename
)
.
build
();
}
...
...
src/main/java/cn/quantgroup/cashloanflowboss/core/configuration/data/ClfDSConfig.java
0 → 100644
View file @
766a9386
package
cn
.
quantgroup
.
cashloanflowboss
.
core
.
configuration
.
data
;
import
com.alibaba.druid.pool.DruidDataSource
;
import
com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.autoconfigure.domain.EntityScan
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Primary
;
import
org.springframework.data.jpa.repository.config.EnableJpaRepositories
;
import
org.springframework.orm.jpa.JpaTransactionManager
;
import
org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean
;
import
org.springframework.transaction.PlatformTransactionManager
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
import
javax.persistence.EntityManagerFactory
;
import
javax.sql.DataSource
;
@Configuration
@EnableTransactionManagement
@EnableJpaRepositories
(
basePackages
=
{
"cn.quantgroup.cashloanflowboss.spi.clf.repository"
},
entityManagerFactoryRef
=
"clfEntityManager"
,
transactionManagerRef
=
"clfTransactionManager"
)
public
class
ClfDSConfig
{
@Value
(
"${data.clf.url}"
)
private
String
jdbcUrl
;
@Value
(
"${data.clf.password}"
)
private
String
password
;
@Value
(
"${data.clf.username}"
)
private
String
user
;
private
String
uniquename
=
"clfDS"
;
@Value
(
"${data.clf.pool-size}"
)
private
Integer
poolSize
;
@Bean
(
name
=
"clfDataSource"
)
@ConfigurationProperties
(
prefix
=
"data.clf"
)
public
DataSource
createDataSource
()
{
DruidDataSource
source
=
DruidDataSourceBuilder
.
create
().
build
();
source
.
setMaxActive
(
200
);
source
.
setMinIdle
(
10
);
source
.
setInitialSize
(
10
);
source
.
setMaxWait
(
500000
);
source
.
setTimeBetweenEvictionRunsMillis
(
60000
);
source
.
setMinEvictableIdleTimeMillis
(
300000
);
source
.
setValidationQuery
(
"SELECT 'x'"
);
source
.
setTestWhileIdle
(
true
);
source
.
setTestOnBorrow
(
false
);
source
.
setTestOnReturn
(
false
);
source
.
setPoolPreparedStatements
(
Boolean
.
FALSE
);
return
source
;
}
@Bean
(
name
=
"clfEntityManager"
)
public
LocalContainerEntityManagerFactoryBean
entityManager
(
EntityManagerFactoryBuilder
builder
)
{
return
builder
.
dataSource
(
createDataSource
())
.
packages
(
"cn.quantgroup.cashloanflowboss.spi.clf.entity"
)
.
persistenceUnit
(
uniquename
)
.
build
();
}
@Bean
(
name
=
"clfTransactionManager"
)
public
PlatformTransactionManager
transactionManager
(
@Qualifier
(
"clfEntityManager"
)
EntityManagerFactory
entityManagerFactory
)
{
return
new
JpaTransactionManager
(
entityManagerFactory
);
}
}
src/main/java/cn/quantgroup/cashloanflowboss/core/dictionary/ApplicationDictionary.java
View file @
766a9386
...
...
@@ -9,5 +9,7 @@ public final class ApplicationDictionary {
// 权限Session Key
public
static
final
String
SECURITY_KEY
=
"PERMISSION"
;
// user Session key
public
static
final
String
USER_KEY
=
"USER"
;
}
src/main/java/cn/quantgroup/cashloanflowboss/core/dictionary/ApplicationStatus.java
View file @
766a9386
...
...
@@ -27,11 +27,11 @@ public enum ApplicationStatus implements Status<ApplicationStatus> {
INVALID_AUTHORITY
(
501001
,
"无效的授权"
),
INVALID_USER
(
50100
1
,
"无效的用户"
),
INVALID_USER
(
50100
2
,
"无效的用户"
),
DISABLED_USER
(
50100
2
,
"用户已被禁用"
),
DISABLED_USER
(
50100
3
,
"用户已被禁用"
),
USERNAME_OR_PASSWORD_ERROR
(
50100
3
,
"用户名或密码错误"
);
USERNAME_OR_PASSWORD_ERROR
(
50100
4
,
"用户名或密码错误"
);
private
int
code
;
...
...
src/main/java/cn/quantgroup/cashloanflowboss/spi/clf/entity/ChannelConfiguration.java
0 → 100644
View file @
766a9386
package
cn
.
quantgroup
.
cashloanflowboss
.
spi
.
clf
.
entity
;
import
cn.quantgroup.cashloanflowboss.spi.clf.model.EncType
;
import
lombok.Data
;
import
javax.persistence.*
;
import
java.io.Serializable
;
import
java.sql.Timestamp
;
/**
* Created by wudi on 2016/11/28.
*/
@Data
@Entity
@Table
(
name
=
"channel_configuration"
,
catalog
=
"cash_loan_flow"
)
public
class
ChannelConfiguration
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
1L
;
@Id
@Column
(
name
=
"id"
)
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
Long
id
;
@Column
(
name
=
"channel_name"
)
private
String
channelName
;
@Column
(
name
=
"channel_code"
)
private
String
channelCode
;
@Column
(
name
=
"registered_from"
)
private
Long
registeredFrom
;
/**
* 默认有效
*/
@Column
(
name
=
"is_active"
)
private
Boolean
isActive
=
Boolean
.
TRUE
;
@Column
(
name
=
"created_at"
)
private
Timestamp
createdAt
=
new
Timestamp
(
System
.
currentTimeMillis
());
/**
* 请求是否使用标准api
*/
@Column
(
name
=
"is_request_standard"
)
private
Boolean
isRequestStandard
=
Boolean
.
FALSE
;
/**
* 加密类型
*/
@Column
(
name
=
"enc_type"
)
private
EncType
encType
=
EncType
.
AES
;
/**
* aes加密key
*/
@Column
(
name
=
"aes_key"
)
private
String
aesKey
;
/**
* md5摘要key
*/
@Column
(
name
=
"md5_key"
)
private
String
md5Key
;
/**
* 授信中心channelCode, 爬虫提交channelCode
*/
@Column
(
name
=
"spider_center_channel_code"
)
private
String
spiderCenterChannelCode
;
/**
* 授信中心商户渠道channelCode,授信授权提交channelCode
*/
@Column
(
name
=
"spider_center_merchant_channel_code"
)
private
String
spiderCenterMerchantChannelCode
;
/**
* 渠道认证选项
*/
@Column
(
name
=
"auth_option"
)
private
String
authOption
;
/**
* 免密登陆跳转url
*/
@Column
(
name
=
"login_page_url"
)
private
String
loginPageUrl
;
}
\ No newline at end of file
src/main/java/cn/quantgroup/cashloanflowboss/spi/clf/model/EncType.java
0 → 100644
View file @
766a9386
package
cn
.
quantgroup
.
cashloanflowboss
.
spi
.
clf
.
model
;
/**
* Created by liqing on 2017/4/26 0026.
* 加解密方式
*/
public
enum
EncType
{
AES
(
"AES"
,
"aesStandardCryptoService"
),
RSA
(
"RSA"
,
"rsaStandardCryptoService"
),
NONE
(
"NONE"
,
"noneStandardCryptoService"
);
public
String
text
;
public
String
serviceClass
;
EncType
(
String
text
,
String
serviceClass
){
this
.
text
=
text
;
this
.
serviceClass
=
serviceClass
;
}
}
src/main/java/cn/quantgroup/cashloanflowboss/spi/clf/repository/ChannelConfigurationRepository.java
0 → 100644
View file @
766a9386
package
cn
.
quantgroup
.
cashloanflowboss
.
spi
.
clf
.
repository
;
import
cn.quantgroup.cashloanflowboss.spi.clf.entity.ChannelConfiguration
;
import
org.springframework.data.jpa.repository.JpaSpecificationExecutor
;
import
org.springframework.data.repository.PagingAndSortingRepository
;
import
org.springframework.stereotype.Repository
;
@Repository
public
interface
ChannelConfigurationRepository
extends
PagingAndSortingRepository
<
ChannelConfiguration
,
Long
>,
JpaSpecificationExecutor
<
ChannelConfiguration
>
{
}
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