|
|
|
@ -46,7 +46,7 @@ public class ExamController extends Controller {
|
|
|
|
|
}
|
|
|
|
|
Kv kv = em.addPerson(person_name, ks, tel);
|
|
|
|
|
if (kv.getBoolean("success")) {
|
|
|
|
|
CookieUtil.set(getResponse(), "person_id", kv.get("person_id").toString(), false, true);
|
|
|
|
|
CookieUtil.set(getResponse(), "dt_person_id", kv.get("person_id").toString(), false, true);
|
|
|
|
|
}
|
|
|
|
|
renderJson(kv);
|
|
|
|
|
}
|
|
|
|
@ -72,7 +72,7 @@ public class ExamController extends Controller {
|
|
|
|
|
*/
|
|
|
|
|
@Before({GET.class})
|
|
|
|
|
public void getRemainSecond() {
|
|
|
|
|
String person_id = getCookie("person_id");
|
|
|
|
|
String person_id = getCookie("dt_person_id");
|
|
|
|
|
long remainSecond = em.getRemainSecond(person_id);
|
|
|
|
|
Kv kv = Kv.by("success", true);
|
|
|
|
|
kv.set("remainSecond", remainSecond);
|
|
|
|
@ -88,7 +88,7 @@ public class ExamController extends Controller {
|
|
|
|
|
@Before({GET.class})
|
|
|
|
|
@IsNumericInterface({"order_id"})
|
|
|
|
|
public void getQuestion(int order_id, int finish) {
|
|
|
|
|
String person_id = getCookie("person_id");
|
|
|
|
|
String person_id = getCookie("dt_person_id");
|
|
|
|
|
if (finish == 1 && em.HaveJiaoJuan(person_id) <= 0) {
|
|
|
|
|
Kv kv = Kv.by("success", false);
|
|
|
|
|
kv.set("message", "你还没有交卷,不能使用此接口!");
|
|
|
|
@ -110,7 +110,7 @@ public class ExamController extends Controller {
|
|
|
|
|
@EmptyInterface({"reply"})
|
|
|
|
|
@IsNumericInterface({"order_id"})
|
|
|
|
|
public void save(int order_id, String reply) {
|
|
|
|
|
String person_id = getCookie("person_id");
|
|
|
|
|
String person_id = getCookie("dt_person_id");
|
|
|
|
|
int result = em.save(person_id, order_id, reply);
|
|
|
|
|
if (result == -1) {
|
|
|
|
|
Kv kv = Kv.by("success", false);
|
|
|
|
@ -128,7 +128,7 @@ public class ExamController extends Controller {
|
|
|
|
|
*/
|
|
|
|
|
@Before({POST.class})
|
|
|
|
|
public void jiaoJuan() {
|
|
|
|
|
String person_id = getCookie("person_id");
|
|
|
|
|
String person_id = getCookie("dt_person_id");
|
|
|
|
|
em.jiaoJuan(person_id);
|
|
|
|
|
Kv kv = Kv.by("success", true);
|
|
|
|
|
kv.put("message", "保存成功!");
|
|
|
|
@ -141,7 +141,7 @@ public class ExamController extends Controller {
|
|
|
|
|
*/
|
|
|
|
|
@Before({GET.class})
|
|
|
|
|
public void getPersonAllInfo() {
|
|
|
|
|
String person_id = getCookie("person_id");
|
|
|
|
|
String person_id = getCookie("dt_person_id");
|
|
|
|
|
List<Record> list = em.getPersonAllInfo(person_id);
|
|
|
|
|
renderJson(list);
|
|
|
|
|
}
|
|
|
|
@ -151,7 +151,7 @@ public class ExamController extends Controller {
|
|
|
|
|
*/
|
|
|
|
|
@Before({GET.class})
|
|
|
|
|
public void getPersonUnFinishCount() {
|
|
|
|
|
String person_id = getCookie("person_id");
|
|
|
|
|
String person_id = getCookie("dt_person_id");
|
|
|
|
|
int count = em.getPersonUnFinishCount(person_id);
|
|
|
|
|
Kv kv = Kv.create();
|
|
|
|
|
kv.set("success", true);
|
|
|
|
@ -164,7 +164,7 @@ public class ExamController extends Controller {
|
|
|
|
|
*/
|
|
|
|
|
@Before({GET.class})
|
|
|
|
|
public void getPersonAllInfoAfterJiaoJuan() {
|
|
|
|
|
String person_id = getCookie("person_id");
|
|
|
|
|
String person_id = getCookie("dt_person_id");
|
|
|
|
|
if (em.HaveJiaoJuan(person_id) <= 0) {
|
|
|
|
|
Kv kv = Kv.by("success", false);
|
|
|
|
|
kv.set("message", "你还没有交卷,不能使用此接口!");
|
|
|
|
|