feat: QR 토큰 API에서 클라이언트 items 우선 처리

- /api/admin/qr/generate에서 client_items 파라미터 추가
- 클라이언트 전달 items 우선, 없으면 MSSQL 조회
- get_sale_items 쿼리 컬럼명 수정 (DrugCode, GoodsName 등)
This commit is contained in:
thug0bin
2026-03-29 12:54:20 +09:00
parent 21e1c3adfa
commit 8bcea3040f
3 changed files with 85 additions and 5 deletions

View File

@@ -21,9 +21,18 @@ from db.dbsetup import DatabaseManager
MILEAGE_RATE = 0.03 # 3% 적립
TOKEN_EXPIRY_DAYS = 30 # 30일 유효기간
# 서버 설정 (v2)
CLOUD_API_URL = "https://pos.pharmq.kr"
PHARMACY_CODE = "P0001"
# 서버 설정 (v2) - config.json에서 읽기
import json
_config_path = os.path.join(os.path.dirname(__file__), '..', 'config.json')
try:
with open(_config_path, 'r', encoding='utf-8') as f:
_config = json.load(f)
CLOUD_API_URL = _config.get('cloud_api_url', 'https://pos.pharmq.kr')
PHARMACY_CODE = _config.get('pharmacy_code', 'P0001')
except:
CLOUD_API_URL = "https://pos.pharmq.kr"
PHARMACY_CODE = "P0001"
QR_BASE_URL = f"{CLOUD_API_URL}/{PHARMACY_CODE}/claim"
# 로거