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("更新失败"); + } + } }