From 97b6f2ddb3939638ad0fc732d780a2b4492ef76f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=8C=E7=8B=BC=E8=93=9D=E5=A4=A9?= Date: Thu, 14 Nov 2024 09:35:15 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B4=BB=E5=8A=A8=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../harmony/controller/ActivateController.java | 11 +++++++++-- .../harmony/controller/AuthController.java | 5 ++++- .../guaiguailang/harmony/service/ActivateService.java | 2 ++ .../harmony/service/impl/ActivateServiceImpl.java | 10 ++++++++++ 4 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/guaiguailang/harmony/controller/ActivateController.java b/src/main/java/com/guaiguailang/harmony/controller/ActivateController.java index 1c6bc10..71ed10d 100644 --- a/src/main/java/com/guaiguailang/harmony/controller/ActivateController.java +++ b/src/main/java/com/guaiguailang/harmony/controller/ActivateController.java @@ -24,8 +24,6 @@ public class ActivateController { // todo 以后可考虑按机构来加载 return ResponseEntity.ok(activateService.loadActivate()); } - - @Operation( summary = "活动 新增", description = "新增一个活动", @@ -35,5 +33,14 @@ public class ActivateController { public ResponseEntity addActivate(@RequestBody ActiveBaseInfo activeBaseInfo){ return ResponseEntity.ok(activateService.addActivate(activeBaseInfo)); } + @Operation( + summary = "活动 更新", + description = "更新活动基本信息", + tags = {"活动相关接口"} + ) + @PostMapping("/update") + public ResponseEntity updateActivate(@RequestBody ActiveBaseInfo activeBaseInfo){ + return ResponseEntity.ok(activateService.updateActivate(activeBaseInfo)); + } } diff --git a/src/main/java/com/guaiguailang/harmony/controller/AuthController.java b/src/main/java/com/guaiguailang/harmony/controller/AuthController.java index b3b8fd9..ef6806b 100644 --- a/src/main/java/com/guaiguailang/harmony/controller/AuthController.java +++ b/src/main/java/com/guaiguailang/harmony/controller/AuthController.java @@ -13,13 +13,14 @@ import io.swagger.v3.oas.annotations.media.Content; import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import java.security.NoSuchAlgorithmException; import java.util.Objects; - +@Slf4j @RestController @Tag(name="系统认证接口") @RequestMapping("/auth") @@ -87,7 +88,9 @@ public class AuthController { ) @PostMapping("/logout") public ResponseEntity logout() { + String id = StpUtil.getLoginId().toString(); StpUtil.logout(); + log.info("用户"+id+"退出"); return ResponseEntity.ok().build(); } @Operation( diff --git a/src/main/java/com/guaiguailang/harmony/service/ActivateService.java b/src/main/java/com/guaiguailang/harmony/service/ActivateService.java index 5436e9a..a348177 100644 --- a/src/main/java/com/guaiguailang/harmony/service/ActivateService.java +++ b/src/main/java/com/guaiguailang/harmony/service/ActivateService.java @@ -12,4 +12,6 @@ public interface ActivateService { ResponseResult addActivate(ActiveBaseInfo activeBaseInfo); ResponseResult loadActivate(); + + ResponseResult updateActivate(ActiveBaseInfo activeBaseInfo); } diff --git a/src/main/java/com/guaiguailang/harmony/service/impl/ActivateServiceImpl.java b/src/main/java/com/guaiguailang/harmony/service/impl/ActivateServiceImpl.java index 8043b12..0d94af6 100644 --- a/src/main/java/com/guaiguailang/harmony/service/impl/ActivateServiceImpl.java +++ b/src/main/java/com/guaiguailang/harmony/service/impl/ActivateServiceImpl.java @@ -70,4 +70,14 @@ public class ActivateServiceImpl implements ActivateService { List activeList = activateMapper.selectList(queryWrapper); return ResponseResult.success(activeList); } + + @Override + public ResponseResult updateActivate(ActiveBaseInfo activeBaseInfo) { + int i = activateMapper.updateById(activeBaseInfo); + if(i>0){ + return ResponseResult.success(activeBaseInfo); + }else{ + return ResponseResult.error("更新失败"); + } + } }