자산 현황 및 자동매매 페이지 제거:
Some checks failed
Build Push and Restart Compose / deploy (push) Failing after 11m20s

- `/templates/pages/asset.html`, `/templates/pages/autotrade.html` HTML 템플릿 삭제.
- `/static/js/asset.js`, `/static/js/autotrade.js` 클라이언트 스크립트 제거.
- 관련 함수 및 초기화 로직 삭제 (자산 조회 및 자동매매 기능 비활성화).
This commit is contained in:
hayato5246
2026-04-07 21:43:24 +09:00
parent 5a29d50752
commit 5aeb5f2b80
47 changed files with 279 additions and 6361 deletions

18
main.go
View File

@@ -16,6 +16,9 @@ func main() {
// 환경변수 로딩
config.Load()
// PostgreSQL 초기화 (DATABASE_URL 미설정 시 메모리 모드)
services.InitDB()
// 키움증권 토큰 발급 (서버 시작 시 즉시 실행)
tokenSvc := services.GetTokenService()
if err := tokenSvc.Start(); err != nil {
@@ -53,7 +56,6 @@ func main() {
})
// 핸들러 초기화
pageHandler := handlers.NewPageHandler()
stockHandler := handlers.NewStockHandler(watchlistSvc)
wsHandler := handlers.NewWSHandler(hub)
authHandler := handlers.NewAuthHandler(sessionSvc)
@@ -64,19 +66,10 @@ func main() {
mux := http.NewServeMux()
// --- 인증 라우트 ---
mux.HandleFunc("GET /login", authHandler.LoginPage)
mux.HandleFunc("POST /login", authHandler.Login)
mux.HandleFunc("POST /logout", authHandler.Logout)
mux.HandleFunc("GET /api/auth/check", authHandler.CheckSession)
// --- 페이지 라우트 ---
mux.HandleFunc("GET /", pageHandler.IndexPage)
mux.HandleFunc("GET /theme", pageHandler.ThemePage)
mux.HandleFunc("GET /kospi200", pageHandler.Kospi200Page)
mux.HandleFunc("GET /asset", pageHandler.AssetPage)
mux.HandleFunc("GET /autotrade", pageHandler.AutoTradePage)
mux.HandleFunc("GET /stock/{code}", pageHandler.StockDetailPage)
// --- REST API 라우트 ---
mux.HandleFunc("GET /api/stock/{code}", stockHandler.GetCurrentPrice)
mux.HandleFunc("GET /api/stock/{code}/chart", stockHandler.GetDailyChart)
@@ -114,6 +107,7 @@ func main() {
mux.HandleFunc("DELETE /api/autotrade/rules/{id}", autoTradeHandler.DeleteRule)
mux.HandleFunc("POST /api/autotrade/rules/{id}/toggle", autoTradeHandler.ToggleRule)
mux.HandleFunc("GET /api/autotrade/positions", autoTradeHandler.GetPositions)
mux.HandleFunc("GET /api/autotrade/trades", autoTradeHandler.GetTrades)
mux.HandleFunc("GET /api/autotrade/logs", autoTradeHandler.GetLogs)
mux.HandleFunc("GET /api/autotrade/watch-source", autoTradeHandler.GetWatchSource)
mux.HandleFunc("PUT /api/autotrade/watch-source", autoTradeHandler.SetWatchSource)
@@ -125,16 +119,12 @@ func main() {
// --- WebSocket 라우트 ---
mux.HandleFunc("GET /ws", wsHandler.ServeWS)
// --- 정적 파일 ---
mux.Handle("GET /static/", http.StripPrefix("/static/", http.FileServer(http.Dir("static"))))
// --- SvelteKit 빌드 정적 서빙 (SPA fallback 포함) ---
if _, err := os.Stat("frontend/build"); err == nil {
spa := http.FileServer(http.Dir("frontend/build"))
mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
path := "frontend/build" + r.URL.Path
if _, err := os.Stat(path); os.IsNotExist(err) {
// SPA fallback: 파일 없으면 index.html 서빙
http.ServeFile(w, r, "frontend/build/index.html")
return
}