summaryrefslogtreecommitdiff
path: root/src/main/java/com/mavlushechka/a1qa/project/models
diff options
context:
space:
mode:
authorMavlushechka <mavlushechka@gmail.com>2022-10-17 22:18:25 +0500
committerMavlushechka <mavlushechka@gmail.com>2022-10-17 22:18:25 +0500
commita32de03308b2246f1e7cd4c970e6f96116b41ea1 (patch)
treed20f5c41028732cb72b46dda38ec584221f542e3 /src/main/java/com/mavlushechka/a1qa/project/models
parentb41d2c22bf3e55123a09fae8b1d548dd9548299d (diff)
Divide classes into 2 packages: framework and project
Diffstat (limited to 'src/main/java/com/mavlushechka/a1qa/project/models')
-rw-r--r--src/main/java/com/mavlushechka/a1qa/project/models/Attachment.java10
-rw-r--r--src/main/java/com/mavlushechka/a1qa/project/models/Comment.java4
-rw-r--r--src/main/java/com/mavlushechka/a1qa/project/models/Liker.java22
-rw-r--r--src/main/java/com/mavlushechka/a1qa/project/models/Post.java4
-rw-r--r--src/main/java/com/mavlushechka/a1qa/project/models/User.java46
5 files changed, 86 insertions, 0 deletions
diff --git a/src/main/java/com/mavlushechka/a1qa/project/models/Attachment.java b/src/main/java/com/mavlushechka/a1qa/project/models/Attachment.java
new file mode 100644
index 0000000..0350d11
--- /dev/null
+++ b/src/main/java/com/mavlushechka/a1qa/project/models/Attachment.java
@@ -0,0 +1,10 @@
+package com.mavlushechka.a1qa.project.models;
+
+public record Attachment(com.mavlushechka.a1qa.project.constants.Attachment attachment, int ownerId, int mediaId) {
+
+ @Override
+ public String toString() {
+ return attachment.name().toLowerCase() + ownerId + "_" + mediaId;
+ }
+
+}
diff --git a/src/main/java/com/mavlushechka/a1qa/project/models/Comment.java b/src/main/java/com/mavlushechka/a1qa/project/models/Comment.java
new file mode 100644
index 0000000..bbbdc0f
--- /dev/null
+++ b/src/main/java/com/mavlushechka/a1qa/project/models/Comment.java
@@ -0,0 +1,4 @@
+package com.mavlushechka.a1qa.project.models;
+
+public record Comment(int id, User user, Post post, String message) {
+}
diff --git a/src/main/java/com/mavlushechka/a1qa/project/models/Liker.java b/src/main/java/com/mavlushechka/a1qa/project/models/Liker.java
new file mode 100644
index 0000000..7f84eba
--- /dev/null
+++ b/src/main/java/com/mavlushechka/a1qa/project/models/Liker.java
@@ -0,0 +1,22 @@
+package com.mavlushechka.a1qa.project.models;
+
+public class Liker {
+
+ private final int uid;
+ private final int copied;
+
+
+ public Liker(int uid, int copied) {
+ this.uid = uid;
+ this.copied = copied;
+ }
+
+ public int getUid() {
+ return uid;
+ }
+
+ public int getCopied() {
+ return copied;
+ }
+
+}
diff --git a/src/main/java/com/mavlushechka/a1qa/project/models/Post.java b/src/main/java/com/mavlushechka/a1qa/project/models/Post.java
new file mode 100644
index 0000000..e7c97b4
--- /dev/null
+++ b/src/main/java/com/mavlushechka/a1qa/project/models/Post.java
@@ -0,0 +1,4 @@
+package com.mavlushechka.a1qa.project.models;
+
+public record Post(int id, User owner, String message, Attachment attachment) {
+}
diff --git a/src/main/java/com/mavlushechka/a1qa/project/models/User.java b/src/main/java/com/mavlushechka/a1qa/project/models/User.java
new file mode 100644
index 0000000..b0089e8
--- /dev/null
+++ b/src/main/java/com/mavlushechka/a1qa/project/models/User.java
@@ -0,0 +1,46 @@
+package com.mavlushechka.a1qa.project.models;
+
+import com.google.gson.annotations.SerializedName;
+
+public class User {
+
+ private final int id;
+ @SerializedName("first_name")
+ private final String firstName;
+ @SerializedName("last_name")
+ private final String lastName;
+ @SerializedName("can_access_closed")
+ private final boolean canAccessClosed;
+ @SerializedName("is_closed")
+ private final boolean isClosed;
+
+
+ public User(int id, String firstName, String lastName, boolean canAccessClosed, boolean isClosed) {
+ this.id = id;
+ this.firstName = firstName;
+ this.lastName = lastName;
+ this.canAccessClosed = canAccessClosed;
+ this.isClosed = isClosed;
+ }
+
+ public int getId() {
+ return id;
+ }
+
+ public String getFirstName() {
+ return firstName;
+ }
+
+ public String getLastName() {
+ return lastName;
+ }
+
+ public boolean isCanAccessClosed() {
+ return canAccessClosed;
+ }
+
+ public boolean isClosed() {
+ return isClosed;
+ }
+
+}