Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ configurations {

repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}


Expand Down Expand Up @@ -87,6 +88,11 @@ dependencies {

//Sentry
implementation 'io.sentry:sentry-spring-boot-starter-jakarta:8.5.0'


//expo fcm push notification
implementation 'com.github.hlspablo:expo-server-sdk-java:v3.1.2'

}

def generatedQueryDsl = 'src/main/generated'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package com.juu.juulabel.push_notification;


import com.juu.juulabel.common.base.BaseTimeEntity;
import jakarta.persistence.*;
import lombok.*;

@Getter
@Builder
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@Entity
@Table(
name = "notification_push_token"
)
public class NotificationPushToken extends BaseTimeEntity {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private Long id;

@Column(name = "member_id", nullable = false)
private Long memberId;

@Column(name = "push_token")
private String pushToken;

@Enumerated(EnumType.STRING)
@Column(name = "platform")
private Platform platform;

@Enumerated(EnumType.STRING)
@Column(name = "permission_status")
private PermissionStatus permissionStatus;

public String getPushToken() {
return String.format("ExponentPushToken[%s]", pushToken);
}
}


Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package com.juu.juulabel.push_notification;

import com.juu.juulabel.common.exception.code.SuccessCode;
import com.juu.juulabel.common.response.CommonResponse;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Tag(
name = "알림 푸시 토큰 API",
description = "알림 푸시 토큰 관련 API"
)
@RestController
@RequestMapping(value = {"/v1/api/notifications/push-tokens"})
@RequiredArgsConstructor
public class NotificationPushTokenController {

@Operation(
summary = "유저 푸시 토큰 등록 및 업데이트",
description = "푸시 알림을 위한 유저 푸시 토큰 등록 및 업데이트"
)
@PostMapping("/")
public ResponseEntity <CommonResponse<Void>> registerPushToken(
) {
return CommonResponse.success(SuccessCode.SUCCESS);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.juu.juulabel.push_notification;

import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor
public class NotificationPushTokenService {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.juu.juulabel.push_notification;

public enum PermissionStatus {
ALLOW, DENY
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.juu.juulabel.push_notification;

public enum Platform {
ANDROID, IOS
}