xiangpei
2024-05-31 16d10cef208de048f8b325facd143c54b7be9963
src/main/java/com/ycl/jxkg/base/Result.java
File was renamed from src/main/java/com/ycl/jxkg/base/RestResponse.java
@@ -6,7 +6,7 @@
 * Copyright (C), 2020-2024, 武汉思维跳跃科技有限公司
 * @date 2021/5/25 10:45
 */
public class RestResponse<T> {
public class Result<T> {
    private int code;
    private String message;
    private T response;
@@ -17,7 +17,7 @@
     * @param code    the code
     * @param message the message
     */
    public RestResponse(int code, String message) {
    public Result(int code, String message) {
        this.code = code;
        this.message = message;
    }
@@ -29,7 +29,7 @@
     * @param message  the message
     * @param response the response
     */
    public RestResponse(int code, String message, T response) {
    public Result(int code, String message, T response) {
        this.code = code;
        this.message = message;
        this.response = response;
@@ -42,8 +42,8 @@
     * @param msg  the msg
     * @return the rest response
     */
    public static RestResponse fail(Integer code, String msg) {
        return new RestResponse<>(code, msg);
    public static Result fail(Integer code, String msg) {
        return new Result<>(code, msg);
    }
    /**
@@ -51,9 +51,9 @@
     *
     * @return the rest response
     */
    public static RestResponse ok() {
    public static Result ok() {
        SystemCode systemCode = SystemCode.OK;
        return new RestResponse<>(systemCode.getCode(), systemCode.getMessage());
        return new Result<>(systemCode.getCode(), systemCode.getMessage());
    }
    /**
@@ -63,9 +63,9 @@
     * @param response the response
     * @return the rest response
     */
    public static <F> RestResponse<F> ok(F response) {
    public static <F> Result<F> ok(F response) {
        SystemCode systemCode = SystemCode.OK;
        return new RestResponse<>(systemCode.getCode(), systemCode.getMessage(), response);
        return new Result<>(systemCode.getCode(), systemCode.getMessage(), response);
    }
    /**