From 241e65aaf1aa4c9c18267806bafc67a4c9b1c213 Mon Sep 17 00:00:00 2001 From: thug0bin Date: Fri, 6 Mar 2026 15:00:15 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EB=B0=B1=EC=A0=9C=EC=95=BD=ED=92=88=20?= =?UTF-8?q?=EC=9E=94=EA=B3=A0=20API=20=EC=97=94=EB=93=9C=ED=8F=AC=EC=9D=B8?= =?UTF-8?q?=ED=8A=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GET /api/baekje/balance - 잔고액 조회 --- backend/baekje_api.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/backend/baekje_api.py b/backend/baekje_api.py index a4417c7..b8ff837 100644 --- a/backend/baekje_api.py +++ b/backend/baekje_api.py @@ -233,3 +233,30 @@ def api_search_for_order(): result['count'] = len(filtered) return jsonify(result) + + +# ========== 잔고 조회 ========== + +@baekje_bp.route('/balance', methods=['GET']) +def api_get_balance(): + """ + 잔고액 조회 + + GET /api/baekje/balance + GET /api/baekje/balance?year=2026 + + Returns: + { + "success": true, + "balance": 14193234, + "monthly": [ + {"month": "2026-03", "sales": 6935133, "balance": 14193234, ...}, + {"month": "2026-02", "sales": 18600692, "balance": 7258101, ...} + ] + } + """ + year = flask_request.args.get('year', '').strip() + + session = get_baekje_session() + result = session.get_balance(year if year else None) + return jsonify(result)