fix: add send review and get reviews (#45)
Release package / release (push) Successful in 15m47s
Release package / release (push) Successful in 15m47s
Co-authored-by: TakahashiNg <83152264+TakahashiNguyen@users.noreply.github.com> Reviewed-on: #45
This commit was merged in pull request #45.
This commit is contained in:
+41
-6
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||
>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
<maven.compiler.source>25</maven.compiler.source>
|
||||
<maven.compiler.target>25</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<org.projectlombok.version>1.18.46</org.projectlombok.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
@@ -41,7 +42,7 @@
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.46</version>
|
||||
<version>${org.projectlombok.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -67,4 +68,38 @@
|
||||
<artifactId>quarkus-smallrye-graphql</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.13.0</version>
|
||||
<configuration>
|
||||
<parameters>true</parameters>
|
||||
<annotationProcessorPaths>
|
||||
<path>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>${org.projectlombok.version}</version>
|
||||
</path>
|
||||
</annotationProcessorPaths>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>io.smallrye</groupId>
|
||||
<artifactId>jandex-maven-plugin</artifactId>
|
||||
<version>3.2.7</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>make-index</id>
|
||||
<goals>
|
||||
<goal>jandex</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -9,4 +9,5 @@ public class Url {
|
||||
public static final String SmsOtp = "/sms_otp";
|
||||
public static final String Me = "/me";
|
||||
public static final String Logout = "/logout";
|
||||
public static final String Review = "/review";
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.drinkool.enums;
|
||||
|
||||
public enum SortBy {
|
||||
LATEST,
|
||||
OLDEST,
|
||||
HIGHEST,
|
||||
LOWEST,
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.drinkool.interfaces;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public interface ReviewInterface {
|
||||
UUID getReviewerId();
|
||||
void setReviewerId(UUID x);
|
||||
|
||||
UUID getEateryId();
|
||||
void setEateryId(UUID x);
|
||||
|
||||
Integer getRating();
|
||||
void setRating(Integer x);
|
||||
|
||||
String getComment();
|
||||
void setComment(String x);
|
||||
}
|
||||
@@ -1,11 +1,26 @@
|
||||
package com.drinkool.lib.dtos;
|
||||
|
||||
import com.drinkool.lib.models.ReviewModel;
|
||||
import com.drinkool.interfaces.ReviewInterface;
|
||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
import java.util.UUID;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
public class SendReview {
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@RegisterForReflection
|
||||
public class SendReview implements ReviewInterface {
|
||||
|
||||
public UUID reviewerId;
|
||||
public UUID orderId;
|
||||
public ReviewModel review;
|
||||
private UUID reviewerId;
|
||||
private UUID eateryId;
|
||||
private Integer rating;
|
||||
private String comment;
|
||||
|
||||
public void setReviewerId(UUID x) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,10 @@ import io.quarkus.hibernate.orm.panache.PanacheEntityBase;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.MappedSuperclass;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.UUID;
|
||||
import org.hibernate.annotations.CreationTimestamp;
|
||||
import org.hibernate.annotations.UpdateTimestamp;
|
||||
|
||||
@MappedSuperclass
|
||||
public class BaseEntity extends PanacheEntityBase {
|
||||
@@ -12,4 +15,10 @@ public class BaseEntity extends PanacheEntityBase {
|
||||
@jakarta.persistence.Id
|
||||
@GeneratedValue(strategy = GenerationType.UUID)
|
||||
public UUID id;
|
||||
|
||||
@CreationTimestamp
|
||||
public LocalDateTime createDate;
|
||||
|
||||
@UpdateTimestamp
|
||||
public LocalDateTime updateDate;
|
||||
}
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
package com.drinkool.lib.models;
|
||||
|
||||
import com.drinkool.lib.entities.BaseEntity;
|
||||
import jakarta.persistence.*;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@MappedSuperclass
|
||||
public class ReviewModel extends BaseEntity {
|
||||
|
||||
@Column
|
||||
public int rating;
|
||||
|
||||
@Column
|
||||
public String comment;
|
||||
|
||||
public ReviewModel(int rating, String comment) {
|
||||
this.rating = rating;
|
||||
this.comment = comment;
|
||||
}
|
||||
|
||||
public ReviewModel() {}
|
||||
|
||||
public ReviewModel(ReviewModel input) {
|
||||
this(input.rating, input.comment);
|
||||
}
|
||||
|
||||
@org.hibernate.annotations.CreationTimestamp
|
||||
@Column(name = "review_date", updatable = false)
|
||||
public LocalDateTime reviewDate;
|
||||
}
|
||||
Reference in New Issue
Block a user