棋开得胜-学生在线2024寒假实训项目-后端仓库
后端
lxy
lrq
ljy
环境:java17+,javafx17+
复制application.yml.example为application.yml,根据实际情况修改。
CREATE DATABASE `BlessingChess`;
-- 创建用户表
CREATE TABLE BlessingChess.`user` (
id INTEGER auto_increment NOT NULL,
session_key TEXT NULL,
open_id TEXT NOT NULL,
last_time DATE NULL,
username TEXT NOT NULL,
invitation_code TEXT NOT NULL,
dice_num INTEGER NOT NULL,
position INTEGER NOT NULL,
CONSTRAINT user_pk PRIMARY KEY (id)
)
ENGINE=InnoDB
DEFAULT CHARSET=utf8mb4
COLLATE=utf8mb4_0900_ai_ci;
-- 创建祝福表
CREATE TABLE BlessingChess.blessing (
id INTEGER auto_increment NOT NULL,
`sender_id` INTEGER NOT NULL,
`receiver_id` INTEGER NOT NULL,
`delivery-_time` DATE NULL,
content TEXT NULL,
icon TEXT NULL,
background TEXT NULL,
is_viewed BOOL NOT NULL,
public BOOL NOT NULL,
CONSTRAINT blessing_pk PRIMARY KEY (id)
)
ENGINE=InnoDB
DEFAULT CHARSET=utf8mb4
COLLATE=utf8mb4_0900_ai_ci;
-- 创建贺卡表
CREATE TABLE BlessingChess.card (
id INTEGER auto_increment NOT NULL,
sender_id INTEGER NOT NULL,
delivery_time DATE NULL,
content TEXT NULL,
icon TEXT NULL,
background TEXT NULL,
CONSTRAINT card_pk PRIMARY KEY (id)
)
ENGINE=InnoDB
DEFAULT CHARSET=utf8mb4
COLLATE=utf8mb4_0900_ai_ci;
-- 创建贺卡接收关系表
CREATE TABLE BlessingChess.card_receiver_relations (
id INTEGER auto_increment NOT NULL,
card_id INTEGER NOT NULL,
receiver_id INTEGER NOT NULL,
CONSTRAINT card_receiver_relations_pk PRIMARY KEY (id)
)
ENGINE=InnoDB
DEFAULT CHARSET=utf8mb4
COLLATE=utf8mb4_0900_ai_ci;