Skip to content

Commit

Permalink
[FEATURE] 유저 expo token 관련 기능 추가 (#146)
Browse files Browse the repository at this point in the history
* feat : 유저 expo token 업데이트 기능 추가

* feat : expo 관련 sendMessage 구현 #143

* feat : 푸시 알림 관련 기능 구현 - 알림 전송 적용 전 #143

* feat : 푸시 알림 관련 기능 구현 - 친구 신청 보내기/받기 eventlistener 구현 #143

* feat : 푸시 알림 관련 기능 구현 - 푸시 알림 조회 필터로 변경 #143

* feat : expo module 의존성 관련 gradle 수정 #143

* feat : 푸시알림 내용 수정 #143
  • Loading branch information
bongsh0112 authored Jan 14, 2024
1 parent a86a897 commit be1f3a8
Show file tree
Hide file tree
Showing 37 changed files with 884 additions and 21 deletions.
10 changes: 9 additions & 1 deletion Api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,18 @@ repositories {
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springdoc:springdoc-openapi-ui:1.6.12'
implementation ('org.springdoc:springdoc-openapi-ui:1.6.12'){
dependencies {
implementation('com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.13.4')
implementation('com.fasterxml.jackson.core:jackson-core:2.13.4')
implementation('com.fasterxml.jackson.core:jackson-databind:2.13.4')
implementation('com.fasterxml.jackson.core:jackson-annotations:2.13.4')
}
}
// implementation 'io.springfox:springfox-boot-starter:3.0.0'
implementation 'org.springframework.boot:spring-boot-starter-security'
// implementation 'com.slack.api:slack-api-client:1.27.2'
implementation 'io.github.jav:expo-server-sdk:1.1.0'
implementation project(':Domain')
implementation project(':Core')
implementation project(':Infrastructure')
Expand Down
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);
}
}
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;
}
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();
}
}
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();
}
}
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();
}
}
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();
}
}
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();
}
}
Loading

0 comments on commit be1f3a8

Please sign in to comment.