mirror of
http://git.pig4cloud.com/pig/pigx.git
synced 2026-11-09 04:49:02 +08:00
Merge branch 'dev' of https://git.pig4cloud.com/pig/pigx into leng_dev
This commit is contained in:
commit
5aea904179
6 files changed
+182
-77
No files matched your search
@@ -0,0 +1,51 @@
|
||||
server:
|
||||
port: 8848
|
||||
tomcat:
|
||||
basedir: logs
|
||||
|
||||
db:
|
||||
num: 1
|
||||
user: ${MYSQL_USER:root}
|
||||
password: ${MYSQL_PWD:root}
|
||||
url:
|
||||
0: jdbc:mysql://${MYSQL_HOST:pigx-mysql}:${MYSQL_PORT:3306}/${MYSQL_DB:pigxx_config}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
|
||||
|
||||
|
||||
nacos:
|
||||
core:
|
||||
auth:
|
||||
system.type: nacos
|
||||
default.token.secret.key: SecretKey012345678901234567890123456789012345678901234567890123456789
|
||||
security:
|
||||
ignore:
|
||||
urls: /,/error,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-fe/public/**,/v1/auth/**,/v1/console/health/**,/actuator/**,/v1/console/server/**
|
||||
|
||||
spring:
|
||||
datasource:
|
||||
platform: mysql #这个过期属性不能修改,nacos 代码对此有硬编码
|
||||
security:
|
||||
enabled: true
|
||||
boot: # 接入 spring boot admin
|
||||
admin:
|
||||
client:
|
||||
url: http://pigx-monitor:5001
|
||||
username: pig
|
||||
password: pig
|
||||
instance:
|
||||
prefer-ip: true
|
||||
application:
|
||||
name: @project.artifactId@
|
||||
|
||||
useAddressServer: true
|
||||
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
exposure:
|
||||
include: '*'
|
||||
metrics:
|
||||
export:
|
||||
influx:
|
||||
enabled: false
|
||||
elastic:
|
||||
enabled: false
|
||||
@@ -0,0 +1,51 @@
|
||||
server:
|
||||
port: 8848
|
||||
tomcat:
|
||||
basedir: logs
|
||||
|
||||
db:
|
||||
num: 1
|
||||
user: ${MYSQL_USER:root}
|
||||
password: ${MYSQL_PWD:root}
|
||||
url:
|
||||
0: jdbc:mysql://${MYSQL_HOST:pigx-mysql}:${MYSQL_PORT:3306}/${MYSQL_DB:pigxx_config}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
|
||||
|
||||
|
||||
nacos:
|
||||
core:
|
||||
auth:
|
||||
system.type: nacos
|
||||
default.token.secret.key: SecretKey012345678901234567890123456789012345678901234567890123456789
|
||||
security:
|
||||
ignore:
|
||||
urls: /,/error,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-fe/public/**,/v1/auth/**,/v1/console/health/**,/actuator/**,/v1/console/server/**
|
||||
|
||||
spring:
|
||||
datasource:
|
||||
platform: mysql #这个过期属性不能修改,nacos 代码对此有硬编码
|
||||
security:
|
||||
enabled: true
|
||||
boot: # 接入 spring boot admin
|
||||
admin:
|
||||
client:
|
||||
url: http://pigx-monitor:5001
|
||||
username: pig
|
||||
password: pig
|
||||
instance:
|
||||
prefer-ip: true
|
||||
application:
|
||||
name: @project.artifactId@
|
||||
|
||||
useAddressServer: true
|
||||
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
exposure:
|
||||
include: '*'
|
||||
metrics:
|
||||
export:
|
||||
influx:
|
||||
enabled: false
|
||||
elastic:
|
||||
enabled: false
|
||||
@@ -0,0 +1,51 @@
|
||||
server:
|
||||
port: 8848
|
||||
tomcat:
|
||||
basedir: logs
|
||||
|
||||
db:
|
||||
num: 1
|
||||
user: ${MYSQL_USER:root}
|
||||
password: ${MYSQL_PWD:root}
|
||||
url:
|
||||
0: jdbc:mysql://${MYSQL_HOST:pigx-mysql}:${MYSQL_PORT:3306}/${MYSQL_DB:pigxx_config}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
|
||||
|
||||
|
||||
nacos:
|
||||
core:
|
||||
auth:
|
||||
system.type: nacos
|
||||
default.token.secret.key: SecretKey012345678901234567890123456789012345678901234567890123456789
|
||||
security:
|
||||
ignore:
|
||||
urls: /,/error,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-fe/public/**,/v1/auth/**,/v1/console/health/**,/actuator/**,/v1/console/server/**
|
||||
|
||||
spring:
|
||||
datasource:
|
||||
platform: mysql #这个过期属性不能修改,nacos 代码对此有硬编码
|
||||
security:
|
||||
enabled: true
|
||||
boot: # 接入 spring boot admin
|
||||
admin:
|
||||
client:
|
||||
url: http://pigx-monitor:5001
|
||||
username: pig
|
||||
password: pig
|
||||
instance:
|
||||
prefer-ip: true
|
||||
application:
|
||||
name: @project.artifactId@
|
||||
|
||||
useAddressServer: true
|
||||
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
exposure:
|
||||
include: '*'
|
||||
metrics:
|
||||
export:
|
||||
influx:
|
||||
enabled: false
|
||||
elastic:
|
||||
enabled: false
|
||||
@@ -1,51 +1,3 @@
|
||||
server:
|
||||
port: 8848
|
||||
tomcat:
|
||||
basedir: logs
|
||||
|
||||
db:
|
||||
num: 1
|
||||
user: ${MYSQL_USER:root}
|
||||
password: ${MYSQL_PWD:root}
|
||||
url:
|
||||
0: jdbc:mysql://${MYSQL_HOST:pigx-mysql}:${MYSQL_PORT:3306}/${MYSQL_DB:pigxx_config}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
|
||||
|
||||
|
||||
nacos:
|
||||
core:
|
||||
auth:
|
||||
system.type: nacos
|
||||
default.token.secret.key: SecretKey012345678901234567890123456789012345678901234567890123456789
|
||||
security:
|
||||
ignore:
|
||||
urls: /,/error,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-fe/public/**,/v1/auth/**,/v1/console/health/**,/actuator/**,/v1/console/server/**
|
||||
|
||||
spring:
|
||||
datasource:
|
||||
platform: mysql #这个过期属性不能修改,nacos 代码对此有硬编码
|
||||
security:
|
||||
enabled: true
|
||||
boot: # 接入 spring boot admin
|
||||
admin:
|
||||
client:
|
||||
url: http://pigx-monitor:5001
|
||||
username: pig
|
||||
password: pig
|
||||
instance:
|
||||
prefer-ip: true
|
||||
application:
|
||||
name: @project.artifactId@
|
||||
|
||||
useAddressServer: true
|
||||
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
exposure:
|
||||
include: '*'
|
||||
metrics:
|
||||
export:
|
||||
influx:
|
||||
enabled: false
|
||||
elastic:
|
||||
enabled: false
|
||||
profiles:
|
||||
active: @profiles.active@
|
||||
+1
@@ -129,6 +129,7 @@ public class SysClientController {
|
||||
* 同步缓存字典
|
||||
* @return R
|
||||
*/
|
||||
@Inner(false)
|
||||
@SysLog("同步终端")
|
||||
@PutMapping("/sync")
|
||||
public R sync() {
|
||||
|
||||
+26
-27
@@ -79,6 +79,28 @@ public class SysOauthClientDetailsServiceImpl extends ServiceImpl<SysOauthClient
|
||||
@Override
|
||||
@CacheEvict(value = CacheConstants.CLIENT_DETAILS_KEY, key = "#clientDetailsDTO.clientId")
|
||||
public Boolean updateClientById(SysOauthClientDetailsDTO clientDetailsDTO) {
|
||||
this.insertOrUpdate(clientDetailsDTO);
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加客户端
|
||||
* @param clientDetailsDTO
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean saveClient(SysOauthClientDetailsDTO clientDetailsDTO) {
|
||||
this.insertOrUpdate(clientDetailsDTO);
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 插入或更新客户端对象
|
||||
* @param clientDetailsDTO
|
||||
* @return
|
||||
*/
|
||||
private SysOauthClientDetails insertOrUpdate(SysOauthClientDetailsDTO clientDetailsDTO){
|
||||
// copy dto 对象
|
||||
SysOauthClientDetails clientDetails = new SysOauthClientDetails();
|
||||
BeanUtils.copyProperties(clientDetailsDTO, clientDetails);
|
||||
@@ -92,35 +114,10 @@ public class SysOauthClientDetailsServiceImpl extends ServiceImpl<SysOauthClient
|
||||
clientDetails.setAdditionalInformation(informationObj.toString());
|
||||
|
||||
// 更新数据库
|
||||
baseMapper.updateById(clientDetails);
|
||||
saveOrUpdate(clientDetails);
|
||||
// 更新Redis
|
||||
SpringContextHolder.publishEvent(new ClientDetailsInitRunner.ClientDetailsInitEvent(clientDetails));
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加客户端
|
||||
* @param clientDetailsDTO
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean saveClient(SysOauthClientDetailsDTO clientDetailsDTO) {
|
||||
// copy dto 对象
|
||||
SysOauthClientDetails clientDetails = new SysOauthClientDetails();
|
||||
BeanUtils.copyProperties(clientDetailsDTO, clientDetails);
|
||||
|
||||
// 获取扩展信息,插入开关相关
|
||||
String information = clientDetailsDTO.getAdditionalInformation();
|
||||
JSONUtil.parseObj(information).set(CommonConstants.CAPTCHA_FLAG, clientDetailsDTO.getCaptchaFlag())
|
||||
.set(CommonConstants.ENC_FLAG, clientDetailsDTO.getEncFlag())
|
||||
.set(CommonConstants.ONLINE_QUANTITY, clientDetailsDTO.getOnlineQuantity());
|
||||
|
||||
// 插入数据
|
||||
this.baseMapper.insert(clientDetails);
|
||||
// 更新Redis
|
||||
SpringContextHolder.publishEvent(new ClientDetailsInitRunner.ClientDetailsInitEvent(clientDetails));
|
||||
return Boolean.TRUE;
|
||||
return clientDetails;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -156,6 +153,8 @@ public class SysOauthClientDetailsServiceImpl extends ServiceImpl<SysOauthClient
|
||||
@Override
|
||||
@CacheEvict(value = CacheConstants.CLIENT_DETAILS_KEY, allEntries = true)
|
||||
public R syncClientCache() {
|
||||
// 更新Redis
|
||||
SpringContextHolder.publishEvent(new ClientDetailsInitRunner.ClientDetailsInitEvent(this));
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user