Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
K
kx-count
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
LJJ
kx-count
Commits
62066236
提交
62066236
authored
9月 09, 2021
作者:
xuyang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
优化
上级
25d0c12d
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
37 行增加
和
17 行删除
+37
-17
TestService.java
src/main/java/com/zjty/countunion/service/TestService.java
+13
-11
application-prod.properties
src/main/resources/application-prod.properties
+19
-0
application.properties
src/main/resources/application.properties
+5
-6
没有找到文件。
src/main/java/com/zjty/countunion/service/TestService.java
浏览文件 @
62066236
...
...
@@ -5,6 +5,7 @@ import com.zjty.countunion.config.JacksonUtil;
import
com.zjty.countunion.entity.PreCount
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Service
;
...
...
@@ -21,13 +22,18 @@ import java.util.List;
public
class
TestService
{
@Autowired
private
RedisTemplate
<
String
,
String
>
redisTemplate
;
private
RedisTemplate
<
String
,
Object
>
defaultRedisTpl
;
public
void
tableCount
()
{
@Value
(
"${spring.datasource.url}"
)
private
String
URL
;
@Value
(
"${spring.datasource.username}"
)
private
String
USER
;
@Value
(
"${spring.datasource.password}"
)
private
String
PASSWORD
;
String
URL
=
"jdbc:mysql://zjtys.com.cn:3306/pre_dc?characterEncoding=utf-8"
;
String
USER
=
"root"
;
String
PASSWORD
=
"root"
;
public
void
tableCount
()
{
try
{
Class
.
forName
(
"com.mysql.jdbc.Driver"
);
Connection
conn
=
DriverManager
.
getConnection
(
URL
,
USER
,
PASSWORD
);
...
...
@@ -57,12 +63,8 @@ public class TestService {
log
.
info
(
"打印:{}"
,
sharePreCounts
.
toString
());
log
.
info
(
"打印:{}"
,
exchangePreCounts
.
toString
());
redisTemplate
.
opsForValue
().
set
(
"a"
,
"a"
);
//redisTemplate.opsForValue().set("exchange_count", JacksonUtil.toJSon(exchangePreCounts));
redisTemplate
.
opsForValue
().
set
(
"exchance_count"
,
JSON
.
toJSONString
(
exchangePreCounts
));
//redisTemplate.opsForValue().set("share_count", JacksonUtil.toJSon(sharePreCounts));
redisTemplate
.
opsForValue
().
set
(
"share_count"
,
JSON
.
toJSONString
(
sharePreCounts
));
defaultRedisTpl
.
opsForValue
().
set
(
"exchange_count"
,
JSON
.
toJSONString
(
exchangePreCounts
));
defaultRedisTpl
.
opsForValue
().
set
(
"share_count"
,
JSON
.
toJSONString
(
sharePreCounts
));
// 关闭资源
conn
.
close
();
...
...
src/main/resources/application-prod.properties
0 → 100644
浏览文件 @
62066236
server.port
=
8079
spring.jpa.properties.hibernate.format_sql
=
true
spring.main.allow-bean-definition-overriding
=
true
spring.jpa.hibernate.ddl-auto
=
none
spring.jpa.show-sql
=
true
spring.jpa.hibernate.naming.implicit-strategy
=
org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyJpaImpl
spring.jpa.hibernate.naming.physical-strategy
=
org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
spring.jpa.database-platform
=
org.hibernate.dialect.MySQL5InnoDBDialect
spring.datasource.driver-class-name
=
com.mysql.cj.jdbc.Driver
spring.datasource.url
=
jdbc:mysql://172.30.30.86/dbt_model?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8
spring.datasource.username
=
mcjsuper
spring.datasource.password
=
mcj123
spring.redis.host
=
172.30.30.89
spring.redis.password
=
MlD8LPkb
logging.file
=
./log/count-union.log
\ No newline at end of file
src/main/resources/application.properties
浏览文件 @
62066236
spring.profiles.active
=
prod
server.port
=
8079
spring.jpa.properties.hibernate.format_sql
=
true
spring.main.allow-bean-definition-overriding
=
true
...
...
@@ -7,14 +9,10 @@ spring.jpa.hibernate.naming.implicit-strategy=org.hibernate.boot.model.naming.Im
spring.jpa.hibernate.naming.physical-strategy
=
org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
spring.jpa.database-platform
=
org.hibernate.dialect.MySQL5InnoDBDialect
spring.datasource.driver-class-name
=
com.mysql.cj.jdbc.Driver
spring.datasource.url
=
jdbc:mysql://zjtys.com.cn:3306/pre_dc?useSSL=false&serverTimezone=Asia/Shanghai&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&allowPublicKeyRetrieval=true
spring.datasource.url
=
jdbc:mysql://localhost:3306/pre_dc?useSSL=false&serverTimezone=Asia/Shanghai&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&allowPublicKeyRetrieval=true
spring.datasource.username
=
root
#Zjty_pd
spring.datasource.password
=
root
spring.redis.host
=
1
72
.0.0.1
spring.redis.host
=
1
27
.0.0.1
spring.redis.password
=
xuyang
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论