diff --git a/.trae/documents/frontend_layout_fix_plan.md b/.trae/documents/frontend_layout_fix_plan.md new file mode 100644 index 0000000..ea80420 --- /dev/null +++ b/.trae/documents/frontend_layout_fix_plan.md @@ -0,0 +1,90 @@ +# 前端布局修复与全量渲染审查 实施计划 + +## 调研结论(已用浏览器实测确认) + +### 问题 1:顶部菜单重复(已证实) +- 管理员端与玩家端页面 `document.querySelectorAll('header').length === 2`,两个 header 中的桌面导航均 `display:flex` 可见。 +- 根因:[app.js](file:///d:/GameParlor/src/main/resources/static/app.js) 的 `initLayout()` 先异步请求 `/api/user/me`,返回后才把 header 插入 DOM、并把 body 全部子节点移动进新建的 `
`。此时 Alpine.js 已启动,DOM 重排触发其 MutationObserver 对组件重新求值,`x-init="init()"` 二次执行 → `initLayout()` 二次注入 header;旧 header 在第二次包裹时被移入 `
`,最终两个 header 都渲染在页面上。 +- 连带影响:init 中的数据加载、轮询(dashboard 的 setInterval)也会执行两次。 + +### 问题 2:弹窗部分超出浏览器视口(已证实) +- 实测:管理员设备弹窗底部越界 48.46px、玩家选时长弹窗底部越界 93.05px;`.modal-mask` 的 `offsetParent` 是 `
` 而非视口,虽然计算样式 `position:fixed`。 +- 根因:`.page-fade` 的 `fadeIn` 动画 `animation-fill-mode: both` 结束后仍保留关键帧 `transform: translateY(0)`;非 none 的 transform 使 `
` 成为 fixed 后代的包含块。`.modal-mask{inset:0}` 因此相对 main(top=56.8px 起、高度超过视口)定位并居中,而不是相对视口。 + +### 问题 3:全量审查发现的其它渲染缺陷 +1. [player/dashboard.html](file:///d:/GameParlor/src/main/resources/static/player/dashboard.html):`x-text="active.gameName || ..."` 在 `active=null` 时仍求值(x-show 不阻止求值),控制台报 `Cannot read properties of null (reading 'gameName')`。 +2. [player/combos.html](file:///d:/GameParlor/src/main/resources/static/player/combos.html):`x-for="it in detail.items"` 初始 `detail=null` 直接报错;`detail.combo.*` 多处无空值保护。 +3. [player/custom-combo.html](file:///d:/GameParlor/src/main/resources/static/player/custom-combo.html#L80) 与 [player/points.html](file:///d:/GameParlor/src/main/resources/static/player/points.html#L37):玩家越权调用 `GET /api/admin/config`,拦截器返回 403 并弹出错误 toast(目前靠 catch 兜底值工作,但每次进页面弹错)。 +4. `[x-cloak]{display:none!important}` 靠 9 个页面各自内联 `` 的页面:删除内联样式(已全局化)。 + +## 实施步骤 + +1. **app.css** + - `fadeIn` 关键帧改为仅 `opacity`(0→1),彻底不产生 transform 包含块;保留 0.35s 淡入。 + - 新增全局 `[x-cloak]{display:none!important}`。 + - 新增 header 组件类:`.gp-header`(sticky、z-50、毛玻璃、底边线)、`.gp-nav` 链接样式与 active 态、`.gp-nav-desktop`(默认隐藏,≥768px 显示为 flex)、`.gp-nav-mobile`(横向滚动,≥768px 隐藏)、`.gp-userbar`。 + - `.gp-page`:`max-width:80rem;width:100%;margin-inline:auto;padding:1rem 1rem 2rem`。 + - `.modal-mask` 增加 `padding:1rem`;`.modal` 增加 `margin:auto`,保证小屏下弹窗四周留白且内部可滚动。 + +2. **app.js(关键重构)** + - IIFE 加载时(app.js 位于 body 末尾、Alpine defer 启动之前执行,此刻不存在 MutationObserver)若 body 无 `gp-auth` 标记,则**同步**: + - 创建 `
`(含 logo、空的桌面 nav 容器、空的移动 nav 容器、空的用户信息容器); + - 创建 `
`,把 body 现有子节点(除 header 外;script/style 标签保留原位不动)移入; + - header 插在 body 最前、main 紧随其后。 + - `initLayout(active)` 改为:幂等保护(`window.__gpLayoutFilled`)→ 请求 `/api/user/me`(401 仍跳登录)→ 仅用 innerHTML 填充两个 nav 容器和用户信息容器,**不再做任何 DOM 移动/包裹**。 + - nav 的显隐完全由 app.css 媒体查询控制,不依赖 Tailwind 运行时生成。 + +3. **index.html**:body class 增加 `gp-auth`,布局脚本对其跳过。 + +4. **页面空值/数据修复** + - player/dashboard.html:`active && active.gameName`、续费按钮在无 active 时禁用;轮询逻辑不变。 + - player/combos.html:`x-for="it in (detail && detail.items) || []"`;标题/价格文本全部加 `detail &&` 保护。 + - admin/users.html:tbody 增加 colspan=7 的"暂无数据"行。 + +5. **后端配置接口** + - 新增 `ConfigController`:`GET /api/config` 返回 `configService.getAll()`(仅 3 个业务键,无敏感信息);拦截器要求登录但不限制角色。 + - custom-combo.html、points.html 两处 `/api/admin/config` 改为 `/api/config`。 + +6. **清理**:删除 9 个页面末尾的 ``(browse、history、combos 玩家端、admin 端 combos/games/devices/snacks/users/timeslots/recharge)。 + +## 依赖与注意事项 + +- app.js 依赖"body 末尾经典脚本先于 defer 的 Alpine 执行"这一时序:经典脚本在解析阶段执行,defer 脚本在 DOMContentLoaded 前按序执行,时序天然成立,无需调整各页面 script 标签位置。 +- 同步包裹时 app.js 之后的内联 ` + + + +
+

套餐管理

+ +
+
+ +
+ + + + + + + + + + + diff --git a/src/main/resources/static/admin/dashboard.html b/src/main/resources/static/admin/dashboard.html new file mode 100644 index 0000000..cceb152 --- /dev/null +++ b/src/main/resources/static/admin/dashboard.html @@ -0,0 +1,47 @@ + + + + + + 概览 · GameParlor + + + + + +

管理概览

+
+
+
用户总数
+
+
+
+
订单总数
+
+
+
+
待审批充值
+
+
+
+
+

系统配置

+ +
+ + + + diff --git a/src/main/resources/static/admin/devices.html b/src/main/resources/static/admin/devices.html new file mode 100644 index 0000000..c13ac18 --- /dev/null +++ b/src/main/resources/static/admin/devices.html @@ -0,0 +1,97 @@ + + + + + + 设备管理 · GameParlor + + + + + +
+

设备管理

+ +
+ +
+ + + + + + + + +
ID名称描述备注创建时间操作
暂无数据
+
+ +
+ + + +
+ + + + + + + + diff --git a/src/main/resources/static/admin/games.html b/src/main/resources/static/admin/games.html new file mode 100644 index 0000000..29041de --- /dev/null +++ b/src/main/resources/static/admin/games.html @@ -0,0 +1,113 @@ + + + + + + 游戏管理 · GameParlor + + + + + +
+

游戏管理

+ +
+ +
+ + + + + + + + +
ID名称通用设备会员单价备注操作
暂无数据
+
+ +
+ + + +
+ + + + + + + diff --git a/src/main/resources/static/admin/recharge.html b/src/main/resources/static/admin/recharge.html new file mode 100644 index 0000000..6fe7d13 --- /dev/null +++ b/src/main/resources/static/admin/recharge.html @@ -0,0 +1,63 @@ + + + + + + 充值审批 · GameParlor + + + + + +

充值审批

+
+ + + + + + +
ID用户ID金额授权码状态时间操作
暂无待审批
+
+ + + + + diff --git a/src/main/resources/static/admin/snacks.html b/src/main/resources/static/admin/snacks.html new file mode 100644 index 0000000..4868eba --- /dev/null +++ b/src/main/resources/static/admin/snacks.html @@ -0,0 +1,89 @@ + + + + + + 零食管理 · GameParlor + + + + + +
+

零食/饮料管理

+ +
+
+ + + + + + +
ID名称类型价格会员单价备注操作
暂无数据
+
+
+ + + +
+ + + + + diff --git a/src/main/resources/static/admin/timeslots.html b/src/main/resources/static/admin/timeslots.html new file mode 100644 index 0000000..08f425c --- /dev/null +++ b/src/main/resources/static/admin/timeslots.html @@ -0,0 +1,81 @@ + + + + + + 时长管理 · GameParlor + + + + + +
+

时长管理

+ +
+
+ + + + + + +
ID时长(分钟)基础单价会员单价操作
暂无数据
+
+
+ + + +
+ + + + + diff --git a/src/main/resources/static/admin/users.html b/src/main/resources/static/admin/users.html new file mode 100644 index 0000000..c615cc1 --- /dev/null +++ b/src/main/resources/static/admin/users.html @@ -0,0 +1,83 @@ + + + + + + 用户管理 · GameParlor + + + + + +

用户管理

+
+ + + + + + +
ID用户名角色余额积分会员到期操作
暂无数据
+
+
+ + + +
+ + + + + diff --git a/src/main/resources/static/app.css b/src/main/resources/static/app.css new file mode 100644 index 0000000..5325d64 --- /dev/null +++ b/src/main/resources/static/app.css @@ -0,0 +1,216 @@ +/* GameParlor 全局样式 — 深色主题 + 霓虹蓝 */ +/* 注:Tailwind 工具类由 tailwind.min.js (Play CDN) 运行时注入;本文件仅定义组件类与基础样式 */ + +:root { + --bg: #0f0f11; + --bg-soft: #16161a; + --bg-card: #1c1c22; + --border: #2a2a33; + --accent: #00d4ff; + --accent-dim: rgba(0, 212, 255, 0.15); + --text: #e8e8ed; + --text-dim: #9a9aa5; + --text-faint: #6b6b78; + --success: #34d399; + --danger: #f87171; + --warning: #fbbf24; +} + +* { box-sizing: border-box; } + +html, body { + margin: 0; + padding: 0; + background: var(--bg); + color: var(--text); + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; + min-height: 100vh; +} + +a { color: var(--accent); text-decoration: none; } + +/* 滚动条 */ +::-webkit-scrollbar { width: 8px; height: 8px; } +::-webkit-scrollbar-track { background: transparent; } +::-webkit-scrollbar-thumb { background: #2a2a33; border-radius: 4px; } +::-webkit-scrollbar-thumb:hover { background: #3a3a45; } + + .card { + background: var(--bg-card); + border: 1px solid var(--border); + border-radius: 14px; + transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; + } + .card-hover:hover { + transform: translateY(-3px); + box-shadow: 0 10px 30px rgba(0, 0, 0, .4), 0 0 0 1px rgba(0, 212, 255, .15); + border-color: rgba(0, 212, 255, .3); + } + + .btn { + display: inline-flex; align-items: center; justify-content: center; gap: .4rem; + padding: .55rem 1.1rem; + border-radius: 10px; + font-size: .875rem; font-weight: 500; + border: 1px solid transparent; + cursor: pointer; + transition: transform .1s ease, background .2s ease, border-color .2s ease, opacity .2s ease; + user-select: none; + } + .btn:active { transform: scale(0.95); } + .btn:disabled { opacity: .5; cursor: not-allowed; } + .btn-primary { background: var(--accent); color: #06242b; } + .btn-primary:hover:not(:disabled) { background: #33ddff; } + .btn-ghost { background: transparent; color: var(--text); border-color: var(--border); } + .btn-ghost:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); } + .btn-danger { background: rgba(248, 113, 113, .12); color: var(--danger); border-color: rgba(248, 113, 113, .3); } + .btn-danger:hover:not(:disabled) { background: rgba(248, 113, 113, .22); } + + .input, .select, .textarea { + width: 100%; + background: var(--bg-soft); + border: 1px solid var(--border); + border-radius: 10px; + padding: .55rem .8rem; + color: var(--text); + font-size: .875rem; + transition: border-color .2s ease, box-shadow .2s ease; + } + .input:focus, .select:focus, .textarea:focus { + outline: none; + border-color: var(--accent); + box-shadow: 0 0 0 3px var(--accent-dim); + } + + .label { font-size: .8rem; color: var(--text-dim); margin-bottom: .35rem; display: block; } + + .badge { + display: inline-flex; align-items: center; + padding: .15rem .55rem; + border-radius: 999px; + font-size: .72rem; font-weight: 600; + } + .badge-accent { background: var(--accent-dim); color: var(--accent); } + .badge-success { background: rgba(52, 211, 153, .12); color: var(--success); } + .badge-danger { background: rgba(248, 113, 113, .12); color: var(--danger); } + .badge-warning { background: rgba(251, 191, 36, .12); color: var(--warning); } + + .remark { font-size: .75rem; color: var(--text-faint); } + + .mono { font-family: "JetBrains Mono", "Fira Code", "Cascadia Code", Consolas, monospace; } + +/* 页面淡入(仅用 opacity:transform 会成为 position:fixed 后代的包含块,导致弹窗越界) */ +@keyframes fadeIn { + from { opacity: 0; } + to { opacity: 1; } +} +.page-fade { animation: fadeIn .35s ease both; } + +/* Alpine 初始化前隐藏 x-cloak 元素(避免弹窗闪现) */ +[x-cloak] { display: none !important; } + +/* 顶部导航布局(纯 CSS,不依赖 Tailwind 运行时) */ +.gp-header { + position: sticky; top: 0; z-index: 50; + background: rgba(15, 15, 17, .85); + backdrop-filter: blur(16px); + -webkit-backdrop-filter: blur(16px); + border-bottom: 1px solid var(--border); +} +.gp-header-inner { + max-width: 80rem; margin: 0 auto; padding: 0 1rem; + min-height: 3.5rem; + display: flex; align-items: center; gap: 1.5rem; +} +.gp-brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: 1rem; flex: none; } +.gp-logo { + width: 1.75rem; height: 1.75rem; border-radius: .5rem; + background: var(--accent); color: #06242b; + display: flex; align-items: center; justify-content: center; font-size: .875rem; +} +.gp-nav { display: flex; align-items: center; gap: .15rem; margin: 0; padding: 0; list-style: none; } +.gp-nav a { + display: inline-block; padding: .375rem .75rem; border-radius: .5rem; + font-size: .875rem; color: var(--text-dim); + white-space: nowrap; cursor: pointer; + transition: color .2s ease, background .2s ease; +} +.gp-nav a:hover { color: #fff; background: rgba(255, 255, 255, .04); } +.gp-nav a.is-active { background: var(--accent-dim); color: var(--accent); } +.gp-nav-desktop { display: none; } +.gp-nav-mobile { + gap: .25rem; padding: .35rem .75rem .5rem; + max-width: 80rem; margin: 0 auto; + overflow-x: auto; flex-wrap: nowrap; +} +.gp-nav-mobile a { font-size: .75rem; padding: .3rem .6rem; flex: none; } +@media (min-width: 768px) { + .gp-nav-desktop { display: flex; } + .gp-nav-mobile { display: none; } +} +.gp-userbar { margin-left: auto; display: flex; align-items: center; gap: .75rem; font-size: .875rem; flex: none; } +.gp-user-meta { display: none; align-items: center; gap: .75rem; color: var(--text-dim); } +.gp-username { color: var(--accent); } +.gp-logout { padding: .25rem .6rem; font-size: .75rem; } +@media (min-width: 640px) { + .gp-user-meta { display: flex; } +} + +/* 页面内容容器 */ +.gp-page { + max-width: 80rem; + width: 100%; + margin: 0 auto; + padding: 1.5rem 1rem 2rem; +} + +/* Toast */ +@keyframes toastIn { + from { opacity: 0; transform: translateY(-10px) scale(.98); } + to { opacity: 1; transform: translateY(0) scale(1); } +} +.toast { + position: fixed; top: 1.2rem; left: 50%; transform: translateX(-50%); + z-index: 9999; + padding: .7rem 1.2rem; + border-radius: 10px; + font-size: .875rem; + box-shadow: 0 8px 30px rgba(0,0,0,.5); + animation: toastIn .25s ease both; +} +.toast-success { background: rgba(52, 211, 153, .15); color: var(--success); border: 1px solid rgba(52, 211, 153, .35); } +.toast-error { background: rgba(248, 113, 113, .15); color: var(--danger); border: 1px solid rgba(248, 113, 113, .35); } + +/* 倒计时颜色渐变 */ +.countdown { font-variant-numeric: tabular-nums; letter-spacing: .02em; } + +/* 表格 */ +.table { width: 100%; border-collapse: collapse; } +.table th, .table td { padding: .7rem .8rem; text-align: left; border-bottom: 1px solid var(--border); font-size: .85rem; } +.table th { color: var(--text-dim); font-weight: 500; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; } +.table tr:hover td { background: rgba(255,255,255,.02); } + +/* 模态遮罩(fixed 相对视口:祖先不得残留非 none 的 transform) */ +.modal-mask { + position: fixed; inset: 0; background: rgba(0,0,0,.6); + backdrop-filter: blur(4px); + z-index: 1000; + display: flex; align-items: center; justify-content: center; + padding: 1rem; + overflow-y: auto; + animation: fadeIn .2s ease both; +} +.modal { + background: var(--bg-card); + border: 1px solid var(--border); + border-radius: 16px; + padding: 1.4rem; + width: 100%; max-width: 480px; + max-height: calc(100vh - 2rem); overflow-y: auto; + margin: auto; +} + +/* 移动端适配 */ +@media (max-width: 640px) { + .btn { padding: .5rem .85rem; font-size: .8rem; } +} diff --git a/src/main/resources/static/app.js b/src/main/resources/static/app.js new file mode 100644 index 0000000..325c779 --- /dev/null +++ b/src/main/resources/static/app.js @@ -0,0 +1,171 @@ +// GameParlor 前端公共脚本 +(function () { + const API_BASE = ''; + + // ---------- 存储 ---------- + const TOKEN_KEY = 'gp_token'; + const USER_KEY = 'gp_user'; + + window.GP = { + getToken() { return localStorage.getItem(TOKEN_KEY); }, + setToken(t) { localStorage.setItem(TOKEN_KEY, t); }, + clearAuth() { localStorage.removeItem(TOKEN_KEY); localStorage.removeItem(USER_KEY); }, + getUser() { + try { return JSON.parse(localStorage.getItem(USER_KEY) || 'null'); } + catch { return null; } + }, + setUser(u) { localStorage.setItem(USER_KEY, JSON.stringify(u)); }, + isAdmin() { const u = this.getUser(); return u && u.role === 'ADMIN'; }, + isMember() { const u = this.getUser(); return u && (u.role === 'MEMBER' || u.role === 'ADMIN'); }, + redirectLogin() { window.location.href = '/index.html'; }, + }; + + // ---------- API ---------- + async function api(path, options = {}) { + const headers = Object.assign({ 'Content-Type': 'application/json' }, options.headers || {}); + const token = GP.getToken(); + if (token) headers['Authorization'] = 'Bearer ' + token; + + const res = await fetch(API_BASE + path, Object.assign({ headers }, options)); + let body; + try { body = await res.json(); } catch { body = { code: 500, message: '网络错误' }; } + + if (body.code === 401) { + GP.clearAuth(); + GP.redirectLogin(); + throw new Error(body.message || '未登录'); + } + if (body.code !== 200) { + toast(body.message || '操作失败', 'error'); + throw new Error(body.message); + } + return body.data; + } + window.api = api; + + // ---------- Toast ---------- + let toastTimer = null; + function toast(message, type = 'success') { + const existing = document.querySelector('.toast'); + if (existing) existing.remove(); + const el = document.createElement('div'); + el.className = 'toast toast-' + type; + el.textContent = message; + document.body.appendChild(el); + clearTimeout(toastTimer); + toastTimer = setTimeout(() => el.remove(), 2200); + } + window.toast = toast; + + // ---------- 登出 ---------- + window.logout = async function () { + try { await api('/api/auth/logout', { method: 'POST' }); } catch {} + GP.clearAuth(); + GP.redirectLogin(); + }; + + // ---------- 工具 ---------- + window.fmtMoney = function (n) { + if (n == null) return '0.00'; + return Number(n).toFixed(2); + }; + window.fmtDateTime = function (s) { + if (!s) return '-'; + return s.replace('T', ' ').slice(0, 16); + }; + window.fmtDate = function (s) { + if (!s) return '-'; + return String(s).slice(0, 10); + }; + window.fmtDuration = function (seconds) { + if (seconds == null) return '00:00'; + const m = Math.floor(seconds / 60); + const s = seconds % 60; + return String(m).padStart(2, '0') + ':' + String(s).padStart(2, '0'); + }; + + // ---------- 布局骨架 ---------- + // 本脚本在 body 末尾以经典脚本方式加载,执行时 Alpine(defer) 尚未启动。 + // 在此同步完成 header/main 的 DOM 搭建,可避免 Alpine 启动后再移动节点 + // 触发 MutationObserver 而导致 x-init / initLayout 二次执行(顶部菜单重复的根因)。 + if (!document.body.classList.contains('gp-auth')) { + const header = document.createElement('header'); + header.className = 'gp-header'; + header.innerHTML = + '
' + + '
GameParlor
' + + '' + + '
' + + '
' + + ''; + + const main = document.createElement('main'); + main.className = 'gp-page page-fade'; + Array.from(document.body.children).forEach(c => main.appendChild(c)); + document.body.appendChild(header); + document.body.appendChild(main); + } + + // ---------- 顶部导航数据填充(Alpine 启动后调用,仅填充,不再移动 DOM) ---------- + window.initLayout = async function (active) { + if (window.__gpLayoutMe) return window.__gpLayoutMe; // 幂等,防止重复注入 + const me = await api('/api/user/me').catch(() => null); + if (!me) { GP.clearAuth(); GP.redirectLogin(); throw new Error('未登录'); } + GP.setUser(me); + window.__gpLayoutMe = me; + + const isAdmin = me.role === 'ADMIN'; + const isMember = me.role === 'MEMBER' || isAdmin; + + const navItems = isAdmin ? [ + { key: 'dashboard', label: '概览', href: '/admin/dashboard.html' }, + { key: 'devices', label: '设备', href: '/admin/devices.html' }, + { key: 'games', label: '游戏', href: '/admin/games.html' }, + { key: 'timeslots', label: '时长', href: '/admin/timeslots.html' }, + { key: 'snacks', label: '零食', href: '/admin/snacks.html' }, + { key: 'combos', label: '套餐', href: '/admin/combos.html' }, + { key: 'users', label: '用户', href: '/admin/users.html' }, + { key: 'recharge', label: '充值审批', href: '/admin/recharge.html' }, + ] : [ + { key: 'dashboard', label: '首页', href: '/player/dashboard.html' }, + { key: 'browse', label: '玩游戏', href: '/player/browse.html' }, + { key: 'combos', label: '套餐', href: '/player/combos.html' }, + ...(isMember ? [{ key: 'custom', label: '拼套餐', href: '/player/custom-combo.html' }] : []), + { key: 'snacks', label: '零食', href: '/player/snacks.html' }, + { key: 'recharge', label: '充值', href: '/player/recharge.html' }, + ...(isMember ? [{ key: 'points', label: '积分兑换', href: '/player/points.html' }] : []), + { key: 'history', label: '记录', href: '/player/history.html' }, + ]; + + const navHtml = navItems.map(n => + `${n.label}`).join(''); + document.querySelectorAll('[data-gp-nav]').forEach(el => { el.innerHTML = navHtml; }); + + const userbar = document.querySelector('[data-gp-userbar]'); + if (userbar) { + userbar.innerHTML = + '' + + '余额 ¥' + fmtMoney(me.balance) + '' + + (isMember ? '会员' : '') + + '★ ' + (me.points || 0) + '' + + '' + + '' + + ''; + userbar.querySelector('.gp-username').textContent = me.username; + } + return me; + }; + + + // ---------- 内联 SVG 图标 ---------- + const iconHome = ''; + const iconDevice = ''; + const iconGame = ''; + const iconClock = ''; + const iconSnack = ''; + const iconCombo = ''; + const iconUser = ''; + const iconWallet = ''; + const iconStar = ''; + const iconList = ''; +})(); diff --git a/src/main/resources/static/index.html b/src/main/resources/static/index.html new file mode 100644 index 0000000..8a9f73b --- /dev/null +++ b/src/main/resources/static/index.html @@ -0,0 +1,79 @@ + + + + + + GameParlor · 登录 + + + + + +
+
+
+
G
+
+

GameParlor

+

电玩店自助管理与消费系统

+
+
+ +
+ + +
+ +
+
+ + +
+
+ + +
+ +
+ +

默认管理员:admin / admin123

+
+
+ + + + + diff --git a/src/main/resources/static/js/vendor/alpine.min.js b/src/main/resources/static/js/vendor/alpine.min.js new file mode 100644 index 0000000..2ca4827 --- /dev/null +++ b/src/main/resources/static/js/vendor/alpine.min.js @@ -0,0 +1,5 @@ +(()=>{var rt=!1,nt=!1,U=[],it=-1;function qt(e){Cn(e)}function Cn(e){U.includes(e)||U.push(e),Tn()}function Ee(e){let t=U.indexOf(e);t!==-1&&t>it&&U.splice(t,1)}function Tn(){!nt&&!rt&&(rt=!0,queueMicrotask(Rn))}function Rn(){rt=!1,nt=!0;for(let e=0;ee.effect(t,{scheduler:r=>{ot?qt(r):r()}}),st=e.raw}function at(e){D=e}function Gt(e){let t=()=>{};return[n=>{let i=D(n);return e._x_effects||(e._x_effects=new Set,e._x_runEffects=()=>{e._x_effects.forEach(o=>o())}),e._x_effects.add(i),t=()=>{i!==void 0&&(e._x_effects.delete(i),L(i))},i},()=>{t()}]}function ve(e,t){let r=!0,n,i=D(()=>{let o=e();JSON.stringify(o),r?n=o:queueMicrotask(()=>{t(o,n),n=o}),r=!1});return()=>L(i)}var Jt=[],Yt=[],Xt=[];function Zt(e){Xt.push(e)}function ee(e,t){typeof t=="function"?(e._x_cleanups||(e._x_cleanups=[]),e._x_cleanups.push(t)):(t=e,Yt.push(t))}function Ae(e){Jt.push(e)}function Oe(e,t,r){e._x_attributeCleanups||(e._x_attributeCleanups={}),e._x_attributeCleanups[t]||(e._x_attributeCleanups[t]=[]),e._x_attributeCleanups[t].push(r)}function ct(e,t){e._x_attributeCleanups&&Object.entries(e._x_attributeCleanups).forEach(([r,n])=>{(t===void 0||t.includes(r))&&(n.forEach(i=>i()),delete e._x_attributeCleanups[r])})}function Qt(e){if(e._x_cleanups)for(;e._x_cleanups.length;)e._x_cleanups.pop()()}var lt=new MutationObserver(pt),ut=!1;function le(){lt.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0}),ut=!0}function ft(){Mn(),lt.disconnect(),ut=!1}var ce=[];function Mn(){let e=lt.takeRecords();ce.push(()=>e.length>0&&pt(e));let t=ce.length;queueMicrotask(()=>{if(ce.length===t)for(;ce.length>0;)ce.shift()()})}function _(e){if(!ut)return e();ft();let t=e();return le(),t}var dt=!1,Se=[];function er(){dt=!0}function tr(){dt=!1,pt(Se),Se=[]}function pt(e){if(dt){Se=Se.concat(e);return}let t=new Set,r=new Set,n=new Map,i=new Map;for(let o=0;os.nodeType===1&&t.add(s)),e[o].removedNodes.forEach(s=>s.nodeType===1&&r.add(s))),e[o].type==="attributes")){let s=e[o].target,a=e[o].attributeName,c=e[o].oldValue,l=()=>{n.has(s)||n.set(s,[]),n.get(s).push({name:a,value:s.getAttribute(a)})},u=()=>{i.has(s)||i.set(s,[]),i.get(s).push(a)};s.hasAttribute(a)&&c===null?l():s.hasAttribute(a)?(u(),l()):u()}i.forEach((o,s)=>{ct(s,o)}),n.forEach((o,s)=>{Jt.forEach(a=>a(s,o))});for(let o of r)t.has(o)||Yt.forEach(s=>s(o));t.forEach(o=>{o._x_ignoreSelf=!0,o._x_ignore=!0});for(let o of t)r.has(o)||o.isConnected&&(delete o._x_ignoreSelf,delete o._x_ignore,Xt.forEach(s=>s(o)),o._x_ignore=!0,o._x_ignoreSelf=!0);t.forEach(o=>{delete o._x_ignoreSelf,delete o._x_ignore}),t=null,r=null,n=null,i=null}function Ce(e){return F(j(e))}function P(e,t,r){return e._x_dataStack=[t,...j(r||e)],()=>{e._x_dataStack=e._x_dataStack.filter(n=>n!==t)}}function j(e){return e._x_dataStack?e._x_dataStack:typeof ShadowRoot=="function"&&e instanceof ShadowRoot?j(e.host):e.parentNode?j(e.parentNode):[]}function F(e){return new Proxy({objects:e},Nn)}var Nn={ownKeys({objects:e}){return Array.from(new Set(e.flatMap(t=>Object.keys(t))))},has({objects:e},t){return t==Symbol.unscopables?!1:e.some(r=>Object.prototype.hasOwnProperty.call(r,t)||Reflect.has(r,t))},get({objects:e},t,r){return t=="toJSON"?Dn:Reflect.get(e.find(n=>Reflect.has(n,t))||{},t,r)},set({objects:e},t,r,n){let i=e.find(s=>Object.prototype.hasOwnProperty.call(s,t))||e[e.length-1],o=Object.getOwnPropertyDescriptor(i,t);return o?.set&&o?.get?o.set.call(n,r)||!0:Reflect.set(i,t,r)}};function Dn(){return Reflect.ownKeys(this).reduce((t,r)=>(t[r]=Reflect.get(this,r),t),{})}function Te(e){let t=n=>typeof n=="object"&&!Array.isArray(n)&&n!==null,r=(n,i="")=>{Object.entries(Object.getOwnPropertyDescriptors(n)).forEach(([o,{value:s,enumerable:a}])=>{if(a===!1||s===void 0||typeof s=="object"&&s!==null&&s.__v_skip)return;let c=i===""?o:`${i}.${o}`;typeof s=="object"&&s!==null&&s._x_interceptor?n[o]=s.initialize(e,c,o):t(s)&&s!==n&&!(s instanceof Element)&&r(s,c)})};return r(e)}function Re(e,t=()=>{}){let r={initialValue:void 0,_x_interceptor:!0,initialize(n,i,o){return e(this.initialValue,()=>Pn(n,i),s=>mt(n,i,s),i,o)}};return t(r),n=>{if(typeof n=="object"&&n!==null&&n._x_interceptor){let i=r.initialize.bind(r);r.initialize=(o,s,a)=>{let c=n.initialize(o,s,a);return r.initialValue=c,i(o,s,a)}}else r.initialValue=n;return r}}function Pn(e,t){return t.split(".").reduce((r,n)=>r[n],e)}function mt(e,t,r){if(typeof t=="string"&&(t=t.split(".")),t.length===1)e[t[0]]=r;else{if(t.length===0)throw error;return e[t[0]]||(e[t[0]]={}),mt(e[t[0]],t.slice(1),r)}}var rr={};function y(e,t){rr[e]=t}function ue(e,t){return Object.entries(rr).forEach(([r,n])=>{let i=null;function o(){if(i)return i;{let[s,a]=_t(t);return i={interceptor:Re,...s},ee(t,a),i}}Object.defineProperty(e,`$${r}`,{get(){return n(t,o())},enumerable:!1})}),e}function nr(e,t,r,...n){try{return r(...n)}catch(i){te(i,e,t)}}function te(e,t,r=void 0){e=Object.assign(e??{message:"No error message given."},{el:t,expression:r}),console.warn(`Alpine Expression Error: ${e.message} + +${r?'Expression: "'+r+`" + +`:""}`,t),setTimeout(()=>{throw e},0)}var Me=!0;function De(e){let t=Me;Me=!1;let r=e();return Me=t,r}function M(e,t,r={}){let n;return x(e,t)(i=>n=i,r),n}function x(...e){return ir(...e)}var ir=gt;function or(e){ir=e}function gt(e,t){let r={};ue(r,e);let n=[r,...j(e)],i=typeof t=="function"?In(n,t):Ln(n,t,e);return nr.bind(null,e,t,i)}function In(e,t){return(r=()=>{},{scope:n={},params:i=[]}={})=>{let o=t.apply(F([n,...e]),i);Ne(r,o)}}var ht={};function kn(e,t){if(ht[e])return ht[e];let r=Object.getPrototypeOf(async function(){}).constructor,n=/^[\n\s]*if.*\(.*\)/.test(e.trim())||/^(let|const)\s/.test(e.trim())?`(async()=>{ ${e} })()`:e,o=(()=>{try{let s=new r(["__self","scope"],`with (scope) { __self.result = ${n} }; __self.finished = true; return __self.result;`);return Object.defineProperty(s,"name",{value:`[Alpine] ${e}`}),s}catch(s){return te(s,t,e),Promise.resolve()}})();return ht[e]=o,o}function Ln(e,t,r){let n=kn(t,r);return(i=()=>{},{scope:o={},params:s=[]}={})=>{n.result=void 0,n.finished=!1;let a=F([o,...e]);if(typeof n=="function"){let c=n(n,a).catch(l=>te(l,r,t));n.finished?(Ne(i,n.result,a,s,r),n.result=void 0):c.then(l=>{Ne(i,l,a,s,r)}).catch(l=>te(l,r,t)).finally(()=>n.result=void 0)}}}function Ne(e,t,r,n,i){if(Me&&typeof t=="function"){let o=t.apply(r,n);o instanceof Promise?o.then(s=>Ne(e,s,r,n)).catch(s=>te(s,i,t)):e(o)}else typeof t=="object"&&t instanceof Promise?t.then(o=>e(o)):e(t)}var bt="x-";function C(e=""){return bt+e}function sr(e){bt=e}var Pe={};function d(e,t){return Pe[e]=t,{before(r){if(!Pe[r]){console.warn(String.raw`Cannot find directive \`${r}\`. \`${e}\` will use the default order of execution`);return}let n=W.indexOf(r);W.splice(n>=0?n:W.indexOf("DEFAULT"),0,e)}}}function ar(e){return Object.keys(Pe).includes(e)}function de(e,t,r){if(t=Array.from(t),e._x_virtualDirectives){let o=Object.entries(e._x_virtualDirectives).map(([a,c])=>({name:a,value:c})),s=wt(o);o=o.map(a=>s.find(c=>c.name===a.name)?{name:`x-bind:${a.name}`,value:`"${a.value}"`}:a),t=t.concat(o)}let n={};return t.map(ur((o,s)=>n[o]=s)).filter(dr).map(jn(n,r)).sort(Fn).map(o=>$n(e,o))}function wt(e){return Array.from(e).map(ur()).filter(t=>!dr(t))}var xt=!1,fe=new Map,cr=Symbol();function lr(e){xt=!0;let t=Symbol();cr=t,fe.set(t,[]);let r=()=>{for(;fe.get(t).length;)fe.get(t).shift()();fe.delete(t)},n=()=>{xt=!1,r()};e(r),n()}function _t(e){let t=[],r=a=>t.push(a),[n,i]=Gt(e);return t.push(i),[{Alpine:B,effect:n,cleanup:r,evaluateLater:x.bind(x,e),evaluate:M.bind(M,e)},()=>t.forEach(a=>a())]}function $n(e,t){let r=()=>{},n=Pe[t.type]||r,[i,o]=_t(e);Oe(e,t.original,o);let s=()=>{e._x_ignore||e._x_ignoreSelf||(n.inline&&n.inline(e,t,i),n=n.bind(n,e,t,i),xt?fe.get(cr).push(n):n())};return s.runCleanups=o,s}var Ie=(e,t)=>({name:r,value:n})=>(r.startsWith(e)&&(r=r.replace(e,t)),{name:r,value:n}),ke=e=>e;function ur(e=()=>{}){return({name:t,value:r})=>{let{name:n,value:i}=fr.reduce((o,s)=>s(o),{name:t,value:r});return n!==t&&e(n,t),{name:n,value:i}}}var fr=[];function re(e){fr.push(e)}function dr({name:e}){return pr().test(e)}var pr=()=>new RegExp(`^${bt}([^:^.]+)\\b`);function jn(e,t){return({name:r,value:n})=>{let i=r.match(pr()),o=r.match(/:([a-zA-Z0-9\-_:]+)/),s=r.match(/\.[^.\]]+(?=[^\]]*$)/g)||[],a=t||e[r]||r;return{type:i?i[1]:null,value:o?o[1]:null,modifiers:s.map(c=>c.replace(".","")),expression:n,original:a}}}var yt="DEFAULT",W=["ignore","ref","data","id","anchor","bind","init","for","model","modelable","transition","show","if",yt,"teleport"];function Fn(e,t){let r=W.indexOf(e.type)===-1?yt:e.type,n=W.indexOf(t.type)===-1?yt:t.type;return W.indexOf(r)-W.indexOf(n)}function G(e,t,r={}){e.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0,composed:!0,cancelable:!0}))}function T(e,t){if(typeof ShadowRoot=="function"&&e instanceof ShadowRoot){Array.from(e.children).forEach(i=>T(i,t));return}let r=!1;if(t(e,()=>r=!0),r)return;let n=e.firstElementChild;for(;n;)T(n,t,!1),n=n.nextElementSibling}function E(e,...t){console.warn(`Alpine Warning: ${e}`,...t)}var mr=!1;function _r(){mr&&E("Alpine has already been initialized on this page. Calling Alpine.start() more than once can cause problems."),mr=!0,document.body||E("Unable to initialize. Trying to load Alpine before `` is available. Did you forget to add `defer` in Alpine's ` + + + +

玩游戏

+ +
+ + + +
+ + +
+ +
+ +
+ +
暂无游戏
+
+ + + + + + + + diff --git a/src/main/resources/static/player/combos.html b/src/main/resources/static/player/combos.html new file mode 100644 index 0000000..51bd36d --- /dev/null +++ b/src/main/resources/static/player/combos.html @@ -0,0 +1,63 @@ + + + + + + 套餐 · GameParlor + + + + + +

套餐

+
+ +
+ + + + + + + diff --git a/src/main/resources/static/player/custom-combo.html b/src/main/resources/static/player/custom-combo.html new file mode 100644 index 0000000..42b263e --- /dev/null +++ b/src/main/resources/static/player/custom-combo.html @@ -0,0 +1,105 @@ + + + + + + 自定义拼套餐 · GameParlor + + + + + +

自定义拼套餐

+

仅会员可用。自由勾选项目,享会员专属折扣。

+ +
+
+ +
+

游戏

+
+ +
+
+ +
+

时长

+
+ +
+
+ +
+

零食饮料

+
+ +
+
+
+ + +
+
+

结算

+
已选 项
+
会员折扣率:
+
+ +
+
+
+ + + + + diff --git a/src/main/resources/static/player/dashboard.html b/src/main/resources/static/player/dashboard.html new file mode 100644 index 0000000..56ce39d --- /dev/null +++ b/src/main/resources/static/player/dashboard.html @@ -0,0 +1,101 @@ + + + + + + 首页 · GameParlor + + + + + +

欢迎回来

+ + +
+
+
+
正在游玩
+
+
+
+
剩余时间
+
+
+
+
+ + +
+
+ + +
+
+
钱包余额
+
+
+
+
积分(累计消费)
+
+
+
+
会员到期
+
+
+
+
角色
+
+
+
+ + +
+

最近订单

+
+ +
暂无订单
+
+
+ + + + + diff --git a/src/main/resources/static/player/history.html b/src/main/resources/static/player/history.html new file mode 100644 index 0000000..99fc46c --- /dev/null +++ b/src/main/resources/static/player/history.html @@ -0,0 +1,92 @@ + + + + + + 历史记录 · GameParlor + + + + + +

历史记录

+
+ + + +
+ +
+ + + + + + +
订单号金额状态时间
暂无订单
+
+ +
+ + + + + + +
类型金额备注时间
暂无记录
+
+ +
+ + + + + + +
金额授权码状态时间
暂无记录
+
+ + + + + diff --git a/src/main/resources/static/player/points.html b/src/main/resources/static/player/points.html new file mode 100644 index 0000000..74fc15f --- /dev/null +++ b/src/main/resources/static/player/points.html @@ -0,0 +1,63 @@ + + + + + + 积分兑换 · GameParlor + + + + + +
+

积分兑换

+
我的积分:
+
+

兑换比例: 积分 = 1 元(按商品原价换算)

+ +
+ +
+ + + + + diff --git a/src/main/resources/static/player/recharge.html b/src/main/resources/static/player/recharge.html new file mode 100644 index 0000000..0f58767 --- /dev/null +++ b/src/main/resources/static/player/recharge.html @@ -0,0 +1,65 @@ + + + + + + 自助充值 · GameParlor + + + + + +

自助充值

+
+
+

提交充值申请

+
+
+ + +
+ +
+
+
请向管理员出示授权码
+
+
管理员审批通过后余额自动到账
+
+
+
+

我的充值记录

+
+ +
暂无记录
+
+
+
+ + + + diff --git a/src/main/resources/static/player/snacks.html b/src/main/resources/static/player/snacks.html new file mode 100644 index 0000000..0986362 --- /dev/null +++ b/src/main/resources/static/player/snacks.html @@ -0,0 +1,70 @@ + + + + + + 零食饮料 · GameParlor + + + + + +
+

零食饮料

+ +
+
+ +
+ + + + + diff --git a/target/classes/application.properties b/target/classes/application.properties new file mode 100644 index 0000000..5ab73e1 --- /dev/null +++ b/target/classes/application.properties @@ -0,0 +1,22 @@ +# 服务端口 +server.port=8080 + +# MySQL 数据源(按需求使用 MySQL 5.x) +spring.datasource.url=jdbc:mysql://192.168.8.3:3306/gameparlor?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true +spring.datasource.username=root +spring.datasource.password=xiaoyu +spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver + +# JPA +spring.jpa.hibernate.ddl-auto=update +spring.jpa.show-sql=false +spring.jpa.properties.hibernate.format_sql=false +spring.jpa.open-in-view=true +# 全局引号标识符,兼容 MySQL 保留字(user、value 等) +spring.jpa.properties.hibernate.globally_quoted_identifiers=true + +# 不自动执行 schema.sql / data.sql(由用户手动在 MySQL 中执行;H2 验证时同样跳过) +spring.sql.init.mode=never + +# 静态资源 +spring.web.resources.static-locations=classpath:/static/ diff --git a/target/classes/com/gameparlor/GameParlorApplication.class b/target/classes/com/gameparlor/GameParlorApplication.class new file mode 100644 index 0000000..167067e Binary files /dev/null and b/target/classes/com/gameparlor/GameParlorApplication.class differ diff --git a/target/classes/com/gameparlor/common/AuthInterceptor.class b/target/classes/com/gameparlor/common/AuthInterceptor.class new file mode 100644 index 0000000..7895300 Binary files /dev/null and b/target/classes/com/gameparlor/common/AuthInterceptor.class differ diff --git a/target/classes/com/gameparlor/common/BusinessException.class b/target/classes/com/gameparlor/common/BusinessException.class new file mode 100644 index 0000000..f821856 Binary files /dev/null and b/target/classes/com/gameparlor/common/BusinessException.class differ diff --git a/target/classes/com/gameparlor/common/GlobalExceptionHandler.class b/target/classes/com/gameparlor/common/GlobalExceptionHandler.class new file mode 100644 index 0000000..622f5b2 Binary files /dev/null and b/target/classes/com/gameparlor/common/GlobalExceptionHandler.class differ diff --git a/target/classes/com/gameparlor/common/Result.class b/target/classes/com/gameparlor/common/Result.class new file mode 100644 index 0000000..a026404 Binary files /dev/null and b/target/classes/com/gameparlor/common/Result.class differ diff --git a/target/classes/com/gameparlor/common/ResultCode.class b/target/classes/com/gameparlor/common/ResultCode.class new file mode 100644 index 0000000..dc233c8 Binary files /dev/null and b/target/classes/com/gameparlor/common/ResultCode.class differ diff --git a/target/classes/com/gameparlor/common/TokenStore$TokenInfo.class b/target/classes/com/gameparlor/common/TokenStore$TokenInfo.class new file mode 100644 index 0000000..6020156 Binary files /dev/null and b/target/classes/com/gameparlor/common/TokenStore$TokenInfo.class differ diff --git a/target/classes/com/gameparlor/common/TokenStore.class b/target/classes/com/gameparlor/common/TokenStore.class new file mode 100644 index 0000000..9c777cd Binary files /dev/null and b/target/classes/com/gameparlor/common/TokenStore.class differ diff --git a/target/classes/com/gameparlor/common/UserContext.class b/target/classes/com/gameparlor/common/UserContext.class new file mode 100644 index 0000000..bb972aa Binary files /dev/null and b/target/classes/com/gameparlor/common/UserContext.class differ diff --git a/target/classes/com/gameparlor/common/WebMvcConfig.class b/target/classes/com/gameparlor/common/WebMvcConfig.class new file mode 100644 index 0000000..7ec64b6 Binary files /dev/null and b/target/classes/com/gameparlor/common/WebMvcConfig.class differ diff --git a/target/classes/com/gameparlor/config/DataInitializer.class b/target/classes/com/gameparlor/config/DataInitializer.class new file mode 100644 index 0000000..f237beb Binary files /dev/null and b/target/classes/com/gameparlor/config/DataInitializer.class differ diff --git a/target/classes/com/gameparlor/config/JacksonConfig.class b/target/classes/com/gameparlor/config/JacksonConfig.class new file mode 100644 index 0000000..27cd254 Binary files /dev/null and b/target/classes/com/gameparlor/config/JacksonConfig.class differ diff --git a/target/classes/com/gameparlor/controller/AuthController$AuthRequest.class b/target/classes/com/gameparlor/controller/AuthController$AuthRequest.class new file mode 100644 index 0000000..41c670e Binary files /dev/null and b/target/classes/com/gameparlor/controller/AuthController$AuthRequest.class differ diff --git a/target/classes/com/gameparlor/controller/AuthController.class b/target/classes/com/gameparlor/controller/AuthController.class new file mode 100644 index 0000000..d00aeba Binary files /dev/null and b/target/classes/com/gameparlor/controller/AuthController.class differ diff --git a/target/classes/com/gameparlor/controller/ComboController.class b/target/classes/com/gameparlor/controller/ComboController.class new file mode 100644 index 0000000..1c7eda6 Binary files /dev/null and b/target/classes/com/gameparlor/controller/ComboController.class differ diff --git a/target/classes/com/gameparlor/controller/ConfigController.class b/target/classes/com/gameparlor/controller/ConfigController.class new file mode 100644 index 0000000..12a1c04 Binary files /dev/null and b/target/classes/com/gameparlor/controller/ConfigController.class differ diff --git a/target/classes/com/gameparlor/controller/DeviceController.class b/target/classes/com/gameparlor/controller/DeviceController.class new file mode 100644 index 0000000..3d65327 Binary files /dev/null and b/target/classes/com/gameparlor/controller/DeviceController.class differ diff --git a/target/classes/com/gameparlor/controller/GameController.class b/target/classes/com/gameparlor/controller/GameController.class new file mode 100644 index 0000000..832eebf Binary files /dev/null and b/target/classes/com/gameparlor/controller/GameController.class differ diff --git a/target/classes/com/gameparlor/controller/HistoryController.class b/target/classes/com/gameparlor/controller/HistoryController.class new file mode 100644 index 0000000..f43f2e1 Binary files /dev/null and b/target/classes/com/gameparlor/controller/HistoryController.class differ diff --git a/target/classes/com/gameparlor/controller/MemberController$CustomComboForm.class b/target/classes/com/gameparlor/controller/MemberController$CustomComboForm.class new file mode 100644 index 0000000..f10644e Binary files /dev/null and b/target/classes/com/gameparlor/controller/MemberController$CustomComboForm.class differ diff --git a/target/classes/com/gameparlor/controller/MemberController$ExchangeForm.class b/target/classes/com/gameparlor/controller/MemberController$ExchangeForm.class new file mode 100644 index 0000000..a33edf3 Binary files /dev/null and b/target/classes/com/gameparlor/controller/MemberController$ExchangeForm.class differ diff --git a/target/classes/com/gameparlor/controller/MemberController.class b/target/classes/com/gameparlor/controller/MemberController.class new file mode 100644 index 0000000..88e75c0 Binary files /dev/null and b/target/classes/com/gameparlor/controller/MemberController.class differ diff --git a/target/classes/com/gameparlor/controller/OrderController$RenewForm.class b/target/classes/com/gameparlor/controller/OrderController$RenewForm.class new file mode 100644 index 0000000..2e48128 Binary files /dev/null and b/target/classes/com/gameparlor/controller/OrderController$RenewForm.class differ diff --git a/target/classes/com/gameparlor/controller/OrderController$SnackListForm.class b/target/classes/com/gameparlor/controller/OrderController$SnackListForm.class new file mode 100644 index 0000000..2f74848 Binary files /dev/null and b/target/classes/com/gameparlor/controller/OrderController$SnackListForm.class differ diff --git a/target/classes/com/gameparlor/controller/OrderController$StartGameForm.class b/target/classes/com/gameparlor/controller/OrderController$StartGameForm.class new file mode 100644 index 0000000..ffa31d8 Binary files /dev/null and b/target/classes/com/gameparlor/controller/OrderController$StartGameForm.class differ diff --git a/target/classes/com/gameparlor/controller/OrderController.class b/target/classes/com/gameparlor/controller/OrderController.class new file mode 100644 index 0000000..d30fdc2 Binary files /dev/null and b/target/classes/com/gameparlor/controller/OrderController.class differ diff --git a/target/classes/com/gameparlor/controller/RechargeController$RechargeForm.class b/target/classes/com/gameparlor/controller/RechargeController$RechargeForm.class new file mode 100644 index 0000000..54fa72f Binary files /dev/null and b/target/classes/com/gameparlor/controller/RechargeController$RechargeForm.class differ diff --git a/target/classes/com/gameparlor/controller/RechargeController.class b/target/classes/com/gameparlor/controller/RechargeController.class new file mode 100644 index 0000000..63afb0b Binary files /dev/null and b/target/classes/com/gameparlor/controller/RechargeController.class differ diff --git a/target/classes/com/gameparlor/controller/SnackController.class b/target/classes/com/gameparlor/controller/SnackController.class new file mode 100644 index 0000000..223586a Binary files /dev/null and b/target/classes/com/gameparlor/controller/SnackController.class differ diff --git a/target/classes/com/gameparlor/controller/TimeSlotController.class b/target/classes/com/gameparlor/controller/TimeSlotController.class new file mode 100644 index 0000000..d1987b1 Binary files /dev/null and b/target/classes/com/gameparlor/controller/TimeSlotController.class differ diff --git a/target/classes/com/gameparlor/controller/UserController.class b/target/classes/com/gameparlor/controller/UserController.class new file mode 100644 index 0000000..e1de116 Binary files /dev/null and b/target/classes/com/gameparlor/controller/UserController.class differ diff --git a/target/classes/com/gameparlor/controller/admin/AdminComboController$ComboForm.class b/target/classes/com/gameparlor/controller/admin/AdminComboController$ComboForm.class new file mode 100644 index 0000000..d66ac1f Binary files /dev/null and b/target/classes/com/gameparlor/controller/admin/AdminComboController$ComboForm.class differ diff --git a/target/classes/com/gameparlor/controller/admin/AdminComboController$ItemForm.class b/target/classes/com/gameparlor/controller/admin/AdminComboController$ItemForm.class new file mode 100644 index 0000000..41ea92d Binary files /dev/null and b/target/classes/com/gameparlor/controller/admin/AdminComboController$ItemForm.class differ diff --git a/target/classes/com/gameparlor/controller/admin/AdminComboController.class b/target/classes/com/gameparlor/controller/admin/AdminComboController.class new file mode 100644 index 0000000..b79cff9 Binary files /dev/null and b/target/classes/com/gameparlor/controller/admin/AdminComboController.class differ diff --git a/target/classes/com/gameparlor/controller/admin/AdminConfigController.class b/target/classes/com/gameparlor/controller/admin/AdminConfigController.class new file mode 100644 index 0000000..cde41d6 Binary files /dev/null and b/target/classes/com/gameparlor/controller/admin/AdminConfigController.class differ diff --git a/target/classes/com/gameparlor/controller/admin/AdminDeviceController$DeviceForm.class b/target/classes/com/gameparlor/controller/admin/AdminDeviceController$DeviceForm.class new file mode 100644 index 0000000..5f56184 Binary files /dev/null and b/target/classes/com/gameparlor/controller/admin/AdminDeviceController$DeviceForm.class differ diff --git a/target/classes/com/gameparlor/controller/admin/AdminDeviceController.class b/target/classes/com/gameparlor/controller/admin/AdminDeviceController.class new file mode 100644 index 0000000..552918f Binary files /dev/null and b/target/classes/com/gameparlor/controller/admin/AdminDeviceController.class differ diff --git a/target/classes/com/gameparlor/controller/admin/AdminGameController$GameForm.class b/target/classes/com/gameparlor/controller/admin/AdminGameController$GameForm.class new file mode 100644 index 0000000..f5bb04d Binary files /dev/null and b/target/classes/com/gameparlor/controller/admin/AdminGameController$GameForm.class differ diff --git a/target/classes/com/gameparlor/controller/admin/AdminGameController.class b/target/classes/com/gameparlor/controller/admin/AdminGameController.class new file mode 100644 index 0000000..3959ee0 Binary files /dev/null and b/target/classes/com/gameparlor/controller/admin/AdminGameController.class differ diff --git a/target/classes/com/gameparlor/controller/admin/AdminRechargeController$ApproveForm.class b/target/classes/com/gameparlor/controller/admin/AdminRechargeController$ApproveForm.class new file mode 100644 index 0000000..0935038 Binary files /dev/null and b/target/classes/com/gameparlor/controller/admin/AdminRechargeController$ApproveForm.class differ diff --git a/target/classes/com/gameparlor/controller/admin/AdminRechargeController.class b/target/classes/com/gameparlor/controller/admin/AdminRechargeController.class new file mode 100644 index 0000000..cb431c6 Binary files /dev/null and b/target/classes/com/gameparlor/controller/admin/AdminRechargeController.class differ diff --git a/target/classes/com/gameparlor/controller/admin/AdminSnackController$SnackForm.class b/target/classes/com/gameparlor/controller/admin/AdminSnackController$SnackForm.class new file mode 100644 index 0000000..7a9256b Binary files /dev/null and b/target/classes/com/gameparlor/controller/admin/AdminSnackController$SnackForm.class differ diff --git a/target/classes/com/gameparlor/controller/admin/AdminSnackController.class b/target/classes/com/gameparlor/controller/admin/AdminSnackController.class new file mode 100644 index 0000000..cbdce1e Binary files /dev/null and b/target/classes/com/gameparlor/controller/admin/AdminSnackController.class differ diff --git a/target/classes/com/gameparlor/controller/admin/AdminStatsController.class b/target/classes/com/gameparlor/controller/admin/AdminStatsController.class new file mode 100644 index 0000000..19d631a Binary files /dev/null and b/target/classes/com/gameparlor/controller/admin/AdminStatsController.class differ diff --git a/target/classes/com/gameparlor/controller/admin/AdminTimeSlotController$SlotForm.class b/target/classes/com/gameparlor/controller/admin/AdminTimeSlotController$SlotForm.class new file mode 100644 index 0000000..ff54a51 Binary files /dev/null and b/target/classes/com/gameparlor/controller/admin/AdminTimeSlotController$SlotForm.class differ diff --git a/target/classes/com/gameparlor/controller/admin/AdminTimeSlotController.class b/target/classes/com/gameparlor/controller/admin/AdminTimeSlotController.class new file mode 100644 index 0000000..0e448de Binary files /dev/null and b/target/classes/com/gameparlor/controller/admin/AdminTimeSlotController.class differ diff --git a/target/classes/com/gameparlor/controller/admin/AdminUserController$UserForm.class b/target/classes/com/gameparlor/controller/admin/AdminUserController$UserForm.class new file mode 100644 index 0000000..5e2717c Binary files /dev/null and b/target/classes/com/gameparlor/controller/admin/AdminUserController$UserForm.class differ diff --git a/target/classes/com/gameparlor/controller/admin/AdminUserController.class b/target/classes/com/gameparlor/controller/admin/AdminUserController.class new file mode 100644 index 0000000..c6d9950 Binary files /dev/null and b/target/classes/com/gameparlor/controller/admin/AdminUserController.class differ diff --git a/target/classes/com/gameparlor/entity/Combo.class b/target/classes/com/gameparlor/entity/Combo.class new file mode 100644 index 0000000..953ddee Binary files /dev/null and b/target/classes/com/gameparlor/entity/Combo.class differ diff --git a/target/classes/com/gameparlor/entity/ComboItem.class b/target/classes/com/gameparlor/entity/ComboItem.class new file mode 100644 index 0000000..d5b835c Binary files /dev/null and b/target/classes/com/gameparlor/entity/ComboItem.class differ diff --git a/target/classes/com/gameparlor/entity/Device.class b/target/classes/com/gameparlor/entity/Device.class new file mode 100644 index 0000000..8471b8c Binary files /dev/null and b/target/classes/com/gameparlor/entity/Device.class differ diff --git a/target/classes/com/gameparlor/entity/Game.class b/target/classes/com/gameparlor/entity/Game.class new file mode 100644 index 0000000..4b289c7 Binary files /dev/null and b/target/classes/com/gameparlor/entity/Game.class differ diff --git a/target/classes/com/gameparlor/entity/Order.class b/target/classes/com/gameparlor/entity/Order.class new file mode 100644 index 0000000..4115837 Binary files /dev/null and b/target/classes/com/gameparlor/entity/Order.class differ diff --git a/target/classes/com/gameparlor/entity/OrderItem.class b/target/classes/com/gameparlor/entity/OrderItem.class new file mode 100644 index 0000000..e70f37a Binary files /dev/null and b/target/classes/com/gameparlor/entity/OrderItem.class differ diff --git a/target/classes/com/gameparlor/entity/RechargeApproval.class b/target/classes/com/gameparlor/entity/RechargeApproval.class new file mode 100644 index 0000000..9ee84eb Binary files /dev/null and b/target/classes/com/gameparlor/entity/RechargeApproval.class differ diff --git a/target/classes/com/gameparlor/entity/Snack.class b/target/classes/com/gameparlor/entity/Snack.class new file mode 100644 index 0000000..80ada42 Binary files /dev/null and b/target/classes/com/gameparlor/entity/Snack.class differ diff --git a/target/classes/com/gameparlor/entity/SystemConfig.class b/target/classes/com/gameparlor/entity/SystemConfig.class new file mode 100644 index 0000000..a35fff1 Binary files /dev/null and b/target/classes/com/gameparlor/entity/SystemConfig.class differ diff --git a/target/classes/com/gameparlor/entity/TimeSlot.class b/target/classes/com/gameparlor/entity/TimeSlot.class new file mode 100644 index 0000000..c54121c Binary files /dev/null and b/target/classes/com/gameparlor/entity/TimeSlot.class differ diff --git a/target/classes/com/gameparlor/entity/TransactionLog.class b/target/classes/com/gameparlor/entity/TransactionLog.class new file mode 100644 index 0000000..591a3de Binary files /dev/null and b/target/classes/com/gameparlor/entity/TransactionLog.class differ diff --git a/target/classes/com/gameparlor/entity/User.class b/target/classes/com/gameparlor/entity/User.class new file mode 100644 index 0000000..3266530 Binary files /dev/null and b/target/classes/com/gameparlor/entity/User.class differ diff --git a/target/classes/com/gameparlor/entity/enums/ComboType.class b/target/classes/com/gameparlor/entity/enums/ComboType.class new file mode 100644 index 0000000..2a750d6 Binary files /dev/null and b/target/classes/com/gameparlor/entity/enums/ComboType.class differ diff --git a/target/classes/com/gameparlor/entity/enums/ItemType.class b/target/classes/com/gameparlor/entity/enums/ItemType.class new file mode 100644 index 0000000..a495759 Binary files /dev/null and b/target/classes/com/gameparlor/entity/enums/ItemType.class differ diff --git a/target/classes/com/gameparlor/entity/enums/OrderStatus.class b/target/classes/com/gameparlor/entity/enums/OrderStatus.class new file mode 100644 index 0000000..b2be015 Binary files /dev/null and b/target/classes/com/gameparlor/entity/enums/OrderStatus.class differ diff --git a/target/classes/com/gameparlor/entity/enums/RechargeStatus.class b/target/classes/com/gameparlor/entity/enums/RechargeStatus.class new file mode 100644 index 0000000..5aa7ef1 Binary files /dev/null and b/target/classes/com/gameparlor/entity/enums/RechargeStatus.class differ diff --git a/target/classes/com/gameparlor/entity/enums/Role.class b/target/classes/com/gameparlor/entity/enums/Role.class new file mode 100644 index 0000000..619223c Binary files /dev/null and b/target/classes/com/gameparlor/entity/enums/Role.class differ diff --git a/target/classes/com/gameparlor/entity/enums/SnackType.class b/target/classes/com/gameparlor/entity/enums/SnackType.class new file mode 100644 index 0000000..687837c Binary files /dev/null and b/target/classes/com/gameparlor/entity/enums/SnackType.class differ diff --git a/target/classes/com/gameparlor/entity/enums/TxType.class b/target/classes/com/gameparlor/entity/enums/TxType.class new file mode 100644 index 0000000..78bc395 Binary files /dev/null and b/target/classes/com/gameparlor/entity/enums/TxType.class differ diff --git a/target/classes/com/gameparlor/repository/ComboItemRepository.class b/target/classes/com/gameparlor/repository/ComboItemRepository.class new file mode 100644 index 0000000..e90b93a Binary files /dev/null and b/target/classes/com/gameparlor/repository/ComboItemRepository.class differ diff --git a/target/classes/com/gameparlor/repository/ComboRepository.class b/target/classes/com/gameparlor/repository/ComboRepository.class new file mode 100644 index 0000000..87aa94d Binary files /dev/null and b/target/classes/com/gameparlor/repository/ComboRepository.class differ diff --git a/target/classes/com/gameparlor/repository/DeviceRepository.class b/target/classes/com/gameparlor/repository/DeviceRepository.class new file mode 100644 index 0000000..c573392 Binary files /dev/null and b/target/classes/com/gameparlor/repository/DeviceRepository.class differ diff --git a/target/classes/com/gameparlor/repository/GameRepository.class b/target/classes/com/gameparlor/repository/GameRepository.class new file mode 100644 index 0000000..b4e6bfc Binary files /dev/null and b/target/classes/com/gameparlor/repository/GameRepository.class differ diff --git a/target/classes/com/gameparlor/repository/OrderItemRepository.class b/target/classes/com/gameparlor/repository/OrderItemRepository.class new file mode 100644 index 0000000..808203c Binary files /dev/null and b/target/classes/com/gameparlor/repository/OrderItemRepository.class differ diff --git a/target/classes/com/gameparlor/repository/OrderRepository.class b/target/classes/com/gameparlor/repository/OrderRepository.class new file mode 100644 index 0000000..8f8f8ca Binary files /dev/null and b/target/classes/com/gameparlor/repository/OrderRepository.class differ diff --git a/target/classes/com/gameparlor/repository/RechargeApprovalRepository.class b/target/classes/com/gameparlor/repository/RechargeApprovalRepository.class new file mode 100644 index 0000000..8fa0d61 Binary files /dev/null and b/target/classes/com/gameparlor/repository/RechargeApprovalRepository.class differ diff --git a/target/classes/com/gameparlor/repository/SnackRepository.class b/target/classes/com/gameparlor/repository/SnackRepository.class new file mode 100644 index 0000000..cbf3047 Binary files /dev/null and b/target/classes/com/gameparlor/repository/SnackRepository.class differ diff --git a/target/classes/com/gameparlor/repository/SystemConfigRepository.class b/target/classes/com/gameparlor/repository/SystemConfigRepository.class new file mode 100644 index 0000000..4437e90 Binary files /dev/null and b/target/classes/com/gameparlor/repository/SystemConfigRepository.class differ diff --git a/target/classes/com/gameparlor/repository/TimeSlotRepository.class b/target/classes/com/gameparlor/repository/TimeSlotRepository.class new file mode 100644 index 0000000..36d3285 Binary files /dev/null and b/target/classes/com/gameparlor/repository/TimeSlotRepository.class differ diff --git a/target/classes/com/gameparlor/repository/TransactionLogRepository.class b/target/classes/com/gameparlor/repository/TransactionLogRepository.class new file mode 100644 index 0000000..c76acdd Binary files /dev/null and b/target/classes/com/gameparlor/repository/TransactionLogRepository.class differ diff --git a/target/classes/com/gameparlor/repository/UserRepository.class b/target/classes/com/gameparlor/repository/UserRepository.class new file mode 100644 index 0000000..8f5a93a Binary files /dev/null and b/target/classes/com/gameparlor/repository/UserRepository.class differ diff --git a/target/classes/com/gameparlor/scheduler/CountdownScheduler.class b/target/classes/com/gameparlor/scheduler/CountdownScheduler.class new file mode 100644 index 0000000..074eb25 Binary files /dev/null and b/target/classes/com/gameparlor/scheduler/CountdownScheduler.class differ diff --git a/target/classes/com/gameparlor/service/AuthService.class b/target/classes/com/gameparlor/service/AuthService.class new file mode 100644 index 0000000..d113e50 Binary files /dev/null and b/target/classes/com/gameparlor/service/AuthService.class differ diff --git a/target/classes/com/gameparlor/service/ComboService$1.class b/target/classes/com/gameparlor/service/ComboService$1.class new file mode 100644 index 0000000..9fb0cf2 Binary files /dev/null and b/target/classes/com/gameparlor/service/ComboService$1.class differ diff --git a/target/classes/com/gameparlor/service/ComboService.class b/target/classes/com/gameparlor/service/ComboService.class new file mode 100644 index 0000000..982d6e3 Binary files /dev/null and b/target/classes/com/gameparlor/service/ComboService.class differ diff --git a/target/classes/com/gameparlor/service/ConfigService.class b/target/classes/com/gameparlor/service/ConfigService.class new file mode 100644 index 0000000..a174b39 Binary files /dev/null and b/target/classes/com/gameparlor/service/ConfigService.class differ diff --git a/target/classes/com/gameparlor/service/MemberService$1.class b/target/classes/com/gameparlor/service/MemberService$1.class new file mode 100644 index 0000000..76bb4ba Binary files /dev/null and b/target/classes/com/gameparlor/service/MemberService$1.class differ diff --git a/target/classes/com/gameparlor/service/MemberService$CustomItem.class b/target/classes/com/gameparlor/service/MemberService$CustomItem.class new file mode 100644 index 0000000..9573232 Binary files /dev/null and b/target/classes/com/gameparlor/service/MemberService$CustomItem.class differ diff --git a/target/classes/com/gameparlor/service/MemberService.class b/target/classes/com/gameparlor/service/MemberService.class new file mode 100644 index 0000000..49c20f4 Binary files /dev/null and b/target/classes/com/gameparlor/service/MemberService.class differ diff --git a/target/classes/com/gameparlor/service/OrderService$SnackItem.class b/target/classes/com/gameparlor/service/OrderService$SnackItem.class new file mode 100644 index 0000000..df512aa Binary files /dev/null and b/target/classes/com/gameparlor/service/OrderService$SnackItem.class differ diff --git a/target/classes/com/gameparlor/service/OrderService.class b/target/classes/com/gameparlor/service/OrderService.class new file mode 100644 index 0000000..4c72f99 Binary files /dev/null and b/target/classes/com/gameparlor/service/OrderService.class differ diff --git a/target/classes/com/gameparlor/service/RechargeService.class b/target/classes/com/gameparlor/service/RechargeService.class new file mode 100644 index 0000000..e86189e Binary files /dev/null and b/target/classes/com/gameparlor/service/RechargeService.class differ diff --git a/target/classes/com/gameparlor/service/SpringContext.class b/target/classes/com/gameparlor/service/SpringContext.class new file mode 100644 index 0000000..d3082bf Binary files /dev/null and b/target/classes/com/gameparlor/service/SpringContext.class differ diff --git a/target/classes/com/gameparlor/service/UserService.class b/target/classes/com/gameparlor/service/UserService.class new file mode 100644 index 0000000..9fd6aa3 Binary files /dev/null and b/target/classes/com/gameparlor/service/UserService.class differ diff --git a/target/classes/com/gameparlor/service/WalletService.class b/target/classes/com/gameparlor/service/WalletService.class new file mode 100644 index 0000000..0dbff1c Binary files /dev/null and b/target/classes/com/gameparlor/service/WalletService.class differ diff --git a/target/classes/data.sql b/target/classes/data.sql new file mode 100644 index 0000000..a960732 --- /dev/null +++ b/target/classes/data.sql @@ -0,0 +1,39 @@ +-- ===================================================== +-- GameParlor 初始数据脚本(MySQL 5.x) +-- 在执行完 schema.sql 后执行本脚本 +-- ===================================================== + +USE gameparlor; + +-- 管理员账号(明文密码) +INSERT INTO `user` (`username`, `password`, `role`, `balance`, `member_expire_date`, `points`, `version`) +VALUES ('admin', 'admin123', 'ADMIN', 9999.00, DATE_ADD(CURDATE(), INTERVAL 10 YEAR), 0, 0); + +-- 设备 +INSERT INTO `device` (`name`, `description`, `remark`, `created_at`) VALUES +('PS5', 'PlayStation 5 主机', '4K 120Hz,支持次世代游戏', NOW()), +('Switch', '任天堂 Switch', '多人派对游戏首选', NOW()); + +-- 游戏 +INSERT INTO `game` (`name`, `description`, `remark`, `is_universal`, `device_id`, `member_price`, `created_at`) VALUES +('艾尔登法环', '开放世界动作 RPG', '运行设备:PS5', b'0', 1, 30.00, NOW()), +('马里奥赛车', '竞速派对游戏', '运行设备:Switch', b'0', 2, 20.00, NOW()), +('街机合集', '经典街机游戏合集', '通用游戏,全设备可玩', b'1', NULL, 15.00, NOW()); + +-- 时长 +INSERT INTO `time_slot` (`duration_minutes`, `base_price`, `member_price`, `created_at`) VALUES +(30, 15.00, 12.00, NOW()), +(60, 25.00, 20.00, NOW()), +(120, 45.00, 38.00, NOW()); + +-- 零食饮料 +INSERT INTO `snack` (`name`, `price`, `type`, `remark`, `member_price`, `created_at`) VALUES +('可乐', 8.00, 'DRINK', '冰镇 330ml', 6.00, NOW()), +('薯片', 10.00, 'SNACK', '原味', 8.00, NOW()), +('绿茶', 6.00, 'DRINK', '无糖', 5.00, NOW()); + +-- 系统配置 +INSERT INTO `system_config` (`config_key`, `value`) VALUES +('points_exchange_rate', '100'), +('member_discount_rate', '0.85'), +('points_earn_rate', '1'); diff --git a/target/classes/schema.sql b/target/classes/schema.sql new file mode 100644 index 0000000..80276f8 --- /dev/null +++ b/target/classes/schema.sql @@ -0,0 +1,155 @@ +-- ===================================================== +-- GameParlor 初始建表脚本(MySQL 5.x) +-- 使用方法:在 MySQL 中创建 gameparlor 库后执行本脚本 +-- ===================================================== + +CREATE DATABASE IF NOT EXISTS gameparlor DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; +USE gameparlor; + +-- 设备 +CREATE TABLE IF NOT EXISTS `device` ( + `id` BIGINT NOT NULL AUTO_INCREMENT, + `name` VARCHAR(100) NOT NULL, + `description` VARCHAR(500), + `remark` VARCHAR(255), + `created_at` DATETIME, + PRIMARY KEY (`id`), + INDEX `idx_device_name` (`name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +-- 游戏 +CREATE TABLE IF NOT EXISTS `game` ( + `id` BIGINT NOT NULL AUTO_INCREMENT, + `name` VARCHAR(100) NOT NULL, + `description` VARCHAR(500), + `remark` VARCHAR(255), + `is_universal` BIT(1) NOT NULL DEFAULT b'0', + `device_id` BIGINT, + `member_price` DECIMAL(10,2), + `created_at` DATETIME, + PRIMARY KEY (`id`), + INDEX `idx_game_device_id` (`device_id`), + INDEX `idx_game_name` (`name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +-- 零食/饮料 +CREATE TABLE IF NOT EXISTS `snack` ( + `id` BIGINT NOT NULL AUTO_INCREMENT, + `name` VARCHAR(100) NOT NULL, + `price` DECIMAL(10,2) NOT NULL, + `type` VARCHAR(20) NOT NULL, + `remark` VARCHAR(255), + `member_price` DECIMAL(10,2), + `created_at` DATETIME, + PRIMARY KEY (`id`), + INDEX `idx_snack_type` (`type`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +-- 游玩时长选项 +CREATE TABLE IF NOT EXISTS `time_slot` ( + `id` BIGINT NOT NULL AUTO_INCREMENT, + `duration_minutes` INT NOT NULL, + `base_price` DECIMAL(10,2) NOT NULL, + `member_price` DECIMAL(10,2), + `created_at` DATETIME, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +-- 套餐 +CREATE TABLE IF NOT EXISTS `combo` ( + `id` BIGINT NOT NULL AUTO_INCREMENT, + `name` VARCHAR(100) NOT NULL, + `type` VARCHAR(20) NOT NULL, + `discount_rate` DECIMAL(5,2) NOT NULL DEFAULT 1.00, + `is_active` BIT(1) NOT NULL DEFAULT b'1', + `created_at` DATETIME, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +-- 套餐组成项 +CREATE TABLE IF NOT EXISTS `combo_item` ( + `id` BIGINT NOT NULL AUTO_INCREMENT, + `combo_id` BIGINT NOT NULL, + `item_type` VARCHAR(20) NOT NULL, + `item_id` BIGINT NOT NULL, + `quantity` INT NOT NULL DEFAULT 1, + `unit_price_at_creation` DECIMAL(10,2) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +-- 用户 +CREATE TABLE IF NOT EXISTS `user` ( + `id` BIGINT NOT NULL AUTO_INCREMENT, + `username` VARCHAR(50) NOT NULL, + `password` VARCHAR(100) NOT NULL, + `role` VARCHAR(20) NOT NULL, + `balance` DECIMAL(12,2) NOT NULL DEFAULT 0.00, + `member_expire_date` DATE, + `points` INT NOT NULL DEFAULT 0, + `created_at` DATETIME, + `version` BIGINT, + PRIMARY KEY (`id`), + UNIQUE INDEX `idx_user_username` (`username`), + INDEX `idx_user_role` (`role`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +-- 订单 +CREATE TABLE IF NOT EXISTS `orders` ( + `id` BIGINT NOT NULL AUTO_INCREMENT, + `user_id` BIGINT NOT NULL, + `total_amount` DECIMAL(12,2) NOT NULL, + `status` VARCHAR(20) NOT NULL, + `created_at` DATETIME, + PRIMARY KEY (`id`), + INDEX `idx_order_user_id` (`user_id`), + INDEX `idx_order_status` (`status`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +-- 订单项 +CREATE TABLE IF NOT EXISTS `order_item` ( + `id` BIGINT NOT NULL AUTO_INCREMENT, + `order_id` BIGINT NOT NULL, + `item_type` VARCHAR(20) NOT NULL, + `item_id` BIGINT NOT NULL, + `start_time` DATETIME, + `end_time` DATETIME, + `quantity` INT NOT NULL DEFAULT 1, + PRIMARY KEY (`id`), + INDEX `idx_order_item_order_id` (`order_id`), + INDEX `idx_order_item_end_time` (`end_time`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +-- 交易日志 +CREATE TABLE IF NOT EXISTS `transaction_log` ( + `id` BIGINT NOT NULL AUTO_INCREMENT, + `user_id` BIGINT NOT NULL, + `type` VARCHAR(20) NOT NULL, + `amount` DECIMAL(12,2) NOT NULL, + `remark` VARCHAR(255), + `created_at` DATETIME, + PRIMARY KEY (`id`), + INDEX `idx_tx_user_id` (`user_id`), + INDEX `idx_tx_type` (`type`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +-- 充值审批 +CREATE TABLE IF NOT EXISTS `recharge_approval` ( + `id` BIGINT NOT NULL AUTO_INCREMENT, + `user_id` BIGINT NOT NULL, + `amount` DECIMAL(12,2) NOT NULL, + `auth_code` VARCHAR(50), + `status` VARCHAR(20) NOT NULL, + `created_at` DATETIME, + PRIMARY KEY (`id`), + INDEX `idx_recharge_user_id` (`user_id`), + INDEX `idx_recharge_status` (`status`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +-- 系统配置 +CREATE TABLE IF NOT EXISTS `system_config` ( + `id` BIGINT NOT NULL AUTO_INCREMENT, + `config_key` VARCHAR(50) NOT NULL, + `value` VARCHAR(100), + PRIMARY KEY (`id`), + UNIQUE INDEX `uk_config_key` (`config_key`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; diff --git a/target/classes/static/admin/combos.html b/target/classes/static/admin/combos.html new file mode 100644 index 0000000..4b8b201 --- /dev/null +++ b/target/classes/static/admin/combos.html @@ -0,0 +1,121 @@ + + + + + + 套餐管理 · GameParlor + + + + + +
+

套餐管理

+ +
+
+ +
+ + + + + + + + + + + diff --git a/target/classes/static/admin/dashboard.html b/target/classes/static/admin/dashboard.html new file mode 100644 index 0000000..cceb152 --- /dev/null +++ b/target/classes/static/admin/dashboard.html @@ -0,0 +1,47 @@ + + + + + + 概览 · GameParlor + + + + + +

管理概览

+
+
+
用户总数
+
+
+
+
订单总数
+
+
+
+
待审批充值
+
+
+
+
+

系统配置

+ +
+ + + + diff --git a/target/classes/static/admin/devices.html b/target/classes/static/admin/devices.html new file mode 100644 index 0000000..c13ac18 --- /dev/null +++ b/target/classes/static/admin/devices.html @@ -0,0 +1,97 @@ + + + + + + 设备管理 · GameParlor + + + + + +
+

设备管理

+ +
+ +
+ + + + + + + + +
ID名称描述备注创建时间操作
暂无数据
+
+ +
+ + + +
+ + + + + + + + diff --git a/target/classes/static/admin/games.html b/target/classes/static/admin/games.html new file mode 100644 index 0000000..29041de --- /dev/null +++ b/target/classes/static/admin/games.html @@ -0,0 +1,113 @@ + + + + + + 游戏管理 · GameParlor + + + + + +
+

游戏管理

+ +
+ +
+ + + + + + + + +
ID名称通用设备会员单价备注操作
暂无数据
+
+ +
+ + + +
+ + + + + + + diff --git a/target/classes/static/admin/recharge.html b/target/classes/static/admin/recharge.html new file mode 100644 index 0000000..6fe7d13 --- /dev/null +++ b/target/classes/static/admin/recharge.html @@ -0,0 +1,63 @@ + + + + + + 充值审批 · GameParlor + + + + + +

充值审批

+
+ + + + + + +
ID用户ID金额授权码状态时间操作
暂无待审批
+
+ + + + + diff --git a/target/classes/static/admin/snacks.html b/target/classes/static/admin/snacks.html new file mode 100644 index 0000000..4868eba --- /dev/null +++ b/target/classes/static/admin/snacks.html @@ -0,0 +1,89 @@ + + + + + + 零食管理 · GameParlor + + + + + +
+

零食/饮料管理

+ +
+
+ + + + + + +
ID名称类型价格会员单价备注操作
暂无数据
+
+
+ + + +
+ + + + + diff --git a/target/classes/static/admin/timeslots.html b/target/classes/static/admin/timeslots.html new file mode 100644 index 0000000..08f425c --- /dev/null +++ b/target/classes/static/admin/timeslots.html @@ -0,0 +1,81 @@ + + + + + + 时长管理 · GameParlor + + + + + +
+

时长管理

+ +
+
+ + + + + + +
ID时长(分钟)基础单价会员单价操作
暂无数据
+
+
+ + + +
+ + + + + diff --git a/target/classes/static/admin/users.html b/target/classes/static/admin/users.html new file mode 100644 index 0000000..c615cc1 --- /dev/null +++ b/target/classes/static/admin/users.html @@ -0,0 +1,83 @@ + + + + + + 用户管理 · GameParlor + + + + + +

用户管理

+
+ + + + + + +
ID用户名角色余额积分会员到期操作
暂无数据
+
+
+ + + +
+ + + + + diff --git a/target/classes/static/app.css b/target/classes/static/app.css new file mode 100644 index 0000000..5325d64 --- /dev/null +++ b/target/classes/static/app.css @@ -0,0 +1,216 @@ +/* GameParlor 全局样式 — 深色主题 + 霓虹蓝 */ +/* 注:Tailwind 工具类由 tailwind.min.js (Play CDN) 运行时注入;本文件仅定义组件类与基础样式 */ + +:root { + --bg: #0f0f11; + --bg-soft: #16161a; + --bg-card: #1c1c22; + --border: #2a2a33; + --accent: #00d4ff; + --accent-dim: rgba(0, 212, 255, 0.15); + --text: #e8e8ed; + --text-dim: #9a9aa5; + --text-faint: #6b6b78; + --success: #34d399; + --danger: #f87171; + --warning: #fbbf24; +} + +* { box-sizing: border-box; } + +html, body { + margin: 0; + padding: 0; + background: var(--bg); + color: var(--text); + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; + min-height: 100vh; +} + +a { color: var(--accent); text-decoration: none; } + +/* 滚动条 */ +::-webkit-scrollbar { width: 8px; height: 8px; } +::-webkit-scrollbar-track { background: transparent; } +::-webkit-scrollbar-thumb { background: #2a2a33; border-radius: 4px; } +::-webkit-scrollbar-thumb:hover { background: #3a3a45; } + + .card { + background: var(--bg-card); + border: 1px solid var(--border); + border-radius: 14px; + transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; + } + .card-hover:hover { + transform: translateY(-3px); + box-shadow: 0 10px 30px rgba(0, 0, 0, .4), 0 0 0 1px rgba(0, 212, 255, .15); + border-color: rgba(0, 212, 255, .3); + } + + .btn { + display: inline-flex; align-items: center; justify-content: center; gap: .4rem; + padding: .55rem 1.1rem; + border-radius: 10px; + font-size: .875rem; font-weight: 500; + border: 1px solid transparent; + cursor: pointer; + transition: transform .1s ease, background .2s ease, border-color .2s ease, opacity .2s ease; + user-select: none; + } + .btn:active { transform: scale(0.95); } + .btn:disabled { opacity: .5; cursor: not-allowed; } + .btn-primary { background: var(--accent); color: #06242b; } + .btn-primary:hover:not(:disabled) { background: #33ddff; } + .btn-ghost { background: transparent; color: var(--text); border-color: var(--border); } + .btn-ghost:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); } + .btn-danger { background: rgba(248, 113, 113, .12); color: var(--danger); border-color: rgba(248, 113, 113, .3); } + .btn-danger:hover:not(:disabled) { background: rgba(248, 113, 113, .22); } + + .input, .select, .textarea { + width: 100%; + background: var(--bg-soft); + border: 1px solid var(--border); + border-radius: 10px; + padding: .55rem .8rem; + color: var(--text); + font-size: .875rem; + transition: border-color .2s ease, box-shadow .2s ease; + } + .input:focus, .select:focus, .textarea:focus { + outline: none; + border-color: var(--accent); + box-shadow: 0 0 0 3px var(--accent-dim); + } + + .label { font-size: .8rem; color: var(--text-dim); margin-bottom: .35rem; display: block; } + + .badge { + display: inline-flex; align-items: center; + padding: .15rem .55rem; + border-radius: 999px; + font-size: .72rem; font-weight: 600; + } + .badge-accent { background: var(--accent-dim); color: var(--accent); } + .badge-success { background: rgba(52, 211, 153, .12); color: var(--success); } + .badge-danger { background: rgba(248, 113, 113, .12); color: var(--danger); } + .badge-warning { background: rgba(251, 191, 36, .12); color: var(--warning); } + + .remark { font-size: .75rem; color: var(--text-faint); } + + .mono { font-family: "JetBrains Mono", "Fira Code", "Cascadia Code", Consolas, monospace; } + +/* 页面淡入(仅用 opacity:transform 会成为 position:fixed 后代的包含块,导致弹窗越界) */ +@keyframes fadeIn { + from { opacity: 0; } + to { opacity: 1; } +} +.page-fade { animation: fadeIn .35s ease both; } + +/* Alpine 初始化前隐藏 x-cloak 元素(避免弹窗闪现) */ +[x-cloak] { display: none !important; } + +/* 顶部导航布局(纯 CSS,不依赖 Tailwind 运行时) */ +.gp-header { + position: sticky; top: 0; z-index: 50; + background: rgba(15, 15, 17, .85); + backdrop-filter: blur(16px); + -webkit-backdrop-filter: blur(16px); + border-bottom: 1px solid var(--border); +} +.gp-header-inner { + max-width: 80rem; margin: 0 auto; padding: 0 1rem; + min-height: 3.5rem; + display: flex; align-items: center; gap: 1.5rem; +} +.gp-brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: 1rem; flex: none; } +.gp-logo { + width: 1.75rem; height: 1.75rem; border-radius: .5rem; + background: var(--accent); color: #06242b; + display: flex; align-items: center; justify-content: center; font-size: .875rem; +} +.gp-nav { display: flex; align-items: center; gap: .15rem; margin: 0; padding: 0; list-style: none; } +.gp-nav a { + display: inline-block; padding: .375rem .75rem; border-radius: .5rem; + font-size: .875rem; color: var(--text-dim); + white-space: nowrap; cursor: pointer; + transition: color .2s ease, background .2s ease; +} +.gp-nav a:hover { color: #fff; background: rgba(255, 255, 255, .04); } +.gp-nav a.is-active { background: var(--accent-dim); color: var(--accent); } +.gp-nav-desktop { display: none; } +.gp-nav-mobile { + gap: .25rem; padding: .35rem .75rem .5rem; + max-width: 80rem; margin: 0 auto; + overflow-x: auto; flex-wrap: nowrap; +} +.gp-nav-mobile a { font-size: .75rem; padding: .3rem .6rem; flex: none; } +@media (min-width: 768px) { + .gp-nav-desktop { display: flex; } + .gp-nav-mobile { display: none; } +} +.gp-userbar { margin-left: auto; display: flex; align-items: center; gap: .75rem; font-size: .875rem; flex: none; } +.gp-user-meta { display: none; align-items: center; gap: .75rem; color: var(--text-dim); } +.gp-username { color: var(--accent); } +.gp-logout { padding: .25rem .6rem; font-size: .75rem; } +@media (min-width: 640px) { + .gp-user-meta { display: flex; } +} + +/* 页面内容容器 */ +.gp-page { + max-width: 80rem; + width: 100%; + margin: 0 auto; + padding: 1.5rem 1rem 2rem; +} + +/* Toast */ +@keyframes toastIn { + from { opacity: 0; transform: translateY(-10px) scale(.98); } + to { opacity: 1; transform: translateY(0) scale(1); } +} +.toast { + position: fixed; top: 1.2rem; left: 50%; transform: translateX(-50%); + z-index: 9999; + padding: .7rem 1.2rem; + border-radius: 10px; + font-size: .875rem; + box-shadow: 0 8px 30px rgba(0,0,0,.5); + animation: toastIn .25s ease both; +} +.toast-success { background: rgba(52, 211, 153, .15); color: var(--success); border: 1px solid rgba(52, 211, 153, .35); } +.toast-error { background: rgba(248, 113, 113, .15); color: var(--danger); border: 1px solid rgba(248, 113, 113, .35); } + +/* 倒计时颜色渐变 */ +.countdown { font-variant-numeric: tabular-nums; letter-spacing: .02em; } + +/* 表格 */ +.table { width: 100%; border-collapse: collapse; } +.table th, .table td { padding: .7rem .8rem; text-align: left; border-bottom: 1px solid var(--border); font-size: .85rem; } +.table th { color: var(--text-dim); font-weight: 500; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; } +.table tr:hover td { background: rgba(255,255,255,.02); } + +/* 模态遮罩(fixed 相对视口:祖先不得残留非 none 的 transform) */ +.modal-mask { + position: fixed; inset: 0; background: rgba(0,0,0,.6); + backdrop-filter: blur(4px); + z-index: 1000; + display: flex; align-items: center; justify-content: center; + padding: 1rem; + overflow-y: auto; + animation: fadeIn .2s ease both; +} +.modal { + background: var(--bg-card); + border: 1px solid var(--border); + border-radius: 16px; + padding: 1.4rem; + width: 100%; max-width: 480px; + max-height: calc(100vh - 2rem); overflow-y: auto; + margin: auto; +} + +/* 移动端适配 */ +@media (max-width: 640px) { + .btn { padding: .5rem .85rem; font-size: .8rem; } +} diff --git a/target/classes/static/app.js b/target/classes/static/app.js new file mode 100644 index 0000000..325c779 --- /dev/null +++ b/target/classes/static/app.js @@ -0,0 +1,171 @@ +// GameParlor 前端公共脚本 +(function () { + const API_BASE = ''; + + // ---------- 存储 ---------- + const TOKEN_KEY = 'gp_token'; + const USER_KEY = 'gp_user'; + + window.GP = { + getToken() { return localStorage.getItem(TOKEN_KEY); }, + setToken(t) { localStorage.setItem(TOKEN_KEY, t); }, + clearAuth() { localStorage.removeItem(TOKEN_KEY); localStorage.removeItem(USER_KEY); }, + getUser() { + try { return JSON.parse(localStorage.getItem(USER_KEY) || 'null'); } + catch { return null; } + }, + setUser(u) { localStorage.setItem(USER_KEY, JSON.stringify(u)); }, + isAdmin() { const u = this.getUser(); return u && u.role === 'ADMIN'; }, + isMember() { const u = this.getUser(); return u && (u.role === 'MEMBER' || u.role === 'ADMIN'); }, + redirectLogin() { window.location.href = '/index.html'; }, + }; + + // ---------- API ---------- + async function api(path, options = {}) { + const headers = Object.assign({ 'Content-Type': 'application/json' }, options.headers || {}); + const token = GP.getToken(); + if (token) headers['Authorization'] = 'Bearer ' + token; + + const res = await fetch(API_BASE + path, Object.assign({ headers }, options)); + let body; + try { body = await res.json(); } catch { body = { code: 500, message: '网络错误' }; } + + if (body.code === 401) { + GP.clearAuth(); + GP.redirectLogin(); + throw new Error(body.message || '未登录'); + } + if (body.code !== 200) { + toast(body.message || '操作失败', 'error'); + throw new Error(body.message); + } + return body.data; + } + window.api = api; + + // ---------- Toast ---------- + let toastTimer = null; + function toast(message, type = 'success') { + const existing = document.querySelector('.toast'); + if (existing) existing.remove(); + const el = document.createElement('div'); + el.className = 'toast toast-' + type; + el.textContent = message; + document.body.appendChild(el); + clearTimeout(toastTimer); + toastTimer = setTimeout(() => el.remove(), 2200); + } + window.toast = toast; + + // ---------- 登出 ---------- + window.logout = async function () { + try { await api('/api/auth/logout', { method: 'POST' }); } catch {} + GP.clearAuth(); + GP.redirectLogin(); + }; + + // ---------- 工具 ---------- + window.fmtMoney = function (n) { + if (n == null) return '0.00'; + return Number(n).toFixed(2); + }; + window.fmtDateTime = function (s) { + if (!s) return '-'; + return s.replace('T', ' ').slice(0, 16); + }; + window.fmtDate = function (s) { + if (!s) return '-'; + return String(s).slice(0, 10); + }; + window.fmtDuration = function (seconds) { + if (seconds == null) return '00:00'; + const m = Math.floor(seconds / 60); + const s = seconds % 60; + return String(m).padStart(2, '0') + ':' + String(s).padStart(2, '0'); + }; + + // ---------- 布局骨架 ---------- + // 本脚本在 body 末尾以经典脚本方式加载,执行时 Alpine(defer) 尚未启动。 + // 在此同步完成 header/main 的 DOM 搭建,可避免 Alpine 启动后再移动节点 + // 触发 MutationObserver 而导致 x-init / initLayout 二次执行(顶部菜单重复的根因)。 + if (!document.body.classList.contains('gp-auth')) { + const header = document.createElement('header'); + header.className = 'gp-header'; + header.innerHTML = + '
' + + '
GameParlor
' + + '' + + '
' + + '
' + + ''; + + const main = document.createElement('main'); + main.className = 'gp-page page-fade'; + Array.from(document.body.children).forEach(c => main.appendChild(c)); + document.body.appendChild(header); + document.body.appendChild(main); + } + + // ---------- 顶部导航数据填充(Alpine 启动后调用,仅填充,不再移动 DOM) ---------- + window.initLayout = async function (active) { + if (window.__gpLayoutMe) return window.__gpLayoutMe; // 幂等,防止重复注入 + const me = await api('/api/user/me').catch(() => null); + if (!me) { GP.clearAuth(); GP.redirectLogin(); throw new Error('未登录'); } + GP.setUser(me); + window.__gpLayoutMe = me; + + const isAdmin = me.role === 'ADMIN'; + const isMember = me.role === 'MEMBER' || isAdmin; + + const navItems = isAdmin ? [ + { key: 'dashboard', label: '概览', href: '/admin/dashboard.html' }, + { key: 'devices', label: '设备', href: '/admin/devices.html' }, + { key: 'games', label: '游戏', href: '/admin/games.html' }, + { key: 'timeslots', label: '时长', href: '/admin/timeslots.html' }, + { key: 'snacks', label: '零食', href: '/admin/snacks.html' }, + { key: 'combos', label: '套餐', href: '/admin/combos.html' }, + { key: 'users', label: '用户', href: '/admin/users.html' }, + { key: 'recharge', label: '充值审批', href: '/admin/recharge.html' }, + ] : [ + { key: 'dashboard', label: '首页', href: '/player/dashboard.html' }, + { key: 'browse', label: '玩游戏', href: '/player/browse.html' }, + { key: 'combos', label: '套餐', href: '/player/combos.html' }, + ...(isMember ? [{ key: 'custom', label: '拼套餐', href: '/player/custom-combo.html' }] : []), + { key: 'snacks', label: '零食', href: '/player/snacks.html' }, + { key: 'recharge', label: '充值', href: '/player/recharge.html' }, + ...(isMember ? [{ key: 'points', label: '积分兑换', href: '/player/points.html' }] : []), + { key: 'history', label: '记录', href: '/player/history.html' }, + ]; + + const navHtml = navItems.map(n => + `${n.label}`).join(''); + document.querySelectorAll('[data-gp-nav]').forEach(el => { el.innerHTML = navHtml; }); + + const userbar = document.querySelector('[data-gp-userbar]'); + if (userbar) { + userbar.innerHTML = + '' + + '余额 ¥' + fmtMoney(me.balance) + '' + + (isMember ? '会员' : '') + + '★ ' + (me.points || 0) + '' + + '' + + '' + + ''; + userbar.querySelector('.gp-username').textContent = me.username; + } + return me; + }; + + + // ---------- 内联 SVG 图标 ---------- + const iconHome = ''; + const iconDevice = ''; + const iconGame = ''; + const iconClock = ''; + const iconSnack = ''; + const iconCombo = ''; + const iconUser = ''; + const iconWallet = ''; + const iconStar = ''; + const iconList = ''; +})(); diff --git a/target/classes/static/index.html b/target/classes/static/index.html new file mode 100644 index 0000000..8a9f73b --- /dev/null +++ b/target/classes/static/index.html @@ -0,0 +1,79 @@ + + + + + + GameParlor · 登录 + + + + + +
+
+
+
G
+
+

GameParlor

+

电玩店自助管理与消费系统

+
+
+ +
+ + +
+ +
+
+ + +
+
+ + +
+ +
+ +

默认管理员:admin / admin123

+
+
+ + + + + diff --git a/target/classes/static/js/vendor/alpine.min.js b/target/classes/static/js/vendor/alpine.min.js new file mode 100644 index 0000000..2ca4827 --- /dev/null +++ b/target/classes/static/js/vendor/alpine.min.js @@ -0,0 +1,5 @@ +(()=>{var rt=!1,nt=!1,U=[],it=-1;function qt(e){Cn(e)}function Cn(e){U.includes(e)||U.push(e),Tn()}function Ee(e){let t=U.indexOf(e);t!==-1&&t>it&&U.splice(t,1)}function Tn(){!nt&&!rt&&(rt=!0,queueMicrotask(Rn))}function Rn(){rt=!1,nt=!0;for(let e=0;ee.effect(t,{scheduler:r=>{ot?qt(r):r()}}),st=e.raw}function at(e){D=e}function Gt(e){let t=()=>{};return[n=>{let i=D(n);return e._x_effects||(e._x_effects=new Set,e._x_runEffects=()=>{e._x_effects.forEach(o=>o())}),e._x_effects.add(i),t=()=>{i!==void 0&&(e._x_effects.delete(i),L(i))},i},()=>{t()}]}function ve(e,t){let r=!0,n,i=D(()=>{let o=e();JSON.stringify(o),r?n=o:queueMicrotask(()=>{t(o,n),n=o}),r=!1});return()=>L(i)}var Jt=[],Yt=[],Xt=[];function Zt(e){Xt.push(e)}function ee(e,t){typeof t=="function"?(e._x_cleanups||(e._x_cleanups=[]),e._x_cleanups.push(t)):(t=e,Yt.push(t))}function Ae(e){Jt.push(e)}function Oe(e,t,r){e._x_attributeCleanups||(e._x_attributeCleanups={}),e._x_attributeCleanups[t]||(e._x_attributeCleanups[t]=[]),e._x_attributeCleanups[t].push(r)}function ct(e,t){e._x_attributeCleanups&&Object.entries(e._x_attributeCleanups).forEach(([r,n])=>{(t===void 0||t.includes(r))&&(n.forEach(i=>i()),delete e._x_attributeCleanups[r])})}function Qt(e){if(e._x_cleanups)for(;e._x_cleanups.length;)e._x_cleanups.pop()()}var lt=new MutationObserver(pt),ut=!1;function le(){lt.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0}),ut=!0}function ft(){Mn(),lt.disconnect(),ut=!1}var ce=[];function Mn(){let e=lt.takeRecords();ce.push(()=>e.length>0&&pt(e));let t=ce.length;queueMicrotask(()=>{if(ce.length===t)for(;ce.length>0;)ce.shift()()})}function _(e){if(!ut)return e();ft();let t=e();return le(),t}var dt=!1,Se=[];function er(){dt=!0}function tr(){dt=!1,pt(Se),Se=[]}function pt(e){if(dt){Se=Se.concat(e);return}let t=new Set,r=new Set,n=new Map,i=new Map;for(let o=0;os.nodeType===1&&t.add(s)),e[o].removedNodes.forEach(s=>s.nodeType===1&&r.add(s))),e[o].type==="attributes")){let s=e[o].target,a=e[o].attributeName,c=e[o].oldValue,l=()=>{n.has(s)||n.set(s,[]),n.get(s).push({name:a,value:s.getAttribute(a)})},u=()=>{i.has(s)||i.set(s,[]),i.get(s).push(a)};s.hasAttribute(a)&&c===null?l():s.hasAttribute(a)?(u(),l()):u()}i.forEach((o,s)=>{ct(s,o)}),n.forEach((o,s)=>{Jt.forEach(a=>a(s,o))});for(let o of r)t.has(o)||Yt.forEach(s=>s(o));t.forEach(o=>{o._x_ignoreSelf=!0,o._x_ignore=!0});for(let o of t)r.has(o)||o.isConnected&&(delete o._x_ignoreSelf,delete o._x_ignore,Xt.forEach(s=>s(o)),o._x_ignore=!0,o._x_ignoreSelf=!0);t.forEach(o=>{delete o._x_ignoreSelf,delete o._x_ignore}),t=null,r=null,n=null,i=null}function Ce(e){return F(j(e))}function P(e,t,r){return e._x_dataStack=[t,...j(r||e)],()=>{e._x_dataStack=e._x_dataStack.filter(n=>n!==t)}}function j(e){return e._x_dataStack?e._x_dataStack:typeof ShadowRoot=="function"&&e instanceof ShadowRoot?j(e.host):e.parentNode?j(e.parentNode):[]}function F(e){return new Proxy({objects:e},Nn)}var Nn={ownKeys({objects:e}){return Array.from(new Set(e.flatMap(t=>Object.keys(t))))},has({objects:e},t){return t==Symbol.unscopables?!1:e.some(r=>Object.prototype.hasOwnProperty.call(r,t)||Reflect.has(r,t))},get({objects:e},t,r){return t=="toJSON"?Dn:Reflect.get(e.find(n=>Reflect.has(n,t))||{},t,r)},set({objects:e},t,r,n){let i=e.find(s=>Object.prototype.hasOwnProperty.call(s,t))||e[e.length-1],o=Object.getOwnPropertyDescriptor(i,t);return o?.set&&o?.get?o.set.call(n,r)||!0:Reflect.set(i,t,r)}};function Dn(){return Reflect.ownKeys(this).reduce((t,r)=>(t[r]=Reflect.get(this,r),t),{})}function Te(e){let t=n=>typeof n=="object"&&!Array.isArray(n)&&n!==null,r=(n,i="")=>{Object.entries(Object.getOwnPropertyDescriptors(n)).forEach(([o,{value:s,enumerable:a}])=>{if(a===!1||s===void 0||typeof s=="object"&&s!==null&&s.__v_skip)return;let c=i===""?o:`${i}.${o}`;typeof s=="object"&&s!==null&&s._x_interceptor?n[o]=s.initialize(e,c,o):t(s)&&s!==n&&!(s instanceof Element)&&r(s,c)})};return r(e)}function Re(e,t=()=>{}){let r={initialValue:void 0,_x_interceptor:!0,initialize(n,i,o){return e(this.initialValue,()=>Pn(n,i),s=>mt(n,i,s),i,o)}};return t(r),n=>{if(typeof n=="object"&&n!==null&&n._x_interceptor){let i=r.initialize.bind(r);r.initialize=(o,s,a)=>{let c=n.initialize(o,s,a);return r.initialValue=c,i(o,s,a)}}else r.initialValue=n;return r}}function Pn(e,t){return t.split(".").reduce((r,n)=>r[n],e)}function mt(e,t,r){if(typeof t=="string"&&(t=t.split(".")),t.length===1)e[t[0]]=r;else{if(t.length===0)throw error;return e[t[0]]||(e[t[0]]={}),mt(e[t[0]],t.slice(1),r)}}var rr={};function y(e,t){rr[e]=t}function ue(e,t){return Object.entries(rr).forEach(([r,n])=>{let i=null;function o(){if(i)return i;{let[s,a]=_t(t);return i={interceptor:Re,...s},ee(t,a),i}}Object.defineProperty(e,`$${r}`,{get(){return n(t,o())},enumerable:!1})}),e}function nr(e,t,r,...n){try{return r(...n)}catch(i){te(i,e,t)}}function te(e,t,r=void 0){e=Object.assign(e??{message:"No error message given."},{el:t,expression:r}),console.warn(`Alpine Expression Error: ${e.message} + +${r?'Expression: "'+r+`" + +`:""}`,t),setTimeout(()=>{throw e},0)}var Me=!0;function De(e){let t=Me;Me=!1;let r=e();return Me=t,r}function M(e,t,r={}){let n;return x(e,t)(i=>n=i,r),n}function x(...e){return ir(...e)}var ir=gt;function or(e){ir=e}function gt(e,t){let r={};ue(r,e);let n=[r,...j(e)],i=typeof t=="function"?In(n,t):Ln(n,t,e);return nr.bind(null,e,t,i)}function In(e,t){return(r=()=>{},{scope:n={},params:i=[]}={})=>{let o=t.apply(F([n,...e]),i);Ne(r,o)}}var ht={};function kn(e,t){if(ht[e])return ht[e];let r=Object.getPrototypeOf(async function(){}).constructor,n=/^[\n\s]*if.*\(.*\)/.test(e.trim())||/^(let|const)\s/.test(e.trim())?`(async()=>{ ${e} })()`:e,o=(()=>{try{let s=new r(["__self","scope"],`with (scope) { __self.result = ${n} }; __self.finished = true; return __self.result;`);return Object.defineProperty(s,"name",{value:`[Alpine] ${e}`}),s}catch(s){return te(s,t,e),Promise.resolve()}})();return ht[e]=o,o}function Ln(e,t,r){let n=kn(t,r);return(i=()=>{},{scope:o={},params:s=[]}={})=>{n.result=void 0,n.finished=!1;let a=F([o,...e]);if(typeof n=="function"){let c=n(n,a).catch(l=>te(l,r,t));n.finished?(Ne(i,n.result,a,s,r),n.result=void 0):c.then(l=>{Ne(i,l,a,s,r)}).catch(l=>te(l,r,t)).finally(()=>n.result=void 0)}}}function Ne(e,t,r,n,i){if(Me&&typeof t=="function"){let o=t.apply(r,n);o instanceof Promise?o.then(s=>Ne(e,s,r,n)).catch(s=>te(s,i,t)):e(o)}else typeof t=="object"&&t instanceof Promise?t.then(o=>e(o)):e(t)}var bt="x-";function C(e=""){return bt+e}function sr(e){bt=e}var Pe={};function d(e,t){return Pe[e]=t,{before(r){if(!Pe[r]){console.warn(String.raw`Cannot find directive \`${r}\`. \`${e}\` will use the default order of execution`);return}let n=W.indexOf(r);W.splice(n>=0?n:W.indexOf("DEFAULT"),0,e)}}}function ar(e){return Object.keys(Pe).includes(e)}function de(e,t,r){if(t=Array.from(t),e._x_virtualDirectives){let o=Object.entries(e._x_virtualDirectives).map(([a,c])=>({name:a,value:c})),s=wt(o);o=o.map(a=>s.find(c=>c.name===a.name)?{name:`x-bind:${a.name}`,value:`"${a.value}"`}:a),t=t.concat(o)}let n={};return t.map(ur((o,s)=>n[o]=s)).filter(dr).map(jn(n,r)).sort(Fn).map(o=>$n(e,o))}function wt(e){return Array.from(e).map(ur()).filter(t=>!dr(t))}var xt=!1,fe=new Map,cr=Symbol();function lr(e){xt=!0;let t=Symbol();cr=t,fe.set(t,[]);let r=()=>{for(;fe.get(t).length;)fe.get(t).shift()();fe.delete(t)},n=()=>{xt=!1,r()};e(r),n()}function _t(e){let t=[],r=a=>t.push(a),[n,i]=Gt(e);return t.push(i),[{Alpine:B,effect:n,cleanup:r,evaluateLater:x.bind(x,e),evaluate:M.bind(M,e)},()=>t.forEach(a=>a())]}function $n(e,t){let r=()=>{},n=Pe[t.type]||r,[i,o]=_t(e);Oe(e,t.original,o);let s=()=>{e._x_ignore||e._x_ignoreSelf||(n.inline&&n.inline(e,t,i),n=n.bind(n,e,t,i),xt?fe.get(cr).push(n):n())};return s.runCleanups=o,s}var Ie=(e,t)=>({name:r,value:n})=>(r.startsWith(e)&&(r=r.replace(e,t)),{name:r,value:n}),ke=e=>e;function ur(e=()=>{}){return({name:t,value:r})=>{let{name:n,value:i}=fr.reduce((o,s)=>s(o),{name:t,value:r});return n!==t&&e(n,t),{name:n,value:i}}}var fr=[];function re(e){fr.push(e)}function dr({name:e}){return pr().test(e)}var pr=()=>new RegExp(`^${bt}([^:^.]+)\\b`);function jn(e,t){return({name:r,value:n})=>{let i=r.match(pr()),o=r.match(/:([a-zA-Z0-9\-_:]+)/),s=r.match(/\.[^.\]]+(?=[^\]]*$)/g)||[],a=t||e[r]||r;return{type:i?i[1]:null,value:o?o[1]:null,modifiers:s.map(c=>c.replace(".","")),expression:n,original:a}}}var yt="DEFAULT",W=["ignore","ref","data","id","anchor","bind","init","for","model","modelable","transition","show","if",yt,"teleport"];function Fn(e,t){let r=W.indexOf(e.type)===-1?yt:e.type,n=W.indexOf(t.type)===-1?yt:t.type;return W.indexOf(r)-W.indexOf(n)}function G(e,t,r={}){e.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0,composed:!0,cancelable:!0}))}function T(e,t){if(typeof ShadowRoot=="function"&&e instanceof ShadowRoot){Array.from(e.children).forEach(i=>T(i,t));return}let r=!1;if(t(e,()=>r=!0),r)return;let n=e.firstElementChild;for(;n;)T(n,t,!1),n=n.nextElementSibling}function E(e,...t){console.warn(`Alpine Warning: ${e}`,...t)}var mr=!1;function _r(){mr&&E("Alpine has already been initialized on this page. Calling Alpine.start() more than once can cause problems."),mr=!0,document.body||E("Unable to initialize. Trying to load Alpine before `` is available. Did you forget to add `defer` in Alpine's ` + + + +

玩游戏

+ +
+ + + +
+ + +
+ +
+ +
+ +
暂无游戏
+
+ + + + + + + + diff --git a/target/classes/static/player/combos.html b/target/classes/static/player/combos.html new file mode 100644 index 0000000..51bd36d --- /dev/null +++ b/target/classes/static/player/combos.html @@ -0,0 +1,63 @@ + + + + + + 套餐 · GameParlor + + + + + +

套餐

+
+ +
+ + + + + + + diff --git a/target/classes/static/player/custom-combo.html b/target/classes/static/player/custom-combo.html new file mode 100644 index 0000000..42b263e --- /dev/null +++ b/target/classes/static/player/custom-combo.html @@ -0,0 +1,105 @@ + + + + + + 自定义拼套餐 · GameParlor + + + + + +

自定义拼套餐

+

仅会员可用。自由勾选项目,享会员专属折扣。

+ +
+
+ +
+

游戏

+
+ +
+
+ +
+

时长

+
+ +
+
+ +
+

零食饮料

+
+ +
+
+
+ + +
+
+

结算

+
已选 项
+
会员折扣率:
+
+ +
+
+
+ + + + + diff --git a/target/classes/static/player/dashboard.html b/target/classes/static/player/dashboard.html new file mode 100644 index 0000000..56ce39d --- /dev/null +++ b/target/classes/static/player/dashboard.html @@ -0,0 +1,101 @@ + + + + + + 首页 · GameParlor + + + + + +

欢迎回来

+ + +
+
+
+
正在游玩
+
+
+
+
剩余时间
+
+
+
+
+ + +
+
+ + +
+
+
钱包余额
+
+
+
+
积分(累计消费)
+
+
+
+
会员到期
+
+
+
+
角色
+
+
+
+ + +
+

最近订单

+
+ +
暂无订单
+
+
+ + + + + diff --git a/target/classes/static/player/history.html b/target/classes/static/player/history.html new file mode 100644 index 0000000..99fc46c --- /dev/null +++ b/target/classes/static/player/history.html @@ -0,0 +1,92 @@ + + + + + + 历史记录 · GameParlor + + + + + +

历史记录

+
+ + + +
+ +
+ + + + + + +
订单号金额状态时间
暂无订单
+
+ +
+ + + + + + +
类型金额备注时间
暂无记录
+
+ +
+ + + + + + +
金额授权码状态时间
暂无记录
+
+ + + + + diff --git a/target/classes/static/player/points.html b/target/classes/static/player/points.html new file mode 100644 index 0000000..74fc15f --- /dev/null +++ b/target/classes/static/player/points.html @@ -0,0 +1,63 @@ + + + + + + 积分兑换 · GameParlor + + + + + +
+

积分兑换

+
我的积分:
+
+

兑换比例: 积分 = 1 元(按商品原价换算)

+ +
+ +
+ + + + + diff --git a/target/classes/static/player/recharge.html b/target/classes/static/player/recharge.html new file mode 100644 index 0000000..0f58767 --- /dev/null +++ b/target/classes/static/player/recharge.html @@ -0,0 +1,65 @@ + + + + + + 自助充值 · GameParlor + + + + + +

自助充值

+
+
+

提交充值申请

+
+
+ + +
+ +
+
+
请向管理员出示授权码
+
+
管理员审批通过后余额自动到账
+
+
+
+

我的充值记录

+
+ +
暂无记录
+
+
+
+ + + + diff --git a/target/classes/static/player/snacks.html b/target/classes/static/player/snacks.html new file mode 100644 index 0000000..0986362 --- /dev/null +++ b/target/classes/static/player/snacks.html @@ -0,0 +1,70 @@ + + + + + + 零食饮料 · GameParlor + + + + + +
+

零食饮料

+ +
+
+ +
+ + + + + diff --git a/target/gameparlor-1.0.0.jar b/target/gameparlor-1.0.0.jar new file mode 100644 index 0000000..81eeb48 Binary files /dev/null and b/target/gameparlor-1.0.0.jar differ diff --git a/target/gameparlor-1.0.0.jar.original b/target/gameparlor-1.0.0.jar.original new file mode 100644 index 0000000..54486db Binary files /dev/null and b/target/gameparlor-1.0.0.jar.original differ diff --git a/target/maven-archiver/pom.properties b/target/maven-archiver/pom.properties new file mode 100644 index 0000000..1f6aefb --- /dev/null +++ b/target/maven-archiver/pom.properties @@ -0,0 +1,3 @@ +artifactId=gameparlor +groupId=com.gameparlor +version=1.0.0 diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..70c4dbb --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,93 @@ +com\gameparlor\controller\TimeSlotController.class +com\gameparlor\repository\RechargeApprovalRepository.class +com\gameparlor\entity\enums\TxType.class +com\gameparlor\controller\SnackController.class +com\gameparlor\entity\enums\OrderStatus.class +com\gameparlor\config\DataInitializer.class +com\gameparlor\controller\OrderController$StartGameForm.class +com\gameparlor\controller\OrderController.class +com\gameparlor\controller\admin\AdminSnackController.class +com\gameparlor\controller\MemberController$ExchangeForm.class +com\gameparlor\controller\RechargeController.class +com\gameparlor\repository\ComboItemRepository.class +com\gameparlor\service\ConfigService.class +com\gameparlor\controller\ComboController.class +com\gameparlor\entity\TimeSlot.class +com\gameparlor\repository\ComboRepository.class +com\gameparlor\controller\admin\AdminComboController.class +com\gameparlor\repository\OrderRepository.class +com\gameparlor\common\TokenStore$TokenInfo.class +com\gameparlor\controller\MemberController$CustomComboForm.class +com\gameparlor\GameParlorApplication.class +com\gameparlor\entity\enums\ComboType.class +com\gameparlor\entity\OrderItem.class +com\gameparlor\controller\OrderController$RenewForm.class +com\gameparlor\common\WebMvcConfig.class +com\gameparlor\controller\GameController.class +com\gameparlor\entity\enums\ItemType.class +com\gameparlor\controller\HistoryController.class +com\gameparlor\entity\Game.class +com\gameparlor\repository\SnackRepository.class +com\gameparlor\service\ComboService.class +com\gameparlor\entity\enums\SnackType.class +com\gameparlor\entity\TransactionLog.class +com\gameparlor\controller\admin\AdminGameController$GameForm.class +com\gameparlor\common\GlobalExceptionHandler.class +com\gameparlor\repository\GameRepository.class +com\gameparlor\repository\UserRepository.class +com\gameparlor\repository\TimeSlotRepository.class +com\gameparlor\entity\Order.class +com\gameparlor\service\MemberService.class +com\gameparlor\controller\admin\AdminDeviceController$DeviceForm.class +com\gameparlor\common\UserContext.class +com\gameparlor\controller\UserController.class +com\gameparlor\controller\admin\AdminRechargeController.class +com\gameparlor\controller\admin\AdminTimeSlotController$SlotForm.class +com\gameparlor\controller\admin\AdminComboController$ItemForm.class +com\gameparlor\entity\SystemConfig.class +com\gameparlor\service\WalletService.class +com\gameparlor\service\MemberService$1.class +com\gameparlor\entity\enums\Role.class +com\gameparlor\controller\admin\AdminDeviceController.class +com\gameparlor\entity\enums\RechargeStatus.class +com\gameparlor\service\OrderService$SnackItem.class +com\gameparlor\service\MemberService$CustomItem.class +com\gameparlor\controller\AuthController.class +com\gameparlor\repository\TransactionLogRepository.class +com\gameparlor\service\UserService.class +com\gameparlor\controller\admin\AdminRechargeController$ApproveForm.class +com\gameparlor\repository\DeviceRepository.class +com\gameparlor\service\ComboService$1.class +com\gameparlor\entity\Combo.class +com\gameparlor\controller\admin\AdminUserController.class +com\gameparlor\controller\admin\AdminUserController$UserForm.class +com\gameparlor\controller\admin\AdminConfigController.class +com\gameparlor\controller\MemberController.class +com\gameparlor\service\SpringContext.class +com\gameparlor\entity\RechargeApproval.class +com\gameparlor\service\OrderService.class +com\gameparlor\repository\OrderItemRepository.class +com\gameparlor\repository\SystemConfigRepository.class +com\gameparlor\entity\Device.class +com\gameparlor\service\RechargeService.class +com\gameparlor\controller\OrderController$SnackListForm.class +com\gameparlor\common\Result.class +com\gameparlor\common\BusinessException.class +com\gameparlor\controller\admin\AdminSnackController$SnackForm.class +com\gameparlor\controller\admin\AdminComboController$ComboForm.class +com\gameparlor\common\ResultCode.class +com\gameparlor\controller\DeviceController.class +com\gameparlor\controller\admin\AdminTimeSlotController.class +com\gameparlor\common\AuthInterceptor.class +com\gameparlor\config\JacksonConfig.class +com\gameparlor\controller\AuthController$AuthRequest.class +com\gameparlor\service\AuthService.class +com\gameparlor\controller\ConfigController.class +com\gameparlor\controller\admin\AdminGameController.class +com\gameparlor\entity\User.class +com\gameparlor\controller\admin\AdminStatsController.class +com\gameparlor\entity\ComboItem.class +com\gameparlor\common\TokenStore.class +com\gameparlor\controller\RechargeController$RechargeForm.class +com\gameparlor\entity\Snack.class +com\gameparlor\scheduler\CountdownScheduler.class diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..df328ef --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,73 @@ +D:\GameParlor\src\main\java\com\gameparlor\common\AuthInterceptor.java +D:\GameParlor\src\main\java\com\gameparlor\common\BusinessException.java +D:\GameParlor\src\main\java\com\gameparlor\common\GlobalExceptionHandler.java +D:\GameParlor\src\main\java\com\gameparlor\common\Result.java +D:\GameParlor\src\main\java\com\gameparlor\common\ResultCode.java +D:\GameParlor\src\main\java\com\gameparlor\common\TokenStore.java +D:\GameParlor\src\main\java\com\gameparlor\common\UserContext.java +D:\GameParlor\src\main\java\com\gameparlor\common\WebMvcConfig.java +D:\GameParlor\src\main\java\com\gameparlor\config\DataInitializer.java +D:\GameParlor\src\main\java\com\gameparlor\config\JacksonConfig.java +D:\GameParlor\src\main\java\com\gameparlor\controller\admin\AdminComboController.java +D:\GameParlor\src\main\java\com\gameparlor\controller\admin\AdminConfigController.java +D:\GameParlor\src\main\java\com\gameparlor\controller\admin\AdminDeviceController.java +D:\GameParlor\src\main\java\com\gameparlor\controller\admin\AdminGameController.java +D:\GameParlor\src\main\java\com\gameparlor\controller\admin\AdminRechargeController.java +D:\GameParlor\src\main\java\com\gameparlor\controller\admin\AdminSnackController.java +D:\GameParlor\src\main\java\com\gameparlor\controller\admin\AdminStatsController.java +D:\GameParlor\src\main\java\com\gameparlor\controller\admin\AdminTimeSlotController.java +D:\GameParlor\src\main\java\com\gameparlor\controller\admin\AdminUserController.java +D:\GameParlor\src\main\java\com\gameparlor\controller\AuthController.java +D:\GameParlor\src\main\java\com\gameparlor\controller\ComboController.java +D:\GameParlor\src\main\java\com\gameparlor\controller\ConfigController.java +D:\GameParlor\src\main\java\com\gameparlor\controller\DeviceController.java +D:\GameParlor\src\main\java\com\gameparlor\controller\GameController.java +D:\GameParlor\src\main\java\com\gameparlor\controller\HistoryController.java +D:\GameParlor\src\main\java\com\gameparlor\controller\MemberController.java +D:\GameParlor\src\main\java\com\gameparlor\controller\OrderController.java +D:\GameParlor\src\main\java\com\gameparlor\controller\RechargeController.java +D:\GameParlor\src\main\java\com\gameparlor\controller\SnackController.java +D:\GameParlor\src\main\java\com\gameparlor\controller\TimeSlotController.java +D:\GameParlor\src\main\java\com\gameparlor\controller\UserController.java +D:\GameParlor\src\main\java\com\gameparlor\entity\Combo.java +D:\GameParlor\src\main\java\com\gameparlor\entity\ComboItem.java +D:\GameParlor\src\main\java\com\gameparlor\entity\Device.java +D:\GameParlor\src\main\java\com\gameparlor\entity\enums\ComboType.java +D:\GameParlor\src\main\java\com\gameparlor\entity\enums\ItemType.java +D:\GameParlor\src\main\java\com\gameparlor\entity\enums\OrderStatus.java +D:\GameParlor\src\main\java\com\gameparlor\entity\enums\RechargeStatus.java +D:\GameParlor\src\main\java\com\gameparlor\entity\enums\Role.java +D:\GameParlor\src\main\java\com\gameparlor\entity\enums\SnackType.java +D:\GameParlor\src\main\java\com\gameparlor\entity\enums\TxType.java +D:\GameParlor\src\main\java\com\gameparlor\entity\Game.java +D:\GameParlor\src\main\java\com\gameparlor\entity\Order.java +D:\GameParlor\src\main\java\com\gameparlor\entity\OrderItem.java +D:\GameParlor\src\main\java\com\gameparlor\entity\RechargeApproval.java +D:\GameParlor\src\main\java\com\gameparlor\entity\Snack.java +D:\GameParlor\src\main\java\com\gameparlor\entity\SystemConfig.java +D:\GameParlor\src\main\java\com\gameparlor\entity\TimeSlot.java +D:\GameParlor\src\main\java\com\gameparlor\entity\TransactionLog.java +D:\GameParlor\src\main\java\com\gameparlor\entity\User.java +D:\GameParlor\src\main\java\com\gameparlor\GameParlorApplication.java +D:\GameParlor\src\main\java\com\gameparlor\repository\ComboItemRepository.java +D:\GameParlor\src\main\java\com\gameparlor\repository\ComboRepository.java +D:\GameParlor\src\main\java\com\gameparlor\repository\DeviceRepository.java +D:\GameParlor\src\main\java\com\gameparlor\repository\GameRepository.java +D:\GameParlor\src\main\java\com\gameparlor\repository\OrderItemRepository.java +D:\GameParlor\src\main\java\com\gameparlor\repository\OrderRepository.java +D:\GameParlor\src\main\java\com\gameparlor\repository\RechargeApprovalRepository.java +D:\GameParlor\src\main\java\com\gameparlor\repository\SnackRepository.java +D:\GameParlor\src\main\java\com\gameparlor\repository\SystemConfigRepository.java +D:\GameParlor\src\main\java\com\gameparlor\repository\TimeSlotRepository.java +D:\GameParlor\src\main\java\com\gameparlor\repository\TransactionLogRepository.java +D:\GameParlor\src\main\java\com\gameparlor\repository\UserRepository.java +D:\GameParlor\src\main\java\com\gameparlor\scheduler\CountdownScheduler.java +D:\GameParlor\src\main\java\com\gameparlor\service\AuthService.java +D:\GameParlor\src\main\java\com\gameparlor\service\ComboService.java +D:\GameParlor\src\main\java\com\gameparlor\service\ConfigService.java +D:\GameParlor\src\main\java\com\gameparlor\service\MemberService.java +D:\GameParlor\src\main\java\com\gameparlor\service\OrderService.java +D:\GameParlor\src\main\java\com\gameparlor\service\RechargeService.java +D:\GameParlor\src\main\java\com\gameparlor\service\SpringContext.java +D:\GameParlor\src\main\java\com\gameparlor\service\UserService.java +D:\GameParlor\src\main\java\com\gameparlor\service\WalletService.java diff --git a/需求文档.md b/需求文档.md new file mode 100644 index 0000000..6facdb9 --- /dev/null +++ b/需求文档.md @@ -0,0 +1,122 @@ +# 项目名称:GameParlor 电玩店自助管理与消费系统 + +## 技术栈与部署约束 +- **后端**:Spring Boot 3.x(Java17) + Spring Data JPA + MySQL 5.X +- **前端**:HTML5 + Tailwind CSS 3.x + Alpine.js(绝对禁止使用框架和CDN)。所有前端文件放置在 `src/main/resources/static/` 目录下。 +- **构建工具**:Maven +- **UI 要求**: + - 整体风格:现代、轻拟物、高质感。参考 Arc Browser 或 Linear App 的视觉语言。 + - 色彩方案:深色背景为主(#0f0f11),辅以霓虹蓝 (#00d4ff) 作为强调色。 + - 交互反馈:按钮点击有微动效(如缩放 0.95)、卡片悬停有上浮阴影、页面切换使用淡入淡出过渡。 + - **严格禁止**:使用 Bootstrap 默认样式、圆角矩形加纯色块的无脑布局、过大的图标库。拒绝“AI 味 UI”。 + +## 一、核心数据模型与关系 + +### 实体定义 +1. **Device (游戏设备)**:id, name, description, remark (备注), createdAt +2. **Game (游戏)**:id, name, description, remark, isUniversal (是否为通用游戏), deviceId (若不为通用游戏则必填外键) +3. **Snack (零食/饮料)**:id, name, price, type (SNACK/DRINK), remark +4. **TimeSlot (游玩时长选项)**:id, durationMinutes (时长分钟数), basePrice (基础单价), createdAt (由管理员创建) +5. **Combo (套餐)**:id, name, type (VIP / DEVICE_GAME / SNACK_DRINK), discountRate (打折率,如 0.85), isActive, createdAt +6. **ComboItem (套餐组成项)**:id, comboId, itemType (GAME / DEVICE / SNACK / TIMESLOT), itemId, quantity, unitPriceAtCreation (加入套餐时的单项单价,用于后续打折计算) +7. **User (用户)**:id, username, password(密码应当使用明文密码), role (PLAYER / MEMBER / ADMIN), balance (钱包余额), memberExpireDate, points (积分), createdAt +8. **Order (订单)**:id, userId, totalAmount, status (PAID / CANCELLED), createdAt +9. **OrderItem (订单项)**:id, orderId, itemType, itemId, startTime, endTime, quantity +10. **TransactionLog (交易日志)**:id, userId, type (RECHARGE / CONSUME / REFUND), amount, remark, createdAt +11. **RechargeApproval (充值审批)**:id, userId, amount, authCode (管理员授权码), status (PENDING / APPROVED / REJECTED), createdAt + +### 关系说明 +- Device 1:N Game +- Combo 1:N ComboItem +- User 1:N Order 1:N OrderItem +- User 1:N TransactionLog +- Admin 可创建 RechargeApproval 记录 + +## 二、功能模块详解 + +### 模块 1:管理员后台管理 +- **设备管理**:增删改查 Device。支持添加备注。 +- **游戏管理**:增删改查 Game。可设置是否为“通用游戏”。若是通用游戏,则无需绑定设备;但在玩家端展示时,必须在游戏名称下方以小字灰色显示备注内容(例如“运行设备:PS5”)。 +- **时长管理**:增删改查 TimeSlot。管理员设定可选的游玩时长及其单价。 +- **套餐管理**: + - 创建 Combo,选择类型(VIP / DEVICE_GAME)。 + - 向 Combo 中添加 ComboItem。支持添加 Game、Device、Snack、TimeSlot。 + - 设置该套餐的全局打折率 discountRate。 + - VIP 套餐的计费方式:将套餐内所有 ComboItem 的 `unitPriceAtCreation * quantity` 求和,再乘以 `discountRate`。 +- **用户管理**:管理员可查看、编辑、删除所有用户。可强制修改余额、密码、角色。可为普通用户直接设置会员到期日(memberExpireDate)。 +- **充值审批**:查看待审批的充值请求,输入授权码完成批准或拒绝。 + +### 模块 2:玩家端功能 +- **注册与登录**:支持用户名密码注册。注册时默认为 PLAYER 角色。 +- **首页仪表盘**: + - 显示当前正在进行的游戏倒计时(如果有)。 + - 显示最近一笔订单状态。 + - 显示钱包余额与会员到期日。 +- **自助选购流程**: + 1. 玩家选择“按设备浏览”或“按游戏浏览”。 + 2. 选择具体游戏后,弹出窗口:选择时长(TimeSlot),确认价格。 + 3. 点击“开始游玩”,扣除余额,创建订单,启动倒计时。 + 4. 倒计时结束后,自动标记订单完成。玩家也可在倒计时结束前点击“续费”,延长时长。 +- **套餐购买**: + - 浏览可用套餐列表。 + - 点击套餐,查看详情(包含哪些 Game、Snack、时长等)。 + - 确认购买,扣款,生成订单。 +- **会员专享:自定义拼套餐**: + - 仅 MEMBER 角色可见此入口。 + - 玩家从可选的 Device、Game、Snack、TimeSlot 列表中自由勾选。 + - 系统实时计算:所选各项的“会员单价”(由管理员预设)之和 × 会员专属折扣率(系统固定值)。 + - 确认后下单。 +- **零食饮料单独购买**:独立页面,展示 Snack 列表,加入购物车,统一结算。 +- **自助充值**: + - 玩家提交充值申请,填写金额。 + - 系统生成一条 PENDING 状态的 RechargeApproval 记录。 + - 玩家需向管理员出示申请记录,获取授权码并填入系统。 + - 管理员在后台审核通过后,余额增加。 +- **积分兑换**: + - 会员玩家可使用积分兑换 TimeSlot、Snack、Combo。 + - 兑换比例由管理员在后台设定(例如 100 积分 = 1 元)。 +- **历史记录**:查看个人订单历史、消费明细、充值记录。 + +### 模块 3:公共功能 +- **钱包系统**:所有交易实时更新余额,并发控制防止超扣。 +- **倒计时引擎**:后端定时任务每分钟检查一次,若有进行中的订单且当前时间 >= endTime,则自动标记完成。前端每 10 秒轮询一次获取剩余秒数。 +- **备注显示**:所有 Device、Game、Snack 在列表页均直接显示 remark 字段(小字灰色),无需点击详情。 + +## 三、权限矩阵 +| 功能 | 管理员 | 会员玩家 | 普通玩家 | +|------|--------|----------|----------| +| 管理设备/游戏/时长/套餐 | ✅ | ❌ | ❌ | +| 管理所有用户 | ✅ | ❌ | ❌ | +| 购买游戏/套餐 | ❌ | ✅ | ✅ | +| 自定义拼套餐 | ❌ | ✅ | ❌ | +| 积分兑换 | ❌ | ✅ | ❌ | +| 自助充值(需授权码) | ❌ | ✅ | ✅ | +| 查看历史记录 | ✅(所有人) | ✅(自己) | ✅(自己) | + +## 四、API 接口设计(示例,非全部) +- POST /api/auth/login +- POST /api/auth/register +- GET /api/devices +- POST /api/admin/devices +- PUT /api/admin/devices/{id} +- DELETE /api/admin/devices/{id} +- GET /api/games?deviceId=xxx +- POST /api/orders (body: {gameId, timeSlotId}) +- POST /api/orders/renew (body: {orderId, additionalMinutes}) +- POST /api/recharge/request (body: {amount}) +- POST /api/recharge/approve (body: {requestId, authCode}) +- GET /api/orders/active (返回当前进行中的订单及剩余秒数) +- GET /api/member/custom-combo/price (body: {itemIds[]}, 返回实时计算价格) +- POST /api/member/custom-combo/purchase (body: {itemIds[]}) + +## 五、错误处理与健壮性要求 +- 所有接口需做参数校验,返回统一 JSON 格式:{code, message, data} +- 余额不足时返回 code 4001,前端弹窗提示。 +- 并发场景:使用乐观锁(@Version)防止余额超扣。 +- 数据库索引:user_id, order_status, game_device_id 等高频查询字段。 + +## 六、UI 与交互补充说明 +- 所有列表页支持分页(每页 10 条)。 +- 所有表单提交成功后有 toast 提示(绿色),失败有红色提示。 +- 倒计时数字使用等宽字体,每秒跳动一次,颜色从绿渐变到红(剩余 < 5 分钟时)。 +- 移动端适配:至少保证 375px 宽度以上正常显示。 \ No newline at end of file