-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: ViewpointReactionEntity storage implementation
- Loading branch information
Showing
13 changed files
with
179 additions
and
69 deletions.
There are no files selected for viewing
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
17 changes: 17 additions & 0 deletions
17
src/main/java/tw/commonground/backend/service/viewpoint/ViewpointReactionRepository.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,17 @@ | ||
package tw.commonground.backend.service.viewpoint; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import tw.commonground.backend.service.viewpoint.entity.Reaction; | ||
import tw.commonground.backend.service.viewpoint.entity.ViewpointReactionEntity; | ||
import tw.commonground.backend.service.viewpoint.entity.ViewpointReactionId; | ||
|
||
import java.util.Optional; | ||
|
||
public interface ViewpointReactionRepository extends JpaRepository<ViewpointReactionEntity, ViewpointReactionId> { | ||
Optional<ViewpointReactionEntity> findById(ViewpointReactionId id); | ||
|
||
// need to query who liked the viewpoint | ||
|
||
|
||
|
||
} |
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
12 changes: 12 additions & 0 deletions
12
src/main/java/tw/commonground/backend/service/viewpoint/dto/ViewpointReactionBase.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,12 @@ | ||
|
||
package tw.commonground.backend.service.viewpoint.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
@Getter | ||
@Setter | ||
public class ViewpointReactionBase { | ||
private String reaction; | ||
} |
9 changes: 9 additions & 0 deletions
9
src/main/java/tw/commonground/backend/service/viewpoint/dto/ViewpointReactionRequest.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,9 @@ | ||
package tw.commonground.backend.service.viewpoint.dto; | ||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
@Getter | ||
@Setter | ||
public class ViewpointReactionRequest extends ViewpointReactionBase { | ||
} |
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
21 changes: 0 additions & 21 deletions
21
src/main/java/tw/commonground/backend/service/viewpoint/entity/ViewpointReaction.java
This file was deleted.
Oops, something went wrong.
23 changes: 23 additions & 0 deletions
23
src/main/java/tw/commonground/backend/service/viewpoint/entity/ViewpointReactionEntity.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,23 @@ | ||
package tw.commonground.backend.service.viewpoint.entity; | ||
|
||
import jakarta.persistence.*; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
import java.util.UUID; | ||
|
||
@Getter | ||
@Setter | ||
@Entity | ||
public class ViewpointReactionEntity { | ||
|
||
@EmbeddedId | ||
private ViewpointReactionId id; | ||
|
||
@Enumerated(EnumType.STRING) | ||
private Reaction reaction; | ||
|
||
public ViewpointReactionEntity() { | ||
this.reaction = Reaction.NONE; | ||
} | ||
} |
Oops, something went wrong.