#!/bin/bash
set -e
cd "$(cd "$(dirname "$0")/.." && pwd)"

echo "========================================"
echo "  医梦AI OKR 绩效考核系统 v1.0.0"
echo "========================================"

# 启动前确保 data 目录存在
mkdir -p data

# 启动服务
JAR="backend/target/okr-performance-1.0.0.jar"
if [ ! -f "$JAR" ]; then
    echo "未找到 JAR 包，请先运行 scripts/build.sh"
    exit 1
fi

echo "启动服务 (端口 18080)..."
echo "访问: http://localhost:18080"
echo "默认管理员: admin / emoon123456"
echo "按 Ctrl+C 停止"
echo ""

java -jar "$JAR"
