org.springframework.web.bind.annotation.RequestMethod Java Examples
The following examples show how to use
org.springframework.web.bind.annotation.RequestMethod.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: QywxMenuController.java From jeewx with Apache License 2.0 | 6 votes |
/** * 删除 * @return */ @RequestMapping(params="doDelete",method = RequestMethod.GET) @ResponseBody public AjaxJson doDelete(@RequestParam(required = true, value = "id" ) String id){ AjaxJson j = new AjaxJson(); try { QywxMenu qywxMenu = new QywxMenu(); qywxMenu.setId(id); qywxMenuDao.delete(qywxMenu); j.setMsg("删除成功"); } catch (Exception e) { log.info(e.getMessage()); j.setSuccess(false); j.setMsg("删除失败"); } return j; }
Example #2
Source File: SysConfigController.java From batch-scheduler with MIT License | 6 votes |
@ApiOperation(value = "更新系统参数", notes = "更新结果只对当前操作的域有效") @ApiImplicitParams({ @ApiImplicitParam(required = true, name = "domain_id", value = "域编码"), @ApiImplicitParam(required = true, name = "config_id", value = "参数编码"), @ApiImplicitParam(required = true, name = "config_value", value = "参数值"), }) @RequestMapping(value = "/v1/dispatch/config/user", method = RequestMethod.POST) public String updateConfigValue(HttpServletResponse response, HttpServletRequest request) { String domainId = request.getParameter("domain_id"); String configId = request.getParameter("config_id"); String configValue = request.getParameter("config_value"); int size = sysConfigService.setValue(domainId, configId, configValue); if (size != 1) { response.setStatus(421); return Hret.error(421, "更新ETL调度系统核心参数失败", null); } return Hret.success(200, "success", null); }
Example #3
Source File: ApplicationViewController.java From abixen-platform with GNU Lesser General Public License v2.1 | 6 votes |
@RequestMapping(value = "", method = RequestMethod.GET) public ModelAndView renderApplicationPage() { log.debug("renderApplicationPage()"); final List<ModuleType> moduleTypes = moduleTypeHystrixClient.getAllModuleTypes(); final Set<Resource> resources = new HashSet<>(); moduleTypes.forEach(moduleType -> { resources.addAll(moduleType.getResources()); }); resources.forEach(resource -> log.debug("resource: {}", resource)); List<Resource> uniqueResources = resources.stream().filter(distinctByKey(resource -> resource.getRelativeUrl())).collect(Collectors.toList()); List<String> angularJsModules = moduleTypes.stream().filter(moduleType -> moduleType.getAngularJsNameApplication() != null).filter(distinctByKey(moduleType -> moduleType.getAngularJsNameApplication())).map(moduleType -> moduleType.getAngularJsNameApplication()).collect(Collectors.toList()); angularJsModules.forEach(angularJsModule -> log.debug(angularJsModule)); ModelAndView modelAndView = new ModelAndView("application/index"); modelAndView.addObject("resources", uniqueResources); modelAndView.addObject("angularJsModules", angularJsModules); return modelAndView; }
Example #4
Source File: StepApiController.java From onboard with Apache License 2.0 | 6 votes |
@RequestMapping(value = "", method = RequestMethod.POST) @Interceptors({ ProjectMemberRequired.class }) @ResponseBody @Caching(evict = { @CacheEvict(value = IterationApiController.ITERATION_CACHE_NAME, key = "#projectId + '*'"), @CacheEvict(value = IterationApiController.ITERATIONS_CACHE_NAME, key = "#projectId + '*'"), @CacheEvict(value = StoryApiController.GET_STORIES_CACHE, key = "#projectId + '*'") }) public StepDTO newStep(@RequestBody Step step, @PathVariable int projectId) { step.setCreatorId(sessionService.getCurrentUser().getId()); step.setCreatorName(sessionService.getCurrentUser().getName()); step.setStatus(IterationItemStatus.TODO.getValue()); step = stepService.create(step); if (step.getAssigneeId() != null) { step.setAssignee(userService.getById(step.getAssigneeId())); } return StepTransform.stepToStepDTO(step); }
Example #5
Source File: MenuController.java From Mario with Apache License 2.0 | 6 votes |
@RequiresRoles("admin") @RequestMapping(value = "create", method = RequestMethod.POST) public String create(@Valid Menu menu, BindingResult result, Model model, RedirectAttributes redirectAttributes) { if (result.hasErrors()) { Menu topMenu = accountService.getTopMenu(); menu.setParent(topMenu); model.addAttribute("menu", menu); model.addAttribute("allShows", allShows); model.addAttribute("action", "create"); return "account/menuForm"; } generateMenuParentIds(menu); accountService.saveMenu(menu); redirectAttributes.addFlashAttribute("message", "创建菜单成功"); return "redirect:/account/menu"; }
Example #6
Source File: AppAdminController.java From jeesuite-config with Apache License 2.0 | 6 votes |
@RequestMapping(value = "add", method = RequestMethod.POST) public ResponseEntity<WrapperResponseEntity> addApp(@RequestBody AddOrEditAppRequest addAppRequest){ SecurityUtil.requireSuperAdmin(); if(addAppRequest.getMasterUid() == null || addAppRequest.getMasterUid() == 0){ throw new JeesuiteBaseException(1002, "请选择项目负责人"); } if(appMapper.findByName(addAppRequest.getName()) != null){ throw new JeesuiteBaseException(1002, "应用["+addAppRequest.getName()+"]已存在"); } AppEntity appEntity = BeanUtils.copy(addAppRequest, AppEntity.class); // UserEntity master = userMapper.selectByPrimaryKey(addAppRequest.getMasterUid()); appEntity.setMaster(master.getName()); appMapper.insertSelective(appEntity); return new ResponseEntity<WrapperResponseEntity>(new WrapperResponseEntity(true),HttpStatus.OK); }
Example #7
Source File: OutcomeController.java From lams with GNU General Public License v2.0 | 6 votes |
@RequestMapping(path = "/outcomeRemoveMapping", method = RequestMethod.POST) public void outcomeRemoveMapping(HttpServletRequest request, HttpServletResponse response) throws Exception { Long mappingId = WebUtil.readLongParam(request, "mappingId"); OutcomeMapping outcomeMapping = (OutcomeMapping) userManagementService.findById(OutcomeMapping.class, mappingId); Organisation organisation = outcomeMapping.getOutcome().getOrganisation(); Integer organisationId = organisation == null ? null : organisation.getOrganisationId(); Integer userId = getUserDTO().getUserID(); if (organisationId == null) { if (!request.isUserInRole(Role.SYSADMIN) && !request.isUserInRole(Role.AUTHOR)) { String error = "User " + userId + " is not sysadmin nor an author and can not remove an outcome mapping"; log.error(error); throw new SecurityException(error); } } else { securityService.hasOrgRole(organisationId, userId, new String[] { Role.AUTHOR }, "remove outcome mapping", true); } userManagementService.delete(outcomeMapping); if (log.isDebugEnabled()) { log.debug("Deleted outcome mapping " + outcomeMapping); } }
Example #8
Source File: CommentController.java From Blog-System with Apache License 2.0 | 6 votes |
@RequestMapping(value = "/api/comment/add", method = RequestMethod.POST) public @ResponseBody Object commentAdd(HttpServletRequest request) { Comment comment=new Comment(); comment.setArticleId(Long.parseLong(request.getParameter("articleId"))); comment.setContent(request.getParameter("content")); comment.setDate(new Date()); comment.setName(request.getParameter("name")); comment.setEmail(request.getParameter("email")); HashMap<String, String> res = new HashMap<String, String>(); if(commentService.insertComment(comment)>0){ res.put("stateCode", "1"); }else { res.put("stateCode", "0"); } return res; }
Example #9
Source File: BrownFieldSiteController.java From Microservices-Building-Scalable-Software with MIT License | 6 votes |
@RequestMapping(value="/confirm", method=RequestMethod.POST) public String ConfirmBooking(@ModelAttribute UIData uiData, Model model) { Flight flight= uiData.getSelectedFlight(); BookingRecord booking = new BookingRecord(flight.getFlightNumber(),flight.getOrigin(), flight.getDestination(), flight.getFlightDate(),null, flight.getFares().getFare()); Set<Passenger> passengers = new HashSet<Passenger>(); Passenger pax = uiData.getPassenger(); pax.setBookingRecord(booking); passengers.add(uiData.getPassenger()); booking.setPassengers(passengers); long bookingId =0; try { //long bookingId = bookingClient.postForObject("http://book-service/booking/create", booking, long.class); bookingId = bookingClient.postForObject("http://book-apigateway/api/booking/create", booking, long.class); logger.info("Booking created "+ bookingId); }catch (Exception e){ logger.error("BOOKING SERVICE NOT AVAILABLE...!!!"); } model.addAttribute("message", "Your Booking is confirmed. Reference Number is "+ bookingId); return "confirm"; }
Example #10
Source File: MonitoringController.java From lams with GNU General Public License v2.0 | 6 votes |
@RequestMapping(path = "/appointScribe", method = RequestMethod.POST) public String appointScribe(@ModelAttribute("monitoringForm") MonitoringForm monitoringForm, HttpServletRequest request) { ScribeSession session = scribeService.getSessionBySessionId(monitoringForm.getToolSessionID()); ScribeUser user = scribeService.getUserByUID(monitoringForm.getAppointedScribeUID()); session.setAppointedScribe(user); scribeService.saveOrUpdateScribeSession(session); ScribeDTO scribeDTO = setupScribeDTO(session.getScribe()); boolean isGroupedActivity = scribeService.isGroupedActivity(session.getScribe().getToolContentId()); request.setAttribute("isGroupedActivity", isGroupedActivity); request.setAttribute("monitoringDTO", scribeDTO); request.setAttribute("contentFolderID", monitoringForm.getContentFolderID()); monitoringForm.setCurrentTab(WebUtil.readLongParam(request, AttributeNames.PARAM_CURRENT_TAB, true)); return "pages/monitoring/monitoring"; }
Example #11
Source File: RoleAdminController.java From Roothub with GNU Affero General Public License v3.0 | 6 votes |
@RequestMapping(value = "/save", method = RequestMethod.POST) @Override public ModelAndView save(RoleVO roleVO, HttpServletRequest request, HttpServletResponse response) { ModelAndView mv = new ModelAndView(); String roleName = roleVO.getRoleName(); if (StringUtils.isEmpty(roleName)) { mv.setViewName(this.getJspPrefix() + "/add"); mv.addObject("error", "角色名称不能为空"); return mv; } QueryWrapper<Role> queryWrapper = new QueryWrapper<>(); queryWrapper.eq("role_name", roleVO.getRoleName()); RoleDTO roleDTO = this.roleService.getOne(queryWrapper); if (roleDTO != null) { mv.setViewName(this.getJspPrefix() + "/add"); mv.addObject("error", "角色名称已存在"); return mv; } roleVO.setCreateDate(DateUtils.formatDateTime(new Date())); mv = super.save(roleVO, request, response); mv.setViewName(redirect(request, "/admin/role/list")); return mv; }
Example #12
Source File: UserController.java From springboot-security-wechat with Apache License 2.0 | 6 votes |
@RequestMapping(method = {RequestMethod.POST}, value = "/wechatJoin") @ResponseBody public Response wechatJoin(@RequestParam(value = "name") String name, @RequestParam(value = "phone") String phone, @RequestParam(value = "vCode") String vCode, @RequestParam(value = "password") String password, HttpServletRequest request) { UserResponse userResponse = null; try { User user = userService.wechatJoin(name, phone, vCode, password, getUser()); user.setPassword(""); userResponse = userService.getUserInfo(user); } catch (Exception e) { return errorResponse("绑定失败", e.toString()); } return successResponse("绑定成功", userResponse); }
Example #13
Source File: SystemPermissionController.java From mumu with Apache License 2.0 | 6 votes |
/** * 添加权限 * @return */ @ResponseBody @RequiresPermissions("system:permission:add") @MumuLog(name = "添加权限",operater = "POST") @RequestMapping(value="/add",method=RequestMethod.POST) public ResponseEntity savePermission(SysPermission permission, HttpServletRequest request){ //获取权限内码和权限名称下面的权限列表 List<SysPermission> permissions = permissionService.querySysPermissionByCondition(null, permission.getPermissionCode(), permission.getPermissionName(), PublicEnum.NORMAL.value()); if(permissions!=null&&permissions.size()>0){ return new ResponseEntity(500, "权限内码、权限名称不可重复", null); } try { permission.setCreator(SecurityUtils.getSubject().getPrincipal().toString()); permissionService.addPermission(permission); } catch (Exception e) { log.error(e); return new ResponseEntity(500,"保存权限内码出现异常",null); } return new ResponseEntity(200, "保存权限操作成功", null); }
Example #14
Source File: AuthenticationRestController.java From tour-of-heros-api-security-zerhusen with MIT License | 6 votes |
@RequestMapping(value = "${jwt.route.authentication.path}", method = RequestMethod.POST) public ResponseEntity<?> createAuthenticationToken(@RequestBody JwtAuthenticationRequest authenticationRequest, Device device) throws AuthenticationException { // Perform the security final Authentication authentication = authenticationManager.authenticate( new UsernamePasswordAuthenticationToken( authenticationRequest.getUsername(), authenticationRequest.getPassword() ) ); SecurityContextHolder.getContext().setAuthentication(authentication); // Reload password post-security so we can generate token final UserDetails userDetails = userDetailsService.loadUserByUsername(authenticationRequest.getUsername()); final String token = jwtTokenUtil.generateToken(userDetails, device); // Return the token return ResponseEntity.ok(new JwtAuthenticationResponse(token)); }
Example #15
Source File: UserController.java From cf-SpringBootTrader with Apache License 2.0 | 6 votes |
@RequestMapping(value = "/registration", method = RequestMethod.POST) public String register(Model model, @ModelAttribute(value="account") Account account) { logger.info("register: user:" + account.getUserid()); //need to set some stuff on account... account.setOpenbalance(account.getBalance()); account.setCreationdate(new Date()); AuthenticationRequest login = new AuthenticationRequest(); login.setUsername(account.getUserid()); model.addAttribute("login", login); model.addAttribute("marketSummary", summaryService.getMarketSummary()); accountService.createAccount(account); return "index"; }
Example #16
Source File: AdminMediaLibrary.java From fenixedu-cms with GNU Lesser General Public License v3.0 | 5 votes |
@RequestMapping(value = "{siteSlug}/{postFileId}/delete", method = RequestMethod.POST) public RedirectView delete(@PathVariable String siteSlug, @PathVariable String postFileId) { Site site = Site.fromSlug(siteSlug); ensureCanDoThis(site, PermissionsArray.Permission.EDIT_POSTS); PostFile postFile = FenixFramework.getDomainObject(postFileId); Post post = postFile.getPost(); if(site.equals(postFile.getSite())) { FenixFramework.atomic(()-> { postFile.delete(); post.fixOrder(post.getFilesSorted()); }); } return mediaLibraryRedirect(site); }
Example #17
Source File: IcsCalendarController.java From fredbet with Creative Commons Attribution Share Alike 4.0 International | 5 votes |
@RequestMapping(value = "/{matchId}", method = RequestMethod.GET, produces = CONTENT_TYPE) public ResponseEntity<byte[]> downloadIcsCalendarFile(@PathVariable("matchId") Long matchId) { final IcsFile icsFile = icsCalendarService.createCalendarEventFromMatch(matchId, LocaleContextHolder.getLocale()); if (icsFile == null) { return ResponseEntity.notFound().build(); } return ResponseEntity.ok().header("Content-Type", CONTENT_TYPE) .header("Content-Disposition", "inline; filename=\"" + icsFile.getFileName() + "\"") .body(icsFile.getBinary()); }
Example #18
Source File: AnalysisController.java From seppb with MIT License | 5 votes |
@RequestMapping(value = "/sqa/bugTmsDensity", method = RequestMethod.POST) public List<Map<String, Object>> defectTmsDensity(HttpServletRequest request) { Map<String, Object> dataMap = new HashMap<>(); dataMap.put(PRODUCT_ID, request.getParameter(PRODUCT_ID)); dataMap.put(QRY_TIME_BEGIN, request.getParameter(QRY_TIME_BEGIN) + " 00:00:00"); dataMap.put(QRY_TIME_END, request.getParameter(QRY_TIME_END) + " 23:59:59"); return analysisService.defectTmsDensity(dataMap); }
Example #19
Source File: EntityApi.java From cicada with MIT License | 5 votes |
/** * 分页获取span. */ @RequestMapping(value = "/spans", method = RequestMethod.POST) @ApiOperation(value = ApiDocs.FETCH_SPAN_PAGE, notes = ApiDocs.FETCH_SPAN_PAGE) public List<SpanModel> fetchSpansPage(@RequestBody final EntityPageRequest request) { if (!request.isValid()) { log.error("request invalid error : fetch span pages request's param incomplete!"); throw new BadRequestException(AppError.INCOMPLETE_PAGE_REQUEST_PARAMS); } return spanService.fetchSpanPage(request); }
Example #20
Source File: RestNetworkServiceRecord.java From NFVO with Apache License 2.0 | 5 votes |
@ApiOperation( value = "Upgrade a Virtual Network Function Record in a NSR", notes = "Specify the ids of the parent NSR and of the VNFR which will be upgraded") @RequestMapping( value = "{idNsr}/vnfrecords/{idVnfr}/upgrade", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE) @ResponseStatus(HttpStatus.ACCEPTED) public void upgradeVnfr( @PathVariable("idNsr") String idNsr, @PathVariable("idVnfr") String idVnfr, @RequestHeader(value = "project-id") String projectId, @RequestBody @Valid JsonObject body) throws NotFoundException, BadFormatException, BadRequestException, ExecutionException, InterruptedException, IOException, VimException, PluginException, VimDriverException { NetworkServiceRecord nsr = networkServiceRecordManagement.query(idNsr, projectId); VirtualNetworkFunctionRecord vnfRecord = networkServiceRecordManagement.getVirtualNetworkFunctionRecord(idNsr, idVnfr, projectId); nsr.getVnfr().add(vnfRecord); String upgradeRequestEntityKey = "vnfdId"; if (!body.has(upgradeRequestEntityKey) || !body.getAsJsonPrimitive(upgradeRequestEntityKey).isString()) throw new BadRequestException( "The passed JSON is not correct. It should include a string field named: " + upgradeRequestEntityKey); // String vnfPackageId = body.getAsJsonPrimitive("vnfPackageId").getAsString(); String upgradeVnfdId = body.getAsJsonPrimitive(upgradeRequestEntityKey).getAsString(); log.info("Executing UPGRADE for VNFR: " + vnfRecord.getName()); networkServiceRecordManagement.upgradeVnfr(idNsr, idVnfr, projectId, upgradeVnfdId); }
Example #21
Source File: ImgController.java From fileServer with Apache License 2.0 | 5 votes |
@ApiOperation(value="上传并裁剪图片", notes="上传并裁剪图片") @RequestMapping(value = "/uploadCutImg", method = RequestMethod.POST) public FileServerModel uploadImage( @ApiParam(value = "文件流,name=file") @RequestParam("file") MultipartFile file, @ApiParam(value = "裁剪尺寸(数组类型)如:20x20,30x30,100x100") @RequestParam("cutSize") String cutSize) throws ServiceException { return imgService.uploadImage(file,cutSize); }
Example #22
Source File: Service.java From arctic-sea with Apache License 2.0 | 5 votes |
@RequestMapping(method = RequestMethod.DELETE) public void delete(HttpServletRequest request, HttpServletResponse response) throws IOException { Stopwatch stopwatch = Stopwatch.createStarted(); long currentCount = logRequest(request); addVersionHeader(response); try { getBinding(request).doDeleteOperation(request, response); } catch (HTTPException exception) { onHttpException(request, response, exception); } finally { logResponse(request, response, currentCount, stopwatch); } }
Example #23
Source File: AnkushHadoopClusterMonitoring.java From ankush with GNU Lesser General Public License v3.0 | 5 votes |
/** * Hadoop submit jobs. * * @param model the model * @param clusterId the cluster id * @return the string */ @RequestMapping(value = "/{clusterName}/{hybridTechnology}/submitJobs/C-D/{clusterId}/{clusterTechnology}", method = RequestMethod.GET) public String hadoopSubmitJobs(ModelMap model ,@PathVariable("clusterId") String clusterId ,@PathVariable("clusterName") String clusterName ,@PathVariable("clusterTechnology") String clusterTechnology ,@PathVariable("hybridTechnology") String hybridTechnology) { logger.info("Inside Hadoop Submit Jobs view"); model.addAttribute("clusterId",clusterId); model.addAttribute("clusterTechnology",clusterTechnology); model.addAttribute("clusterName",clusterName); model.addAttribute("hybridTechnology",hybridTechnology); model.addAttribute("page","submitJob"); return "hadoop/monitoring_hadoop/jobSubmission"; }
Example #24
Source File: BusinessObjectDataStatusRestController.java From herd with Apache License 2.0 | 5 votes |
/** * Updates status of a business object data with 3 subpartition values. <p>Requires WRITE permission on namespace</p> * * @param namespace the namespace * @param businessObjectDefinitionName the business object definition name * @param businessObjectFormatUsage the business object format usage * @param businessObjectFormatFileType the business object format file type * @param businessObjectFormatVersion the business object format version * @param partitionValue the partition value * @param subPartition1Value the value of the first subpartition * @param subPartition2Value the value of the second subpartition * @param subPartition3Value the value of the third subpartition * @param businessObjectDataVersion the business object data version * @param request the business object data status update request * * @return the business object data status update response */ @RequestMapping( value = BUSINESS_OBJECT_DATA_STATUS_URI_PREFIX + "/namespaces/{namespace}" + "/businessObjectDefinitionNames/{businessObjectDefinitionName}/businessObjectFormatUsages/{businessObjectFormatUsage}" + "/businessObjectFormatFileTypes/{businessObjectFormatFileType}/businessObjectFormatVersions/{businessObjectFormatVersion}" + "/partitionValues/{partitionValue}/subPartition1Values/{subPartition1Value}/subPartition2Values/{subPartition2Value}" + "/subPartition3Values/{subPartition3Value}/businessObjectDataVersions/{businessObjectDataVersion}", method = RequestMethod.PUT, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_BUSINESS_OBJECT_DATA_STATUS_PUT) public BusinessObjectDataStatusUpdateResponse updateBusinessObjectDataStatus(@PathVariable("namespace") String namespace, @PathVariable("businessObjectDefinitionName") String businessObjectDefinitionName, @PathVariable("businessObjectFormatUsage") String businessObjectFormatUsage, @PathVariable("businessObjectFormatFileType") String businessObjectFormatFileType, @PathVariable("businessObjectFormatVersion") Integer businessObjectFormatVersion, @PathVariable("partitionValue") String partitionValue, @PathVariable("subPartition1Value") String subPartition1Value, @PathVariable("subPartition2Value") String subPartition2Value, @PathVariable("subPartition3Value") String subPartition3Value, @PathVariable("businessObjectDataVersion") Integer businessObjectDataVersion, @RequestBody BusinessObjectDataStatusUpdateRequest request) { // Update status of the business object data. BusinessObjectDataStatusUpdateResponse businessObjectDataStatusUpdateResponse = businessObjectDataStatusService.updateBusinessObjectDataStatus( new BusinessObjectDataKey(namespace, businessObjectDefinitionName, businessObjectFormatUsage, businessObjectFormatFileType, businessObjectFormatVersion, partitionValue, Arrays.asList(subPartition1Value, subPartition2Value, subPartition3Value), businessObjectDataVersion), request); // Create business object data notification. notificationEventService.processBusinessObjectDataNotificationEventAsync(NotificationEventTypeEntity.EventTypesBdata.BUS_OBJCT_DATA_STTS_CHG, businessObjectDataStatusUpdateResponse.getBusinessObjectDataKey(), businessObjectDataStatusUpdateResponse.getStatus(), businessObjectDataStatusUpdateResponse.getPreviousStatus()); return businessObjectDataStatusUpdateResponse; }
Example #25
Source File: HomeController.java From Spring with Apache License 2.0 | 5 votes |
@RequestMapping(value="/logout", method = RequestMethod.GET) public ModelAndView logout(SecurityContextHolder sch, HttpServletRequest request) throws ServletException { final ModelAndView mav = new ModelAndView("home"); request.logout(); // clearing security context the application #1 //sch.getContext().setAuthentication(null); clearing security context the application #2 //sch.clearContext(); clearing security context the application #3 return mav; }
Example #26
Source File: AnkushDashboardController.java From ankush with GNU Lesser General Public License v3.0 | 5 votes |
@RequestMapping(value = "/nodeMaintenance", method = RequestMethod.GET) public String nodeMaintenance(ModelMap model,@RequestParam("clusterId") String clusterId,@RequestParam("host") String host) { model.addAttribute("title", "nodeMaintenance"); model.addAttribute("clusterId", clusterId); model.addAttribute("host", host); return "dashboard/nodeMaintenance"; }
Example #27
Source File: RestaurantController.java From Mastering-Microservices-with-Java-9-Second-Edition with MIT License | 5 votes |
/** * Fetch restaurants with the specified name. A partial case-insensitive * match is supported. So <code>http://.../restaurants/rest</code> will find * any restaurants with upper or lower case 'rest' in their name. * * @param name * @return A non-null, non-empty collection of restaurants. */ @RequestMapping(method = RequestMethod.GET) public ResponseEntity<Collection<Restaurant>> findByName(@RequestParam("name") String name) { logger.info(String.format("restaurant-service findByName() invoked:{} for {} ", restaurantService.getClass().getName(), name)); name = name.trim().toLowerCase(); Collection<Restaurant> restaurants; try { restaurants = restaurantService.findByName(name); } catch (Exception ex) { logger.log(Level.SEVERE, "Exception raised findByName REST Call", ex); return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); } return restaurants.size() > 0 ? new ResponseEntity<>(restaurants, HttpStatus.OK) : new ResponseEntity<>(HttpStatus.NO_CONTENT); }
Example #28
Source File: ActionController.java From qconfig with MIT License | 5 votes |
@RequestMapping(value = "/publish", method = RequestMethod.POST) @ResponseBody public Object publish(@RequestBody CandidateDTO candidate) { logger.info("publish with {}", candidate); checkCandidate(candidate); Monitor.PUBLISH_STATICS.inc(); try { applyService.publish(candidate, ""); return JsonV2.success(); } catch (Exception e) { return handleException(candidate, e); } }
Example #29
Source File: BrownFieldSiteController.java From Learning-Path-Spring-5-End-to-End-Programming with MIT License | 5 votes |
@RequestMapping(value="/", method=RequestMethod.GET) public String greetingForm(Model model) { SearchQuery query = new SearchQuery("NYC","SFO","22-JAN-18"); UIData uiData = new UIData(); uiData.setSearchQuery(query); model.addAttribute("uidata",uiData ); return "search"; }
Example #30
Source File: AdminLoginController.java From Spring-MVC-Blueprints with MIT License | 5 votes |
@RequestMapping(method=RequestMethod.GET) public String initForm(Model model, HttpServletRequest req){ LoginForm adminLoginForm = new LoginForm(); model.addAttribute("adminLoginForm", adminLoginForm); return "admin_login_form"; }