コード例 #1
0
 @RequestMapping(value = "/providers", method = RequestMethod.GET)
 public String findAllProvider(Model uiModel) {
   Provider provider = providerService.findOne(6l);
   System.out.println(provider.getBusinessLicenseUrl());
   uiModel.addAttribute("provider", provider);
   return PROVIDERCREATEOK;
 }
コード例 #2
0
 @RequestMapping(value = "/provider/detail", method = RequestMethod.GET)
 public String findCurrentProvider(Model uiModel) {
   SiteUser user = userContext.getCurrentUser();
   Provider provider = providerService.findOne(user.getId());
   if (provider == null) {
     throw new UserNotFoundException();
   }
   uiModel.addAttribute("user", provider);
   return "user/provider/detail";
 }
コード例 #3
0
 @RequestMapping(value = "/provider/detail", method = RequestMethod.PUT)
 public String updateCurrentProvider(
     Model uiModel, @ModelAttribute("user") Provider provider, BindingResult bindingResult) {
   if (bindingResult.hasErrors()) {
     uiModel.addAttribute("user", provider);
     return "user/provider/detail";
   }
   SiteUser user = userContext.getCurrentUser();
   provider.setId(user.getId());
   provider = providerService.updateProvider(provider);
   uiModel.addAttribute("user", provider);
   return "user/provider/detail";
 }