ImSQL
C++ 기반 SQL 자동화 및 라이선스 관리 엔진
Loading...
Searching...
No Matches
handler_base.hpp File Reference

API 핸들러에서 공통적으로 사용하는 기본 타입 및 유틸리티를 정의합니다. More...

#include <utils/utils.hpp>
#include <string>
#include <unordered_map>
#include <nlohmann/json.hpp>
+ Include dependency graph for handler_base.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum class  handler::StatusCode {
  _200 = 200 , _201 = 201 , _204 = 204 , _400 = 400 ,
  _401 = 401 , _403 = 403 , _404 = 404 , _405 = 405 ,
  _422 = 422 , _429 = 429 , _500 = 500
}
 HTTP 상태 코드를 나타내는 열거형.
 

Functions

crow::response handler::createCommonResponse (StatusCode status_code, const std::string &message="")
 공통 HTTP 응답을 생성하는 함수.
 

Detailed Description

API 핸들러에서 공통적으로 사용하는 기본 타입 및 유틸리티를 정의합니다.

Function Documentation

◆ createCommonResponse()

crow::response handler::createCommonResponse ( StatusCode status_code,
const std::string & message = "" )
inline

공통 HTTP 응답을 생성하는 함수.

Parameters
status_codeHTTP 상태 코드
message응답 메시지 (기본값: 빈 문자열)
Returns
crow::response 생성된 HTTP 응답 객체
  • 204 No Content 인 경우, 바디 없이 상태 코드만 반환합니다.
  • 그 외의 경우, JSON 포맷으로 메시지를 포함한 응답을 반환합니다.