コード例 #1
0
 @RequestMapping("/load/config")
 @ResponseBody
 public ExtData load(
     @RequestParam(value = "page", required = false, defaultValue = "1") Integer currentPage,
     @RequestParam(required = false, value = "limit", defaultValue = "10") Integer pageSize,
     HttpServletRequest request) {
   Page<SystemConfigEntity> datas =
       systemConfigDao.findAll(new ExtPageRequest(currentPage, pageSize));
   return new ExtGridData(true, datas.getTotalElements(), datas.getContent());
 }
コード例 #2
0
 @RequestMapping("/loadone/config")
 @ResponseBody
 public SystemConfigEntity loadOne() {
   SystemConfigEntity entity = systemConfigDao.findOne(1L);
   if (entity != null) {
     return entity;
   } else {
     return null;
   }
 }
コード例 #3
0
 @RequestMapping("/update/config")
 @ResponseBody
 public ExtData update(@RequestBody String body)
     throws JsonParseException, JsonMappingException, IOException {
   if (!body.startsWith("[")) {
     body = "[" + body + "]";
   }
   List<SystemConfigEntity> entities = objectMapper.readValue(body, VALUE_TYPE_REF);
   systemConfigDao.save(entities);
   return new ExtGridData(true, entities.size(), entities);
 }