| | |
| | | bannerService.page(page, lambdaQueryWrapper); |
| | | for (Banner banner:page.getRecords()){ |
| | | banner.setLanguageText(Constants.LANGUAGE.get(banner.getLanguage())); |
| | | banner.setHttpImageUrl(awsS3OSSFileService.getUrl(banner.getImage())); |
| | | banner.setHttpImageUrl(Constants.IMAGES_HTTP+banner.getImage()); |
| | | } |
| | | return Result.ok(page); |
| | | } |
| | |
| | | @ApiOperation(value = "新增") |
| | | @PostMapping("add") |
| | | public Result<?> add(@RequestBody @Valid BannerModel model) { |
| | | model.setLoginSafeword(passwordManager.decryptPassword(model.getLoginSafeword())); |
| | | SysUser sysUser = sysUserService.getSysUserById(SecurityUtils.getSysUser().getUserId()); |
| | | if (!passwordEncoder.matches(model.getLoginSafeword(), sysUser.getSafePassword())) { |
| | | throw new YamiShopBindException("资金密码不正确!"); |
| | | } |
| | | if (StrUtil.isEmpty(model.getImage())){ |
| | | throw new YamiShopBindException("展示图片不能为空"); |
| | | } |
| | |
| | | @ApiOperation(value = "更新") |
| | | @PostMapping("update") |
| | | public Result<?> update(@RequestBody @Valid BannerModel model) { |
| | | model.setLoginSafeword(passwordManager.decryptPassword(model.getLoginSafeword())); |
| | | SysUser sysUser = sysUserService.getSysUserById(SecurityUtils.getSysUser().getUserId()); |
| | | if (!passwordEncoder.matches(model.getLoginSafeword(), sysUser.getSafePassword())) { |
| | | throw new YamiShopBindException("资金密码不正确!"); |
| | | } |
| | | if (StrUtil.isEmpty(model.getImage())){ |
| | | throw new YamiShopBindException("展示图片不能为空"); |
| | | } |