项目的交互:
7/29:项目间的交互,复杂问题间,逻辑混乱
今天做的功能点:添加系统提醒,并储存到数据库,实时更新系统提醒,还有在添加班级那里加了一个老师能够决定学生进入班级。这里主要是更改,添加判断,就逻辑很乱,再加上实时更新 的要求,就更加有问题,现在就简单的测试了一下,还没有完全检测,后面再找找bug,优化优化,这里主要的问题,还是因为在进行处理逻辑时,进行处理实时更新,还要处理学生端,老师端的更新,确实很有问题,
收获:下次做这种问题,应该先完成主要的业务逻辑,操作数据库,然后再根据需求进行实时更新,要先完成主要业务,再进行实现更新问题。
实现实时更新,逻辑混乱,要仔细检查代码。
实现系统的提醒地方不清楚,导致代码地方有点乱,后面整理整理。
7/30:发布活动,随机选人,还有发布抢答
1.界面问题:
老师端和学生端的点击事件,成员变量...等的不同,会导致大量的操作细节不同,所以,我分开写老师和学生的界面,小组件的点击事件都不一样,进行更新还有进行修改,初始化,都更加清晰。
DateTimeFormatter.ofPattern("格式字符串")
这里的格式字符串,如果HH:mm:ss 为24小时制,时间, hh:mm:ss 为12小时,hh:mm:ss a :显示12小时,然后显示上下午,AM / PM
2.实体类的设计
对于实体类的成员变量类型,最好不要有非基础类型,因为虽然最其进行赋值时简单一点,但是进行数据库存储,还有有时候只有某些字段,才有的时候,就会导致问题,数据库中的值取不出来。真实踩坑,这样会导致自己某个地方,成员变量为空。
eg:班级加入申请:实体类
package com.test.po;import java.io.Serializable;
import java.time.LocalDateTime;public class StudentApply implements Serializable {private int id;private Student student;private LocalDateTime startTime;private int Class_id;private int choice; // 1 未处理, 2 : 同意 3:拒绝private String content;private int student_id;private String student_name;public String getStudent_name() {return student_name;}public void setStudent_name(String student_name) {this.student_name = student_name;}public int getStudent_id() {return student_id;}public void setStudent_id(int student_id) {this.student_id = student_id;}public StudentApply() {}public String getContent() {return content;}public void setContent(String content) {this.content = content;}public int getChoice() {return choice;}public void setChoice(int choice) {this.choice = choice;}public StudentApply(int id, Student student, LocalDateTime startTime, int class_id,int choice) {this.id = id;this.student = student;this.startTime = startTime;Class_id = class_id;this.choice = choice;this.student_id = student.getId();}public int getId() {return id;}public void setId(int id) {this.id = id;}public Student getStudent() {return student;}public void setStudent(Student student) {this.student = student;}public LocalDateTime getStartTime() {return startTime;}public void setStartTime(LocalDateTime startTime) {this.startTime = startTime;}public int getClass_id() {return Class_id;}public void setClass_id(int class_id) {Class_id = class_id;}
}
应该不要有student实例成员的。基础类型即可。