-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
src/main/java/com/beep/beep/global/common/dto/Response.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.beep.beep.global.common.dto; | ||
|
||
import lombok.Builder; | ||
import lombok.Getter; | ||
import org.springframework.http.HttpStatus; | ||
|
||
@Getter | ||
@Builder | ||
public class Response { | ||
|
||
private int status; | ||
private String message; | ||
|
||
public static Response of(HttpStatus status, String message) { | ||
return new Response(status.value(), message); | ||
} | ||
|
||
public static Response ok(String message) { | ||
return new Response(HttpStatus.OK.value(), message); | ||
} | ||
|
||
public static Response created(String message) { | ||
return new Response(HttpStatus.CREATED.value(), message); | ||
} | ||
|
||
public static Response noContent(String message) { | ||
return new Response(HttpStatus.NO_CONTENT.value(), message); | ||
} | ||
} |