commit
d0164dc956
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="JsonSchemaMappingsProjectConfiguration">
|
||||
<state>
|
||||
<map>
|
||||
<entry key="bukkit-plugin">
|
||||
<value>
|
||||
<SchemaInfo>
|
||||
<option name="name" value="bukkit-plugin" />
|
||||
<option name="relativePathToSchema" value="http://json.schemastore.org/bukkit-plugin" />
|
||||
<option name="applicationDefined" value="true" />
|
||||
<option name="patterns">
|
||||
<list>
|
||||
<Item>
|
||||
<option name="path" value="src/core/user/student.json" />
|
||||
</Item>
|
||||
</list>
|
||||
</option>
|
||||
</SchemaInfo>
|
||||
</value>
|
||||
</entry>
|
||||
</map>
|
||||
</state>
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,32 @@
|
||||
package core.process;
|
||||
|
||||
import core.operation.Search;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class C_StudentSearchTeacher {
|
||||
Map<String,String> TeacherInfo=new HashMap<String, String>();
|
||||
public Map<String,String> search(String teacherID) throws Exception {
|
||||
Search search = new Search() ;
|
||||
search.setOptions(new HashMap<>());
|
||||
String table = "teacher";
|
||||
search.addOptions("table",table);
|
||||
List<String> fields = new ArrayList<>();
|
||||
fields.add("*");
|
||||
search.addOptions("field",fields);
|
||||
Map<String,String> limits = new HashMap<>();
|
||||
limits.put("id",teacherID);
|
||||
search.addOptions("limits",limits);
|
||||
search.addOptions("start",0);
|
||||
search.addOptions("end",1);
|
||||
Map<String, Object> options = search.execute(null);
|
||||
List<String[]> result = (List<String[]>) options.get("result");
|
||||
String[] s = result.get(0);
|
||||
TeacherInfo.put("id",s[0]);
|
||||
TeacherInfo.put("name",s[2]);
|
||||
return TeacherInfo;
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package core.process;
|
||||
|
||||
import core.operation.Select;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class C_StudentSelectTeacher extends Process {
|
||||
public void select(String studentID,String teacherID)throws Exception{
|
||||
Select select=new Select();
|
||||
select.setOptions(new HashMap<>());
|
||||
String student_id=studentID;
|
||||
select.addOptions("student_id",student_id);
|
||||
String teacher_id=teacherID;
|
||||
select.addOptions("teacher_id",teacher_id);
|
||||
Map<String,Object> options=select.execute(null);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package core.process;
|
||||
|
||||
import core.operation.Search;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class C_TeacherSearchStudent {
|
||||
Map<String,String> StudentInfo=new HashMap<String,String>();
|
||||
public Map<String,String> search(String studentID) throws Exception{
|
||||
Search search = new Search() ;
|
||||
search.setOptions(new HashMap<>());
|
||||
String table = "student";
|
||||
search.addOptions("table",table);
|
||||
List<String> fields = new ArrayList<>();
|
||||
fields.add("*");
|
||||
search.addOptions("field",fields);
|
||||
Map<String,String> limits = new HashMap<>();
|
||||
limits.put("id",studentID);
|
||||
search.addOptions("limits",limits);
|
||||
search.addOptions("start",0);
|
||||
search.addOptions("end",1);
|
||||
Map<String, Object> options = search.execute(null);
|
||||
List<String[]> result = (List<String[]>) options.get("result");
|
||||
String[] s = result.get(0);
|
||||
StudentInfo.put("id",s[0]);
|
||||
StudentInfo.put("name",s[2]);
|
||||
return StudentInfo;
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package core.process;
|
||||
|
||||
import core.operation.Select;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class C_TeacherSelectStudent extends Process {
|
||||
List<String> list;
|
||||
|
||||
public C_TeacherSelectStudent clone(){
|
||||
C_TeacherSelectStudent tst = new C_TeacherSelectStudent();
|
||||
tst.setInfo( this.getInfo());
|
||||
List<String> list = new ArrayList<>();
|
||||
for(String s:this.list){
|
||||
list.add(new String(s));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public void select(String teacherID,String studentID)throws Exception{
|
||||
Select select=new Select();
|
||||
select.setOptions(new HashMap<>());
|
||||
String teacher_id=teacherID;
|
||||
select.addOptions("teacher_id",teacher_id);
|
||||
String student_id=studentID;
|
||||
select.addOptions("student_id",student_id);
|
||||
Map<String,Object> options=select.execute(null);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package servlet.account;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
|
||||
@WebServlet(name = "S_TeacherSelectStudent")
|
||||
public class S_TeacherSelectStudent extends HttpServlet {
|
||||
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||
|
||||
}
|
||||
|
||||
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in new issue