-
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.
[FEATURE] 유저 expo token 관련 기능 추가 (#146)
* feat : 유저 expo token 업데이트 기능 추가 * feat : expo 관련 sendMessage 구현 #143 * feat : 푸시 알림 관련 기능 구현 - 알림 전송 적용 전 #143 * feat : 푸시 알림 관련 기능 구현 - 친구 신청 보내기/받기 eventlistener 구현 #143 * feat : 푸시 알림 관련 기능 구현 - 푸시 알림 조회 필터로 변경 #143 * feat : expo module 의존성 관련 gradle 수정 #143 * feat : 푸시알림 내용 수정 #143
- Loading branch information
1 parent
a86a897
commit be1f3a8
Showing
37 changed files
with
884 additions
and
21 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
31 changes: 31 additions & 0 deletions
31
Api/src/main/java/tify/server/api/alarm/controller/AlarmHistoryController.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,31 @@ | ||
package tify.server.api.alarm.controller; | ||
|
||
|
||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.security.SecurityRequirement; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import java.util.List; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springdoc.api.annotations.ParameterObject; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
import tify.server.api.alarm.model.condition.AlarmCondition; | ||
import tify.server.api.alarm.model.vo.AlarmHistoryVo; | ||
import tify.server.api.alarm.service.RetrieveAlarmHistoryUseCase; | ||
|
||
@RestController | ||
@RequiredArgsConstructor | ||
@RequestMapping(value = "alarm") | ||
@SecurityRequirement(name = "access-token") | ||
@Tag(name = "9. 알림") | ||
public class AlarmHistoryController { | ||
|
||
private final RetrieveAlarmHistoryUseCase retrieveAlarmHistoryUseCase; | ||
|
||
@Operation(summary = "푸시 알림을 조회합니다. (유저, 읽음상태, 제목 필터)") | ||
@GetMapping | ||
public List<AlarmHistoryVo> getAlarmsByUser(@ParameterObject AlarmCondition condition) { | ||
return retrieveAlarmHistoryUseCase.execute(condition); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
Api/src/main/java/tify/server/api/alarm/model/condition/AlarmCondition.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,21 @@ | ||
package tify.server.api.alarm.model.condition; | ||
|
||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import tify.server.core.consts.Status; | ||
|
||
@Getter | ||
@Builder | ||
public class AlarmCondition { | ||
|
||
@Schema(description = "필터로 쓰일 유저의 pk값입니다.", example = "1") | ||
private final Long userId; | ||
|
||
@Schema(description = "필터로 쓰일 알림의 조회여부입니다.", implementation = Status.class) | ||
private final Status status; | ||
|
||
@Schema(description = "필터로 쓰일 알림의 제목입니다.", example = "답변 가능한 취향 질문이 남아있어요 \uD83D\uDC40") | ||
private final String title; | ||
} |
22 changes: 22 additions & 0 deletions
22
Api/src/main/java/tify/server/api/alarm/model/dto/AnswerKnockEventDto.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,22 @@ | ||
package tify.server.api.alarm.model.dto; | ||
|
||
|
||
import lombok.Builder; | ||
import lombok.Getter; | ||
import tify.server.domain.domains.question.domain.Knock; | ||
|
||
@Getter | ||
@Builder | ||
public class AnswerKnockEventDto { | ||
|
||
private final Long fromUserId; | ||
|
||
private final Long toUserId; | ||
|
||
public static AnswerKnockEventDto from(Knock knock) { | ||
return AnswerKnockEventDto.builder() | ||
.fromUserId(knock.getUserId()) | ||
.toUserId(knock.getKnockedUserId()) | ||
.build(); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
Api/src/main/java/tify/server/api/alarm/model/dto/CreateKnockEventDto.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,25 @@ | ||
package tify.server.api.alarm.model.dto; | ||
|
||
|
||
import lombok.Builder; | ||
import lombok.Getter; | ||
import tify.server.domain.domains.question.domain.Knock; | ||
|
||
@Getter | ||
@Builder | ||
public class CreateKnockEventDto { | ||
|
||
private final Long fromUserId; | ||
|
||
private final Long toUserId; | ||
|
||
private final Long questionId; | ||
|
||
public static CreateKnockEventDto from(Knock knock) { | ||
return CreateKnockEventDto.builder() | ||
.fromUserId(knock.getUserId()) | ||
.toUserId(knock.getKnockedUserId()) | ||
.questionId(knock.getDailyQuestionId()) | ||
.build(); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
Api/src/main/java/tify/server/api/alarm/model/dto/ReceiveApplicationEventDto.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,22 @@ | ||
package tify.server.api.alarm.model.dto; | ||
|
||
|
||
import lombok.Builder; | ||
import lombok.Getter; | ||
import tify.server.domain.domains.user.domain.NeighborApplication; | ||
|
||
@Getter | ||
@Builder | ||
public class ReceiveApplicationEventDto { | ||
|
||
private final Long fromUserId; | ||
|
||
private final Long toUserId; | ||
|
||
public static ReceiveApplicationEventDto from(NeighborApplication application) { | ||
return ReceiveApplicationEventDto.builder() | ||
.fromUserId(application.getFromUserId()) | ||
.toUserId(application.getToUserId()) | ||
.build(); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
Api/src/main/java/tify/server/api/alarm/model/dto/SendApplicationEventDto.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,22 @@ | ||
package tify.server.api.alarm.model.dto; | ||
|
||
|
||
import lombok.Builder; | ||
import lombok.Getter; | ||
import tify.server.domain.domains.user.domain.NeighborApplication; | ||
|
||
@Getter | ||
@Builder | ||
public class SendApplicationEventDto { | ||
|
||
private final Long fromUserId; | ||
|
||
private final Long toUserId; | ||
|
||
public static SendApplicationEventDto from(NeighborApplication application) { | ||
return SendApplicationEventDto.builder() | ||
.fromUserId(application.getFromUserId()) | ||
.toUserId(application.getToUserId()) | ||
.build(); | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
Api/src/main/java/tify/server/api/alarm/model/vo/AlarmHistoryVo.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,36 @@ | ||
package tify.server.api.alarm.model.vo; | ||
|
||
|
||
import lombok.Builder; | ||
import lombok.Getter; | ||
import tify.server.core.consts.Status; | ||
import tify.server.domain.domains.alarm.domain.AlarmHistory; | ||
import tify.server.domain.domains.alarm.domain.AlarmType; | ||
|
||
@Getter | ||
@Builder | ||
public class AlarmHistoryVo { | ||
|
||
private final Long id; | ||
|
||
private final AlarmType alarmType; | ||
|
||
private final String title; | ||
|
||
private final String content; | ||
|
||
private final Long userId; | ||
|
||
private final Status isRead; | ||
|
||
public static AlarmHistoryVo from(AlarmHistory alarmHistory) { | ||
return AlarmHistoryVo.builder() | ||
.id(alarmHistory.getId()) | ||
.alarmType(alarmHistory.getAlarmType()) | ||
.title(alarmHistory.getTitle()) | ||
.content(alarmHistory.getContent()) | ||
.userId(alarmHistory.getUserId()) | ||
.isRead(alarmHistory.getIsRead()) | ||
.build(); | ||
} | ||
} |
Oops, something went wrong.