You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
84 lines
1.6 KiB
84 lines
1.6 KiB
# token管理表
|
|
create table api_token
|
|
(
|
|
id int auto_increment primary key,
|
|
refresh_token varchar(256),
|
|
# Access Token的有效期(秒为单位,一般为1个月);
|
|
expires_in int,
|
|
# 有效时间
|
|
end_time datetime,
|
|
scope varchar(1024),
|
|
session_key varchar(256),
|
|
# 要获取的Access Token;
|
|
access_token varchar(256),
|
|
session_secret varchar(32)
|
|
);
|
|
|
|
# 垃圾分类表
|
|
create table garbage
|
|
(
|
|
# 垃圾名
|
|
name varchar(32) primary key,
|
|
# 类别
|
|
category int,
|
|
# 创建时间
|
|
create_at datetime,
|
|
# 更新时间
|
|
update_at datetime
|
|
);
|
|
|
|
# 参数表
|
|
create table param
|
|
(
|
|
# 参数名
|
|
param_key varchar(16) primary key,
|
|
# 参数值
|
|
param_value varchar(128),
|
|
# 参数描述
|
|
param_desc varchar(32)
|
|
);
|
|
|
|
# 问题管理
|
|
create table question
|
|
(
|
|
# 问题id
|
|
question_id int auto_increment primary key,
|
|
# 问题
|
|
question_title varchar(32) not null
|
|
);
|
|
|
|
# 答案管理
|
|
create table answer
|
|
(
|
|
# 答案id
|
|
answer_id int auto_increment primary key,
|
|
# 问题id
|
|
question_id int,
|
|
# 答案,
|
|
answer varchar(32) not null,
|
|
# 是否正确答案
|
|
is_true bool
|
|
);
|
|
|
|
# 管理员表
|
|
create table manager
|
|
(
|
|
#管理员
|
|
manager_name varchar(10) primary key,
|
|
# 密码
|
|
manager_pwd varchar(32),
|
|
#上次登录ip
|
|
last_ip varchar(15),
|
|
# 上次登陆时间
|
|
last_time datetime
|
|
);
|
|
|
|
|
|
# 超级管理员账号
|
|
insert manager (manager_name, manager_pwd)
|
|
values ('admin', md5('admin'));
|
|
|
|
# 初始化参数
|
|
insert param
|
|
values ('api_key', null, null),
|
|
('secret_key', null, null); |