瀏覽代碼

add specification of Response class.

171870002 5 年之前
父節點
當前提交
37dad1b050
共有 1 個文件被更改,包括 43 次插入0 次删除
  1. 43 0
      src/main/java/com/example/data_structure/common/Response.java

+ 43 - 0
src/main/java/com/example/data_structure/common/Response.java

@@ -1,4 +1,47 @@
 package com.example.data_structure.common;
 
 public class Response {
+
+    private Object content;
+    private String message;
+    private boolean success;
+
+    public Response(Object content, String message, boolean success) {
+        this.content = content;
+        this.message = message;
+        this.success = success;
+    }
+
+    public Response(Object content, boolean success) {
+        this.content = content;
+        this.success = success;
+        this.message=null;
+    }
+
+    public Response(String message, boolean success) {
+        this.message = message;
+        this.success = success;
+        this.content=null;
+    }
+
+    public Response(boolean success) {
+        this.success = success;
+        this.message=null;
+        this.content=null;
+    }
+
+    public static Response buildSuccess(){
+        return null;
+    }
+
+    public static  Response buildSuccess(Object content,String message){
+        return null;
+    }
+
+    public static Response buildSuccess(Object content){
+        return null;
+    }
+
+    
+
 }