Files
lottery/docs/DEV-README.md
T
feng0207 3fc4dcc777 initial commit: lottery 项目集(三工程统一管理)
- apps/lotteryServer, lotteryCapture, lotteryOpen 三个业务工程
- 忽略 archive/, tools/, infra/data/ 大目录与敏感配置文件
- 移除 lotteryServer 原嵌套 git,并入顶层统一管理
2026-09-17 19:03:32 +08:00

38 lines
2.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# lotteryServer(原 nine_surplus)本地开发环境
## 组成
| 组件 | 位置 | 端口 |
|---|---|---|
| Tomcat 8.5 (应用) | `tools/dev-tools/apache-tomcat-8.5.100` | http://localhost:8080 |
| MySQL 5.7 (docker: lottery-mysql) | 数据卷 `infra/data/mysql` | 宿主 33206 → 3306 |
| Redis 5 (docker: lottery-redis) | 数据卷 `infra/data/redis` | 宿主 36379 → 6379 |
| JDK 8 (Temurin) | `tools/dev-tools/jdk8u504-b01` | - |
| Maven 3.9.9 | `tools/dev-tools/apache-maven-3.9.9` | - |
项目源码:`apps/lotteryServer`。数据库 root 密码:`devpass123`,库名 `ecai`(110 张表,来自 `database/ecai.sql`)。
## 日常启动 / 停止
```
scripts\dev.bat # 启动容器 + Tomcat(不改代码时)
scripts\dev.bat build # 重新 mvn package + 部署 WAR + 重启 Tomcat
```
只停应用不停容器:`tools\dev-tools\apache-tomcat-8.5.100\bin\shutdown.bat`
全部停掉:`docker compose -f infra/docker-compose.yml down`(数据保留在 infra/data/)
## 配置改动(相对原仓库)
- `src/main/resources/config/datasource/db.properties`:三组连接指向 `127.0.0.1:33206/ecai`,密码用 druid ConfigTools 按 `devpass123` 重新加密(原生产配置在 git 历史里)。
- `src/main/resources/config/datasource/redis.properties`:端口 6379 → 36379。
## 注意事项
- **必须用 JDK 8**(本机默认 JDK 25 跑不了这个 2018 年的依赖栈)。脚本已自带 JAVA_HOME。
- **不能用 `mvn tomcat7:run`**:Spring 4.1 WebSocket 需要 Tomcat 8+,Tomcat 7 会报 `No suitable default RequestUpgradeStrategy found`。所以用外置 Tomcat 8.5 部署 WAR。
- 前台登录是 `user` 表(如 zz / test1),**没有 admin 账号**;`admin/admin` 是后台(admin_user 表)的账号。前台密码规则:传输值 = MD5大写(MD5大写(MD5大写(MD5大写(明文))) + token),数据库存 MD5^3(明文)。
- 验证码是 4 位纯数字,存在 Redis 会话 `spring:session:sessions:<SID>` 的 `sessionAttr:LOGIN_VALIDATE_CODE`(JDK 序列化字符串,末尾 4 字节即验证码)。
- 定时任务(GameReportJob 等依赖外部采号服务的 Job)启动后会持续抛 NPE,属正常现象,不影响 Web 功能。
- 下载慢时走本地代理 `curl -x http://127.0.0.1:17890`。