コード例 #1
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";
  }
コード例 #2
0
 @RequestMapping("/loadPackageType")
 @ResponseBody
 public String loadPackageType() {
   List<PackageType> list = packageService.findAllPackageTypes();
   return JsonUtils.aaData(list);
 }