Merge remote-tracking branch 'remotes/origin/master' into hechu1

zgl
何楚 6 years ago
commit 6f4aac88f0

@ -0,0 +1,15 @@
package core.operation;
import core.user.User;
import dao.DBManagement;
import error.GExcptSQL;
public class Delete extends Operation {
@Override
public void execute(User subject) throws GExcptSQL {
String id = (String)options.get("id");
String sql = "DELETE FROM graduation_design WHERE id = \'"+
id+"\'";
DBManagement.update(sql);
}
}

@ -0,0 +1,3 @@
{
"id": "java.lang.String"
}

@ -0,0 +1,4 @@
package core.operation;
public class DownloadFile {
}

@ -0,0 +1,4 @@
package core.operation;
public class FillInformation {
}

@ -9,8 +9,8 @@ import java.util.Map;
public abstract class Operation {
private Map<String, Object> options;
private User subject;
protected Map<String, Object> options;
protected User subject;
Operation(){
super();
}
@ -38,6 +38,6 @@ public abstract class Operation {
}
this.options.put(key,value);
}
public abstract void execute(User subject) throws GExcptSQL;
public abstract void execute(User subject) throws Exception;
}

@ -0,0 +1,22 @@
package core.operation;
import core.user.User;
import dao.DBManagement;
import java.sql.ResultSet;
public class Search extends Operation {
@Override
public void execute(User subject) throws Exception {
String table = (String)options.get("table");
String field = (String)options.get("field");
String value = (String)options.get("value");
int start = (int)options.get("start");
int end = (int)options.get("end");
String sql = "SELECT * FROM "+table+
" WHERE "+field+" = \'"+value+"\'"+
" limit "+start+", "+end;
ResultSet rs = DBManagement.query(sql);
//todo
}
}

@ -0,0 +1,8 @@
{
"table": "java.lang.String",
"field": "java.lang.String",
"value": "java.lang.String",
"start": "int",
"end": "int",
"return": "java.lang.String[][]"
}

@ -8,11 +8,15 @@ import java.util.Map;
public class Select extends Operation {
private Map<String, Object> options;
private User subject;
@Override
public void execute(User subject) throws GExcptSQL {
this.setSubject(subject);
DBManagement.update("update stu ");
String student_id = (String)options.get("student_id");
String teacher_id = (String)options.get("teacher_id");
String id = student_id;
String sql = "INSERT INTO graduation_design VALUES (\'"+
id+"\', "+
student_id+"\', "+
teacher_id+"\', \'m\', \'m\')";
DBManagement.update(sql);
}
}

@ -0,0 +1,4 @@
{
"student_id": "java.lang.String",
"teacher_id": "java.lang.String"
}
Loading…
Cancel
Save