-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
117 additions
and
82 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+3 Bytes
(100%)
driver-location-service/target/classes/com/nas/driver/location/config/DriverConfig.class
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,5 @@ | |
public class RatingCommand { | ||
private Integer ratingScore; | ||
private String userId; | ||
private String driverId; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
rating-service/src/main/java/com/nas/rating/models/CustomerRating.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.nas.rating.models; | ||
|
||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
@Getter | ||
@Setter | ||
public class CustomerRating { | ||
private String id; | ||
|
||
public CustomerRating(String id) { | ||
this.id = id; | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
rating-service/src/main/java/com/nas/rating/models/DriverRating.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.nas.rating.models; | ||
|
||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
@Getter | ||
@Setter | ||
public class DriverRating { | ||
private String id; | ||
|
||
public DriverRating(String id) { | ||
this.id = id; | ||
} | ||
} |
32 changes: 0 additions & 32 deletions
32
rating-service/src/main/java/com/nas/rating/models/Rating.java
This file was deleted.
Oops, something went wrong.
35 changes: 35 additions & 0 deletions
35
rating-service/src/main/java/com/nas/rating/models/RatingEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.nas.rating.models; | ||
|
||
|
||
import com.nas.rating.command.RatingCommand; | ||
import lombok.*; | ||
|
||
import javax.persistence.*; | ||
|
||
@Entity | ||
@Getter | ||
@Setter | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@AllArgsConstructor(access = AccessLevel.PROTECTED) | ||
public class RatingEntity extends BaseEntity{ | ||
|
||
@Column(name = "USER_ID") | ||
private String userId; | ||
|
||
@Column(name = "USER_ID_FEEDBACK") | ||
private String userIdFeedback = ""; | ||
@Column(name = "SCORE") | ||
private Integer ratingScore = null; | ||
|
||
public static RatingEntity create(final RatingCommand ratingCommand){ | ||
final RatingEntity rating = new RatingEntity(); | ||
|
||
return rating; | ||
} | ||
public static RatingEntity getOneAndCreate(final String userId){ | ||
final RatingEntity rating = new RatingEntity(); | ||
|
||
rating.userId = userId; | ||
return rating; | ||
} | ||
} |
5 changes: 2 additions & 3 deletions
5
rating-service/src/main/java/com/nas/rating/repository/RatingRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
package com.nas.rating.repository; | ||
|
||
import com.nas.rating.models.Rating; | ||
import com.nas.rating.models.RatingEntity; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
|
||
@Repository | ||
public interface RatingRepository extends JpaRepository<Rating, String> { | ||
Rating findRatingByUserId(String id); | ||
public interface RatingRepository extends JpaRepository<RatingEntity, String> { | ||
} |
10 changes: 3 additions & 7 deletions
10
rating-service/src/main/java/com/nas/rating/service/RatingService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,9 @@ | ||
package com.nas.rating.service; | ||
|
||
import com.nas.rating.command.RatingCommand; | ||
import com.nas.rating.models.Rating; | ||
import org.springframework.data.domain.Page; | ||
import org.springframework.data.domain.Pageable; | ||
import com.nas.rating.models.RatingEntity; | ||
|
||
public interface RatingService { | ||
Rating createRating(final RatingCommand ratingCommand); | ||
Page<Rating> getRatings(Pageable pageable); | ||
Rating findById(String ratingId); | ||
Rating findRatingByDriverId(String driverId); | ||
RatingEntity createRating(final RatingCommand ratingCommand); | ||
RatingEntity getOneAndCreate(final String accountId); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.