πŸ“¨ ν™˜κ²½ μ„€μ •


πŸ”Œ μ½”λ“œ μ»¨λ²€μ…˜

<aside> 🏷️

λͺ…λͺ… κ·œμΉ™

</aside>

  1. λ‹€λ₯Έ μ‚¬λžŒμ΄ 맑은 μ½”λ“œλŠ” μž„μ˜λ‘œ κ³ μΉ˜μ§€ 말고 κΌ­ λ‹΄λ‹Ήμžλž‘ μ–˜κΈ°ν•˜κΈ°

  2. μ½”λ“œ λ¦¬νŒ©ν† λ§ ν•˜κΈ° μ „μ—λŠ” λ¦¬νŒ©ν† λ§ λ‹΄λ‹Ήμžκ°€ νŒ€ 전체에 κ³΅μœ ν•˜κΈ°

  3. PR 올리기 μ „ 두 κ°€μ§€ κΌ­ ν•˜κΈ°

  4. Collection λ³€μˆ˜λŠ” λ³€μˆ˜λͺ… + Collection νƒ€μž…

  5. 주석은 // 만 μ‚¬μš©ν•˜κΈ°

  6. DTO λͺ…λͺ… μ‹œ 유의 사항

  7. 카멜 μΌ€μ΄μŠ€



ResponseBody

@Getter
@AllArgsConstructor
public class ApiResponse<T> {	
	private String message;
	private T data;
	
    public static ResponseEntity<ApiResponse<Void>> success(HttpStatus status, String message) {
        return ResponseEntity.status(status.value())
                .body(new ApiResponse<>(message, null));
    }

    public static <T> ResponseEntity<ApiResponse<T>> success(HttpStatus status, String message, T data) {
        return ResponseEntity.status(status.value())
                .body(new ApiResponse<>(message, data));
    }

    public static <T> ResponseEntity<ApiResponse<T>> error(HttpStatus status, String message) {
        return ResponseEntity.status(status.value())
                .body(new ApiResponse<>(message, null));
    }
	
}