File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed
springboot-starter/src/main/java/com/codingapi/springboot/framework/dto/response Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change
1
+ package com .codingapi .springboot .framework .dto .response ;
2
+
3
+ import lombok .Getter ;
4
+ import lombok .Setter ;
5
+
6
+ import java .util .HashMap ;
7
+ import java .util .Map ;
8
+
9
+ @ Setter
10
+ @ Getter
11
+ public class MapResponse extends Response {
12
+
13
+ private Map <String ,Object > data ;
14
+
15
+ public MapResponse () {
16
+ this .data = new HashMap <>();
17
+ }
18
+
19
+ public static MapResponse create () {
20
+ MapResponse singleResponse = new MapResponse ();
21
+ singleResponse .setSuccess (true );
22
+ return singleResponse ;
23
+ }
24
+
25
+ public static MapResponse empty () {
26
+ MapResponse mapResponse = new MapResponse ();
27
+ mapResponse .setSuccess (true );
28
+ mapResponse .setData (null );
29
+ return mapResponse ;
30
+ }
31
+
32
+ public MapResponse add (String key , Object value ){
33
+ this .data .put (key , value );
34
+ return this ;
35
+ }
36
+ }
You can’t perform that action at this time.
0 commit comments