From 16d10cef208de048f8b325facd143c54b7be9963 Mon Sep 17 00:00:00 2001 From: xiangpei <xiangpei@timesnew.cn> Date: 星期五, 31 五月 2024 11:53:39 +0800 Subject: [PATCH] 重构:lombok、vo、mybatisplus、beanutils、包名 --- src/main/java/com/ycl/jxkg/base/Result.java | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/ycl/jxkg/base/RestResponse.java b/src/main/java/com/ycl/jxkg/base/Result.java similarity index 79% rename from src/main/java/com/ycl/jxkg/base/RestResponse.java rename to src/main/java/com/ycl/jxkg/base/Result.java index 95ed20f..5b121fe 100644 --- a/src/main/java/com/ycl/jxkg/base/RestResponse.java +++ b/src/main/java/com/ycl/jxkg/base/Result.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); } /** -- Gitblit v1.8.0