From d2542a6123fa6834e01ed3af23c7ba0a02696bc6 Mon Sep 17 00:00:00 2001 From: Pu Zhibing <393733352@qq.com> Date: 星期五, 29 十一月 2024 16:37:02 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/BannerController.java | 40 ++++++++++++++++++++++++++++++++++++---- 1 files changed, 36 insertions(+), 4 deletions(-) diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/BannerController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/BannerController.java index d8785a1..5fe3a69 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/BannerController.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/BannerController.java @@ -1,6 +1,7 @@ package com.ruoyi.other.controller; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.utils.StringUtils; import com.ruoyi.other.api.domain.Banner; @@ -8,10 +9,7 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.ibatis.annotations.Param; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import java.util.List; @@ -39,6 +37,40 @@ .list(); return R.ok(list); } + @PostMapping("/add") + @ApiOperation(value = "添加", tags = {"后台-广告管理-banner管理"}) + public R add(@RequestBody Banner banner){ + bannerService.save(banner); + return R.ok(); + } + @PostMapping("/delete") + @ApiOperation(value = "删除", tags = {"后台-广告管理-banner管理"}) + public R delete(@RequestParam Integer id){ + bannerService.removeById(id); + return R.ok(); + } + @PostMapping("/edit") + @ApiOperation(value = "修改", tags = {"后台-广告管理-banner管理"}) + public R edit(@RequestBody Banner banner){ + bannerService.updateById(banner); + return R.ok(); + } + @PostMapping("/detail") + @ApiOperation(value = "详情", tags = {"后台-广告管理-banner管理"}) + public R detail(@RequestParam Integer id){ + Banner byId = bannerService.getById(id); + return R.ok(byId); + } + @PostMapping("/page/list") + @ApiOperation(value = "列表", tags = {"后台-广告管理--banner"}) + public R<Page<Banner>> pagelist(String name, Integer jumpType, Integer position,Integer pageNum,Integer pageSize){ + Page<Banner> page = bannerService.lambdaQuery().like(StringUtils.isNotEmpty(name), Banner::getName, name) + .eq(Banner::getJumpType, jumpType) + .eq(Banner::getPosition, position) + .page(Page.of(pageNum, pageSize)); + return R.ok(page); + } + } -- Gitblit v1.7.1