1.pom调整
This commit is contained in:
@@ -1,27 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
<parent>
|
|
||||||
<groupId>com.czg</groupId>
|
|
||||||
<artifactId>cash-common</artifactId>
|
|
||||||
<version>1.0.0</version>
|
|
||||||
</parent>
|
|
||||||
<name>异常处理模块</name>
|
|
||||||
<description>异常处理</description>
|
|
||||||
<artifactId>cash-common-exception</artifactId>
|
|
||||||
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-web</artifactId>
|
|
||||||
<exclusions>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>org.apache.tomcat.embed</groupId>
|
|
||||||
<artifactId>tomcat-embed-core</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
</exclusions>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
</project>
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
package com.czg.handler;
|
|
||||||
|
|
||||||
|
|
||||||
import jakarta.annotation.PostConstruct;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.http.HttpStatus;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Administrator
|
|
||||||
*/
|
|
||||||
@RestControllerAdvice
|
|
||||||
public class GlobalExceptionHandler {
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(GlobalExceptionHandler.class);
|
|
||||||
|
|
||||||
@PostConstruct
|
|
||||||
public void init() {
|
|
||||||
log.info("✅ GlobalExceptionHandler 已初始化");
|
|
||||||
}
|
|
||||||
@ExceptionHandler(Exception.class)
|
|
||||||
public Map<String, Object> handleRuntimeException(Exception e) {
|
|
||||||
log.error("", e);
|
|
||||||
Map<String, Object> error = new HashMap<>();
|
|
||||||
error.put("code", 500);
|
|
||||||
error.put("msg", e.getMessage());
|
|
||||||
return error;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -14,7 +14,6 @@
|
|||||||
<modules>
|
<modules>
|
||||||
<module>cash-common-tools</module>
|
<module>cash-common-tools</module>
|
||||||
<module>cash-common-sa-token</module>
|
<module>cash-common-sa-token</module>
|
||||||
<module>cash-common-exception</module>
|
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@@ -40,11 +40,6 @@
|
|||||||
<artifactId>cash-common-tools</artifactId>
|
<artifactId>cash-common-tools</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>com.czg</groupId>
|
|
||||||
<artifactId>cash-common-exception</artifactId>
|
|
||||||
<version>1.0.0</version>
|
|
||||||
</dependency>
|
|
||||||
<!-- Sa-Token 权限认证,在线文档:https://sa-token.cc -->
|
<!-- Sa-Token 权限认证,在线文档:https://sa-token.cc -->
|
||||||
<!-- sa-token 的漏洞的依赖处理 -->
|
<!-- sa-token 的漏洞的依赖处理 -->
|
||||||
<!-- sa-token start -->
|
<!-- sa-token start -->
|
||||||
|
|||||||
@@ -28,10 +28,7 @@
|
|||||||
<artifactId>cash-common-tools</artifactId>
|
<artifactId>cash-common-tools</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.czg</groupId>
|
|
||||||
<artifactId>cash-common-exception</artifactId>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ public class Main {
|
|||||||
//设置表前缀和只生成哪些表,setGenerateTable 未配置时,生成所有表
|
//设置表前缀和只生成哪些表,setGenerateTable 未配置时,生成所有表
|
||||||
globalConfig.getStrategyConfig()
|
globalConfig.getStrategyConfig()
|
||||||
.setTablePrefix("")
|
.setTablePrefix("")
|
||||||
.setGenerateTable("tb_shop_user");
|
.setGenerateTable("sys_users_roles");
|
||||||
|
|
||||||
//设置生成 entity 并启用 Lombok
|
//设置生成 entity 并启用 Lombok
|
||||||
globalConfig.enableEntity()
|
globalConfig.enableEntity()
|
||||||
|
|||||||
Reference in New Issue
Block a user