package com.goldenchart.trading; /** * 로그인 사용자(userId) 전용 매매·모의·전략 접근 규칙. * 게스트(앱 입장만 한 비로그인)는 deviceId만으로 매매 기능을 사용할 수 없다. */ public final class TradingAccess { private TradingAccess() {} /** 모의 계좌 device_id 컬럼(NOT NULL UK)용 합성 키 — 실제 기기와 무관 */ public static String accountDeviceKey(long userId) { return "user:" + userId; } public static long requireUserId(Long userId) { if (userId == null || userId <= 0) { throw new TradingAccessDeniedException(); } return userId; } public static boolean isRegisteredUser(Long userId) { return userId != null && userId > 0; } }