From 1383d90315bc81dfeb6427c3173a461622a28060 Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Fri, 17 Mar 2023 17:04:56 +0800
Subject: [PATCH] 后台修改
---
src/main/java/cc/mrbird/febs/mall/controller/AdminNewsInfoController.java | 26 ++++++++++++++++++++++++++
1 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/src/main/java/cc/mrbird/febs/mall/controller/AdminNewsInfoController.java b/src/main/java/cc/mrbird/febs/mall/controller/AdminNewsInfoController.java
index f09959a..96a8c09 100644
--- a/src/main/java/cc/mrbird/febs/mall/controller/AdminNewsInfoController.java
+++ b/src/main/java/cc/mrbird/febs/mall/controller/AdminNewsInfoController.java
@@ -85,10 +85,36 @@
return new FebsResponse().success().message("新增成功");
}
+ /**
+ * 新闻分类-删除
+ */
+ @GetMapping("delNewsCategoryInfo/{id}")
+ @ControllerEndpoint(operation = "新闻分类-删除", exceptionMessage = "操作失败")
+ public FebsResponse delNewsCategoryInfo(@NotNull(message = "{required}") @PathVariable Long id) {
+ return mallNewsInfoService.delNewsCategoryInfo(id);
+ }
+
@GetMapping(value = "findAllCategoryList")
public FebsResponse findAllCategoryList() {
List<MallNewsCategory> categories = mallNewsInfoService.findAllCategory();
return new FebsResponse().success().data(categories);
}
+ @PostMapping(value = "/topNews/{id}")
+ public FebsResponse topNews(@PathVariable Long id) {
+ MallNewsInfo mallNewsInfo = new MallNewsInfo();
+ mallNewsInfo.setIsTop(1);
+ mallNewsInfo.setId(id);
+ mallNewsInfoService.updateById(mallNewsInfo);
+ return new FebsResponse().success();
+ }
+
+ @PostMapping(value = "/unTopNews/{id}")
+ public FebsResponse unTopNews(@PathVariable Long id) {
+ MallNewsInfo mallNewsInfo = new MallNewsInfo();
+ mallNewsInfo.setIsTop(2);
+ mallNewsInfo.setId(id);
+ mallNewsInfoService.updateById(mallNewsInfo);
+ return new FebsResponse().success();
+ }
}
--
Gitblit v1.9.1