From f9c1a9eb8f6088d944d67f9701e036a3d98eaf44 Mon Sep 17 00:00:00 2001 From: topsun Date: Fri, 28 Apr 2023 00:54:27 +0800 Subject: [PATCH] =?UTF-8?q?service-driver-user=E5=8F=B8=E6=9C=BA=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DriverUserController.java | 6 ++++++ .../taxi/servicedriveruser/service/DriverUserService.java | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/online-taxi-public/service-driver-user/src/main/java/com/taxi/servicedriveruser/controller/DriverUserController.java b/online-taxi-public/service-driver-user/src/main/java/com/taxi/servicedriveruser/controller/DriverUserController.java index fb631aa..e5db4c4 100644 --- a/online-taxi-public/service-driver-user/src/main/java/com/taxi/servicedriveruser/controller/DriverUserController.java +++ b/online-taxi-public/service-driver-user/src/main/java/com/taxi/servicedriveruser/controller/DriverUserController.java @@ -5,6 +5,7 @@ import com.internal.dto.ResponseResult; import com.taxi.servicedriveruser.service.DriverUserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; @@ -21,4 +22,9 @@ public class DriverUserController { return driverUserService.addDriverUser(driverUser); } + @PutMapping("/user") + public ResponseResult updateDriverUser(@RequestBody DriverUser driverUser){ + return driverUserService.updateDriverUser(driverUser); + } + } diff --git a/online-taxi-public/service-driver-user/src/main/java/com/taxi/servicedriveruser/service/DriverUserService.java b/online-taxi-public/service-driver-user/src/main/java/com/taxi/servicedriveruser/service/DriverUserService.java index 5392c41..31440ff 100644 --- a/online-taxi-public/service-driver-user/src/main/java/com/taxi/servicedriveruser/service/DriverUserService.java +++ b/online-taxi-public/service-driver-user/src/main/java/com/taxi/servicedriveruser/service/DriverUserService.java @@ -22,4 +22,12 @@ public class DriverUserService { return ResponseResult.success(); } + public ResponseResult updateDriverUser(DriverUser driverUser){ + LocalDateTime localDate = LocalDateTime.now(); + driverUser.setGmtCreate(localDate); + driverUser.setGmtModified(localDate); + driverUserMapper.updateById(driverUser); + return ResponseResult.success(); + } + }