@RequestMapping({ "helloWithOptionalName", "helloWithOptional/{name}" }) public ObjectNode helloWithOptionalName(@PathVariable Optional<String> name) { ObjectNode resultJson = jacksonMapper.createObjectNode(); logger.info( "simple log" ) ; if (name.isPresent() ) resultJson.put("name", name.get()) ; else resultJson.put( "name", "not-provided" ) ; resultJson.put( "Response", "Hello from " + HOST_NAME + " at " + LocalDateTime.now().format( DateTimeFormatter.ofPattern( "HH:mm:ss, MMMM d uuuu " ) )); return resultJson ; }
/** * Get movie info by movie id. * * @param id movie id * @param model spring model * @return movie detail page */ @RequestMapping(value = "/movies/{id}", method = RequestMethod.GET) public String getMovieById(@PathVariable Long id, Model model) { Movie movie = movieRepository.getMovie(Long.toString(id)); if (movie != null) { if (movie.getImageUri() != null) { movie.setImageFullPathUri( azureStorageUploader.getAzureStorageBaseUri(applicationContext) + movie.getImageUri()); } model.addAttribute("movie", movie); return "moviedetail"; } else { return "moviedetailerror"; } }
@RequestMapping(value="/checkin/{flightNumber}/{origin}/{destination}/{flightDate}/{fare}/{firstName}/{lastName}/{gender}/{bookingid}", method=RequestMethod.GET) public String bookQuery(@PathVariable String flightNumber, @PathVariable String origin, @PathVariable String destination, @PathVariable String flightDate, @PathVariable String fare, @PathVariable String firstName, @PathVariable String lastName, @PathVariable String gender, @PathVariable String bookingid, Model model) { CheckInRecord checkIn = new CheckInRecord(firstName, lastName, "28C", null, flightDate,flightDate, new Long(bookingid).longValue()); long checkinId = checkInClient.postForObject("http://checkin-apigateway/api/checkin/create", checkIn, long.class); model.addAttribute("message","Checked In, Seat Number is 28c , checkin id is "+ checkinId); return "checkinconfirm"; }
/** * Atualiza os dados de um lançamento. * * @param id * @param lancamentoDto * @return ResponseEntity<Response<Lancamento>> * @throws ParseException */ @PutMapping(value = "/{id}") public ResponseEntity<Response<LancamentoDto>> atualizar(@PathVariable("id") Long id, @Valid @RequestBody LancamentoDto lancamentoDto, BindingResult result) throws ParseException { log.info("Atualizando lançamento: {}", lancamentoDto.toString()); Response<LancamentoDto> response = new Response<LancamentoDto>(); validarFuncionario(lancamentoDto, result); lancamentoDto.setId(Optional.of(id)); Lancamento lancamento = this.converterDtoParaLancamento(lancamentoDto, result); if (result.hasErrors()) { log.error("Erro validando lançamento: {}", result.getAllErrors()); result.getAllErrors().forEach(error -> response.getErrors().add(error.getDefaultMessage())); return ResponseEntity.badRequest().body(response); } lancamento = this.lancamentoService.persistir(lancamento); response.setData(this.converterLancamentoDto(lancamento)); return ResponseEntity.ok(response); }
@RequestMapping(value="/task/{taskId}/identity/{type}/{identityId}", method = RequestMethod.DELETE, name="任务候选人删除") @ResponseStatus(value = HttpStatus.NO_CONTENT) public void deleteIdentityLink(@PathVariable("taskId") String taskId, @PathVariable("identityId") String identityId, @PathVariable("type") String type) { Task task = getTaskFromRequest(taskId,false); validateIdentityLinkArguments(identityId, type); getIdentityLink(taskId, identityId, type); if (TaskIdentityRequest.AUTHORIZE_GROUP.equals(type)) { taskService.deleteGroupIdentityLink(task.getId(), identityId,IdentityLinkType.CANDIDATE); } else if(TaskIdentityRequest.AUTHORIZE_USER.equals(type)) { taskService.deleteUserIdentityLink(task.getId(), identityId,IdentityLinkType.CANDIDATE); } }
@ApiOperation(value = "getParticipantFromCGOR", nickname = "getParticipantFromCGOR") @RequestMapping(value = "/CISConnector/getParticipantFromCGOR/{cgorName}", method = RequestMethod.GET) @ApiImplicitParams({ @ApiImplicitParam(name = "cgorName", value = "the CGOR name", required = true, dataType = "String", paramType = "path"), @ApiImplicitParam(name = "organisation", value = "the Organisation name", required = true, dataType = "String", paramType = "query") }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success", response = Participant.class), @ApiResponse(code = 400, message = "Bad Request", response = Participant.class), @ApiResponse(code = 500, message = "Failure", response = Participant.class)}) public ResponseEntity<Participant> getParticipantFromCGOR(@PathVariable String cgorName, @QueryParam("organisation") String organisation) { log.info("--> getParticipantFromCGOR: " + cgorName); Participant participant; try { participant = connector.getParticipantFromCGOR(cgorName, organisation); } catch (CISCommunicationException e) { log.error("Error executing the request: Communication Error" , e); participant = null; } HttpHeaders responseHeaders = new HttpHeaders(); log.info("getParticipantFromCGOR -->"); return new ResponseEntity<Participant>(participant, responseHeaders, HttpStatus.OK); }
@PutMapping(value = "/{id}") public ResponseEntity<User> updateUser(@PathVariable("id") long id, @RequestBody User user) { logger.info("Updating User: {} ", user); Optional<User> optionalUser = userService.findById(id); if (optionalUser.isPresent()) { User currentUser = optionalUser.get(); currentUser.setUsername(user.getUsername()); currentUser.setAddress(user.getAddress()); currentUser.setEmail(user.getEmail()); userService.updateUser(currentUser); return ResponseEntity.ok(currentUser); } else { logger.warn("User with id :{} doesn't exists", id); return ResponseEntity.notFound().build(); } }
@DeleteMapping(path = "/{id:.*}") public void deleteClientConfiguration(HttpServletRequest request, HttpServletResponse response, @PathVariable ClientID id) throws IOException { HTTPRequest httpRequest = ServletUtils.createHTTPRequest(request); try { ClientDeleteRequest clientDeleteRequest = ClientDeleteRequest.parse(httpRequest); resolveAndValidateClient(id, clientDeleteRequest); this.clientRepository.deleteById(id); response.setStatus(HttpServletResponse.SC_NO_CONTENT); } catch (GeneralException e) { ClientRegistrationResponse registrationResponse = new ClientRegistrationErrorResponse(e.getErrorObject()); ServletUtils.applyHTTPResponse(registrationResponse.toHTTPResponse(), response); } }
@Cacheable(exp = defaultCacheTime) @RequestMapping(value = "/tagapp/topic/{catalog}/{tagId}.json", method = RequestMethod.GET, produces = "application/json;charset=UTF-8") @ResponseBody public String appTagTopic(@PathVariable short catalog, @PathVariable int tagId) { JSONObject output = new JSONObject(); JSONObject server = new JSONObject(); try { Set<AppTopic> list = service.getAppTopic(tagId, catalog); output.put("result", server); output.put("data", list); output.put("total", list == null ? 0 : list.size()); server.put("code", SvrResult.OK.getCode()); server.put("msg", SvrResult.OK.getMsg()); } catch (Exception e) { server.put("code", SvrResult.ERROR.getCode()); server.put("msg", SvrResult.ERROR.getMsg()); logger.error("Exception", e); } return output.toJSONString(jsonStyle); }
@RequestMapping(value = "/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/branches/{branchName}/rules", method = RequestMethod.GET) public GrayReleaseRuleDTO findBranchGrayRules(@PathVariable String appId, @PathVariable String clusterName, @PathVariable String namespaceName, @PathVariable String branchName) { checkBranch(appId, clusterName, namespaceName, branchName); GrayReleaseRule rules = namespaceBranchService.findBranchGrayRules(appId, clusterName, namespaceName, branchName); if (rules == null) { return null; } GrayReleaseRuleDTO ruleDTO = new GrayReleaseRuleDTO(rules.getAppId(), rules.getClusterName(), rules.getNamespaceName(), rules.getBranchName()); ruleDTO.setReleaseId(rules.getReleaseId()); ruleDTO.setRuleItems(GrayReleaseRuleItemTransformer.batchTransformFromJSON(rules.getRules())); return ruleDTO; }
@RequestMapping(value = "/dashboards/{name}/builds", method = GET, produces = APPLICATION_JSON_VALUE) public Map<String, Object> getBuildsByBoardName(@PathVariable("name") String name) { DashboardDTO dashboard = dashboardService.getDashboard(name); if (dashboard == null || dashboard.getCodeRepos() == null || dashboard.getCodeRepos().isEmpty()) { return null; } List<Build> builds = buildService .getLastBuildsByKeywordsAndByTeamMembers( dashboard.getCodeRepos(), dashboard.getTeamMembers()); BuildStats stats = buildService.getStatsByKeywordsAndByTeamMembers( dashboard.getCodeRepos(), dashboard.getTeamMembers()); Map<String, Object> response = new HashMap<>(); response.put("lastBuilds", builds); response.put("stats", stats); return response; }
/** * Edit post with provided id. * It is not possible to edit if the user is not authenticated * and if he is now the owner of the post * * @param id * @param principal * @return post model and postForm view, for editing post */ @RequestMapping(value = "/editPost/{id}", method = RequestMethod.GET) public ModelAndView editPostWithId(@PathVariable Long id, Principal principal) { ModelAndView modelAndView = new ModelAndView(); Post post = postService.findPostForId(id); // Not possible to edit if user is not logged in, or if he is now the owner of the post if (principal == null || !principal.getName().equals(post.getUser().getUsername())) { modelAndView.setViewName("403"); } if (post == null) { modelAndView.setViewName("404"); } else { modelAndView.addObject("post", post); modelAndView.setViewName("postForm"); } return modelAndView; }
@GetMapping(value = BASE_PATH + "/" + FILENAME + "/raw", produces = MediaType.IMAGE_JPEG_VALUE) @ResponseBody public Mono<ResponseEntity<?>> oneRawImage( @PathVariable String filename) { // tag::try-catch[] return imageService.findOneImage(filename) .map(resource -> { try { return ResponseEntity.ok() .contentLength(resource.contentLength()) .body(new InputStreamResource( resource.getInputStream())); } catch (IOException e) { return ResponseEntity.badRequest() .body("Couldn't find " + filename + " => " + e.getMessage()); } }); // end::try-catch[] }
/** * GET Details for a specific Topic. */ @ResponseBody @RequestMapping(path = "/cluster/{id}/topic/{topic}/details", method = RequestMethod.GET, produces = "application/json") public TopicDetails getTopicDetails(@PathVariable final Long id, @PathVariable final String topic) { // Retrieve cluster final Cluster cluster = clusterRepository.findOne(id); if (cluster == null) { throw new NotFoundApiException("TopicDetails", "Unable to find cluster"); } // Create new Operational Client try (final KafkaOperations operations = createOperationsClient(cluster)) { return operations.getTopicDetails(topic); } catch (final Exception e) { throw new ApiException("TopicDetails", e); } }
@RequestMapping(value = "/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/{namespaceName}/branches/{branchName}", method = RequestMethod.DELETE) public void deleteBranch(@PathVariable String appId, @PathVariable String env, @PathVariable String clusterName, @PathVariable String namespaceName, @PathVariable String branchName) { boolean canDelete = permissionValidator.hasReleaseNamespacePermission(appId, namespaceName) || (permissionValidator.hasModifyNamespacePermission(appId, namespaceName) && releaseService.loadLatestRelease(appId, Env.valueOf(env), branchName, namespaceName) == null); if (!canDelete) { throw new AccessDeniedException("Forbidden operation. " + "Caused by: 1.you don't have release permission " + "or 2. you don't have modification permission " + "or 3. you have modification permission but branch has been released"); } namespaceBranchService.deleteBranch(appId, Env.valueOf(env), clusterName, namespaceName, branchName); }
/** * Function to delete a user - * Only the administrators can perform this operation * * @param id * @return ResponseEntity<DtoUser> */ @RequestMapping(value = "/{id}", method = RequestMethod.DELETE) public ResponseEntity<DtoUser> deleteOne(@PathVariable("id") final long id) { if (!this.getLoggedInUser().isAdmin()) { LOGGER.error(() -> "Users can only be deleted by system administrators"); return new ResponseEntity<>(HttpStatus.FORBIDDEN); } final IUser found = serviceUser.findOne(id); if (found == null) { LOGGER.warn(() -> "User with id " + id + " not found"); return new ResponseEntity<>(HttpStatus.NOT_FOUND); } LOGGER.debug(() -> "Deleting User with id " + id); serviceUser.deleteUser(found.getId()); return new ResponseEntity<>(getDtoUser(found), HttpStatus.OK); }
@RequestMapping(value="type/{type}") public ActionResultObj findByType(@PathVariable String type){ ActionResultObj result = new ActionResultObj(); try{ if(StringUtil.isNotBlank(type)){ List<EDict> dictList = dictDao.query(Cnd.where("type", "=", type).and("del_flag", "=", Constans.POS_NEG.NEG).orderBy("sort", "asc")); //处理返回值 WMap map = new WMap(); map.put("type", type); map.put("data", dictList); result.ok(map); result.okMsg("查询成功!"); }else{ result.errorMsg("查询失败,字典类型不存在!"); } }catch(Exception e){ e.printStackTrace(); LOG.error("查询失败,原因:"+e.getMessage()); result.error(e); } return result; }
/** * 创新排期,单 JVM 并发量可期的情况下,简单粗暴的使用 synchronized 来解决并发创建、更新排期的问题. * * @param id 会议室 id * @param schedule 新建的排期 */ @RequestMapping(path = "/meetingRooms/{id}/schedule", method = RequestMethod.POST) public synchronized Result<Schedule> createOrUpdateSchedule(@PathVariable(name = "id") Long id, @RequestParam(name = "formId", required = false) String formId, @RequestBody Schedule schedule) { MeetingRoom meetingRoom = meetingRoomRepository.findOne(id); validate(id, schedule); if (null == schedule.getId()) { schedule.setMeetingRoom(meetingRoom); schedule.addParticipant(creatorAsParticipant(schedule, formId)); scheduleRepository.save(schedule); } else { Schedule s = scheduleRepository.findOne(schedule.getId()); Assert.notNull(s, "修改的排期不存在."); s.setTitle(schedule.getTitle()); s.setStartTime(schedule.getStartTime()); s.setEndTime(schedule.getEndTime()); s.setDate(schedule.getDate()); s.setRepeatMode(schedule.getRepeatMode()); scheduleRepository.save(s); } return DefaultResult.newResult(schedule); }
@RequestMapping("edit/{groupId}.htm") public String edit(@PathVariable("groupId")Long groupId, Model model) { Group group = groupService.getById(groupId); List<Group> groups = groupService.getGroupforAgent(); model.addAttribute("group",group); model.addAttribute("groups",groups); return "/group/edit"; }
/** * Return json-information about all users in database. */ @GetMapping("/{id}") @ResponseStatus(HttpStatus.OK) public UserDto loadUserById(@PathVariable final String id) { log.info("Start loadUserById: {}", id); return mapper.map(userService.find(id), UserDto.class); }
@RequestMapping(method = GET, value = "{" + ImportIdPathVar + "}") public ResponseEntity<String> getStatusUpdate( @PathVariable(value=ImportIdPathVar) String importId, HttpServletResponse response) throws IOException { ImportId taskId = new ImportId(importId); Path importLog = service.importLogPathFor(taskId).get(); FileStreamer streamer = new FileStreamer(importLog, MediaType.TEXT_PLAIN, Caches::doNotCache); return streamer.streamOr404(response); }
/** * Returns the Bot status for a given Bot id. * * @param user the authenticated user. * @param botId the id of the Bot to fetch. * @return the Bot status for the given id. */ @PreAuthorize("hasRole('USER')") @RequestMapping(value = "/{botId}" + STATUS_RESOURCE_PATH, method = RequestMethod.GET) public ResponseEntity<?> getBotStatus(@AuthenticationPrincipal User user, @PathVariable String botId) { LOG.info("GET " + RUNTIME_ENDPOINT_BASE_URI + botId + STATUS_RESOURCE_PATH + " - getBotStatus()"); // - caller: " + user.getUsername()); final BotStatus botStatus = botProcessService.getBotStatus(botId); return botStatus == null ? new ResponseEntity<>(HttpStatus.NOT_FOUND) : buildResponseEntity(botStatus, HttpStatus.OK); }
@RequestMapping(value="/updatedept.html/{id}", method=RequestMethod.POST) public String updateRecordSubmit(Model model, @ModelAttribute("departmentForm") DepartmentForm departmentForm, @PathVariable("id") Integer id ){ departmentServiceImpl.updateDepartment(departmentForm, id); model.addAttribute("departments", departmentServiceImpl.readDepartments()); return "dept_result"; }
@GetMapping("/articulo/{id}/eliminar") public String eliminarArticulo (Model model, @PathVariable long id){ Articulo articulo = articulo_repository.findOne(id); articulo_repository.delete(articulo); model.addAttribute("articulos", articulo_repository.findAll()); return "articulo_eliminado"; }
@RequestMapping(value = "/{user_id}", method = GET) public ResponseEntity<UserView> get(@PathVariable("user_id") final String userId) { Optional<User> userOptional = userRemoteService.get(userId); if (userOptional.isPresent()) { UserView userView = userMapper.map(userOptional.get(), UserView.class); return ResponseEntity.ok(userView); } return ResponseEntity.notFound().build(); }
/** * Implements the "Go" command See https://www.w3.org/TR/webdriver/#dfn-go */ @RequestMapping(value = "/session/{sessionId}/url", method = RequestMethod.POST, produces = "application/json; charset=utf-8") public @ResponseBody ResponseEntity<Response> go(@PathVariable String sessionId, @RequestBody(required = false) String body) throws Throwable { LOGGER.info("go -->"); LOGGER.info(" -> " + body); LOGGER.info(" <- ERROR: unknown command"); LOGGER.info("go <--"); return responseFactory.error(sessionId, ProtocolError.UNKNOWN_COMMAND); }
/** * 通过menuId获取元素列表 * @return * @throws RuntimeException */ @ApiOperation(value = "通过menuId获取元素列表" ) @RequestMapping(value = "getByMenuId/{menuId}", method = RequestMethod.GET) public JSONObject getByMenuId(@PathVariable Integer menuId)throws Exception{ List<TElement> result = bsi.getListByMenuId(menuId); return JsonUtil.getSuccessJsonObject(result); }
@RequestMapping(value="/extra/user/deletefaq/{faqid}") public ResultBody deleteFaq(@PathVariable String faqid) throws GlobalErrorInfoException{ try { faqinfoServiceImpl.deleteFaqinfo(faqid); } catch (Exception e) { e.printStackTrace(); logger.debug(e); throw new GlobalErrorInfoException(NodescribeErrorInfoEnum.NO_DESCRIBE_ERROR); } return new ResultBody(new HashMap<>()); }
@RequestMapping(method = RequestMethod.POST, value = "{userId}/obligation", produces = "application/json", consumes = "application/json") public ResponseEntity<String> addObligationDetails(@RequestBody ObligationDetails obligationDetails, @PathVariable("userId") UUID userId) { logger.debug(addObligationDetails + " Creating user's obligation with Id " + userId + " and details : " + obligationDetails); obligationDetails.setUserId(userId.toString()); financialService.saveObligation(obligationDetails); return new ResponseEntity<>(HttpStatus.CREATED); }
@RequestMapping(value = "/{id}.html", method = RequestMethod.PUT) public ModelAndView put(@PathVariable("id") long id, Customer customer, HttpServletRequest httpRequest) { customer.setId(id); customerRepository.save(customer); return new ModelAndView("success"); }
@RequestMapping("/tags:{tagNames}/search:{search}/sort:{sort}/page:{page}") public String tagsWithSearch(@PathVariable("tagNames") String tagNames, @PathVariable("search") String search, @PathVariable("sort") String sort, @PathVariable("page") String page,Model model){ List<String> tags = this.tagService.stringToTagList(tagNames); Weaver currentWeaver = this.weaverService.getCurrentWeaver(); if(!this.tagService.validateTag(tags,currentWeaver)){ return "redirect:/code/sort:age-desc/page:1"; } int pageNum = WebUtil.getPageNumber(page); int size = WebUtil.getPageSize(page,5); model.addAttribute("codes", this.codeService.getCodes(currentWeaver,tags, search, sort, pageNum, size)); model.addAttribute("codeCount", this.codeService.countCodes(currentWeaver,tags, search, sort)); model.addAttribute("number", size); model.addAttribute("tagNames", tagNames); model.addAttribute("search", search); model.addAttribute("pageIndex", pageNum); model.addAttribute("pageUrl", "/tags:"+tagNames+"/search:"+search+"/sort:"+sort+"/page:"); return "/code/front"; }
/** * DELETE /exerciseTips/:id -> delete the "id" exerciseTip. */ @RequestMapping(value = "/exerciseTips/{id}", method = RequestMethod.DELETE, produces = MediaType.APPLICATION_JSON_VALUE) @Timed public ResponseEntity<Void> deleteExerciseTip(@PathVariable Long id) { log.debug("REST request to delete ExerciseTip : {}", id); exerciseTipRepository.delete(id); return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert("exerciseTip", id.toString())).build(); }
@RequestMapping( value = "/after/{date}", method = RequestMethod.POST ) public List< Holidays > getHolidaysAfter( @PathVariable String date ) throws ParseException { SimpleDateFormat sdf = new SimpleDateFormat( "dd-MM-yyyy" ); Date actualDate = sdf.parse( date ); logger.info( "Fetching holidays after " + actualDate ); return holidayService.getHolidaysafter( actualDate ); }
@RequestMapping(value="/languagelearn/delete/{id}", method=RequestMethod.POST, produces=MediaType.APPLICATION_JSON_UTF8_VALUE) public void deleteLanguagelearn(@PathVariable("id") Long languageId){ logger.info( "deleteLanguagelearn()..." ); try { this.talkerService.deleteLanguageLearn(languageId); } catch (Exception e) { logger.error(e.getMessage()); } }
@GetMapping(value = "/customer/{name}/get/fraud/get/", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) ResponseEntity<FraudResponse> frauds(@PathVariable String name) { // I smell NPE List<Charge> charges = manager.listAllCharges(name).getCharges(); if (charges.isEmpty()) { return ResponseEntity .accepted() .body(new FraudResponse("You're not a fraud", UUID.randomUUID().toString())); } return ResponseEntity .status(HttpStatus.BAD_REQUEST) .body(new FraudResponse("Pay your debts first", UUID.randomUUID().toString())); }
@RequestMapping(value = "/person/{id}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity<Person> getPerson(@PathVariable("id") Integer id, Environment environment) { Person person = service.getPerson(id); if (null != person) { return new ResponseEntity<Person>(person, HttpStatus.OK); } return new ResponseEntity<Person>(HttpStatus.NOT_FOUND); }
@PostMapping("/users/{name}/todos") ResponseEntity<?> add(@PathVariable String name, @Valid @RequestBody Todo todo) { Todo createdTodo = todoService.addTodo(name, todo.getDesc(), todo.getTargetDate(), todo.isDone()); if (createdTodo == null) { return ResponseEntity.noContent().build(); } URI location = ServletUriComponentsBuilder.fromCurrentRequest().path("/{id}") .buildAndExpand(createdTodo.getId()).toUri(); return ResponseEntity.created(location).build(); }
/** * 删除权限 * @param permissionId 权限id * @return */ @ResponseBody @RequiresPermissions("system:menu:permissionDelete") @MumuLog(name = "删除菜单下的权限",operater = "DELETE") @RequestMapping(value = "/permission/{permissionId}", method = RequestMethod.DELETE) public ResponseEntity deleteMenuPermission(@PathVariable String permissionId) { try { permissionService.deletePermissionById(permissionId); } catch (Exception e) { log.error(e); return new ResponseEntity(500, "删除菜单权限出现异常", null); } return new ResponseEntity(200,"删除菜单权限操作成功",null); }
@RequestMapping("/delete/{id}") @Menu(type = "apps" , subtype = "topic" , access = true) public ModelAndView delete(HttpServletRequest request , HttpServletResponse response, @PathVariable String id) { ModelAndView view = request(super.createRequestPageTempletResponse("redirect:/")) ; if(!StringUtils.isBlank(id)){ topicRes.delete(id); } return view; }
@RequestMapping(value = "/getOrgs/{type}") public ActionResultObj getOrgsByListByType(@PathVariable String type) { ActionResultObj result = new ActionResultObj(); try { if (StringUtil.isNotBlank(type)) { // 处理查询条件 Criteria cnd = Cnd.cri(); if(!type.equals("all")){ cnd.where().andEquals("type", type); } cnd.getOrderBy().desc("id"); // 分页查询 List<EOrg> orgList = orgDao.query(cnd); // 处理返回值 WMap map = new WMap(); map.put("data", orgList); result.ok(map); result.okMsg("查询成功!"); } else { result.errorMsg("删除失败,链接不存在!"); } } catch (Exception e) { e.printStackTrace(); LOG.error("查询失败,原因:" + e.getMessage()); result.error(e); } return result; }