Skip to content

Commit

Permalink
[fix] :: global
Browse files Browse the repository at this point in the history
made baseResponse
  • Loading branch information
heunseoRyu committed Jun 12, 2024
1 parent ea4f0f4 commit 496730a
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/main/java/com/beep/beep/global/common/dto/Response.java
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);
}
}

0 comments on commit 496730a

Please sign in to comment.