package com.goldenchart.controller; import com.goldenchart.service.AppSettingsService; import lombok.RequiredArgsConstructor; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import java.util.Map; /** * 앱 전역 차트 기본 설정 REST API. * *
프론트엔드에 하드코딩된 기본값들(기본 심볼·타임프레임·테마·캔들 색상 등)을 * 장치/사용자별로 DB 에서 관리한다.
* ** GET /app-settings — 현재 기본 설정 로드 (앱 시작 시 호출) * PUT /app-settings — 기본 설정 저장 ** * 반환 구조: *
* {
* "defaultSymbol": "KRW-BTC",
* "defaultTimeframe": "1D",
* "defaultChartType": "candlestick",
* "defaultTheme": "dark",
* "defaultLogScale": false,
* "defaultLayoutId": "1",
* "mainChartStyle": { "upColor":"#ff6b6b", "downColor":"#4dabf7", ... },
* "syncOptions": { "symbol":false, "interval":false, "crosshair":true, ... }
* }
*
*/
@RestController
@RequestMapping("/app-settings")
@RequiredArgsConstructor
public class AppSettingsController {
private final AppSettingsService service;
// ── GET ───────────────────────────────────────────────────────────────────
/**
* 앱 시작 시 기본 설정 로드.
* DB 에 데이터가 없으면 엔티티 기본값(hardcoded fallback)을 반환한다.
*/
@GetMapping
public ResponseEntity