初始提交,实现WebSocket聊天室基本功能
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package cn.airnan.dg.utils;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public class CommonResponse<T> {
|
||||
private int code;
|
||||
private String msg;
|
||||
private T data;
|
||||
|
||||
public static <T> CommonResponse<T> success(T data) {
|
||||
return new CommonResponse<T>(0, "success", data);
|
||||
}
|
||||
|
||||
public static <T> CommonResponse<T> success() {
|
||||
return new CommonResponse<T>(0, "success", null);
|
||||
}
|
||||
|
||||
public static <T> CommonResponse<T> error(String msg) {
|
||||
return new CommonResponse<T>(1, msg, null);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user