예제 #1
0
 @RequestMapping("/previewImage")
 @LayoutNone
 public String previewImage(@RequestParam String hash, HttpServletRequest request) {
   String imageUrl = QiniuHelper.QINIU_IMAGE_HOST + hash;
   Packages packages = new Packages();
   packages.setPackageServiceIcon(imageUrl);
   request.setAttribute("packages", packages);
   return "packages_image";
 }
예제 #2
0
 @RequestMapping("/saveOrUpdatePackages")
 public String saveOrUpdatePackages(
     @ModelAttribute("packages") Packages packages, HttpSession session) {
   Boolean isContinue = packages.getContinue();
   packages = packageService.saveOrUpdatePackages(packages);
   if (isContinue) {
     return "redirect:/package/editPackages/0";
   }
   return "redirect:/package/packages";
 }
예제 #3
0
  @RequestMapping("/editPackages/{id}")
  public String editPackages(
      @PathVariable Integer id, @ModelAttribute Packages packages, HttpServletRequest request) {
    packages.setId(null);
    if (id != 0) {
      Packages tmp = packageService.findPackagesByPackageId(id);
      BeanUtils.copyProperties(tmp, packages);
    } else {
      packages.setPackageServicePrice((float) 0.0);
    }

    List<PackageType> list = packageService.findAllPackageTypes();
    request.setAttribute("packageTypeList", list);

    try {
      String uptoken = QiniuHelper.generateUpToken(QiniuHelper.QINIU_BUCKET_IMAGE);
      request.setAttribute("uptoken", uptoken);
    } catch (AuthException e) {
      e.printStackTrace();
    }

    return "packages_edit";
  }