| | |
| | | import com.sandu.common.object.BaseConditionVO; |
| | | import com.sandu.common.util.ResponseUtil; |
| | | import com.sandu.ximon.admin.dto.BannerDto; |
| | | import com.sandu.ximon.admin.dto.BannerPositionDto; |
| | | import com.sandu.ximon.admin.param.BannerParam; |
| | | import com.sandu.ximon.admin.service.BannerService; |
| | | import com.sandu.ximon.dao.domain.Banner; |
| | |
| | | public ResponseVO<Object> addBanner(@Validated @RequestBody BannerParam bannerParam) { |
| | | boolean result = contentBannerService.addBanner(bannerParam); |
| | | if (result) { |
| | | return ResponseUtil.success(null); |
| | | return ResponseUtil.success("添加成功"); |
| | | } else { |
| | | return ResponseUtil.fail("添加失败"); |
| | | } |
| | |
| | | public ResponseVO<Object> updateBanner(@PathVariable Long bannerId, @Validated @RequestBody BannerParam bannerParam) { |
| | | boolean result = contentBannerService.updateBanner(bannerId,bannerParam); |
| | | if (result) { |
| | | return ResponseUtil.success(null); |
| | | return ResponseUtil.success("更新成功"); |
| | | } else { |
| | | return ResponseUtil.fail("添加失败"); |
| | | return ResponseUtil.fail("更新失败"); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @GetMapping |
| | | public ResponseVO<Object> listMainBanner(BaseConditionVO conditionVO) { |
| | | PageHelper.startPage(conditionVO.getPageNo(), conditionVO.getPageSize()); |
| | | public ResponseVO<Object> listMainBanner() { |
| | | List<Banner> list = contentBannerService.listBanner(); |
| | | return ResponseUtil.success(list); |
| | | } |
| | |
| | | public ResponseVO<Object> deleteBanner(@PathVariable Long bannerId) { |
| | | boolean result = contentBannerService.deleteBanner(bannerId); |
| | | if (result) { |
| | | return ResponseUtil.success(null); |
| | | return ResponseUtil.success("删除成功"); |
| | | } else { |
| | | return ResponseUtil.fail("操作失败"); |
| | | return ResponseUtil.fail("删除失败"); |
| | | } |
| | | } |
| | | |