Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

接入springcloud,版本降低 #3

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 35 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<spring-boot.version>2.7.10</spring-boot.version>
<admin.spring-boot.version>2.7.3</admin.spring-boot.version>
<spring-boot.version>2.3.12.RELEASE</spring-boot.version>
<admin.spring-boot.version>2.3.1</admin.spring-boot.version>
<spring.version>5.3.26</spring.version>
<spring-boot.version>2.3.12.RELEASE</spring-boot.version>
<spring.version>5.2.15.RELEASE</spring.version>
<spring-cloud.version>Hoxton.SR12</spring-cloud.version>
<nacos.version>2.2.8.RELEASE</nacos.version>

</properties>

Expand All @@ -32,6 +36,35 @@
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
<version>${nacos.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
<version>${nacos.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-common</artifactId>
<version>2.1.0</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import org.antlr.v4.runtime.tree.ParseTreeVisitor;


/**
* This interface defines a complete generic visitor for a parse tree produced
* by {@link StarRocksParser}.
Expand Down
21 changes: 21 additions & 0 deletions xingyun-app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,27 @@
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-loadbalancer</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-common</artifactId>
</dependency>

<dependency>
<groupId>cn.cloudcharts</groupId>
<artifactId>xingyun-core</artifactId>
Expand Down
29 changes: 2 additions & 27 deletions xingyun-app/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ server:
# max-http-post-size: 4MB

spring:
application:
name: xingyun
profiles:
active: test
datasource:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
Expand Down Expand Up @@ -52,29 +52,6 @@ spring:
# enable: true
# required: true

# mybatis-plus 配置
mybatis-plus:
configuration:
map-underscore-to-camel-case: true
auto-mapping-behavior: full
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
use-generated-keys: true
mapper-locations: classpath*:mapper/**/*Mapper.xml

# PageHelper插件的配置
pagehelper:
# helper-dialect: mysql #指定数据库类型。不配置的话pageHelper也会自动检测
# 分页合理化参数配置
reasonable: true
# 支持通过 Mapper 接口参数来传递分页参数
support-methods-arguments: true
# 默认每页条数
default-page-size: 10
# 默认第一页
default-page-num: 1
params: #默认值为pageNum=pageNum;pageSize=pageSize;count=countSql;reasonable=reasonable;pageSizeZero=pageSizeZero。



# DFS config type: hdfs、s3、local
dfs:
Expand All @@ -83,7 +60,6 @@ dfs:
namespace: /xingyun
path.separator: /


# springdoc-openapi项目配置
springdoc:
swagger-ui:
Expand All @@ -105,7 +81,6 @@ knife4j:
enable-footer-custom: true
footer-custom-content: Apache License 2.0 | Copyright 2023-[星云](https://github.com/haibao2015/xingyun)


management:
endpoints:
web:
Expand Down
19 changes: 19 additions & 0 deletions xingyun-app/src/main/resources/bootstrap-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
spring:
profiles: dev
cloud:
nacos:
config:
enabled: false
server-addr: 192.168.201.54:8848
username: nacos
password: nacos
namespace: 256cb68f-b3db-4346-a149-af0a9b749222
refresh-enabled: true
fileExtension: yaml
# extension-configs[0]:
# dataId: xx-xx.yaml
discovery:
server-addr: 192.168.201.54:8848
namespace: 256cb68f-b3db-4346-a149-af0a9b749222
username: nacos
password: nacos
17 changes: 17 additions & 0 deletions xingyun-app/src/main/resources/bootstrap-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
spring:
profiles: prod
cloud:
nacos:
config:
enabled: false
server-addr: 192.168.110.40:8848
username: nacos
password: nacos
namespace: 256cb68f-b3db-4346-a149-af0a9b749222
refresh-enabled: true
fileExtension: yaml
discovery:
server-addr: 192.168.201.66:8848
namespace: 256cb68f-b3db-4346-a149-af0a9b749222
username: nacos
password: nacos
17 changes: 17 additions & 0 deletions xingyun-app/src/main/resources/bootstrap-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
spring:
profiles: test
cloud:
nacos:
config:
enabled: false
server-addr: 192.168.110.40:8848
username: nacos
password: nacos
namespace: 256cb68f-b3db-4346-a149-af0a9b749222
refresh-enabled: true
fileExtension: yaml
discovery:
server-addr: 192.168.110.40:8848
namespace: 256cb68f-b3db-4346-a149-af0a9b749222
username: nacos
password: nacos
31 changes: 31 additions & 0 deletions xingyun-app/src/main/resources/bootstrap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
spring:
profiles:
active: dev
application:
name: xingyun
cloud:
discovery:
enabled: true

# mybatis-plus 配置
mybatis-plus:
configuration:
map-underscore-to-camel-case: true
auto-mapping-behavior: full
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
use-generated-keys: true
mapper-locations: classpath*:mapper/**/*Mapper.xml

# PageHelper插件的配置
pagehelper:
# helper-dialect: mysql #指定数据库类型。不配置的话pageHelper也会自动检测
# 分页合理化参数配置
reasonable: true
# 支持通过 Mapper 接口参数来传递分页参数
support-methods-arguments: true
# 默认每页条数
default-page-size: 10
# 默认第一页
default-page-num: 1
params: #默认值为pageNum=pageNum;pageSize=pageSize;count=countSql;reasonable=reasonable;pageSizeZero=pageSizeZero。

Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,22 @@ public boolean submitSyncTask(Connection conn, SyncTaskGenInfo taskGenInfo) {
}
});
// }
log.info("result:{},submit task:{}",res,taskSql);

// if(res > 0){
ThreadUtil.execAsync(() -> {
Map resMap = new HashMap();
resMap.put("taskName",taskGenInfo.getTaskName());
String taskResultSql = CustomSQL.getInstance().get("task.sr.sync.insert.async.result",resMap).toLowerCase();
try {
QueryRunner queryRunner = new QueryRunner();
TaskRunsResult taskRunsResult = queryRunner.query(conn,taskResultSql,new BeanHandler<TaskRunsResult>(TaskRunsResult.class, new BasicRowProcessor(new GenerousBeanProcessor())));
log.info("task:{},result:{}",taskGenInfo.getTaskName(), GsonUtils.gsonString(taskRunsResult));
} catch (SQLException e) {
throw new RuntimeException(e);
}
});
// }

return res > 0;
}
Expand Down