调整 pom 结构
This commit is contained in:
@@ -1,77 +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>
|
||||
|
||||
<groupId>com.czg</groupId>
|
||||
<artifactId>cash-common-dependencies</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>1.0.0</version>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<java.version>21</java.version>
|
||||
<captcha.version>1.6.2</captcha.version>
|
||||
<druid.version>1.2.23</druid.version>
|
||||
<mybatisflex.version>1.10.6</mybatisflex.version>
|
||||
<hutool.version>5.8.26</hutool.version>
|
||||
<lombok.version>1.18.22</lombok.version>
|
||||
<quartz.version>2.3.2</quartz.version>
|
||||
<fastjson2.version>2.0.54</fastjson2.version>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.czg</groupId>
|
||||
<artifactId>cash-common-tools</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.whvcse</groupId>
|
||||
<artifactId>easy-captcha</artifactId>
|
||||
<version>${captcha.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>${lombok.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.mybatis-flex</groupId>
|
||||
<artifactId>mybatis-flex-spring-boot3-starter</artifactId>
|
||||
<version>${mybatisflex.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.mybatis-flex</groupId>
|
||||
<artifactId>mybatis-flex-processor</artifactId>
|
||||
<version>${mybatisflex.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid-spring-boot-3-starter</artifactId>
|
||||
<version>${druid.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>${hutool.version}</version>
|
||||
</dependency>
|
||||
<!--
|
||||
<dependency>
|
||||
<groupId>org.quartz-scheduler</groupId>
|
||||
<artifactId>quartz</artifactId>
|
||||
<version>${quartz.version}</version>
|
||||
</dependency>
|
||||
-->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.fastjson2</groupId>
|
||||
<artifactId>fastjson2</artifactId>
|
||||
<version>${fastjson2.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
</project>
|
||||
@@ -6,7 +6,7 @@ import lombok.Getter;
|
||||
* @author GYJoker
|
||||
*/
|
||||
@Getter
|
||||
public enum RespCode {
|
||||
public enum CzgRespCode {
|
||||
SUCCESS(200, "操作成功"),
|
||||
FAILURE(500, "操作失败"),
|
||||
SYSTEM_ERROR(555, "系统内部错误"),
|
||||
@@ -18,7 +18,7 @@ public enum RespCode {
|
||||
private final int code;
|
||||
private final String msg;
|
||||
|
||||
RespCode(int code, String msg) {
|
||||
CzgRespCode(int code, String msg) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
@@ -9,7 +9,7 @@ import java.io.Serializable;
|
||||
* @author GYJ
|
||||
*/
|
||||
@Data
|
||||
public class Result<T> implements Serializable {
|
||||
public class CzgResult<T> implements Serializable {
|
||||
|
||||
private int code;
|
||||
|
||||
@@ -18,7 +18,7 @@ public class Result<T> implements Serializable {
|
||||
private T data;
|
||||
|
||||
// 私有构造函数,用于在类内部创建实例,强制通过静态方法来获取Result对象
|
||||
private Result(int code, String msg, T data) {
|
||||
private CzgResult(int code, String msg, T data) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
this.data = data;
|
||||
@@ -27,36 +27,36 @@ public class Result<T> implements Serializable {
|
||||
// 以下是三个静态方法,分别用于创建不同状态的Result对象
|
||||
|
||||
// 创建成功的响应结果对象,默认消息和无数据情况
|
||||
public static <T> Result<T> success() {
|
||||
return new Result<>(200, "操作成功", null);
|
||||
public static <T> CzgResult<T> success() {
|
||||
return new CzgResult<>(200, "操作成功", null);
|
||||
}
|
||||
|
||||
// 创建成功的响应结果对象,携带指定的数据
|
||||
public static <T> Result<T> success(T data) {
|
||||
return new Result<>(200, "操作成功", data);
|
||||
public static <T> CzgResult<T> success(T data) {
|
||||
return new CzgResult<>(200, "操作成功", data);
|
||||
}
|
||||
|
||||
// 创建带有自定义消息的成功响应结果对象,携带指定的数据
|
||||
public static <T> Result<T> success(String msg, T data) {
|
||||
return new Result<>(200, msg, data);
|
||||
public static <T> CzgResult<T> success(String msg, T data) {
|
||||
return new CzgResult<>(200, msg, data);
|
||||
}
|
||||
|
||||
// 创建失败的响应结果对象,默认消息和无数据情况
|
||||
public static <T> Result<T> failure() {
|
||||
return new Result<>(500, "操作失败", null);
|
||||
public static <T> CzgResult<T> failure() {
|
||||
return new CzgResult<>(500, "操作失败", null);
|
||||
}
|
||||
|
||||
// 创建失败的响应结果对象,携带指定的自定义消息
|
||||
public static <T> Result<T> failure(String msg) {
|
||||
return new Result<>(500, msg, null);
|
||||
public static <T> CzgResult<T> failure(String msg) {
|
||||
return new CzgResult<>(500, msg, null);
|
||||
}
|
||||
|
||||
// 创建带有自定义状态码和消息的失败响应结果对象,无数据情况
|
||||
public static <T> Result<T> failure(int code, String msg) {
|
||||
return new Result<>(code, msg, null);
|
||||
public static <T> CzgResult<T> failure(int code, String msg) {
|
||||
return new CzgResult<>(code, msg, null);
|
||||
}
|
||||
|
||||
public static <T> Result<T> failure(RespCode respCode) {
|
||||
return new Result<>(respCode.getCode(), respCode.getMsg(), null);
|
||||
public static <T> CzgResult<T> failure(CzgRespCode respCode) {
|
||||
return new CzgResult<>(respCode.getCode(), respCode.getMsg(), null);
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,6 @@
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<modules>
|
||||
<module>cash-common-dependencies</module>
|
||||
<module>cash-common-tools</module>
|
||||
<module>cash-common-sa-token</module>
|
||||
</modules>
|
||||
|
||||
Reference in New Issue
Block a user