zyh 53d6de47dc refactor: 优化设备状态检查服务和定时任务日志输出
主要修改:
1. 将设备状态检查服务中的INFO级别日志调整为DEBUG级别,以减少日志冗余。
2. 更新定时检查空闲设备的日志输出,简化信息并保持DEBUG级别。
3. 仅在发现需要更新的任务时输出INFO级别日志,提升日志的可读性和有效性。

技术细节:
- 通过调整日志级别,增强了系统的调试能力,同时保持了必要的信息输出。
2025-08-27 16:04:57 +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%