Skip to content

Commit

Permalink
#2 - Feat: 들어온 인자들을 (key, value) 쌍으로 HttpHeaders 에 담아 반환하는 Ut.spring.…
Browse files Browse the repository at this point in the history
…httpHeadersOf() 도입
  • Loading branch information
ahah525 committed Nov 8, 2022
1 parent 8523f92 commit c26d357
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,21 @@ public static <T> ResponseEntity<RsData> responseEntityOf(RsData<T> rsData, Http
// body, header, httpStatus
return new ResponseEntity<>(rsData, headers, httpStatus);
}

// 들어온 인자를 (key, value) 형태의 HttpHeaders 로 반환
public static HttpHeaders httpHeadersOf(String... args) {
HttpHeaders headers = new HttpHeaders();

// (key, value)
Map<String, String> map = Ut.mapOf(args);

for(String key : map.keySet()) {
String value = map.get(key);
headers.set(key, value);
}

return headers;
}
}

public static class date {
Expand Down

0 comments on commit c26d357

Please sign in to comment.