springcloud改tsf
- pom.xml
将原来springcloud相关依赖删除(包括spring-boot-starter-web)
引入tsf相关依赖
<!--腾讯云-->
<parent>
<groupId>com.tencent.tsf</groupId>
<artifactId>spring-cloud-tsf-dependencies</artifactId>
<version>1.16.0-Finchley-RELEASE</version>
</parent>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<!-- TSF 启动器 -->
<!-- 腾讯云 -->
<dependency>
<groupId>com.tencent.tsf</groupId>
<artifactId>spring-cloud-tsf-starter</artifactId>
<exclusions>
<exclusion>
<groupId>com.tencent.tsf</groupId>
<artifactId>spring-cloud-tsf-sleuth</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.tencent.tsf</groupId>
<artifactId>spring-cloud-tsf-swagger</artifactId>
<exclusions>
<exclusion>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
</exclusion>
</exclusions>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-sleuth</artifactId>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
<version>1.5.21</version>
</dependency>
<!-- 需要使用MYSQL数据库 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<!-- tsf自带swagger,不用单独引入 -->
...
</dependencies>
2.application.yml
- 删除eureka和swagger的相关配置
- 将数据源oracle连接改为mysql连接
3.将swagger配置类删除,因为tsf已集成swgger配置,不删除会报bean错误
4.找不到相关class,删了,重新下载tfs相关依赖jar包(一共有15个)
notes:不用修改注解,需要启动consul.exe注册中心(到注册中心解压目录 命令行 .\consul.exe agent -dev)
oracle视图改为tbsql(MySQL)
| oracle | mysql |
|---|---|
| nvl() | ifnull() |
| –这是注释 | – 这是注释 |
| to_char(‘date‘,‘yyyy-MM-dd‘) | date_format(‘date‘,‘yyyy-MM-dd‘) |
| sysdate | sysdate() |
| sysdate | sysdate() |
| decode() | case when then else end |
| where rownum<=10 | limit 0,10 |
还有 || 改为 concat()
示例:
decode(‘Y’,substr(e.prj_code,1,1),‘一般性项目’,‘专项项目’) 项目类别,
改为
case
when ‘Y’ = substr(e.prj_code,1,1) then ‘一般性项目’
wheh ‘Y’ != substr(e.prj_code,1,1) then ‘专项项目’
end 项目类别,
版权声明:本文为shuaigeyimei1原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。