Skip to content

Commit

Permalink
update: TaxiDriver 위치 변경 및 merge
Browse files Browse the repository at this point in the history
- taxidriver/model/TaxiDriver -> taxidriver/model/entity/TaxiDriver
  • Loading branch information
Yoojin-An committed Oct 17, 2023
1 parent 5bac727 commit 1948ec7
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 75 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
package com.hh2.katj.taxidriver.component

import com.hh2.katj.taxi.model.Taxi
import com.hh2.katj.taxidriver.model.dto.request.AddTotalInfoRequest
import com.hh2.katj.taxidriver.model.entity.TaxiDriver
import com.hh2.katj.taxidriver.model.entity.TaxiDriverStatus
import com.hh2.katj.taxidriver.repository.TaxiDriverRepository
import com.hh2.katj.util.exception.ExceptionMessage.ID_DOES_NOT_EXIST
import com.hh2.katj.util.exception.ExceptionMessage.USER_DOES_NOT_EXIST
import com.hh2.katj.util.exception.ExceptionMessage.INTERNAL_SERVER_ERROR_FROM_DATABASE
import com.hh2.katj.util.exception.failWithMessage
import com.hh2.katj.util.exception.findByIdOrThrowMessage
import org.springframework.stereotype.Component
import org.springframework.transaction.annotation.Transactional
Expand Down
60 changes: 0 additions & 60 deletions src/main/kotlin/com/hh2/katj/taxidriver/model/TaxiDriver.kt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import com.hh2.katj.taxi.model.Taxi
import com.hh2.katj.taxidriver.model.dto.request.AddTotalInfoRequest
import com.hh2.katj.taxidriver.model.dto.request.UpdateStatusRequest
import com.hh2.katj.taxidriver.model.dto.response.TaxiDriverResponse
import com.hh2.katj.util.exception.ExceptionMessage
import com.hh2.katj.util.exception.failWithMessage
import com.hh2.katj.util.model.RoadAddress
import jakarta.persistence.*
import java.time.LocalDate
Expand Down Expand Up @@ -66,6 +68,11 @@ class TaxiDriver(
this.img = request.img
}

fun statusWaiting() {
if (this.status != TaxiDriverStatus.WAITING) {
failWithMessage(ExceptionMessage.INCORRECT_STATUS_VALUE.name)
}
}
fun updateStatus(status: TaxiDriverStatus) {
this.status = status
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.hh2.katj.taxidriver.repository

import com.hh2.katj.taxidriver.model.TaxiDriver
import com.hh2.katj.taxidriver.model.entity.TaxiDriver
import org.springframework.data.jpa.repository.JpaRepository
import org.springframework.stereotype.Repository

Expand Down
3 changes: 1 addition & 2 deletions src/main/kotlin/com/hh2/katj/trip/model/Trip.kt
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package com.hh2.katj.trip.model

import com.hh2.katj.taxidriver.model.entity.TaxiDriver
import com.hh2.katj.util.model.BaseEntity
import com.hh2.katj.taxidriver.model.TaxiDriver
import com.hh2.katj.trip.model.response.ResponseTrip
import com.hh2.katj.user.model.entity.User
import com.hh2.katj.util.model.RoadAddress
import jakarta.persistence.*
import java.time.LocalDate
import java.time.LocalDateTime
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.hh2.katj.trip.model.request

import com.hh2.katj.taxidriver.model.TaxiDriver
import com.hh2.katj.taxidriver.model.entity.TaxiDriver
import com.hh2.katj.trip.model.DepartureRoadAddress
import com.hh2.katj.trip.model.DestinationRoadAddress
import com.hh2.katj.trip.model.Trip
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.hh2.katj.trip.model.response

import com.hh2.katj.taxidriver.model.TaxiDriver
import com.hh2.katj.taxidriver.model.entity.TaxiDriver
import com.hh2.katj.trip.model.DepartureRoadAddress
import com.hh2.katj.trip.model.DestinationRoadAddress
import com.hh2.katj.trip.model.TripStatus
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package com.hh2.katj.trip.service

import com.hh2.katj.payment.component.PaymentMethodReader
import com.hh2.katj.payment.model.entity.PaymentMethod
import com.hh2.katj.taxidriver.model.TaxiDriver
import com.hh2.katj.taxidriver.model.entity.TaxiDriver
import com.hh2.katj.trip.component.TripManager
import com.hh2.katj.trip.component.TripReader
import com.hh2.katj.trip.model.Trip
Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/com/hh2/katj/trip/service/QueueProcessor.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.hh2.katj.trip.service

import com.hh2.katj.taxidriver.model.TaxiDriver
import com.hh2.katj.taxidriver.model.TaxiDriverStatus
import com.hh2.katj.taxidriver.model.entity.TaxiDriver
import com.hh2.katj.taxidriver.model.entity.TaxiDriverStatus
import com.hh2.katj.trip.controller.TripController
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.delay
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import com.hh2.katj.taxi.model.ChargeType
import com.hh2.katj.taxi.model.FuelType
import com.hh2.katj.taxi.model.Taxi
import com.hh2.katj.taxi.repository.TaxiRepository
import com.hh2.katj.taxidriver.model.TaxiDriver
import com.hh2.katj.taxidriver.model.TaxiDriverStatus
import com.hh2.katj.taxidriver.repository.TaxiDriverRepository
import com.hh2.katj.trip.model.DepartureRoadAddress
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import com.hh2.katj.taxi.model.ChargeType
import com.hh2.katj.taxi.model.FuelType
import com.hh2.katj.taxi.model.Taxi
import com.hh2.katj.taxi.repository.TaxiRepository
import com.hh2.katj.taxidriver.model.TaxiDriver
import com.hh2.katj.taxidriver.model.TaxiDriverStatus
import com.hh2.katj.taxidriver.model.entity.TaxiDriver
import com.hh2.katj.taxidriver.model.entity.TaxiDriverStatus
import com.hh2.katj.taxidriver.repository.TaxiDriverRepository
import com.hh2.katj.trip.model.DepartureRoadAddress
import com.hh2.katj.trip.model.DestinationRoadAddress
Expand Down

0 comments on commit 1948ec7

Please sign in to comment.