32 lines
2.4 KiB
HTML
32 lines
2.4 KiB
HTML
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../jacoco-resources/report.css" type="text/css"/><link rel="shortcut icon" href="../jacoco-resources/report.gif" type="image/gif"/><title>ApiResult.java</title><link rel="stylesheet" href="../jacoco-resources/prettify.css" type="text/css"/><script type="text/javascript" src="../jacoco-resources/prettify.js"></script></head><body onload="window['PR_TAB_WIDTH']=4;prettyPrint()"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../jacoco-sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">project-auth-server</a> > <a href="index.source.html" class="el_package">com.project.auth.presentation.support.response</a> > <span class="el_source">ApiResult.java</span></div><h1>ApiResult.java</h1><pre class="source lang-java linenums">package com.project.auth.presentation.support.response;
|
|
|
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
|
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
/**
|
|
* 모든 API 응답의 통일된 응답 봉투(envelope).
|
|
*
|
|
* <ul>
|
|
* <li>{@code data}: 성공 응답의 페이로드. 실패 시에는 null.</li>
|
|
* <li>{@code errors}: 검증/cross-field 에러 메시지의 키-리스트 맵. 검증 실패에서만
|
|
* 채워진다. 필드 레벨 진단이 없으면 null. {@code data}와 분리해서 OpenAPI 스펙이
|
|
* {@code data}를 도메인 타입과 에러 맵의 oneOf로 모델링할 필요가 없게 한다.</li>
|
|
* </ul>
|
|
*
|
|
* null 필드는 JSON 직렬화 시 제외하여, 성공 응답에 {@code "errors": null} 잡음이나
|
|
* 실패 응답에 {@code "data": null}이 따라붙지 않도록 한다.
|
|
*/
|
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
|
<span class="fc" id="L22">public record ApiResult<T>(</span>
|
|
boolean success,
|
|
String code,
|
|
String message,
|
|
T data,
|
|
Map<String, List<String>> errors,
|
|
String traceId,
|
|
String timestamp
|
|
) {
|
|
}
|
|
</pre><div class="footer"><span class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a> 0.8.14.202510111229</span></div></body></html> |