-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
24ce1f8
commit 803753a
Showing
11 changed files
with
116 additions
and
64 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,6 +60,7 @@ dependencies { | |
//jwt | ||
implementation 'io.jsonwebtoken:jjwt:0.9.1' | ||
|
||
|
||
} | ||
|
||
tasks.named('test') { | ||
|
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
60 changes: 0 additions & 60 deletions
60
...dokme/src/main/java/com/example/server_9dokme/Notification/SSE/EmitterRepositoryImpl.java
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
server_9dokme/src/main/java/com/example/server_9dokme/Notification/SSE/SseEmitters.java
This file was deleted.
Oops, something went wrong.
11 changes: 11 additions & 0 deletions
11
...c/main/java/com/example/server_9dokme/Notification/repository/NotificationRepository.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,11 @@ | ||
package com.example.server_9dokme.Notification.repository; | ||
|
||
import com.example.server_9dokme.Notification.entity.Notification; | ||
import org.springframework.data.domain.Page; | ||
import org.springframework.data.domain.Pageable; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface NotificationRepository extends JpaRepository<Notification,Integer> { | ||
|
||
Page<Notification> findAllByMember_MemberId(Long memberId, Pageable pageable); | ||
} |
32 changes: 32 additions & 0 deletions
32
...kme/src/main/java/com/example/server_9dokme/Notification/service/NotificationService.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,32 @@ | ||
package com.example.server_9dokme.Notification.service; | ||
|
||
|
||
import com.example.server_9dokme.Notification.entity.Notification; | ||
import com.example.server_9dokme.Notification.repository.NotificationRepository; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.data.domain.Page; | ||
import org.springframework.data.domain.PageRequest; | ||
import org.springframework.data.domain.Pageable; | ||
import org.springframework.stereotype.Service; | ||
|
||
@Service | ||
@Data | ||
@NoArgsConstructor | ||
public class NotificationService { | ||
|
||
@Autowired | ||
private NotificationRepository notificationRepository; | ||
|
||
public Page<Notification> findAllNotification(Long memberId, int pageNo){ | ||
|
||
Pageable pageable = PageRequest.of(pageNo,8); | ||
|
||
Page<Notification> notifications = notificationRepository.findAllByMember_MemberId(memberId,pageable); | ||
|
||
return notifications; | ||
} | ||
|
||
|
||
} |
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
27 changes: 27 additions & 0 deletions
27
server_9dokme/src/main/java/com/example/server_9dokme/member/entity/Device.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,27 @@ | ||
package com.example.server_9dokme.member.entity; | ||
|
||
|
||
import com.example.server_9dokme.common.entity.BaseEntity; | ||
import jakarta.persistence.*; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import org.hibernate.annotations.GenericGenerator; | ||
|
||
@Entity | ||
@Data | ||
@NoArgsConstructor | ||
public class Device extends BaseEntity { | ||
|
||
@Id | ||
@GeneratedValue(generator = "uuid") | ||
@GenericGenerator(name = "uuid", strategy = "uuid2") | ||
private String deviceId; | ||
|
||
private Boolean notificationStatement; | ||
|
||
private String userFirebaseToken; | ||
|
||
@ManyToOne | ||
@JoinColumn(name ="member_id") | ||
private Member member; | ||
} |
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
18 changes: 18 additions & 0 deletions
18
...er_9dokme/src/main/java/com/example/server_9dokme/member/repository/DeviceRepository.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,18 @@ | ||
package com.example.server_9dokme.member.repository; | ||
|
||
import com.example.server_9dokme.member.entity.Device; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Query; | ||
import org.springframework.data.repository.query.Param; | ||
|
||
import java.util.List; | ||
|
||
public interface DeviceRepository extends JpaRepository<Device, String> { | ||
|
||
@Query("SELECT d.deviceId " + | ||
"FROM Device d " + | ||
"JOIN d.member m " + | ||
"JOIN Keyword k ON k.member.memberId = m.memberId " + | ||
"WHERE k.keyword LIKE %:title%") | ||
List<String> findDeviceIdsByTitle(@Param("title") String title); | ||
} |
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