public JSONArray getJson(long id) {
JSONArray jsons = new JSONArray();
JSONObject jo = null;
List<ShrgSchScheduleInfoT> list = MinuteRingFactory.getMinuteRingFactory().getInstance().getMinuteRing(id);
for (ShrgSchScheduleInfoT shrgSchScheduleInfoT : list) {
jo = new JSONObject();
try {
jo.put("name", shrgSchScheduleInfoT.getName());
jo.put("classStartTime", shrgSchScheduleInfoT.getClassStartTime());
jo.put("classOverTime", shrgSchScheduleInfoT.getClassOverTime());
jo.put("classRing", shrgSchScheduleInfoT.getClassRing());
jsons.put(jo);
} catch (JSONException e) {
e.printStackTrace();
}
}
return jsons;
}
@Test
public void getJson(){
JSONArray jsons = new JSONArray();
JSONObject jo = null;
List<ShrgSchScheduleInfoT> list = MinuteRingFactory.getMinuteRingFactory().getInstance().getMinuteRing(2);
for (ShrgSchScheduleInfoT shrgSchScheduleInfoT : list) {
jo = new JSONObject();
try {
jo.put("name", shrgSchScheduleInfoT.getName());
jo.put("classStartTime", shrgSchScheduleInfoT.getClassStartTime());
jo.put("classOverTime", shrgSchScheduleInfoT.getClassOverTime());
jo.put("classRing", shrgSchScheduleInfoT.getClassRing());
jsons.put(jo);
} catch (JSONException e) {
e.printStackTrace();
}
}
System.out.println(jsons);
}
JSONArray jsons = new JSONArray();
JSONObject jo = null;
List<ShrgSchScheduleInfoT> list = MinuteRingFactory.getMinuteRingFactory().getInstance().getMinuteRing(id);
for (ShrgSchScheduleInfoT shrgSchScheduleInfoT : list) {
jo = new JSONObject();
try {
jo.put("name", shrgSchScheduleInfoT.getName());
jo.put("classStartTime", shrgSchScheduleInfoT.getClassStartTime());
jo.put("classOverTime", shrgSchScheduleInfoT.getClassOverTime());
jo.put("classRing", shrgSchScheduleInfoT.getClassRing());
jsons.put(jo);
} catch (JSONException e) {
e.printStackTrace();
}
}
return jsons;
}
@Test
public void getJson(){
JSONArray jsons = new JSONArray();
JSONObject jo = null;
List<ShrgSchScheduleInfoT> list = MinuteRingFactory.getMinuteRingFactory().getInstance().getMinuteRing(2);
for (ShrgSchScheduleInfoT shrgSchScheduleInfoT : list) {
jo = new JSONObject();
try {
jo.put("name", shrgSchScheduleInfoT.getName());
jo.put("classStartTime", shrgSchScheduleInfoT.getClassStartTime());
jo.put("classOverTime", shrgSchScheduleInfoT.getClassOverTime());
jo.put("classRing", shrgSchScheduleInfoT.getClassRing());
jsons.put(jo);
} catch (JSONException e) {
e.printStackTrace();
}
}
System.out.println(jsons);
}