文章目录
注:非专业,为课程进度用
一、选取技术(2021.9.19 18:30)
- 前端交互—vue
- 数据操作—mysql
- 后端服务—nodejs
二、设计表(2021.9.19 23:00)
1、业务流程
定义三个身份:
* 学生(查看个人成绩)
* 教师(录入学生成绩)
* 超级管理(查看相关日志)
2、所需表
思维导图绘制
选用线上免费绘图网站绘制
传送门:https://gitmind.cn/app/template
三、创建数据库,表(2021.9.20 01:32)
创建数据库(myproject)
创建学生表(student)
create table `myproject`.`student`(
`s_id` int(9) not null,
`s_name` varchar(20) not null,
`s_password` varchar(30) not null,
primary key (`s_id`)
) charset=utf8;
创建教师表(teacher)
create table `myproject`.`teacher`(
`t_id` int(10) not null,
`t_name` varchar(20) not null,
`t_password` varchar(30) not null,
primary key (`t_id`)
);
创建成绩表(fraction)
ps:外键约束
create table `myproject`.`fraction`(
`sid` int(9) not null,
`tid` int(10) not null,
`subject_name` varchar(20) not null,
`subject_score` varchar(20) not null,
foreign key (`sid`) references `myproject`.`student`(`s_id`),
foreign key (`tid`) references `myproject`.`teacher`(`t_id`)
) charset=utf8;
创建日志表(log)
create table `myproject`.`log`(
`l_id` int(100) not null auto_increment,
`l_time` time not null,
`l_action` varchar(10) not null,
`l_content` varbinary(520) not null,
primary key (`l_id`)
);
alter table `myproject`.`log`
change `l_time` `l_time` datetime not null;
创建超级管理表(root)
create table `myproject`.`root`(
`root_id` varchar(10) not null,
`root_password` varchar(10) not null,
primary key (`root_id`)
);
四、接口编写(~-2021.9.25 18:39)
此时扔在加班,决定放弃log表和超管表
·················所有请求为post····························
- baseurl
http://127.0.0.1:5200/
- login 登录
/**
* 必传
* id
* password
* 教师传type:'T'
*/
- register 注册
/**
* 必传
* id
* username
* password
* 教师传type:'T'
*/
- addSub 添加成绩
/**
* 必传
* sid
* tid
* subname
* subscore
* 教师传type:'T'
*/
- getTeacherData 获取该教师添加的学生成绩单
/**
* 必传
* id
*/
- getStudentData 获取学生成绩单
/**
* 必传
* id
*/
五、客户端vue编写(10.9结束)
ps:国庆玩去了没写,哈哈哈哈哈
后面代码会上传我的资源,有需要的伙伴可以下载看看
六、总结
···下载源码地址···
总的来说一般,花的时间少也不少多也不多,主要是上班时间,我怕被boss弄死,也就是这门课是我喜欢的老师我才做的,其他课都懒得看,哈哈哈哈,还在上学的别学我噗
node我也是一知半解,主要是要写接口,就半查半写,后面还要好好学。现在前端node也很重要,总之,这次前后端都用JavaScript来写属实是爽的鸭批哈哈哈哈