diff --git a/JAVA_MYSQL_WEBSITE/.idea/workspace.xml b/JAVA_MYSQL_WEBSITE/.idea/workspace.xml index 43a06ef..af83bcc 100644 --- a/JAVA_MYSQL_WEBSITE/.idea/workspace.xml +++ b/JAVA_MYSQL_WEBSITE/.idea/workspace.xml @@ -5,16 +5,9 @@ + - - - - - - - - - + + + @@ -70,11 +66,11 @@ + - @@ -103,7 +99,8 @@ - + + 1730470371982 @@ -119,7 +116,14 @@ - @@ -127,6 +131,7 @@ - \ No newline at end of file diff --git a/JAVA_MYSQL_WEBSITE/gp-web/src/main/java/com/hc/gpweb/controller/api/BannerController.java b/JAVA_MYSQL_WEBSITE/gp-web/src/main/java/com/hc/gpweb/controller/api/BannerController.java index 26fd0d1..fcb71ff 100644 --- a/JAVA_MYSQL_WEBSITE/gp-web/src/main/java/com/hc/gpweb/controller/api/BannerController.java +++ b/JAVA_MYSQL_WEBSITE/gp-web/src/main/java/com/hc/gpweb/controller/api/BannerController.java @@ -36,23 +36,6 @@ public class BannerController { return Result.success(this.bannerService.queryById(id)); } - @PostMapping("/insert") - @ApiOperation(value = "新增 WebBanner", response = Result.class) - public Result addWebBanner(@Valid @RequestBody WebBanner banner) { - return Result.success(bannerService.insert(banner)); - } - - @PutMapping("/update") - @ApiOperation(value = "修改 WebBanner", response = Result.class) - public Result updateWebBanner(@RequestBody WebBanner banner) { - return Result.success(bannerService.update(banner)); - } - - @DeleteMapping("/delete/{id}") - @ApiOperation(value = "依据主键删除 WebBanner", response = Result.class) - public Result deleteWebBanner(@PathVariable("id") Integer id) { - return Result.success(bannerService.deleteById(id)); - } @GetMapping("/list") @ApiOperation(value = "获取 WebBanner列表(分页)", response = Result.class) diff --git a/JAVA_MYSQL_WEBSITE/gp-web/src/main/java/com/hc/gpweb/controller/front/FrontBannerController.java b/JAVA_MYSQL_WEBSITE/gp-web/src/main/java/com/hc/gpweb/controller/front/FrontBannerController.java new file mode 100644 index 0000000..d6d61f4 --- /dev/null +++ b/JAVA_MYSQL_WEBSITE/gp-web/src/main/java/com/hc/gpweb/controller/front/FrontBannerController.java @@ -0,0 +1,48 @@ +package com.hc.gpweb.controller.front; + +import com.hc.gpbusiness.model.WebBanner; +import com.hc.gpbusiness.service.WebBannerService; +import com.hc.gpcore.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + + +/** + * 广告表 + * (WebBanner)表控制层 + * + * @author java + * @since 2020-07-29 16:23:04 + */ + +@RestController +@RequestMapping("/api/front/banner") +public class FrontBannerController { + + /** + * 服务对象 + */ + private final WebBannerService bannerService; + + public FrontBannerController(WebBannerService bannerService) { + this.bannerService = bannerService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 WebBanner", response = Result.class) + public Result selectWebBanner(@PathVariable("id") Integer id) { + return Result.success(this.bannerService.queryById(id)); + } + + + @GetMapping("/list") + @ApiOperation(value = "获取 WebBanner列表(分页)", response = Result.class) + public Result listWebBanner(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(bannerService.queryAllByLimit(page, size)); + } + + +} \ No newline at end of file