重构:在多个文件中添加注释并改进代码结构
为了提高代码库的可读性和可维护性,通过添加注释来详细说明各类、方法及变量的目的和功能。 同时,引入必要的构造器、getter、setter,并根据更好的编程实践重构现有功能。 修改的文件包括: src/dao/AdminDao.java src/dao/AdminDaoImpl.java src/po/Admin.java src/View/AdminView.java src/po/Business.java src/dao/BusinessDao.java src/dao/BusinessDaoImpl.java src/View/Display.java src/ElmAdminEntry.java src/ElmBusinessEntry.java src/jdbc/JDBC.java
This commit is contained in:
parent
9f6c2729ca
commit
341989695b
02_Intellij_Java_CourseExperiment_20240611/CourseExperiment/src
@ -12,6 +12,8 @@ public class ElmAdminEntry {
|
||||
new ElmAdminEntry().work();
|
||||
}
|
||||
|
||||
// CodeLineNum 2600
|
||||
|
||||
private static final int exitCode = 10;
|
||||
|
||||
public void work(){
|
||||
@ -99,4 +101,4 @@ public class ElmAdminEntry {
|
||||
System.exit(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -127,4 +127,4 @@ public class ElmBusinessEntry {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -555,4 +555,4 @@ public class AdminView {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -209,4 +209,4 @@ public class Display {
|
||||
System.out.println("+ °´»Ø³µ¼ü¼ÌÐø...");
|
||||
sca.nextLine();
|
||||
}
|
||||
}
|
||||
}
|
@ -15,4 +15,4 @@ public interface AdminDao {
|
||||
boolean updateAdminPassword(Admin admin);
|
||||
ResultSet fuzzyQueryExampleForName(String name);
|
||||
ResultSet getAllAdmin();
|
||||
}
|
||||
}
|
@ -181,4 +181,4 @@ public class AdminDaoImpl implements AdminDao{
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
@ -26,4 +26,4 @@ public interface BusinessDao {
|
||||
boolean deleteFoodId(int foodId, Business business);
|
||||
boolean deleteFoodName(String foodName, Business business);
|
||||
ResultSet getBusinessFoodInfo(Business business);
|
||||
}
|
||||
}
|
@ -511,4 +511,4 @@ public class BusinessDaoImpl implements BusinessDao{
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
@ -30,4 +30,4 @@ public class JDBC {
|
||||
throw new RuntimeException("数据库连接失败", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -57,4 +57,4 @@ public class Admin {
|
||||
public void setAdminPassword(String password){
|
||||
adminPassword = password;
|
||||
}
|
||||
}
|
||||
}
|
@ -93,4 +93,4 @@ public class Business {
|
||||
public String toString() {
|
||||
return super.toString();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user