zyh 058970b95c feat: 优化选区逻辑和日志输出
主要修改:
1. 在LinkController中更新选区请求的日志信息,增强可读性。
2. 在LinkStatusService中重构选区操作的日志记录,增加步骤标识和详细信息,提升调试能力。
3. 移除performAutoRefresh方法,简化链接状态处理逻辑。
4. 在GameInterfaceResponse中新增操作成功字段,提供更清晰的响应数据。

技术细节:
- 通过优化日志输出和选区逻辑,提升了代码的可维护性和用户体验,同时确保了操作的透明性和准确性。
2025-08-29 15:57:30 +08:00
1
2025-08-26 15:18:14 +08:00
2025-08-24 15:33:03 +08:00

Game Platform Server (Spring Boot WebFlux + MyBatis + MySQL)

A minimal backend scaffold using Spring Boot 3, WebFlux, MyBatis, and MySQL. Includes a sample User CRUD implemented via MyBatis (blocking JDBC) safely wrapped in reactive APIs.

Tech Stack

  • Spring Boot 3 (WebFlux, Actuator)
  • MyBatis Spring Boot Starter (JDBC)
  • MySQL Connector/J
  • Java 17

Blocking JDBC with WebFlux

MyBatis uses JDBC which is blocking. To keep WebFlux event loop non-blocking, all data access is offloaded to Schedulers.boundedElastic() (see UserService). This is a common and safe pattern when you need WebFlux endpoints but must use JDBC/MyBatis.

Project Layout

  • pom.xml Maven build, dependencies
  • src/main/resources/application.yml datasource + mybatis config
  • src/main/resources/mapper/*.xml MyBatis mappers (XML)
  • src/main/resources/schema.sql initial table
  • src/main/java/com/gameplatform/server application code

Configure Database

  1. Create database:
    CREATE DATABASE game_platform CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
    
  2. Update spring.datasource.* in application.yml with your MySQL credentials.
  3. Run the SQL init:
    USE game_platform;
    -- then execute contents of src/main/resources/schema.sql
    

Build & Run

Requires JDK 17+ and Maven 3.9+.

mvn spring-boot:run

The app starts on http://localhost:8080.

Endpoints

  • GET /actuator/health health check
  • GET /api/users list users
  • GET /api/users/{id} get user by id
  • POST /api/users create user
    • body:
      {"username": "alice", "email": "alice@example.com"}
      
  • DELETE /api/users/{id} delete user

Notes

  • If you need true end-to-end reactive IO, consider R2DBC instead of JDBC/MyBatis. Here we keep MyBatis for mapping convenience and use bounded elastic threads to avoid blocking the event loop.
Description
No description provided
Readme 4 MiB
Languages
Java 98%
Python 2%