Skip to content

Commit

Permalink
add seata canal email send msg demo update fastJson version
Browse files Browse the repository at this point in the history
  • Loading branch information
jzfai committed Jan 11, 2022
1 parent a5b7529 commit e32e620
Show file tree
Hide file tree
Showing 62 changed files with 2,325 additions and 2,395 deletions.
2 changes: 1 addition & 1 deletion README-zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ ty-common: 统一依赖,统一配置管理,feign接口整合等
本架构的微服务有:
ty-gateway:网关微服务。使用的是spring-cloud-starter-gateway,先对于zull网关来说性能更好。主要实现了,权限控制和拦截,jwt token解析和校验,swagger文件整合,使用令牌技术请求限流等
ty-auth:权限服务。jwt token生成,解析,校验等,默认配置3天有效期,少于一天自动续约(此处感兴趣的可以查看下源码)
ty-user:用户服务。用户的登录,注册,查看用户信息等一系列功能
integration-front:用户服务。用户的登录,注册,查看用户信息等一系列功能
ty-excel:excel文件的读取和导出
ty-upload:文件上传服务。使用的技术为fastDFS技术,此服务主要用于文件的上传和下载
```
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ mybatis-plus: 3.3.2
rabbitmq:3.7-management
redis: 3.2.9
mysql:5.7
seata:1.4.2
cancel
```


Expand Down Expand Up @@ -51,9 +53,8 @@ ty-common: 统一依赖,统一配置管理,feign接口整合等
本架构的微服务有:
ty-gateway:网关微服务。使用的是spring-cloud-starter-gateway,先对于zull网关来说性能更好。主要实现了,权限控制和拦截,jwt token解析和校验,swagger文件整合,使用令牌技术请求限流等
ty-auth:权限服务。jwt token生成,解析,校验等,默认配置3天有效期,少于一天自动续约(此处感兴趣的可以查看下源码)
ty-user:用户服务。用户的登录,注册,查看用户信息等一系列功能
ty-excel:excel文件的读取和导出
ty-upload:文件上传服务。使用的技术为fastDFS技术,此服务主要用于文件的上传和下载
integration-front:前端实例数据。用户的登录,注册,查看用户信息等一系列功能
ty-example:全分布式事务seata,rabbitmq延时队列,短信发送,email发送,canal等功能实例
```


Expand Down
2 changes: 1 addition & 1 deletion ty-user/pom.xml → integration-front/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>ty-user</artifactId>
<artifactId>integration-front</artifactId>

<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
package top.kuanghua.tyuser;

import io.seata.spring.annotation.datasource.EnableAutoDataSourceProxy;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

/**
* @Title: UserApplication
* @Description:
* @Auther: kuanghua
* @create 2020/11/7 20:07
*/
@SpringBootApplication
@EnableAutoDataSourceProxy
public class UserApplication {
public static void main(String[] args) {
SpringApplication.run(UserApplication.class, args);
}
}
package top.kuanghua.integrationfront;

import io.seata.spring.annotation.datasource.EnableAutoDataSourceProxy;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

/**
* @Title: UserApplication
* @Description:
* @Auther: kuanghua
* @create 2020/11/7 20:07
*/
@SpringBootApplication
@EnableAutoDataSourceProxy
public class IntegrationFrontApplication {
public static void main(String[] args) {
SpringApplication.run(IntegrationFrontApplication.class, args);
}
}
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
package top.kuanghua.tyuser.config;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
* @Title: BaseConfig
* @Description:
* @Auther: kuanghua
* @create 2020/8/23 21:52
*/
/*
* 总结:1.@Configuration 下的@ComponentScan回将包下带有@Component扫描变成配置类,
* 而@SpringBootApplication扫描的只会变成普通类
* */
@Configuration
//扫描公用包的配置和自身的配置类
@ComponentScan(basePackages = {"top.kuanghua.khcomomon","top.kuanghua.tyuser"})
//feign扫描
@EnableFeignClients(basePackages = {"top.kuanghua.feign.tyexecl","top.kuanghua.feign.tyauth"})
//mapper包扫描
@MapperScan(basePackages = {"top.kuanghua.tyuser.mapper"})
public class BaseConfig {

}
package top.kuanghua.integrationfront.config;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
* @Title: BaseConfig
* @Description:
* @Auther: kuanghua
* @create 2020/8/23 21:52
*/
/*
* 总结:1.@Configuration 下的@ComponentScan回将包下带有@Component扫描变成配置类,
* 而@SpringBootApplication扫描的只会变成普通类
* */
@Configuration
//扫描公用包的配置和自身的配置类
@ComponentScan(basePackages = {"top.kuanghua.khcomomon", "top.kuanghua.integrationfront"})
//feign扫描
@EnableFeignClients(basePackages = {"top.kuanghua.feign.tyauth"})
//mapper包扫描
@MapperScan(basePackages = {"top.kuanghua.integrationfront.mapper"})
public class BaseConfig {

}
Original file line number Diff line number Diff line change
@@ -1,56 +1,56 @@
package top.kuanghua.tyuser.config;

import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

@Component
@EnableSwagger2 //开启在线接口文档
//配置包扫描
public class Swagger2Config {
private boolean swagger_is_enable = true;
// @Value("${.ipAddr}")
// private String ipAddr;
@Value("${server.port}")
private String port;

@Bean
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2)
.enable(swagger_is_enable)
//.host(this.ipAddr + ":" + this.port)
.apiInfo(apiInfo())
.select()
.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
//.apis(basePackage("top.kuanghua.swagger.controller"))
.paths(PathSelectors.any())
.build();
}

/**
* 构建 api文档的详细信息函数
*
* @return
*/
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("标题:swagger文档")
.description("描述:新一代的微服务架构")
.contact(new Contact("jzfai", null, "[email protected]"))
.version("版本号:2.8")
.build();
}

/**
* http://localhost:8080/swagger-ui.html
*/
}
package top.kuanghua.integrationfront.config;

import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

@Component
@EnableSwagger2 //开启在线接口文档
//配置包扫描
public class Swagger2Config {
private boolean swagger_is_enable = true;
// @Value("${.ipAddr}")
// private String ipAddr;
@Value("${server.port}")
private String port;

@Bean
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2)
.enable(swagger_is_enable)
//.host(this.ipAddr + ":" + this.port)
.apiInfo(apiInfo())
.select()
.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
//.apis(basePackage("top.kuanghua.swagger.controller"))
.paths(PathSelectors.any())
.build();
}

/**
* 构建 api文档的详细信息函数
*
* @return
*/
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("标题:swagger文档")
.description("描述:新一代的微服务架构")
.contact(new Contact("jzfai", null, "[email protected]"))
.version("版本号:2.8")
.build();
}

/**
* http://localhost:8080/swagger-ui.html
*/
}
Loading

0 comments on commit e32e620

Please sign in to comment.