コード例 #1
0
 @RequestMapping("/introduce")
 @ResponseBody
 public Result toIntroduce(HttpServletRequest request, Model model) {
   Result result = new Result();
   String routeId = request.getParameter("routeId");
   List<Schedule> record = scheduleService.selectByRouteId(routeId);
   if (record == null) {
     result.setStatus("failed");
   } else {
     result.setData(record);
   }
   return result;
 }
コード例 #2
0
 @RequestMapping("/description")
 @ResponseBody
 public Result readDescription(HttpServletRequest request, Model model) {
   String scheduleId = request.getParameter("scheduleId");
   Schedule schedule = scheduleService.selectByPrimaryKey(scheduleId);
   Result result = new Result();
   if (schedule == null) {
     result.setStatus("failed");
     return result;
   } else {
     List<Object> record = new ArrayList<>();
     record.add(schedule.getDescription());
     record.add(schedule.getLink());
     result.setData(record);
     return result;
   }
 }