今天任务:
完成了团队项目的后端代码,在idea上创建了数据库
-- auto-generated definition
create table department
(
department_id int auto_increment comment '部门唯一ID'
primary key,
department_name varchar(50) not null comment '部门名称',
level1_position varchar(50) not null comment '一级职位名称',
level2_position varchar(50) not null comment '二级职位名称',
level3_position varchar(50) not null comment '三级职位名称',
level1_permission tinyint default 1 not null comment '一级权限(固定1)',
level2_permission tinyint default 2 not null comment '二级权限(固定2)',
level3_permission tinyint default 3 not null comment '三级权限(固定3)',
level1position varchar(255) null,
level2position varchar(255) null,
level3position varchar(255) null
);
-- auto-generated definition
create table mentorship
(
id int auto_increment
primary key,
mentor_id int not null,
mentee_id int not null,
constraint mentorship_ibfk_1
foreign key (mentor_id) references user (id),
constraint mentorship_ibfk_2
foreign key (mentee_id) references user (id)
);
create index mentee_id
on mentorship (mentee_id);
create index mentor_id
on mentorship (mentor_id);
-- auto-generated definition
create table promotion_request
(
id int auto_increment
primary key,
target_rank_level int null,
user_id int null,
constraint FKcjllk3cu7ty9ntltbrhyxvphc
foreign key (user_id) references user (id)
);-- auto-generated definition
create table promotion_request_content
(
id int auto_increment
primary key,
content text null,
change_type int null,
user_id int null,
constraint promotion_request_content_ibfk_1
foreign key (user_id) references user (id)
);
create index user_id
on promotion_request_content (user_id);
-- auto-generated definition
create table user
(
id int auto_increment comment '用户唯一标识'
primary key,
password varchar(255) not null comment '加密后的密码',
permission_level tinyint default 1 not null comment '权限等级 (1-普通用户, 2-管理员, 3-超级管理员)',
position varchar(20) null comment '职位 (如: 开发工程师、项目经理)',
height decimal(5, 2) null comment '身高 (单位: 厘米,示例: 175.50)',
weight decimal(5, 2) null comment '体重 (单位: 公斤,示例: 68.50)',
vision decimal(3, 1) null comment '视力 (示例: 5.0 或 4.5)',
department_id int null,
department varchar(255) null,
performance_score int null,
constraint fk_user_department
foreign key (department_id) references department (department_id)
);
上述为数据库代码
后端代码与web端代码基本相同
今天遇到的困难:
我建立的数据库表与队友建立的表不同,于是我们选择将团队web端的表直接导入进去,而队友使用的非idea中自带的数据库,导致导入工作很麻烦,但在求助ai后完成了该任务
浙公网安备 33010602011771号