飞滴出行网约车2022-service-driver-user实现司机用户信息修改

master
yh 3 years ago
parent b35acd6040
commit 19e3848acf

@ -5,6 +5,7 @@ import com.mashibing.internalcommon.dto.ResponseResult;
import com.mashibing.servicedriveruser.service.DriverUserService; import com.mashibing.servicedriveruser.service.DriverUserService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; 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.RequestBody;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@ -16,8 +17,12 @@ public class UserController {
@PostMapping("/user") @PostMapping("/user")
public ResponseResult saveUser(@RequestBody DriverUser driverUser){ public ResponseResult saveUser(@RequestBody DriverUser driverUser){
return service.saveUser(driverUser); return service.saveUser(driverUser);
} }
@PutMapping("/user")
public ResponseResult updateUser(@RequestBody DriverUser driverUser){
return service.updateUser(driverUser);
}
} }

@ -32,4 +32,16 @@ public class DriverUserService {
return ResponseResult.success("插入成功"); return ResponseResult.success("插入成功");
} }
public ResponseResult<DriverUser> updateUser(DriverUser user){
LocalDateTime localDateTime = LocalDateTime.now();
user.setGmtModified(localDateTime);
int status = driverUserMapper.updateById(user);
if(status <= 0){
return ResponseResult.success("更新失败");
}
return ResponseResult.success("更新成功");
}
} }

Loading…
Cancel
Save