This commit is contained in:
2026-07-15 18:33:33 +09:00
parent 6b1583103f
commit f533082537
201 changed files with 19776 additions and 563 deletions
@@ -0,0 +1,67 @@
---
status: stable
page_id: A08_Support
related_pages: ["[[A08_Support/A08_frontend]]", "[[A06_Login/A06_backend]]", "[[db_schema/logs_monitoring]]"]
last_updated: 2026-07-12
---
# A08_Support — Backend
기술지원 문의 접수 API. `support_requests` 테이블 저장 + 관리자 알림 메일.
## 파일 구조
| 파일 | 위치 | 역할 |
|---|---|---|
| `A08_Support_Router.py` | `A08_Support/A08_Support_Router.py:1-68` | 문의 접수 API (prefix `/api/a08`) |
| `A08_Support_Schema.py` | `A08_Support/A08_Support_Schema.py:1-13` | 문의 요청 검증 Pydantic 모델 |
## API 엔드포인트
| 엔드포인트 | 위치 | 역할 |
|---|---|---|
| `POST /api/a08/support` | `A08_Support/A08_Support_Router.py:27` | 문의 접수. DB 저장 + ADMIN_EMAIL로 알림 메일 |
## 내부 헬퍼
| 함수 | 위치 | 역할 |
|---|---|---|
| `_get_company_name(company_id)` | `A08_Support/A08_Support_Router.py:16` | company_id로 회사명 조회 (없으면 None) |
## 요청 스키마 (Pydantic)
| 모델 | 위치 | 필드 |
|---|---|---|
| `SupportRequestPayload` | `A08_Support/A08_Support_Schema.py:6` | name(1~255), email(EmailStr), phone?(≤30), subject(1~255), message(1~5000) |
## 접수 로직
1. `get_optional_session()`으로 로그인 여부 확인 (비로그인 허용)
2. 로그인 상태면 세션의 `company_id``_get_company_name()`으로 회사명 조회, 비로그인이면 None
3. `support_requests` INSERT (아래 컬럼)
4. ADMIN_EMAIL 설정 시 관리자에게 문의 알림 메일 발송
## DB 저장 컬럼 (실 코드 INSERT 기준)
`support_requests`에 INSERT하는 컬럼:
`company_id, company_name, user_name, user_email, user_phone, subject, message`
→ 테이블 정의 → [[db_schema/logs_monitoring]]
## 특징
- **비로그인도 문의 가능** (`get_optional_session`): 세션 없으면 회사 정보만 None으로 저장
- 로그인 상태면 회사 정보 자동 연결
## 의존성 (공통 유틸)
- [[common_util]] — `common_util_auth`(`get_optional_session`), `common_util_email`(`send_email_background`), `common_util_email_templates`(`support_request_email`)
- `config_system``ADMIN_EMAIL`
- DB → [[db_schema/logs_monitoring]]
## ⚠️ DB 스키마 불일치 (확인 필요)
[[db_schema/logs_monitoring]]의 `support_requests` 컬럼은 계획서 기준
(`user_id, title, priority, status`)인데, 실 코드 INSERT는
`company_id, company_name, user_name, user_email, user_phone, subject, message`.
컬럼명이 다름 — 실 DB 스키마 대조 필요 (규칙6: 실 코드 우선). logs_monitoring 갱신 대상.