diff --git a/README-zh_CN.md b/README-zh_CN.md
index 19d331a..f198909 100644
--- a/README-zh_CN.md
+++ b/README-zh_CN.md
@@ -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技术,此服务主要用于文件的上传和下载
```
diff --git a/README.md b/README.md
index 2c5c8cc..1eae783 100644
--- a/README.md
+++ b/README.md
@@ -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
```
@@ -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等功能实例
```
diff --git a/ty-user/pom.xml b/integration-front/pom.xml
similarity index 97%
rename from ty-user/pom.xml
rename to integration-front/pom.xml
index cb45de4..8fea0ed 100644
--- a/ty-user/pom.xml
+++ b/integration-front/pom.xml
@@ -9,7 +9,7 @@
4.0.0
- ty-user
+ integration-front
diff --git a/ty-user/src/main/java/top/kuanghua/tyuser/UserApplication.java b/integration-front/src/main/java/top/kuanghua/integrationfront/IntegrationFrontApplication.java
similarity index 72%
rename from ty-user/src/main/java/top/kuanghua/tyuser/UserApplication.java
rename to integration-front/src/main/java/top/kuanghua/integrationfront/IntegrationFrontApplication.java
index 836265c..ac8b53d 100644
--- a/ty-user/src/main/java/top/kuanghua/tyuser/UserApplication.java
+++ b/integration-front/src/main/java/top/kuanghua/integrationfront/IntegrationFrontApplication.java
@@ -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);
+ }
+}
diff --git a/ty-user/src/main/java/top/kuanghua/tyuser/config/BaseConfig.java b/integration-front/src/main/java/top/kuanghua/integrationfront/config/BaseConfig.java
similarity index 67%
rename from ty-user/src/main/java/top/kuanghua/tyuser/config/BaseConfig.java
rename to integration-front/src/main/java/top/kuanghua/integrationfront/config/BaseConfig.java
index b9b4cf5..6d960e2 100644
--- a/ty-user/src/main/java/top/kuanghua/tyuser/config/BaseConfig.java
+++ b/integration-front/src/main/java/top/kuanghua/integrationfront/config/BaseConfig.java
@@ -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 {
+
+}
diff --git a/ty-user/src/main/java/top/kuanghua/tyuser/config/Swagger2Config.java b/integration-front/src/main/java/top/kuanghua/integrationfront/config/Swagger2Config.java
similarity index 95%
rename from ty-user/src/main/java/top/kuanghua/tyuser/config/Swagger2Config.java
rename to integration-front/src/main/java/top/kuanghua/integrationfront/config/Swagger2Config.java
index 934deb1..0f38531 100644
--- a/ty-user/src/main/java/top/kuanghua/tyuser/config/Swagger2Config.java
+++ b/integration-front/src/main/java/top/kuanghua/integrationfront/config/Swagger2Config.java
@@ -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, "869653722@qq.com"))
- .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, "869653722@qq.com"))
+ .version("版本号:2.8")
+ .build();
+ }
+
+ /**
+ * http://localhost:8080/swagger-ui.html
+ */
+}
diff --git a/ty-user/src/main/java/top/kuanghua/tyuser/controller/BrandController.java b/integration-front/src/main/java/top/kuanghua/integrationfront/controller/BrandController.java
similarity index 94%
rename from ty-user/src/main/java/top/kuanghua/tyuser/controller/BrandController.java
rename to integration-front/src/main/java/top/kuanghua/integrationfront/controller/BrandController.java
index c171fa4..1a43e45 100644
--- a/ty-user/src/main/java/top/kuanghua/tyuser/controller/BrandController.java
+++ b/integration-front/src/main/java/top/kuanghua/integrationfront/controller/BrandController.java
@@ -1,127 +1,127 @@
-package top.kuanghua.tyuser.controller;
-
-
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.web.bind.annotation.*;
-import top.kuanghua.khcomomon.entity.KHCommonParams;
-import top.kuanghua.khcomomon.entity.ResResult;
-import top.kuanghua.tyuser.entity.Brand;
-import top.kuanghua.tyuser.service.BrandService;
-
-import javax.annotation.Resource;
-import java.util.List;
-
-@Api(tags = "品牌表(Brand)")
-@RestController
-@RequestMapping("brand")
-public class BrandController {
-
- @Resource
- private BrandService brandService;
-
- /**
- * 分页查询所有数据
- *
- * @param brand 查询实体
- * @return 所有数据
- */
- @GetMapping("selectPage")
- @ApiOperation(value = "分页查询所有数据")
- public ResResult selectPage(Brand brand, KHCommonParams commonParams) {
- QueryWrapper queryWrapper = new QueryWrapper<>();
- if (ObjectUtils.isNotEmpty(brand.getId())) {
- queryWrapper.like("id", brand.getId());
- }
- if (ObjectUtils.isNotEmpty(brand.getName())) {
- queryWrapper.like("name", brand.getName());
- }
- if (ObjectUtils.isNotEmpty(brand.getImage())) {
- queryWrapper.like("image", brand.getImage());
- }
-
- if (ObjectUtils.isNotEmpty(brand.getLetter())) {
- queryWrapper.like("letter", brand.getLetter());
- }
- if (ObjectUtils.isNotEmpty(brand.getSeq())) {
- queryWrapper.like("seq", brand.getSeq());
- }
- queryWrapper.orderByDesc("create_time");
- if (StringUtils.isNotEmpty(commonParams.getStartTime())) {
- queryWrapper.between("create_time", commonParams.getStartTime(), commonParams.getEndTime());
- }
- queryWrapper.select("id,name,image,letter,seq,create_time,update_time");
- Page brandPage = this.brandService.selectPage(commonParams.getPageNum(), commonParams.getPageSize(), queryWrapper);
- return new ResResult().success(brandPage);
- }
-
- /**
- * 通过主键查询单条数据
- *
- * @param id 主键
- * @return 单条数据
- */
- @GetMapping("selectById")
- @ApiOperation(value = "通过id主键查询单条数据")
- public ResResult selectById(@RequestParam("id") Integer id) {
- return new ResResult().success(this.brandService.selectById(id));
- }
-
- /**
- * @Description: 根据id数组查询品牌列表
- * @Param: idList id数组
- * @return: ids列表数据
- */
- @ApiOperation(value = "根据id数组查询品牌列表")
- @PostMapping("selectBatchIds")
- public ResResult selectBatchIds(@RequestParam("idList") List idList) {
- return new ResResult().success(this.brandService.selectBatchIds(idList));
- }
-
-
- /**
- * 新增数据
- *
- * @param brand 实体对象
- * @return 新增结果
- */
- @ApiOperation(value = "新增数据")
- @PostMapping("insert")
- public ResResult insert(@RequestBody Brand brand) {
- return new ResResult().success(this.brandService.insert(brand));
- }
-
- /**
- * 修改数据
- *
- * @param brand 实体对象
- * @return 修改结果
- */
- @ApiOperation(value = "根据id修改数据")
- @PutMapping("updateById")
- public ResResult updateById(@RequestBody Brand brand) {
- return new ResResult().success(this.brandService.updateById(brand));
- }
-
- /**
- * 删除数据
- *
- * @param idList 主键结合
- * @return 删除结果
- */
- @ApiOperation(value = "根据id数组删除数据")
- @DeleteMapping("deleteBatchIds")
- public ResResult deleteBatchIds(@RequestBody List idList) {
- return new ResResult().success(this.brandService.deleteBatchIds(idList));
- }
-
- @DeleteMapping("deleteById")
- @ApiOperation(value = "根据id数组删除数据")
- public ResResult deleteById(@RequestParam("id") Integer id) {
- return new ResResult().success(this.brandService.deleteById(id));
- }
-}
+package top.kuanghua.integrationfront.controller;
+
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.web.bind.annotation.*;
+import top.kuanghua.khcomomon.entity.KHCommonParams;
+import top.kuanghua.khcomomon.entity.ResResult;
+import top.kuanghua.integrationfront.entity.Brand;
+import top.kuanghua.integrationfront.service.BrandService;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+@Api(tags = "品牌表(Brand)")
+@RestController
+@RequestMapping("brand")
+public class BrandController {
+
+ @Resource
+ private BrandService brandService;
+
+ /**
+ * 分页查询所有数据
+ *
+ * @param brand 查询实体
+ * @return 所有数据
+ */
+ @GetMapping("selectPage")
+ @ApiOperation(value = "分页查询所有数据")
+ public ResResult selectPage(Brand brand, KHCommonParams commonParams) {
+ QueryWrapper queryWrapper = new QueryWrapper<>();
+ if (ObjectUtils.isNotEmpty(brand.getId())) {
+ queryWrapper.like("id", brand.getId());
+ }
+ if (ObjectUtils.isNotEmpty(brand.getName())) {
+ queryWrapper.like("name", brand.getName());
+ }
+ if (ObjectUtils.isNotEmpty(brand.getImage())) {
+ queryWrapper.like("image", brand.getImage());
+ }
+
+ if (ObjectUtils.isNotEmpty(brand.getLetter())) {
+ queryWrapper.like("letter", brand.getLetter());
+ }
+ if (ObjectUtils.isNotEmpty(brand.getSeq())) {
+ queryWrapper.like("seq", brand.getSeq());
+ }
+ queryWrapper.orderByDesc("create_time");
+ if (StringUtils.isNotEmpty(commonParams.getStartTime())) {
+ queryWrapper.between("create_time", commonParams.getStartTime(), commonParams.getEndTime());
+ }
+ queryWrapper.select("id,name,image,letter,seq,create_time,update_time");
+ Page brandPage = this.brandService.selectPage(commonParams.getPageNum(), commonParams.getPageSize(), queryWrapper);
+ return new ResResult().success(brandPage);
+ }
+
+ /**
+ * 通过主键查询单条数据
+ *
+ * @param id 主键
+ * @return 单条数据
+ */
+ @GetMapping("selectById")
+ @ApiOperation(value = "通过id主键查询单条数据")
+ public ResResult selectById(@RequestParam("id") Integer id) {
+ return new ResResult().success(this.brandService.selectById(id));
+ }
+
+ /**
+ * @Description: 根据id数组查询品牌列表
+ * @Param: idList id数组
+ * @return: ids列表数据
+ */
+ @ApiOperation(value = "根据id数组查询品牌列表")
+ @PostMapping("selectBatchIds")
+ public ResResult selectBatchIds(@RequestParam("idList") List idList) {
+ return new ResResult().success(this.brandService.selectBatchIds(idList));
+ }
+
+
+ /**
+ * 新增数据
+ *
+ * @param brand 实体对象
+ * @return 新增结果
+ */
+ @ApiOperation(value = "新增数据")
+ @PostMapping("insert")
+ public ResResult insert(@RequestBody Brand brand) {
+ return new ResResult().success(this.brandService.insert(brand));
+ }
+
+ /**
+ * 修改数据
+ *
+ * @param brand 实体对象
+ * @return 修改结果
+ */
+ @ApiOperation(value = "根据id修改数据")
+ @PutMapping("updateById")
+ public ResResult updateById(@RequestBody Brand brand) {
+ return new ResResult().success(this.brandService.updateById(brand));
+ }
+
+ /**
+ * 删除数据
+ *
+ * @param idList 主键结合
+ * @return 删除结果
+ */
+ @ApiOperation(value = "根据id数组删除数据")
+ @DeleteMapping("deleteBatchIds")
+ public ResResult deleteBatchIds(@RequestBody List idList) {
+ return new ResResult().success(this.brandService.deleteBatchIds(idList));
+ }
+
+ @DeleteMapping("deleteById")
+ @ApiOperation(value = "根据id数组删除数据")
+ public ResResult deleteById(@RequestParam("id") Integer id) {
+ return new ResResult().success(this.brandService.deleteById(id));
+ }
+}
diff --git a/ty-user/src/main/java/top/kuanghua/tyuser/controller/ErrorCollectionController.java b/integration-front/src/main/java/top/kuanghua/integrationfront/controller/ErrorCollectionController.java
similarity index 94%
rename from ty-user/src/main/java/top/kuanghua/tyuser/controller/ErrorCollectionController.java
rename to integration-front/src/main/java/top/kuanghua/integrationfront/controller/ErrorCollectionController.java
index dcae33f..e474129 100644
--- a/ty-user/src/main/java/top/kuanghua/tyuser/controller/ErrorCollectionController.java
+++ b/integration-front/src/main/java/top/kuanghua/integrationfront/controller/ErrorCollectionController.java
@@ -1,123 +1,123 @@
-package top.kuanghua.tyuser.controller;
-
-
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.web.bind.annotation.*;
-import top.kuanghua.khcomomon.entity.KHCommonParams;
-import top.kuanghua.khcomomon.entity.ResResult;
-import top.kuanghua.tyuser.entity.ErrorCollection;
-import top.kuanghua.tyuser.service.ErrorCollectionService;
-
-import javax.annotation.Resource;
-import java.util.List;
-
-@Api(tags = "日志相关")
-@RestController
-@RequestMapping("errorCollection")
-public class ErrorCollectionController {
-
- @Resource
- private ErrorCollectionService errorCollectionService;
-
- /**
- * 分页查询所有数据
- *
- * @param errorCollection 查询实体
- * @return 所有数据
- */
- @GetMapping("selectPage")
- @ApiOperation(value = "分页查询所有数据")
- public ResResult selectPage(ErrorCollection errorCollection, KHCommonParams khCommonParams) {
- QueryWrapper queryWrapper = new QueryWrapper<>();
- if (ObjectUtils.isNotEmpty(errorCollection.getErrorLog())) {
- queryWrapper.like("error_log", errorCollection.getErrorLog());
- }
- if (ObjectUtils.isNotEmpty(errorCollection.getPageUrl())) {
- queryWrapper.like("page_url", errorCollection.getPageUrl());
- }
- if (ObjectUtils.isNotEmpty(errorCollection.getVersion())) {
- queryWrapper.like("version", errorCollection.getVersion());
- }
- if (ObjectUtils.isNotEmpty(errorCollection.getCreateTime())) {
- queryWrapper.like("create_time", errorCollection.getCreateTime());
- }
-
- if (StringUtils.isNotEmpty(khCommonParams.getStartTime())) {
- queryWrapper.between("create_time", khCommonParams.getStartTime(), khCommonParams.getEndTime());
- }
- queryWrapper.orderByDesc("create_time");
- Page errorCollectionPage = this.errorCollectionService.selectPage(khCommonParams.getPageNum(), khCommonParams.getPageSize(), queryWrapper);
- return new ResResult().success(errorCollectionPage);
- }
-
- /**
- * 通过主键查询单条数据
- *
- * @param id 主键
- * @return 单条数据
- */
- @GetMapping("selectById")
- @ApiOperation(value = "通过id主键查询单条数据")
- public ResResult selectById(@RequestParam("id") Integer id) {
- return new ResResult().success(this.errorCollectionService.selectById(id));
- }
-
- /**
- * @Description: 根据id数组查询品牌列表
- * @Param: idList id数组
- * @return: ids列表数据
- */
- @ApiOperation(value = "根据id数组查询品牌列表")
- @PostMapping("selectBatchIds")
- public ResResult selectBatchIds(@RequestParam("idList") List idList) {
- return new ResResult().success(this.errorCollectionService.selectBatchIds(idList));
- }
-
-
- /**
- * 新增数据
- *
- * @param errorCollection 实体对象
- * @return 新增结果
- */
- @ApiOperation(value = "新增数据")
- @PostMapping("insert")
- public ResResult insert(@RequestBody ErrorCollection errorCollection) {
- return new ResResult().success(this.errorCollectionService.insert(errorCollection));
- }
-
- /**
- * 修改数据
- *
- * @param errorCollection 实体对象
- * @return 修改结果
- */
- @ApiOperation(value = "根据id修改数据")
- @PutMapping("updateById")
- public ResResult updateById(@RequestBody ErrorCollection errorCollection) {
- return new ResResult().success(this.errorCollectionService.updateById(errorCollection));
- }
-
- /**
- * 删除数据
- *
- * @param idList 主键结合
- * @return 删除结果
- */
- @ApiOperation(value = "根据id数组删除数据")
- @DeleteMapping("deleteBatchIds")
- public ResResult deleteBatchIds(@RequestBody List idList) {
- return new ResResult().success(this.errorCollectionService.deleteBatchIds(idList));
- }
-
- @DeleteMapping("deleteById")
- @ApiOperation(value = "根据id数组删除数据")
- public ResResult deleteById(@RequestParam("id") Integer id) {
- return new ResResult().success(this.errorCollectionService.deleteById(id));
- }
-}
+package top.kuanghua.integrationfront.controller;
+
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.web.bind.annotation.*;
+import top.kuanghua.khcomomon.entity.KHCommonParams;
+import top.kuanghua.khcomomon.entity.ResResult;
+import top.kuanghua.integrationfront.entity.ErrorCollection;
+import top.kuanghua.integrationfront.service.ErrorCollectionService;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+@Api(tags = "日志相关")
+@RestController
+@RequestMapping("errorCollection")
+public class ErrorCollectionController {
+
+ @Resource
+ private ErrorCollectionService errorCollectionService;
+
+ /**
+ * 分页查询所有数据
+ *
+ * @param errorCollection 查询实体
+ * @return 所有数据
+ */
+ @GetMapping("selectPage")
+ @ApiOperation(value = "分页查询所有数据")
+ public ResResult selectPage(ErrorCollection errorCollection, KHCommonParams khCommonParams) {
+ QueryWrapper queryWrapper = new QueryWrapper<>();
+ if (ObjectUtils.isNotEmpty(errorCollection.getErrorLog())) {
+ queryWrapper.like("error_log", errorCollection.getErrorLog());
+ }
+ if (ObjectUtils.isNotEmpty(errorCollection.getPageUrl())) {
+ queryWrapper.like("page_url", errorCollection.getPageUrl());
+ }
+ if (ObjectUtils.isNotEmpty(errorCollection.getVersion())) {
+ queryWrapper.like("version", errorCollection.getVersion());
+ }
+ if (ObjectUtils.isNotEmpty(errorCollection.getCreateTime())) {
+ queryWrapper.like("create_time", errorCollection.getCreateTime());
+ }
+
+ if (StringUtils.isNotEmpty(khCommonParams.getStartTime())) {
+ queryWrapper.between("create_time", khCommonParams.getStartTime(), khCommonParams.getEndTime());
+ }
+ queryWrapper.orderByDesc("create_time");
+ Page errorCollectionPage = this.errorCollectionService.selectPage(khCommonParams.getPageNum(), khCommonParams.getPageSize(), queryWrapper);
+ return new ResResult().success(errorCollectionPage);
+ }
+
+ /**
+ * 通过主键查询单条数据
+ *
+ * @param id 主键
+ * @return 单条数据
+ */
+ @GetMapping("selectById")
+ @ApiOperation(value = "通过id主键查询单条数据")
+ public ResResult selectById(@RequestParam("id") Integer id) {
+ return new ResResult().success(this.errorCollectionService.selectById(id));
+ }
+
+ /**
+ * @Description: 根据id数组查询品牌列表
+ * @Param: idList id数组
+ * @return: ids列表数据
+ */
+ @ApiOperation(value = "根据id数组查询品牌列表")
+ @PostMapping("selectBatchIds")
+ public ResResult selectBatchIds(@RequestParam("idList") List idList) {
+ return new ResResult().success(this.errorCollectionService.selectBatchIds(idList));
+ }
+
+
+ /**
+ * 新增数据
+ *
+ * @param errorCollection 实体对象
+ * @return 新增结果
+ */
+ @ApiOperation(value = "新增数据")
+ @PostMapping("insert")
+ public ResResult insert(@RequestBody ErrorCollection errorCollection) {
+ return new ResResult().success(this.errorCollectionService.insert(errorCollection));
+ }
+
+ /**
+ * 修改数据
+ *
+ * @param errorCollection 实体对象
+ * @return 修改结果
+ */
+ @ApiOperation(value = "根据id修改数据")
+ @PutMapping("updateById")
+ public ResResult updateById(@RequestBody ErrorCollection errorCollection) {
+ return new ResResult().success(this.errorCollectionService.updateById(errorCollection));
+ }
+
+ /**
+ * 删除数据
+ *
+ * @param idList 主键结合
+ * @return 删除结果
+ */
+ @ApiOperation(value = "根据id数组删除数据")
+ @DeleteMapping("deleteBatchIds")
+ public ResResult deleteBatchIds(@RequestBody List idList) {
+ return new ResResult().success(this.errorCollectionService.deleteBatchIds(idList));
+ }
+
+ @DeleteMapping("deleteById")
+ @ApiOperation(value = "根据id数组删除数据")
+ public ResResult deleteById(@RequestParam("id") Integer id) {
+ return new ResResult().success(this.errorCollectionService.deleteById(id));
+ }
+}
diff --git a/ty-user/src/main/java/top/kuanghua/tyuser/controller/UserController.java b/integration-front/src/main/java/top/kuanghua/integrationfront/controller/UserController.java
similarity index 89%
rename from ty-user/src/main/java/top/kuanghua/tyuser/controller/UserController.java
rename to integration-front/src/main/java/top/kuanghua/integrationfront/controller/UserController.java
index 123f073..a082535 100644
--- a/ty-user/src/main/java/top/kuanghua/tyuser/controller/UserController.java
+++ b/integration-front/src/main/java/top/kuanghua/integrationfront/controller/UserController.java
@@ -1,204 +1,202 @@
-package top.kuanghua.tyuser.controller;
-
-
-import com.alibaba.fastjson.JSON;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.web.bind.annotation.*;
-import springfox.documentation.annotations.ApiIgnore;
-import top.kuanghua.feign.tyauth.feign.TokenFeign;
-import top.kuanghua.khcomomon.entity.KHCommonParams;
-import top.kuanghua.khcomomon.entity.ResResult;
-import top.kuanghua.tyuser.entity.User;
-import top.kuanghua.tyuser.mapper.MultiPageMapper;
-import top.kuanghua.tyuser.mapper.UserMapper;
-import top.kuanghua.tyuser.service.UserService;
-
-import javax.annotation.Resource;
-import javax.validation.Valid;
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-@Api(tags = "用户相关")
-@RestController
-@RequestMapping("user")
-@Transactional
-public class UserController {
- @Resource
- private UserService userService;
- @Resource
- private UserMapper userMapper;
-
- @Resource
- private MultiPageMapper multiPageMapper;
-
-
- @Autowired
- private TokenFeign tokenFeign;
- /**
- * 分页查询所有数据
- * @param user 查询实体
- * @return 所有数据
- */
- @GetMapping("selectPage")
- @ApiOperation(value = "分页查询数据")
- public ResResult selectPage(User user, KHCommonParams commonParams) {
- QueryWrapper queryWrapper = new QueryWrapper<>();
- if(StringUtils.isNotEmpty(user.getUsername())) {
- queryWrapper.like("username",user.getUsername());
- }
- if(StringUtils.isNotEmpty(user.getPhone())) {
- queryWrapper.like("phone",user.getPhone());
- }
- if(StringUtils.isNotEmpty(commonParams.getStartTime())) {
- queryWrapper.between("create_time",commonParams.getStartTime(),commonParams.getEndTime());
- }
- queryWrapper.select("username","phone","create_time");
- Page userPage = this.userMapper.selectPage(new Page<>(commonParams.getPageNum(), commonParams.getPageSize()), queryWrapper);
- return new ResResult().success(userPage);
- }
-
- /**
- * 通过主键查询单条数据
- *
- * @param id 主键
- * @return 单条数据
- */
- @GetMapping("selectById")
- @ApiOperation(value = "通过id主键查询单条数据")
- public ResResult selectById(@RequestParam("id") Integer id) {
- return new ResResult().success(this.userMapper.selectById(id));
- }
-//
-// /**
-// * @Description: 根据id数组查询品牌列表
-// * @Param: idList id数组
-// * @return: ids列表数据
-// */
-// @ApiOperation(value = "根据id数组查询品牌列表")
-// @PostMapping("selectBatchIds")
-// public ResResult selectBatchIds(@RequestParam("idList") List idList) {
-// return new ResResult().success(this.userMapper.selectBatchIds(idList));
-// }
-
- /**
- * 新增数据
- *
- * @param user 实体对象
- * @return 新增结果
- */
- @ApiOperation(value = "新增数据")
- @PostMapping("insert")
-
- public ResResult insert(@Valid @RequestBody User user) {
- //List userInfos = userInfoMapper.selectList(new EntityWrapper<>(userInfo).like("firstname", name)
- // .like("lastname", name));52
- return new ResResult().success(this.userService.insert(user));
- }
- /**
- * 修改数据
- *
- * @param user 实体对象
- * @return 修改结果
- */
-
-// @ApiOperation(value = "根据id修改数据")
-// @PutMapping("updateById")
-// public ResResult updateById(@RequestBody User user) {
-// return new ResResult().success(this.userService.updateById(user));
-// }
-// /**
-// * 删除数据
-// *
-// * @param idList 主键结合
-// * @return 删除结果
-// */
- @ApiOperation(value = "根据id数组删除数据")
- @DeleteMapping("deleteBatchIds")
- public ResResult deleteBatchIds(@RequestBody List idList) {
- return new ResResult().success(this.userMapper.deleteBatchIds(idList));
- }
- @DeleteMapping("deleteById")
- @ApiOperation(value = "根据id删除数据")
- public ResResult deleteById(@RequestParam("id") Integer id) {
- return new ResResult().success(this.userMapper.deleteById(id));
- }
-
- @PostMapping("registry")
- @ApiOperation(value = "用户注册")
- public ResResult registry(User user,String code,String password) throws Exception {
- this.userService.registry(user,code);
- return new ResResult().success();
- }
-
- @PostMapping("loginValid")
- @ApiOperation(value = "登录校验")
- public ResResult loginValid(User user) throws Exception {
- HashMap hm = this.userService.loginValid(user);
- return new ResResult().success(hm);
- }
-
- @PostMapping("loginOut")
- @ApiOperation(value = "退出登录")
-
- public ResResult loginOut() {
- this.userService.loginOut();
- return new ResResult().success();
- }
- @PostMapping("multiPageTest")
- @ApiOperation(value = "多分页测试")
- public Page
\ No newline at end of file
diff --git a/ty-gateway/ty-gateway-one/src/main/java/top/kuanghua/gatewaytwo/controller/HstrixController.java b/ty-common/src/main/java/top/kuanghua/controller/HstrixController.java
similarity index 83%
rename from ty-gateway/ty-gateway-one/src/main/java/top/kuanghua/gatewaytwo/controller/HstrixController.java
rename to ty-common/src/main/java/top/kuanghua/controller/HstrixController.java
index 9138091..8762eaf 100644
--- a/ty-gateway/ty-gateway-one/src/main/java/top/kuanghua/gatewaytwo/controller/HstrixController.java
+++ b/ty-common/src/main/java/top/kuanghua/controller/HstrixController.java
@@ -1,7 +1,8 @@
-package top.kuanghua.gatewaytwo.controller;
+package top.kuanghua.controller;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.kuanghua.khcomomon.entity.ResResult;
@@ -14,7 +15,7 @@
@RestController
public class HstrixController {
@ApiOperation(value = "")
- @GetMapping("fallback")
+ @RequestMapping("/fallback")
public ResResult fallback() {
ResResult resResult = new ResResult();
//设置20010为熔断状态吗
diff --git a/ty-common/src/main/java/top/kuanghua/feign/tyuser/feign/UserFeign.java b/ty-common/src/main/java/top/kuanghua/feign/integrationfront/feign/UserFeign.java
similarity index 72%
rename from ty-common/src/main/java/top/kuanghua/feign/tyuser/feign/UserFeign.java
rename to ty-common/src/main/java/top/kuanghua/feign/integrationfront/feign/UserFeign.java
index 79c0c79..e2a6fc8 100644
--- a/ty-common/src/main/java/top/kuanghua/feign/tyuser/feign/UserFeign.java
+++ b/ty-common/src/main/java/top/kuanghua/feign/integrationfront/feign/UserFeign.java
@@ -1,17 +1,15 @@
-package top.kuanghua.feign.tyuser.feign;
-
-import org.springframework.cloud.openfeign.FeignClient;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import top.kuanghua.feign.config.FeignConfiguration;
-import top.kuanghua.khcomomon.entity.ResResult;
-
-@FeignClient(name="ty-user",configuration = FeignConfiguration.class)
-@RequestMapping("user")
-public interface UserFeign {
-
- @PostMapping("insertUser")
- ResResult insertUser(@RequestParam("username") String username);
-}
+package top.kuanghua.feign.integrationfront.feign;
+
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import top.kuanghua.feign.config.FeignConfiguration;
+import top.kuanghua.khcomomon.entity.ResResult;
+
+@FeignClient(name="integration-front",configuration = FeignConfiguration.class)
+@RequestMapping("user")
+public interface UserFeign {
+ @PostMapping("insertUser")
+ ResResult insertUser(@RequestParam("username") String username);
+}
diff --git a/ty-common/src/main/java/top/kuanghua/feign/tyexecl/feign/ExcelFeign.java b/ty-common/src/main/java/top/kuanghua/feign/tyexecl/feign/ExcelFeign.java
deleted file mode 100644
index 93cb15e..0000000
--- a/ty-common/src/main/java/top/kuanghua/feign/tyexecl/feign/ExcelFeign.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package top.kuanghua.feign.tyexecl.feign;
-
-import org.springframework.cloud.openfeign.FeignClient;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import top.kuanghua.feign.config.FeignConfiguration;
-import top.kuanghua.khcomomon.entity.ResResult;
-
-/**
- * @Title: ExcelFeign
- * @Description:
- * @Auther: kuanghua
- * @create 2021/7/12 10:09
- */
-@FeignClient(name="ty-excel",configuration = FeignConfiguration.class)
-@RequestMapping("excel")
-public interface ExcelFeign {
- /*查询execl表中的用户*/
- @GetMapping("selectExcelByUser")
- public ResResult selectExcelByUser(@RequestParam("username") String username);
-}
diff --git a/ty-example/src/main/java/top/kuanghua/tyexample/ExampleApplication.java b/ty-example/src/main/java/top/kuanghua/tyexample/ExampleApplication.java
index eb9767a..4d0b9d6 100644
--- a/ty-example/src/main/java/top/kuanghua/tyexample/ExampleApplication.java
+++ b/ty-example/src/main/java/top/kuanghua/tyexample/ExampleApplication.java
@@ -10,7 +10,7 @@
@SpringBootApplication
@EnableScheduling
@EnableAsync
-//@EnableCanalClient
+@EnableCanalClient
@EnableAutoDataSourceProxy
public class ExampleApplication {
public static void main(String[] args) {
diff --git a/ty-example/src/main/java/top/kuanghua/tyexample/config/BaseConfig.java b/ty-example/src/main/java/top/kuanghua/tyexample/config/BaseConfig.java
index 809d29d..4403c0f 100644
--- a/ty-example/src/main/java/top/kuanghua/tyexample/config/BaseConfig.java
+++ b/ty-example/src/main/java/top/kuanghua/tyexample/config/BaseConfig.java
@@ -18,10 +18,10 @@
@Configuration
//扫描公用包的配置和自身的配置类
@ComponentScan(basePackages = {"top.kuanghua.khcomomon"})
-//mapper包扫描
+//mapper scanning
@MapperScan(basePackages = {"top.kuanghua.tyexample.mapper"})
-//feign扫描
-@EnableFeignClients(basePackages = {"top.kuanghua.feign.tyuser"})
+//feign scanning
+@EnableFeignClients(basePackages = {"top.kuanghua.feign"})
public class BaseConfig {
}
diff --git a/ty-example/src/main/java/top/kuanghua/tyexample/config/Swagger2Config.java b/ty-example/src/main/java/top/kuanghua/tyexample/config/Swagger2Config.java
index 4e14a84..e1e8d54 100644
--- a/ty-example/src/main/java/top/kuanghua/tyexample/config/Swagger2Config.java
+++ b/ty-example/src/main/java/top/kuanghua/tyexample/config/Swagger2Config.java
@@ -41,7 +41,7 @@ public Docket api() {
*/
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
- .title("标题:kuanghua")
+ .title("title:micro-service-plus")
.description("描述:新一代的微服务架构")
.contact(new Contact("jzfai", null, "869653722@qq.com"))
.version("版本号:2.9")
diff --git a/ty-example/src/main/java/top/kuanghua/tyexample/listener/CanalDataEventListener.java b/ty-example/src/main/java/top/kuanghua/tyexample/listener/CanalDataEventListener.java
index 5e45cc6..5bef611 100644
--- a/ty-example/src/main/java/top/kuanghua/tyexample/listener/CanalDataEventListener.java
+++ b/ty-example/src/main/java/top/kuanghua/tyexample/listener/CanalDataEventListener.java
@@ -11,35 +11,35 @@
*/
@CanalEventListener
public class CanalDataEventListener {
- @InsertListenPoint
- public void onEventInsert(CanalEntry.EventType eventType, CanalEntry.RowData rowData) {
- for (CanalEntry.Column column : rowData.getAfterColumnsList()) {
- System.out.println("新增" + column.getName() + ":获取的数据" + column.getValue());
- }
- }
-
- @UpdateListenPoint
- public void onEventUpdate(CanalEntry.EventType eventType, CanalEntry.RowData rowData) {
- for (CanalEntry.Column column : rowData.getBeforeColumnsList()) {
- System.out.println("修改前" + column.getName() + ":获取的数据" + column.getValue());
- }
- for (CanalEntry.Column column : rowData.getAfterColumnsList()) {
- System.out.println("修改后" + column.getName() + ":获取的数据" + column.getValue());
- }
- }
-
- @DeleteListenPoint
- public void onEventDelete(CanalEntry.EventType eventType, CanalEntry.RowData rowData) {
- for (CanalEntry.Column column : rowData.getBeforeColumnsList()) {
- System.out.println("删除前" + column.getName() + ":获取的数据" + column.getValue());
- }
- }
+// @InsertListenPoint
+// public void onEventInsert(CanalEntry.EventType eventType, CanalEntry.RowData rowData) {
+// for (CanalEntry.Column column : rowData.getAfterColumnsList()) {
+// System.out.println("新增" + column.getName() + ":获取的数据" + column.getValue());
+// }
+// }
+//
+// @UpdateListenPoint
+// public void onEventUpdate(CanalEntry.EventType eventType, CanalEntry.RowData rowData) {
+// for (CanalEntry.Column column : rowData.getBeforeColumnsList()) {
+// System.out.println("修改前" + column.getName() + ":获取的数据" + column.getValue());
+// }
+// for (CanalEntry.Column column : rowData.getAfterColumnsList()) {
+// System.out.println("修改后" + column.getName() + ":获取的数据" + column.getValue());
+// }
+// }
+//
+// @DeleteListenPoint
+// public void onEventDelete(CanalEntry.EventType eventType, CanalEntry.RowData rowData) {
+// for (CanalEntry.Column column : rowData.getBeforeColumnsList()) {
+// System.out.println("删除前" + column.getName() + ":获取的数据" + column.getValue());
+// }
+// }
//自定义监听
@ListenPoint(
- eventType = {CanalEntry.EventType.DELETE, CanalEntry.EventType.UPDATE}, //监听类型
- schema = {"changgou_content"},
- table = {"tb_content"}, //指定监控的表
+ eventType = {CanalEntry.EventType.DELETE, CanalEntry.EventType.UPDATE,CanalEntry.EventType.UPDATE}, //监听类型
+ schema = {"micro-service-plus"},//Library
+ table = {"tb_error_collection"}, //table
destination = "example" //指定实例的地址
)
public void onEventCustomUpdate(CanalEntry.EventType eventType, CanalEntry.RowData rowData) {
diff --git a/ty-example/src/main/java/top/kuanghua/tyexample/service/SeataTestService.java b/ty-example/src/main/java/top/kuanghua/tyexample/service/SeataTestService.java
index 3b733e7..5040928 100644
--- a/ty-example/src/main/java/top/kuanghua/tyexample/service/SeataTestService.java
+++ b/ty-example/src/main/java/top/kuanghua/tyexample/service/SeataTestService.java
@@ -1,8 +1,8 @@
package top.kuanghua.tyexample.service;
+import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-import top.kuanghua.feign.tyuser.feign.UserFeign;
+import top.kuanghua.feign.integrationfront.feign.UserFeign;
import javax.annotation.Resource;
@@ -18,7 +18,7 @@ public class SeataTestService {
@Resource
private UserFeign userFeign;
- @Transactional(rollbackFor = Exception.class)
+ @GlobalTransactional(rollbackFor = Exception.class)
public void testSeataRollback(){
userFeign.insertUser("jzfai");
int i=10/0;
diff --git a/ty-example/src/main/java/top/kuanghua/tyexample/service/UploadService.java b/ty-example/src/main/java/top/kuanghua/tyexample/service/UploadService.java
index eb5317b..6c04b9a 100644
--- a/ty-example/src/main/java/top/kuanghua/tyexample/service/UploadService.java
+++ b/ty-example/src/main/java/top/kuanghua/tyexample/service/UploadService.java
@@ -30,17 +30,17 @@ public class UploadService {
@Resource
private FastFileStorageClient storageClient;
- private static final List CONTENT_TYPES = Arrays.asList("image/jpeg", "image/gif");
+ //private static final List CONTENT_TYPES = Arrays.asList("image/jpeg", "image/gif");
public String upload(MultipartFile file) throws IOException {
String originalFilename = file.getOriginalFilename();
//检验文件类型
- String contentType = file.getContentType();
- if (!CONTENT_TYPES.contains(contentType)) {
- //文件类型不合法
- log.info("文件类型不合法:{}", originalFilename);
- throw new RuntimeException("文件内容不合法");
- }
+// String contentType = file.getContentType();
+// if (!CONTENT_TYPES.contains(contentType)) {
+// //文件类型不合法
+// log.info("文件类型不合法:{}", originalFilename);
+// throw new RuntimeException("文件内容不合法");
+// }
//检验文件内容
BufferedImage bufferedImage = ImageIO.read(file.getInputStream());
if (bufferedImage == null) {
@@ -62,10 +62,10 @@ public Map uploadGetMetaData(MultipartFile file) throws IOExcept
String originalFilename = file.getOriginalFilename();
//检验文件类型
String contentType = file.getContentType();
- if (!CONTENT_TYPES.contains(contentType)) {
- //文件类型不合法
- log.info("文件类型不合法:{}", originalFilename);
- }
+// if (!CONTENT_TYPES.contains(contentType)) {
+// //文件类型不合法
+// log.info("文件类型不合法:{}", originalFilename);
+// }
//检验文件内容
BufferedImage bufferedImage = ImageIO.read(file.getInputStream());
if (bufferedImage == null) {
diff --git a/ty-example/src/main/resources/application.yml b/ty-example/src/main/resources/application.yml
index 5d95712..e69de29 100644
--- a/ty-example/src/main/resources/application.yml
+++ b/ty-example/src/main/resources/application.yml
@@ -1,33 +0,0 @@
-#msg config, place change to you sms config
-kuanghua:
- sms:
- accessKeyId: LTAI4FrD2voTK2wTgRCPwT6d
- accessKeySecret: Zj07thnb2jiBkl4wtqgvPeuSzkJRJ3
- signName: 品优商城 # 签名名称
- verifyCodeTemplate: SMS_189216068 # 模板名称
-
-
-
-#email config, place change to you email
-spring:
- mail:
- username: 869653722@qq.com
- password: xbthzedhnxatbcab
- host: smtp.qq.com
- properties:
- mail.smtp.starttls.enable: true
-
-
-
-server:
- port: ${envpt.tomcatPortPre}0121
-
-
-
-#canal配置
-canal:
- client:
- instances:
- example:
- host: 8.135.1.141
- port: 11111
diff --git a/ty-excel/src/main/java/top/kuanghua/tyexcel/service/ExcelService.java b/ty-excel/src/main/java/top/kuanghua/tyexcel/service/ExcelService.java
index 82ec61b..acfbf48 100644
--- a/ty-excel/src/main/java/top/kuanghua/tyexcel/service/ExcelService.java
+++ b/ty-excel/src/main/java/top/kuanghua/tyexcel/service/ExcelService.java
@@ -131,8 +131,6 @@ private void saveData() {
}
-
-
//注:headRowNumber(1)如果不写会自动匹配
})// 需要读取批注 默认不读取
.extraRead(CellExtraTypeEnum.COMMENT)
diff --git a/ty-gateway/ty-gateway-one/src/main/java/top/kuanghua/gatewaytwo/config/SpecialHystrixGatewayFilterFactory.java b/ty-gateway/ty-gateway-one/src/main/java/top/kuanghua/gatewaytwo/config/SpecialHystrixGatewayFilterFactory.java
index a206eeb..440d247 100644
--- a/ty-gateway/ty-gateway-one/src/main/java/top/kuanghua/gatewaytwo/config/SpecialHystrixGatewayFilterFactory.java
+++ b/ty-gateway/ty-gateway-one/src/main/java/top/kuanghua/gatewaytwo/config/SpecialHystrixGatewayFilterFactory.java
@@ -82,7 +82,7 @@ public GatewayFilter apply(Config config) {
HystrixRuntimeException.FailureType failureType = e.getFailureType();
switch (failureType) {
case TIMEOUT:
- return Mono.error(new TimeoutException());
+ return Mono.error(new TimeoutException("接口请求超时了"));
case COMMAND_EXCEPTION: {
Throwable cause = e.getCause();
if (cause instanceof ResponseStatusException || AnnotatedElementUtils
diff --git a/ty-gateway/ty-gateway-one/src/main/resources/application.yml b/ty-gateway/ty-gateway-one/src/main/resources/application.yml
index b77388d..678e70c 100644
--- a/ty-gateway/ty-gateway-one/src/main/resources/application.yml
+++ b/ty-gateway/ty-gateway-one/src/main/resources/application.yml
@@ -4,24 +4,24 @@ server:
spring:
cloud:
gateway:
- globalcors:
- corsConfigurations:
- '[/**]':
- # 允许携带认证信息
- # 允许跨域的源(网站域名/ip),设置*为全部
- # 允许跨域请求里的head字段,设置*为全部
- # 允许跨域的method, 默认为GET和OPTIONS,设置*为全部
- # 跨域允许的有效期
- allow-credentials: true
- allowed-origins: "*"
- allowed-headers: "*"
- allowed-methods:
- - OPTIONS
- - GET
- - POST
- - PUT
- - DELETE
- #max-age: 3600
+# globalcors:
+# corsConfigurations:
+# '[/**]':
+# # 允许携带认证信息
+# # 允许跨域的源(网站域名/ip),设置*为全部
+# # 允许跨域请求里的head字段,设置*为全部
+# # 允许跨域的method, 默认为GET和OPTIONS,设置*为全部
+# # 跨域允许的有效期
+# allow-credentials: true
+# allowed-origins: "*"
+# allowed-headers: "*"
+# allowed-methods:
+# - OPTIONS
+# - GET
+# - POST
+# - PUT
+# - DELETE
+# #max-age: 3600
routes:
- id: ty-auth
uri: lb://ty-auth
@@ -61,14 +61,13 @@ spring:
#指定接口超时处理 hystrixRibbon -> @RequestMapping("hystrixRibbon")
#timeoutTest-> @GetMapping("timeoutTest") , - > /
hystrixRibbon-timeoutTest: 11000
- #file-upload-: 20000
- #file-download-: 20000
- #course-file-upload-local-: 20000
+ upload-image: 2000
+ upload-file: 30000
- - id: ty-user
- uri: lb://ty-user
+ - id: integration-front
+ uri: lb://integration-front
predicates:
- - Path=/api/ty-user/**
+ - Path=/api/integration-front/**
filters:
- StripPrefix=2
@@ -90,20 +89,20 @@ management:
#白名单过滤
filter:
- allowPaths: /
+ #not filter , you can config it when dev
+ #allowPaths: /
+ allowPaths: swagger,docs,userRegister,userLogin,sendEmailCode,registry,login,loginOut,insertUser,example
notValidExpList: export,excel
-
token-properties:
renewTokenMinute: 1440 #默认1天时间告知前端刷新token
-
#config the visit service of gateway swagger
swagger-doc:
serviceMap: {
- ty-user: "用户模块",
+ integration-front: "前端数据整合",
ty-upload: "文件上传",
ty-example: "使用例子"
}
\ No newline at end of file