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
4354c86c
Commit
4354c86c
authored
Aug 06, 2019
by
suntao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
channelconf
parent
29490912
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
289 additions
and
23 deletions
+289
-23
ChannelConfController.java
...lowboss/api/channel/controller/ChannelConfController.java
+16
-9
ChannelConfiguration.java
...flowboss/api/channel/entity/clf/ChannelConfiguration.java
+92
-0
ChannelConfAddModel.java
...nflowboss/api/channel/model/boss/ChannelConfAddModel.java
+1
-1
ChannelConfBaseModel.java
...flowboss/api/channel/model/boss/ChannelConfBaseModel.java
+1
-1
ChannelConfigurationPage.java
...wboss/api/channel/model/clf/ChannelConfigurationPage.java
+10
-0
EncType.java
...group/cashloanflowboss/api/channel/model/clf/EncType.java
+16
-0
ChannelConfigurationRepository.java
...hannel/repository/clf/ChannelConfigurationRepository.java
+22
-0
ChannelConfService.java
...hloanflowboss/api/channel/service/ChannelConfService.java
+26
-10
ChannelConfUtil.java
...up/cashloanflowboss/api/channel/util/ChannelConfUtil.java
+2
-2
Result.java
...java/cn/quantgroup/cashloanflowboss/core/base/Result.java
+24
-0
ClfDSConfig.java
...cashloanflowboss/core/configuration/data/ClfDSConfig.java
+79
-0
No files found.
src/main/java/cn/quantgroup/cashloanflowboss/api/channel/controller/ChannelConfController.java
View file @
4354c86c
package
cn
.
quantgroup
.
cashloanflowboss
.
api
.
channel
.
controller
;
import
cn.quantgroup.cashloanflowboss.api.channel.entity.clf.ChannelConfiguration
;
import
cn.quantgroup.cashloanflowboss.api.channel.service.ChannelConfService
;
import
cn.quantgroup.cashloanflowboss.api.user.entity.boss.User
;
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.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.validation.Valid
;
import
java.util.Map
;
/**
...
...
@@ -14,7 +20,7 @@ import java.util.Map;
* @author suntao
*/
@RestController
@RequestMapping
(
"channel
/cfg
"
)
@RequestMapping
(
"channel"
)
public
class
ChannelConfController
{
...
...
@@ -23,15 +29,16 @@ public class ChannelConfController {
@GetMapping
(
"/info"
)
public
Result
channelConfInfo
(
Integer
channelId
)
{
public
Page
<
ChannelConfiguration
>
channelInfo
(
@RequestParam
@Valid
Pagination
pagination
,
Integer
channelId
)
{
return
channelConfService
.
getChannelInfo
(
pagination
,
channelId
);
}
Map
<
String
,
Object
>
channelConf
=
channelConfService
.
getChannelConf
(
channelId
);
if
(
channelConf
==
null
)
{
return
new
Result
();
}
else
{
// TODO
return
null
;
}
@GetMapping
(
"/cfg/info"
)
public
Result
channelConfInfo
(
Integer
channelId
)
{
return
channelConfService
.
getChannelConf
(
channelId
);
}
}
src/main/java/cn/quantgroup/cashloanflowboss/api/channel/entity/clf/ChannelConfiguration.java
0 → 100644
View file @
4354c86c
package
cn
.
quantgroup
.
cashloanflowboss
.
api
.
channel
.
entity
.
clf
;
import
cn.quantgroup.cashloanflowboss.api.channel.model.clf.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/api/channel/model/ChannelConfAddModel.java
→
src/main/java/cn/quantgroup/cashloanflowboss/api/channel/model/
boss/
ChannelConfAddModel.java
View file @
4354c86c
package
cn
.
quantgroup
.
cashloanflowboss
.
api
.
channel
.
model
;
package
cn
.
quantgroup
.
cashloanflowboss
.
api
.
channel
.
model
.
boss
;
import
lombok.Data
;
...
...
src/main/java/cn/quantgroup/cashloanflowboss/api/channel/model/ChannelConfBaseModel.java
→
src/main/java/cn/quantgroup/cashloanflowboss/api/channel/model/
boss/
ChannelConfBaseModel.java
View file @
4354c86c
package
cn
.
quantgroup
.
cashloanflowboss
.
api
.
channel
.
model
;
package
cn
.
quantgroup
.
cashloanflowboss
.
api
.
channel
.
model
.
boss
;
import
lombok.Data
;
...
...
src/main/java/cn/quantgroup/cashloanflowboss/api/channel/model/clf/ChannelConfigurationPage.java
0 → 100644
View file @
4354c86c
package
cn
.
quantgroup
.
cashloanflowboss
.
api
.
channel
.
model
.
clf
;
/**
* function:
* date: 2019/8/6
*
* @author: suntao
*/
public
class
ChannelConfigurationPage
{
}
src/main/java/cn/quantgroup/cashloanflowboss/api/channel/model/clf/EncType.java
0 → 100644
View file @
4354c86c
package
cn
.
quantgroup
.
cashloanflowboss
.
api
.
channel
.
model
.
clf
;
/**
* 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/api/channel/repository/clf/ChannelConfigurationRepository.java
0 → 100644
View file @
4354c86c
package
cn
.
quantgroup
.
cashloanflowboss
.
api
.
channel
.
repository
.
clf
;
import
cn.quantgroup.cashloanflowboss.api.channel.entity.clf.ChannelConfiguration
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.repository.PagingAndSortingRepository
;
import
org.springframework.stereotype.Repository
;
@Repository
public
interface
ChannelConfigurationRepository
extends
PagingAndSortingRepository
<
ChannelConfiguration
,
String
>
{
/**
* 获取用户列表(分页)
*
* @param pageable 分页
* @return
*/
Page
<
ChannelConfiguration
>
findAllBy
(
Pageable
pageable
);
ChannelConfiguration
findByRegisteredFrom
(
Integer
channelId
);
}
src/main/java/cn/quantgroup/cashloanflowboss/api/channel/service/ChannelConfService.java
View file @
4354c86c
package
cn
.
quantgroup
.
cashloanflowboss
.
api
.
channel
.
service
;
import
cn.quantgroup.cashloanflowboss.api.channel.entity.boss.ChannelConf
;
import
cn.quantgroup.cashloanflowboss.api.channel.entity.clf.ChannelConfiguration
;
import
cn.quantgroup.cashloanflowboss.api.channel.repository.boss.ChannelConfRepository
;
import
cn.quantgroup.cashloanflowboss.api.channel.repository.clf.ChannelConfigurationRepository
;
import
cn.quantgroup.cashloanflowboss.api.channel.util.ChannelConfUtil
;
import
cn.quantgroup.cashloanflowboss.api.user.entity.boss.User
;
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
;
...
...
@@ -18,20 +25,29 @@ 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
<
ChannelConfiguration
>
getChannelInfo
(
Pagination
pagination
,
Integer
channelId
)
{
if
(
channelId
==
null
)
{
return
clfChannelConfigurationRepository
.
findAllBy
(
new
PageRequest
(
pagination
.
getPageNumber
(),
pagination
.
getPageSize
()));
}
else
{
ChannelConfiguration
channelConfiguration
=
clfChannelConfigurationRepository
.
findByRegisteredFrom
(
channelId
);
Page
<
ChannelConfiguration
>
result
=
null
;
return
null
;
}
}
// ChannelConf channelConf = channelConfRepository.getByChannelId(channelId);
// if (channelConf == null) {
// return null;
// }
//
// return ChannelConfUtil.channelConfConvertVOModel(channelConf);
return
null
;
public
Result
getChannelConf
(
Integer
channelId
)
{
ChannelConf
channelConf
=
channelConfRepository
.
getByChannelId
(
channelId
);
return
Result
.
buildSuccess
(
ChannelConfUtil
.
channelConfConvertVOModel
(
channelConf
),
"success"
);
}
}
src/main/java/cn/quantgroup/cashloanflowboss/api/channel/util/ChannelConfUtil.java
View file @
4354c86c
...
...
@@ -2,8 +2,8 @@ package cn.quantgroup.cashloanflowboss.api.channel.util;
import
java.util.Date
;
import
cn.quantgroup.cashloanflowboss.api.channel.entity.boss.ChannelConf
;
import
cn.quantgroup.cashloanflowboss.api.channel.model.ChannelConfAddModel
;
import
cn.quantgroup.cashloanflowboss.api.channel.model.ChannelConfBaseModel
;
import
cn.quantgroup.cashloanflowboss.api.channel.model.
boss.
ChannelConfAddModel
;
import
cn.quantgroup.cashloanflowboss.api.channel.model.
boss.
ChannelConfBaseModel
;
import
org.springframework.beans.BeanUtils
;
import
java.util.HashMap
;
...
...
src/main/java/cn/quantgroup/cashloanflowboss/core/base/Result.java
View file @
4354c86c
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,27 @@ 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
(
T
data
,
String
message
)
{
return
new
Result
(
ApplicationStatus
.
FAILURE
,
data
,
message
);
}
}
src/main/java/cn/quantgroup/cashloanflowboss/core/configuration/data/ClfDSConfig.java
0 → 100644
View file @
4354c86c
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
@EntityScan
(
basePackages
=
{
"cn.quantgroup.cashloanflowboss.api.*.entity.clf"
})
@EnableTransactionManagement
@EnableJpaRepositories
(
basePackages
=
{
"cn.quantgroup.cashloanflowboss.api.*.repository.clf"
},
entityManagerFactoryRef
=
"bossEntityManager"
,
transactionManagerRef
=
"bossTransactionManager"
)
public
class
ClfDSConfig
{
@Value
(
"${data.boss.url}"
)
private
String
jdbcUrl
;
@Value
(
"${data.boss.password}"
)
private
String
password
;
@Value
(
"${data.boss.username}"
)
private
String
user
;
private
String
uniquename
=
"bossDS"
;
@Value
(
"${data.boss.pool-size}"
)
private
Integer
poolSize
;
@Primary
@Bean
(
name
=
"bossDataSource"
)
@ConfigurationProperties
(
prefix
=
"data.boss"
)
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
;
}
@Primary
@Bean
(
name
=
"bossEntityManager"
)
public
LocalContainerEntityManagerFactoryBean
entityManager
(
EntityManagerFactoryBuilder
builder
)
{
return
builder
.
dataSource
(
createDataSource
())
.
packages
(
"cn.quantgroup.cashloanflowboss.api.*.entity.clf"
)
.
persistenceUnit
(
uniquename
)
.
build
();
}
@Primary
@Bean
(
name
=
"bossTransactionManager"
)
public
PlatformTransactionManager
transactionManager
(
@Qualifier
(
"bossEntityManager"
)
EntityManagerFactory
entityManagerFactory
)
{
return
new
JpaTransactionManager
(
entityManagerFactory
);
}
}
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