1.pom调整

This commit is contained in:
张松
2025-02-10 14:48:52 +08:00
parent 1255780aa1
commit f0b5d3c535
6 changed files with 2 additions and 71 deletions

View File

@@ -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>

View File

@@ -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;
}
}

View File

@@ -14,7 +14,6 @@
<modules>
<module>cash-common-tools</module>
<module>cash-common-sa-token</module>
<module>cash-common-exception</module>
</modules>
</project>

View File

@@ -40,11 +40,6 @@
<artifactId>cash-common-tools</artifactId>
<version>1.0.0</version>
</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 的漏洞的依赖处理 -->
<!-- sa-token start -->

View File

@@ -28,10 +28,7 @@
<artifactId>cash-common-tools</artifactId>
</dependency>
<dependency>
<groupId>com.czg</groupId>
<artifactId>cash-common-exception</artifactId>
</dependency>
</dependencies>
</project>

View File

@@ -69,7 +69,7 @@ public class Main {
//设置表前缀和只生成哪些表setGenerateTable 未配置时,生成所有表
globalConfig.getStrategyConfig()
.setTablePrefix("")
.setGenerateTable("tb_shop_user");
.setGenerateTable("sys_users_roles");
//设置生成 entity 并启用 Lombok
globalConfig.enableEntity()