{"openapi":"3.0.3","info":{"title":"AIRS Backend API","version":"v1","description":"AIRS backend API definition"},"tags":[{"name":"Auth","description":"회원가입 및 로그인 API"},{"name":"User","description":"사용자 정보 API"},{"name":"Device","description":"기기 등록 및 조회 API"},{"name":"Sensor","description":"센서 조회 API"},{"name":"Internal Sensor","description":"내부 AI용 센서 조회 API"}],"paths":{"/airs/auth/signup":{"post":{"tags":["Auth"],"summary":"회원가입","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignUpRequest"}}}},"responses":{"201":{"description":"회원가입 성공","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignUpResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"409":{"$ref":"#/components/responses/Conflict"}}}},"/airs/auth/login":{"post":{"tags":["Auth"],"summary":"로그인","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}}},"responses":{"200":{"description":"로그인 성공","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/airs/users/me":{"get":{"tags":["User"],"summary":"내 정보 조회","description":"Authorization: Bearer {accessToken} 헤더가 필요합니다.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"조회 성공","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserMeResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/airs/devices":{"post":{"tags":["Device"],"summary":"기기 등록","description":"Authorization: Bearer {accessToken} 헤더가 필요합니다.","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceRegisterRequest"}}}},"responses":{"201":{"description":"기기 등록 성공","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceRegisterResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"}}},"get":{"tags":["Device"],"summary":"내 기기 목록 조회","description":"Authorization: Bearer {accessToken} 헤더가 필요합니다.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"조회 성공","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DeviceSummaryResponse"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/airs/devices/{nodeId}":{"get":{"tags":["Device"],"summary":"기기 상세 조회","description":"Authorization: Bearer {accessToken} 헤더가 필요합니다.","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/NodeId"}],"responses":{"200":{"description":"조회 성공","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceDetailResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}},"patch":{"tags":["Device"],"summary":"기기 설정 수정","description":"Authorization: Bearer {accessToken} 헤더가 필요합니다.","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/NodeId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceUpdateRequest"}}}},"responses":{"200":{"description":"수정 성공","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceDetailResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/airs/devices/{nodeId}/measurements/summary":{"get":{"tags":["Sensor"],"summary":"DHT22 일간 요약 조회","description":"Authorization: Bearer {accessToken} 헤더가 필요합니다.","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/NodeId"},{"name":"date","in":"query","required":true,"schema":{"type":"string","format":"date","example":"2026-05-06"}}],"responses":{"200":{"description":"조회 성공","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyDht22SummaryResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/airs/internal/devices/{nodeId}/measurements/range":{"get":{"tags":["Internal Sensor"],"summary":"AI용 DHT22 기간 조회","description":"localhost 내부 호출 전용 API입니다.","parameters":[{"$ref":"#/components/parameters/NodeId"},{"name":"from","in":"query","required":true,"schema":{"type":"string","format":"date-time","example":"2026-05-06T00:00:00Z"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","format":"date-time","example":"2026-05-06T23:59:59Z"}}],"responses":{"200":{"description":"조회 성공","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Dht22RangeResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"parameters":{"NodeId":{"name":"nodeId","in":"path","required":true,"schema":{"type":"string","example":"NODE-001"}}},"responses":{"BadRequest":{"description":"요청 값이 올바르지 않습니다.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"Unauthorized":{"description":"인증이 필요하거나 토큰이 유효하지 않습니다.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"Forbidden":{"description":"접근 권한이 없습니다.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"NotFound":{"description":"요청한 리소스를 찾을 수 없습니다.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"Conflict":{"description":"중복된 리소스입니다.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}},"schemas":{"SignUpRequest":{"type":"object","required":["email","password","nickname"],"properties":{"email":{"type":"string","example":"user@example.com"},"password":{"type":"string","example":"Abcd1234!"},"nickname":{"type":"string","example":"jaeho"}}},"SignUpResponse":{"type":"object","properties":{"userId":{"type":"integer","format":"int64"},"email":{"type":"string"},"nickname":{"type":"string"}}},"LoginRequest":{"type":"object","required":["email","password"],"properties":{"email":{"type":"string","example":"user@example.com"},"password":{"type":"string","example":"Abcd1234!"}}},"LoginResponse":{"type":"object","properties":{"accessToken":{"type":"string"},"userId":{"type":"integer","format":"int64"},"email":{"type":"string"},"nickname":{"type":"string"}}},"UserMeResponse":{"type":"object","properties":{"userId":{"type":"integer","format":"int64"},"email":{"type":"string"},"nickname":{"type":"string"},"role":{"type":"string","enum":["USER","ADMIN"]},"createdAt":{"type":"string","format":"date-time"}}},"DeviceRegisterRequest":{"type":"object","required":["nodeId"],"properties":{"nodeId":{"type":"string","example":"NODE-001"}}},"DeviceRegisterResponse":{"type":"object","properties":{"nodeId":{"type":"string"},"userId":{"type":"integer","format":"int64"},"preferredTemperature":{"type":"number","nullable":true},"preferredHumidity":{"type":"number","nullable":true},"wifiSsid":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"}}},"DeviceSummaryResponse":{"type":"object","properties":{"nodeId":{"type":"string"},"preferredTemperature":{"type":"number","nullable":true},"preferredHumidity":{"type":"number","nullable":true},"wifiSsid":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"}}},"DeviceDetailResponse":{"type":"object","properties":{"nodeId":{"type":"string"},"userId":{"type":"integer","format":"int64"},"preferredTemperature":{"type":"number","nullable":true},"preferredHumidity":{"type":"number","nullable":true},"wifiSsid":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"}}},"DeviceUpdateRequest":{"type":"object","properties":{"preferredTemperature":{"type":"number","nullable":true,"example":24.5},"preferredHumidity":{"type":"number","nullable":true,"example":45.0}}},"DailyDht22SummaryResponse":{"type":"object","properties":{"nodeId":{"type":"string"},"date":{"type":"string","format":"date"},"peakTemperature":{"type":"number","nullable":true},"peakTemperatureTime":{"type":"string","format":"date-time","nullable":true},"averageTemperature":{"type":"number","nullable":true},"minTemperature":{"type":"number","nullable":true},"minTemperatureTime":{"type":"string","format":"date-time","nullable":true},"peakHumidity":{"type":"number","nullable":true},"peakHumidityTime":{"type":"string","format":"date-time","nullable":true},"averageHumidity":{"type":"number","nullable":true},"minHumidity":{"type":"number","nullable":true},"minHumidityTime":{"type":"string","format":"date-time","nullable":true}}},"Dht22MeasurementItem":{"type":"object","properties":{"temperature":{"type":"number"},"humidity":{"type":"number"},"timestamp":{"type":"string","format":"date-time"}}},"Dht22RangeResponse":{"type":"object","properties":{"nodeId":{"type":"string"},"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"measurements":{"type":"array","items":{"$ref":"#/components/schemas/Dht22MeasurementItem"}}}},"ApiErrorResponse":{"type":"object","properties":{"timestamp":{"type":"string","format":"date-time"},"status":{"type":"integer"},"error":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}}}}}}