Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
3825e8a
[chore/#1] initial setting (#3)
yongjun0511 Jul 29, 2025
eb8d8eb
[chore/#4] api 전역 에러 처리 구현 (#5)
yongjun0511 Jul 30, 2025
4204cf9
[chore/#6] QueryDSL 설정 및 Swagger 설정 (#7)
yongjun0511 Jul 30, 2025
bb04040
[chore/#8] 모듈 의존성 추가 (#9)
yongjun0511 Jul 30, 2025
fc22ede
[feat/#10] jacoco & sonarcloud 설정 (#11)
yongjun0511 Jul 30, 2025
c5ddfdc
[feat/#12] DB 세팅과 flyway 세팅 (#13)
yongjun0511 Jul 30, 2025
081fc63
[test/#14] 테스트 유틸리티 구현 (#15)
yongjun0511 Jul 31, 2025
fdfc960
[feat/#16] db migration (#17)
juuuuone Aug 5, 2025
44e0287
[feat/#19] 옷 생성 API 구현 (#20)
yongjun0511 Aug 8, 2025
6c5c7f7
[feat] 댓글 및 대댓글 작성 API 구현 (#24)
yongjun0511 Aug 12, 2025
2fda835
[feat/28] 기록의 댓글 목록 조회 API 구현 (#29)
yongjun0511 Aug 14, 2025
8b4f3f7
[feat/#22] 프로필수정 api 구현 (#26)
juuuuone Aug 15, 2025
9564b0b
[feat/#30] 대댓글 조회 API 구현 (#31)
yongjun0511 Aug 15, 2025
4f38a80
[feat/#25] OIDC 기반 소셜 로그인 구현 (#34)
yongjun0511 Aug 16, 2025
a742229
[feat/#27] id duplicate check (#33)
juuuuone Aug 21, 2025
b3e5b8b
[feat/#35] 토큰 재발급 기능 구현 (#36)
yongjun0511 Aug 23, 2025
96f2cc5
[feat/#37] 로그아웃 API 구현 (#38)
yongjun0511 Aug 24, 2025
632aaf2
[feat/#39] 약관 동의 API (#40)
yongjun0511 Aug 26, 2025
582c4e4
[refactor/#41] 약관 동의 API에서 device token 입력 분리 (#42)
yongjun0511 Aug 26, 2025
8179bcd
[feat/#43] 전체 약관 조회 API (#44)
yongjun0511 Aug 27, 2025
10b6308
[docs/#49] Clokey Docs 작성 (#50)
yongjun0511 Aug 29, 2025
540c8d4
[feat/#45] 나의 선택 약관 정보 조회 및 변경 API 구현 (#46)
yongjun0511 Aug 29, 2025
eecf2c7
[feat/#52] 회원 차단 API 구현 (#53)
yongjun0511 Sep 4, 2025
90fc98a
[feat/#56] 댓글 & 대댓글 삭제 API (#57)
yongjun0511 Sep 8, 2025
34af8fc
[feat/#58] Presigned URL 관련 유틸리티 함수 구현 (#59)
yongjun0511 Sep 11, 2025
0b1d267
[docs/#61] flyway 누락 이미지 추가 (#62)
yongjun0511 Sep 14, 2025
1725747
[feat/#63] 오늘의 코디 생성 API 구현 (#64)
yongjun0511 Sep 17, 2025
74f8d5f
[Feat/#60] 신고 생성 api 구현 (#65)
dev2yup Sep 23, 2025
ee75f0c
[fix/#69] S3 Utils 문제 & 양방향 삭제 로직 제거 (#70)
yongjun0511 Sep 27, 2025
c069cfd
[Feat/#72] 본인 확인 API 구현 (#73)
dev2yup Sep 30, 2025
3d7ee4a
[refactor/#66] 기타 수정 사항 반영 (#75)
yongjun0511 Oct 1, 2025
22ac238
[feat/#76] 코디 생성 기능 구현 (#77)
yongjun0511 Oct 6, 2025
14687ee
[Feat/#74] 차단 멤버 조회 API 구현 (#78)
dev2yup Oct 10, 2025
d033aab
[feat/#79] 코디 수정 & 삭제 API 구현 (#80)
yongjun0511 Oct 13, 2025
daead5f
[feat/#48] follow api (#51)
juuuuone Oct 18, 2025
572f8f4
[feat/#71] 카테고리 조회 (#81)
juuuuone Oct 18, 2025
ebe246f
[feat/#83] 코디 관련 조회 기능 구현 (#84)
yongjun0511 Oct 28, 2025
277d89b
[feat/#89] 코디 좋아요 토글 (#90)
yongjun0511 Oct 29, 2025
0185ed2
[feat/#91] 룩북 도메인 API 개발 (#92)
yongjun0511 Nov 2, 2025
e3deb37
[Feat/#82] 팔로잉 / 팔로워 목록 조회 API (#88)
dev2yup Nov 3, 2025
61acb0d
[refactor/#93] 댓글 도메인 리팩토링 (#94)
yongjun0511 Nov 4, 2025
7d60b4d
[feat/#96] 옷 도메인 API 개발 (#99)
yongjun0511 Nov 6, 2025
9937e90
fix: 옷 이미지 반환 로직 추가 (#101)
yongjun0511 Nov 6, 2025
1d0d179
회원 조회 API (#97)
dev2yup Nov 6, 2025
13d506c
[feat/#102] 나의 최애 코디 조회 API (#103)
yongjun0511 Nov 6, 2025
e900b1f
feat: tag 추가 및 update 로직 구현 (#108)
yongjun0511 Nov 10, 2025
d6d019a
[Feat/#21] 기록 생성 api 구현 (#98)
Ssamssamukja Nov 10, 2025
a7f91ef
[Feat/#104] 팔로우 푸시 알림 구현 (#110)
dev2yup Nov 15, 2025
f74a50b
[Feat/#112] 댓글 / 대댓글 푸시알림 구현 (#113)
dev2yup Nov 17, 2025
230a8e2
[refactor/#116: 팔로워/팔로잉 목록 조회 시 차단관계 멤버 제외 (#117)
dev2yup Nov 20, 2025
163688c
[feat/#118] 옷 삭제 API 구현 (#120)
yongjun0511 Nov 23, 2025
1a3bdbd
[Feat/#115] 안읽은 알림 유무 확인 API (#119)
dev2yup Nov 24, 2025
8be1800
[Feat/#109] 기록 수정 api 구현 (#122)
Ssamssamukja Nov 25, 2025
0cf5003
[Feat/#121] 알림 목록 조회 API 구현 (#124)
dev2yup Nov 30, 2025
b418e7d
[Fix/#125] 차단 관계 멤버 팔로잉/팔로워 수 집계에 미포함 (#126)
dev2yup Dec 1, 2025
fd85069
[feat/#128] 전체 스타일, 상황 조회 API (#129)
yongjun0511 Dec 6, 2025
520b215
[feat/#130] 옷 이미지 업로드 API 구현 (#131)
yongjun0511 Dec 6, 2025
1c6ff0f
[Feat/#127] 알림 읽음 처리 API 구현 (#133)
dev2yup Dec 16, 2025
51a822a
[Feat/#134] 알림 전체 읽음 처리 API 구현 (#135)
dev2yup Dec 18, 2025
9d3b7e0
[chore/#67] CI/CD 파이프라인 구현 (#68)
yongjun0511 Dec 26, 2025
14f72e5
[chore/#146] CD workflow (#147)
Ssamssamukja Dec 26, 2025
57f382c
Merge branch 'main' into develop
Ssamssamukja Dec 26, 2025
24b4f8f
[Chore/#149] dev-cd.yml, prod-cd.yml 수정 (#150)
Ssamssamukja Dec 26, 2025
4bae59b
[Chore/#153] add firebase environment (#154)
Ssamssamukja Dec 26, 2025
b5934a7
[Merge/#155] update develop (#156)
Ssamssamukja Dec 26, 2025
07eb4cf
[Chore/#158] firebase env (#160)
Ssamssamukja Dec 27, 2025
579515d
refactor: 수정 (#163)
Ssamssamukja Dec 27, 2025
2fd4233
[Feat/#136] 오늘의 온도 알림 API 구현 (#139)
dev2yup Dec 28, 2025
5e747d4
[feat/#159] 옷장 리포트 관련 기능 구현 (#166)
yongjun0511 Dec 28, 2025
2be17b0
[fix/#167] api 필터에서 swagger 허용 (#168)
2ghrms Dec 28, 2025
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
120 changes: 60 additions & 60 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,60 +1,60 @@
#name: Clokey CI
#
#on:
# pull_request:
# branches: [ "main", "develop" ]
# paths:
# - "clokey-api/**"
# - "clokey-domain/**"
# - "clokey-common/**"
# - "clokey-common-web/**"
# - ".github/workflows/ci.yml"
#
#permissions:
# contents: read
#
#jobs:
# build:
# runs-on: ubuntu-latest
#
# steps:
# - uses: actions/checkout@v4
# with:
# clean: true
#
# - name: Setup Java 21
# uses: actions/setup-java@v4
# with:
# distribution: 'corretto'
# java-version: '21'
#
# - name: Start Redis container for test
# run: docker compose -f ./docker-compose-test.yml up -d
#
# - name: Gradle Caching
# uses: actions/cache@v4
# with:
# path: |
# ~/.gradle/caches
# ~/.gradle/wrapper
# key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
# restore-keys: ${{ runner.os }}-gradle-
#
# - name: Grant execute permission for gradlew
# run: chmod +x ./gradlew
#
# - name: Spotless Check
# run: ./gradlew spotlessCheck
#
# - name: SonarCloud Caching
# uses: actions/cache@v4
# with:
# path: ~/.sonar/cache
# key: ${{ runner.os }}-sonar
# restore-keys: ${{ runner.os }}-sonar
#
# - name: Test and Analyze
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# run: ./gradlew test sonar --info --stacktrace
name: Clokey CI

on:
pull_request:
branches: [ "main", "develop" ]
paths:
- "clokey-api/**"
- "clokey-domain/**"
- "clokey-common/**"
- "clokey-common-web/**"
- ".github/workflows/ci.yml"

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
clean: true

- name: Setup Java 21
uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: '21'

- name: Start Redis container for test
run: docker compose -f ./docker-compose-test.yml up -d

- name: Gradle Caching
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: ${{ runner.os }}-gradle-

- name: Grant execute permission for gradlew
run: chmod +x ./gradlew

- name: Spotless Check
run: ./gradlew spotlessCheck

- name: SonarCloud Caching
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

- name: Test and Analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew test sonar --info --stacktrace
14 changes: 10 additions & 4 deletions .github/workflows/dev-cd.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Clokey-Dev CD

on:
pull_request:
push:
branches: [ develop ]

jobs:
Expand Down Expand Up @@ -63,7 +63,7 @@ jobs:
username: ubuntu
host: ${{ secrets.DEV_EC2_HOST }}
key: ${{ secrets.DEV_EC2_SSH_KEY }}
envs: DOCKERHUB_USERNAME,DEV_MYSQL_HOST,MYSQL_PORT,DB_NAME,DB_USERNAME,DB_PASSWORD,REDIS_HOST,REDIS_PORT,REDIS_PASSWORD,DEV_KAKAO_CLIENT_ID,DEV_KAKAO_CLIENT_SECRET,DEV_APPLE_CLIENT_ID,DEV_APPLE_CLIENT_SECRET,JWT_ACCESS_TOKEN_SECRET,JWT_REFRESH_TOKEN_SECRET,JWT_ACCESS_TOKEN_EXPIRATION_TIME,JWT_REFRESH_TOKEN_EXPIRATION_TIME,JWT_ISSUER,DEV_AWS_ACCESS_KEY_ID,DEV_AWS_SECRET_ACCESS_KEY,AWS_REGION,DEV_S3_BUCKET,DEV_S3_ENDPOINT,SWAGGER_USERNAME,SWAGGER_PASSWORD
envs: DOCKERHUB_USERNAME,DEV_MYSQL_HOST,MYSQL_PORT,DB_NAME,DB_USERNAME,DB_PASSWORD,REDIS_HOST,REDIS_PORT,REDIS_PASSWORD,DEV_KAKAO_CLIENT_ID,DEV_KAKAO_CLIENT_SECRET,DEV_APPLE_CLIENT_ID,DEV_APPLE_CLIENT_SECRET,JWT_ACCESS_TOKEN_SECRET,JWT_REFRESH_TOKEN_SECRET,JWT_ACCESS_TOKEN_EXPIRATION_TIME,JWT_REFRESH_TOKEN_EXPIRATION_TIME,JWT_ISSUER,DEV_AWS_ACCESS_KEY_ID,DEV_AWS_SECRET_ACCESS_KEY,AWS_REGION,DEV_S3_BUCKET,DEV_S3_ENDPOINT,SWAGGER_USERNAME,SWAGGER_PASSWORD,FIREBASE_SA_JSON_B64
script: |
export DOCKERHUB_NAME=${{ secrets.DOCKERHUB_USERNAME }}
export DOCKER_TAG=dev-app
Expand Down Expand Up @@ -98,12 +98,18 @@ jobs:

export SWAGGER_USERNAME=${{ secrets.SWAGGER_USERNAME }}
export SWAGGER_PASSWORD=${{ secrets.SWAGGER_PASSWORD }}


sudo mkdir -p /home/ubuntu/secrets
echo "${{ secrets.FIREBASE_SA_JSON_B64 }}" | base64 -d | sudo tee /home/ubuntu/secrets/firebase-sa.json > /dev/null
sudo chmod 600 /home/ubuntu/secrets/firebase-sa.json

export FIREBASE_CREDENTIALS_PATH=/home/ubuntu/secrets/firebase-sa.json

echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin

cd /home/ubuntu
docker compose -f clokey-api/dev-compose.yml up -d

echo "Cleaning up dangling Docker images..."
docker image prune -f

18 changes: 12 additions & 6 deletions .github/workflows/prod-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ jobs:
username: ubuntu
host: ${{ secrets.PROD_EC2_HOST }}
key: ${{ secrets.PROD_EC2_SSH_KEY }}
envs: DOCKERHUB_USERNAME,SPRING_PROFILES_ACTIVE,PROD_MYSQL_HOST,MYSQL_PORT,DB_NAME,DB_USERNAME,DB_PASSWORD,REDIS_HOST,REDIS_PORT,REDIS_PASSWORD,PROD_KAKAO_CLIENT_ID,PROD_KAKAO_CLIENT_SECRET,PROD_APPLE_CLIENT_ID,PROD_APPLE_CLIENT_SECRET,JWT_ACCESS_TOKEN_SECRET,JWT_REFRESH_TOKEN_SECRET,JWT_ACCESS_TOKEN_EXPIRATION_TIME,JWT_REFRESH_TOKEN_EXPIRATION_TIME,JWT_ISSUER,PROD_AWS_ACCESS_KEY_ID,PROD_AWS_SECRET_ACCESS_KEY,AWS_REGION,PROD_S3_BUCKET,PROD_S3_ENDPOINT,SWAGGER_USERNAME,SWAGGER_PASSWORD
envs: DOCKERHUB_USERNAME,SPRING_PROFILES_ACTIVE,PROD_MYSQL_HOST,MYSQL_PORT,DB_NAME,DB_USERNAME,DB_PASSWORD,REDIS_HOST,REDIS_PORT,REDIS_PASSWORD,PROD_KAKAO_CLIENT_ID,PROD_KAKAO_CLIENT_SECRET,PROD_APPLE_CLIENT_ID,PROD_APPLE_CLIENT_SECRET,JWT_ACCESS_TOKEN_SECRET,JWT_REFRESH_TOKEN_SECRET,JWT_ACCESS_TOKEN_EXPIRATION_TIME,JWT_REFRESH_TOKEN_EXPIRATION_TIME,JWT_ISSUER,PROD_AWS_ACCESS_KEY_ID,PROD_AWS_SECRET_ACCESS_KEY,AWS_REGION,PROD_S3_BUCKET,PROD_S3_ENDPOINT,SWAGGER_USERNAME,SWAGGER_PASSWORD,FIREBASE_SA_JSON_B64
script: |
export DOCKERHUB_NAME=${{ secrets.DOCKERHUB_USERNAME }}
export DOCKER_TAG=prod-app

export DEV_MYSQL_HOST=${{ secrets.PROD_MYSQL_HOST }}
export PROD_MYSQL_HOST=${{ secrets.PROD_MYSQL_HOST }}
export MYSQL_PORT=${{ secrets.MYSQL_PORT }}
export DB_NAME=${{ secrets.DB_NAME }}
export DB_USERNAME=${{ secrets.DB_USERNAME }}
Expand All @@ -100,15 +100,21 @@ jobs:
export JWT_REFRESH_TOKEN_EXPIRATION_TIME=${{ secrets.JWT_REFRESH_TOKEN_EXPIRATION_TIME }}
export JWT_ISSUER=${{ secrets.JWT_ISSUER }}

export DEV_AWS_ACCESS_KEY_ID=${{ secrets.PROD_AWS_ACCESS_KEY_ID }}
export DEV_AWS_SECRET_ACCESS_KEY=${{ secrets.PROD_AWS_SECRET_ACCESS_KEY }}
export PROD_AWS_ACCESS_KEY_ID=${{ secrets.PROD_AWS_ACCESS_KEY_ID }}
export PROD_AWS_SECRET_ACCESS_KEY=${{ secrets.PROD_AWS_SECRET_ACCESS_KEY }}
export AWS_REGION=${{ secrets.AWS_REGION }}
export DEV_S3_BUCKET=${{ secrets.PROD_S3_BUCKET }}
export DEV_S3_ENDPOINT=${{ secrets.PROD_S3_ENDPOINT }}
export PROD_S3_BUCKET=${{ secrets.PROD_S3_BUCKET }}
export PROD_S3_ENDPOINT=${{ secrets.PROD_S3_ENDPOINT }}

export SWAGGER_USERNAME=${{ secrets.SWAGGER_USERNAME }}
export SWAGGER_PASSWORD=${{ secrets.SWAGGER_PASSWORD }}

sudo mkdir -p /home/ubuntu/secrets
echo "${{ secrets.FIREBASE_SA_JSON_B64 }}" | base64 -d | sudo tee /home/ubuntu/secrets/firebase-sa.json > /dev/null
sudo chmod 600 /home/ubuntu/secrets/firebase-sa.json

export FIREBASE_CREDENTIALS_PATH=/home/ubuntu/secrets/firebase-sa.json

echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin

cd /home/ubuntu
Expand Down
7 changes: 7 additions & 0 deletions clokey-api/dev-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ services:
APPLE_CLIENT_ID: ${APPLE_CLIENT_ID}
APPLE_CLIENT_SECRET: ${APPLE_CLIENT_SECRET}

# Firebase
FIREBASE_CREDENTIALS_PATH: /run/secrets/firebase-sa.json

# JWT
JWT_ACCESS_TOKEN_SECRET: ${JWT_ACCESS_TOKEN_SECRET}
JWT_REFRESH_TOKEN_SECRET: ${JWT_REFRESH_TOKEN_SECRET}
Expand All @@ -46,6 +49,10 @@ services:
# Swagger
SWAGGER_USERNAME: ${SWAGGER_USERNAME}
SWAGGER_PASSWORD: ${SWAGGER_PASSWORD}

volumes:
- /home/ubuntu/secrets/firebase-sa.json:/run/secrets/firebase-sa.json:ro

networks:
- app_network

Expand Down
7 changes: 7 additions & 0 deletions clokey-api/prod-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ services:
APPLE_CLIENT_ID: ${APPLE_CLIENT_ID}
APPLE_CLIENT_SECRET: ${APPLE_CLIENT_SECRET}

# Firebase
FIREBASE_CREDENTIALS_PATH: /run/secrets/firebase-sa.json

# JWT
JWT_ACCESS_TOKEN_SECRET: ${JWT_ACCESS_TOKEN_SECRET}
JWT_REFRESH_TOKEN_SECRET: ${JWT_REFRESH_TOKEN_SECRET}
Expand All @@ -46,6 +49,10 @@ services:
# Swagger
SWAGGER_USERNAME: ${SWAGGER_USERNAME}
SWAGGER_PASSWORD: ${SWAGGER_PASSWORD}

volumes:
- /home/ubuntu/secrets/firebase-sa.json:/run/secrets/firebase-sa.json:ro

networks:
- app_network

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
import org.clokey.cloth.entity.Cloth;
import org.springframework.data.jpa.repository.JpaRepository;

public interface ClothRepository extends JpaRepository<Cloth, Long>, ClothRepositoryCustom {}
public interface ClothRepository extends JpaRepository<Cloth, Long>, ClothRepositoryCustom {
boolean existsByMemberId(Long memberId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,6 @@ default boolean existsDailyCoordinateByDateAndMemberId(LocalDate date, Long memb

@Query("select c from Coordinate c where c.member.id = :memberId and c.liked = true")
List<Coordinate> findLikedCoordinatesByMemberId(Long memberId);

boolean existsByMemberId(Long memberId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
import org.clokey.history.entity.History;
import org.springframework.data.jpa.repository.JpaRepository;

public interface HistoryRepository extends JpaRepository<History, Long> {}
public interface HistoryRepository extends JpaRepository<History, Long> {
boolean existsByMemberId(Long memberId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import org.clokey.code.GlobalBaseSuccessCode;
import org.clokey.domain.notification.dto.request.TemperatureNotificationRequest;
import org.clokey.domain.notification.dto.response.NotificationListResponse;
import org.clokey.domain.notification.dto.response.UnreadNotificationResponse;
import org.clokey.domain.notification.service.CodiveNotificationService;
Expand Down Expand Up @@ -55,4 +57,12 @@ public BaseResponse<Void> updateAllReadStatus() {
codiveNotificationService.updateAllReadStatus();
return BaseResponse.onSuccess(GlobalBaseSuccessCode.NO_CONTENT, null);
}

@PostMapping("/today-temperature")
@Operation(summary = "오늘의 온도 API", description = "오늘의 온도를 알리는 알림을 발송합니다.")
public BaseResponse<Void> sendTemperatureNotification(
@Valid @RequestBody TemperatureNotificationRequest request) {
codiveNotificationService.sendNewTemperatureNotification(request);
return BaseResponse.onSuccess(GlobalBaseSuccessCode.NO_CONTENT, null);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package org.clokey.domain.notification.dto.request;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;

public record TemperatureNotificationRequest(
@NotNull(message = "온도는 비워둘 수 없습니다.") @Schema(description = "현재 기온", example = "-10.5")
Double temperature) {}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import org.clokey.domain.comment.event.NewCommentEvent;
import org.clokey.domain.comment.event.NewReplyEvent;
import org.clokey.domain.notification.dto.request.TemperatureNotificationRequest;
import org.clokey.domain.notification.dto.response.NotificationListResponse;
import org.clokey.domain.notification.dto.response.UnreadNotificationResponse;
import org.clokey.response.SliceResponse;
Expand All @@ -16,6 +17,8 @@ public interface CodiveNotificationService {

void sendNewReplyNotification(NewReplyEvent event);

void sendNewTemperatureNotification(TemperatureNotificationRequest request);

SliceResponse<NotificationListResponse> getNotificationList(
Long lastNotificationId, Integer size);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import org.clokey.domain.history.repository.HistoryRepository;
import org.clokey.domain.member.exception.MemberErrorCode;
import org.clokey.domain.member.repository.MemberRepository;
import org.clokey.domain.notification.dto.request.TemperatureNotificationRequest;
import org.clokey.domain.notification.dto.response.NotificationListResponse;
import org.clokey.domain.notification.dto.response.UnreadNotificationResponse;
import org.clokey.domain.notification.exception.NotificationErrorCode;
Expand Down Expand Up @@ -52,6 +53,9 @@ public class CodiveNotificationServiceImpl implements CodiveNotificationService
private static final String NEW_COMMENT_NOTIFICATION = "%s님이 회원님의 기록에 댓글을 남겼습니다. : %s";
private static final String NEW_REPLY_NOTIFICATION = "%s님이 회원님의 댓글에 답장을 남겼습니다. : %s";

private static final String TODAY_TEMPERATURE_NOTIFICATION =
"오늘의 기온은 %d도 입니다!\n날씨에 맞는 오늘의 옷차림이 기다리고 있어요👀";

@Override
public void sendNewFollowerNotification(Long followFromId, Long followToId) {
Member followFromMember = getMemberById(followFromId);
Expand Down Expand Up @@ -214,6 +218,28 @@ public void sendNewReplyNotification(NewReplyEvent event) {
}
}

@Override
public void sendNewTemperatureNotification(TemperatureNotificationRequest request) {
Member receiver = memberUtil.getCurrentMember();
String content = "";

if (isAbleToSendNotification(receiver)) {

Notification notification = Notification.builder().setBody(content).build();
Message message =
Message.builder()
.setToken(receiver.getDeviceToken())
.setNotification(notification)
.build();

try {
firebaseMessaging.send(message);
} catch (FirebaseMessagingException e) {
throw new BaseCustomException(NotificationErrorCode.NOTIFICATION_FIREBASE_ERROR);
}
}
}

@Override
public SliceResponse<NotificationListResponse> getNotificationList(
Long lastNotificationId, Integer size) {
Expand Down
Loading