-
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.
* 알림 기능 추가(#483) * [feat] FCM 연결 로직 추가(#483) * [feat] Alarm 테이블 및 Update API 추가 * [feat] Mypage 조회시 알림 정보 추가 * [feat] Alarm Update API에 Validation 추가 * [feat] Alarm API RestDoc 문서에 추가 * 기존 유저 Alarm 정보 추가 기능 설정 (#526) * 일반 로그인 로직 제거 (#525) * [chore] metricsConfig 삭제(#507) (#529) * [refactor] 감정어 통계 로직 변경 (#531) * [refactor] 감정어 통계 로직 오타 수정(#532) (#533) * [fix] setAllowCredentials false 설정 (#535) * 회원가입/로그인 분산락 적용 (#537) * [feat] 회원가입/로그인에 Lettuce 분산락 적용 * [feat] 인증 트랜잭션 범위 축소 - 프록시 내부 호출 관련 작업 * [refactor] AuthService 에서 @transactional 제거 * [refactor] 락 획득을 위한 @lockname 설정 파라미터 변경 (#539) - 이메일 기반 락 생성 * [Search] 검색 기능 수정 (#541) * [refactor] 검색 기능 수정 * [refactor] 일기 content,회고 answer 조건에 맞게 파싱 * [refactor] 검색시 Diary response 간략화 * [Search] 검색 문장 파싱시 '... ' 추가 * [feat] 후원자 인증 기능 (#545) * [feat] 엔티티 생성(#540) * [feat] 후원자 기능 구현(#540) * [feat] 예외처리(#540) * [feat] 검색 response에 type 추가 (#547) * [refactor] LogRepository save 메서드에서 REQUIRES_NEW 제거 (#549) * [Docs] 검색 API 문서 수정 (#552) * [docs] 검색 API 문서 수정 * 후원자 등록시 Redis 분산락으로 동시성 처리 (#553) * [feat] Lock name에 method name 추가 * [feat] 후원자 등록시 분산락으로 동시성 처리 * [feat] 후원자 인증 기능 문서 작성(#555) * [Search] 사용자 식별값 추가 (#557) * [feat] 일기, 회고 조회시 사용자 식별값 추가 * [refactor] 검색 관련 문자열 파싱 수정 * [refactor] 검색 관련 문자열 파싱 - 문장 잘림 수정 (#559) * [refactor] 감정어 로직 변경(#562) * [refactor] 감정어 정렬 고정(#564) * [refactor] 반복문 수정(#566) * [refactor] @transactional 제거(#567) * [refactor] 감정어 반복해서 나오는 문제 해결 (#568) * [refactor] @transactional 제거(#563) * [refactor] 감정어 반복해서 나오는 문제 수정(#563) * [refactor] 조건문 추가(#569) * [refactor] 검색시 회고 질문 번호 순서 기준으로 변경 (#571) * [refactor] 회고 조회 API (#573) * [refactor] 회고 주차 추가(#574) * [feat] 회고 답변 예외처리 (#575) * [refactor] 회고 주차 추가(#572) * [feat] 회고 답변 예외처리 * 검색 API 분리 (#577) * [feat] 검색 API 분리 * [test] 검색 TC 수정 * 서비스 사용일수 로직 수정 (#579) * 지표 추출 후 엑셀 다운로드 기능 (#581) * [feat] dau 지표 엑셀 추출(#580) * [feat] wau 지표 엑셀 추출(#580) * [feat] 일간 가입자 수엑셀 추출(#580) * [feat] 유저별 회고 진행한 횟수 엑셀 추출(#580) * [refactor] 회고 조회 API 통합과 관련된 로직들 수정 (#582) * [refactor] 회고탭 API 응답에 retrospectId 추가 * [refactor] 일반 회고 조회, 검색 시 회고 조회 API 통합 * [refactor] 회고수정, 삭제 API 수정 * [refactor] 문서 변경, 관련 수정할 지점 수정 * [refactor] readOnly True 제거 * 회고 조회 ver2 (#584) * [refactor] 하위 호환성을 위해 V2 패키지 생성, 통합 API 해당 패키지로 이동 * [feat] retrospect v2 API 문서 작성(#583) * [refactor] 기존 코드로 롤백(#583) * [refactor] 테스트 코드 기존 코드로 롤백(#583) * [refactor] API 문서 반영(#583) * [refactor] ReadOnly 제거(#583) --------- Co-authored-by: imdh <[email protected]>
- Loading branch information
1 parent
c0772e8
commit 64aa853
Showing
104 changed files
with
6,334 additions
and
607 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
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
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,12 @@ | ||
[[Alarm-API]] | ||
== Alarm API | ||
|
||
[[Alarm-일기-알림-변경]] | ||
=== Alarm 일기 알림 변경 | ||
operation::alarm-controller-test/일기_알림_변경[snippets='http-request,request-fields,http-response,response-fields'] | ||
|
||
--- | ||
|
||
[[Alarm-회고-알림-변경]] | ||
=== Alarm 회고 알림 변경 | ||
operation::alarm-controller-test/회고_알림_변경[snippets='http-request,request-fields,http-response,response-fields'] |
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 @@ | ||
[[Retrospect-API-V2]] | ||
== Retrospect API V2 | ||
|
||
[[Retrospect-회고-탭-v2]] | ||
=== Retrospect 회고 탭 v2 | ||
operation::retrospect-controller-test-v2/회고_탭[snippets='http-request,request-headers,request-parameters,http-response,response-fields'] | ||
|
||
--- | ||
|
||
[[Retrospect-회고-조회-v2]] | ||
=== Retrospect 회고 조회 v2 | ||
operation::retrospect-controller-test-v2/회고_조회[snippets='http-request,request-headers,request-parameters,http-response,response-fields'] | ||
|
||
--- | ||
|
||
[[Retrospect-회고-수정-v2]] | ||
=== Retrospect 회고 수정 v2 | ||
operation::retrospect-controller-test-v2/회고_수정[snippets='http-request,request-headers,request-fields,http-response,response-fields'] | ||
|
||
--- | ||
|
||
[[Retrospect-회고-삭제-v2]] | ||
=== Retrospect 회고 삭제 v2 | ||
operation::retrospect-controller-test-v2/회고_삭제[snippets='http-request,request-headers,http-response,response-fields'] | ||
|
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
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,6 @@ | ||
[[Sponsor-API]] | ||
== Sponsor API | ||
|
||
[[Sponsor-후원자]] | ||
=== Sponsor 후원자 인증 | ||
operation::sponsor-controller-test/후원자_인증[snippets='http-request,request-headers,request-fields,http-response,response-fields'] |
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
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
42 changes: 42 additions & 0 deletions
42
src/main/java/com/nanal/backend/domain/alarm/controller/AlarmController.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,42 @@ | ||
package com.nanal.backend.domain.alarm.controller; | ||
|
||
import com.nanal.backend.domain.alarm.dto.ReqUpdateDiaryAlarm; | ||
import com.nanal.backend.domain.alarm.dto.ReqUpdateRetrospectAlarm; | ||
import com.nanal.backend.domain.alarm.service.AlarmService; | ||
import com.nanal.backend.global.response.CommonResponse; | ||
import com.nanal.backend.global.response.ErrorCode; | ||
import com.nanal.backend.global.security.User; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.security.core.annotation.AuthenticationPrincipal; | ||
import org.springframework.web.bind.annotation.PutMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import javax.validation.Valid; | ||
|
||
@RequiredArgsConstructor | ||
@RestController | ||
public class AlarmController { | ||
|
||
private final AlarmService alarmService; | ||
|
||
@PutMapping("/alarm/diary") | ||
public CommonResponse<?> updateDiaryAlarm( | ||
@AuthenticationPrincipal User user, | ||
@RequestBody @Valid ReqUpdateDiaryAlarm reqUpdateDiaryAlarm) { | ||
|
||
alarmService.updateDiaryAlarm(user.getSocialId(), reqUpdateDiaryAlarm); | ||
|
||
return new CommonResponse<>(ErrorCode.SUCCESS); | ||
} | ||
|
||
@PutMapping("/alarm/retrospect") | ||
public CommonResponse<?> updateRetrospectAlarm( | ||
@AuthenticationPrincipal User user, | ||
@RequestBody @Valid ReqUpdateRetrospectAlarm reqUpdateRetrospectAlarm) { | ||
|
||
alarmService.updateRetrospectAlarm(user.getSocialId(), reqUpdateRetrospectAlarm); | ||
|
||
return new CommonResponse<>(ErrorCode.SUCCESS); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/main/java/com/nanal/backend/domain/alarm/dto/ReqUpdateDiaryAlarm.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,23 @@ | ||
package com.nanal.backend.domain.alarm.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
import javax.validation.constraints.NotBlank; | ||
import javax.validation.constraints.NotNull; | ||
import javax.validation.constraints.Pattern; | ||
|
||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Data | ||
public class ReqUpdateDiaryAlarm { | ||
|
||
@NotNull(message = "diaryAlarmActive 값이 올바르지 않습니다.") | ||
private Boolean diaryAlarmActive; | ||
|
||
@NotBlank(message = "diaryAlarmTime 는 비어있을 수 없습니다.") | ||
@Pattern(message = "diaryAlarmTime 값이 올바르지 않습니다.", | ||
regexp = "^(0[0-9]|1[0-9]|2[0-3]):([0-5][0-9])$") | ||
private String diaryAlarmTime; | ||
} |
23 changes: 23 additions & 0 deletions
23
src/main/java/com/nanal/backend/domain/alarm/dto/ReqUpdateRetrospectAlarm.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,23 @@ | ||
package com.nanal.backend.domain.alarm.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
import javax.validation.constraints.NotBlank; | ||
import javax.validation.constraints.NotNull; | ||
import javax.validation.constraints.Pattern; | ||
|
||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Data | ||
public class ReqUpdateRetrospectAlarm { | ||
|
||
@NotNull(message = "retrospectAlarmActive 값이 올바르지 않습니다.") | ||
private Boolean retrospectAlarmActive; | ||
|
||
@NotBlank(message = "retrospectAlarmTime 는 비어있을 수 없습니다.") | ||
@Pattern(message = "retrospectAlarmTime 값이 올바르지 않습니다.", | ||
regexp = "^(0[0-9]|1[0-9]|2[0-3]):([0-5][0-9])$") | ||
private String retrospectAlarmTime; | ||
} |
59 changes: 59 additions & 0 deletions
59
src/main/java/com/nanal/backend/domain/alarm/entity/Alarm.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,59 @@ | ||
package com.nanal.backend.domain.alarm.entity; | ||
|
||
import com.nanal.backend.domain.alarm.dto.ReqUpdateDiaryAlarm; | ||
import com.nanal.backend.domain.alarm.dto.ReqUpdateRetrospectAlarm; | ||
import com.nanal.backend.domain.auth.entity.Member; | ||
import com.nanal.backend.global.config.BaseTime; | ||
import lombok.*; | ||
|
||
import javax.persistence.*; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@Builder | ||
@Table(name = "alarm") | ||
@Entity | ||
public class Alarm extends BaseTime { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Column(name = "alarm_id") | ||
private Long alarmId; | ||
|
||
@Column(nullable = false) | ||
private Boolean diaryActive; | ||
|
||
@Column(length = 5, nullable = false) | ||
private String diaryTime; | ||
|
||
@Column(nullable = false) | ||
private Boolean retrospectActive; | ||
|
||
@Column(length = 5, nullable = false) | ||
private String retrospectTime; | ||
|
||
@OneToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "member_id") | ||
private Member member; | ||
|
||
public static Alarm createAlarm(Member member) { | ||
return Alarm.builder() | ||
.diaryActive(true) | ||
.diaryTime("20:00") | ||
.retrospectActive(true) | ||
.retrospectTime("20:00") | ||
.member(member) | ||
.build(); | ||
} | ||
|
||
public void updateDiaryAlarm(ReqUpdateDiaryAlarm reqUpdateDiaryAlarm) { | ||
this.diaryActive = reqUpdateDiaryAlarm.getDiaryAlarmActive(); | ||
this.diaryTime = reqUpdateDiaryAlarm.getDiaryAlarmTime(); | ||
} | ||
|
||
public void updateRetrospectAlarm(ReqUpdateRetrospectAlarm reqUpdateRetrospectAlarm) { | ||
this.retrospectActive = reqUpdateRetrospectAlarm.getRetrospectAlarmActive(); | ||
this.retrospectTime = reqUpdateRetrospectAlarm.getRetrospectAlarmTime(); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
src/main/java/com/nanal/backend/domain/alarm/repository/AlarmRepository.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,12 @@ | ||
package com.nanal.backend.domain.alarm.repository; | ||
|
||
import com.nanal.backend.domain.alarm.entity.Alarm; | ||
import com.nanal.backend.domain.auth.entity.Member; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
import java.util.Optional; | ||
|
||
public interface AlarmRepository extends JpaRepository<Alarm, Long> { | ||
|
||
Optional<Alarm> findByMember(Member member); | ||
} |
38 changes: 38 additions & 0 deletions
38
src/main/java/com/nanal/backend/domain/alarm/service/AlarmService.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,38 @@ | ||
package com.nanal.backend.domain.alarm.service; | ||
|
||
import com.nanal.backend.domain.alarm.dto.ReqUpdateDiaryAlarm; | ||
import com.nanal.backend.domain.alarm.dto.ReqUpdateRetrospectAlarm; | ||
import com.nanal.backend.domain.alarm.entity.Alarm; | ||
import com.nanal.backend.domain.alarm.repository.AlarmRepository; | ||
import com.nanal.backend.domain.auth.entity.Member; | ||
import com.nanal.backend.domain.auth.repository.MemberRepository; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Service; | ||
|
||
import javax.transaction.Transactional; | ||
|
||
@Transactional | ||
@RequiredArgsConstructor | ||
@Service | ||
public class AlarmService { | ||
|
||
private final MemberRepository memberRepository; | ||
|
||
public void updateDiaryAlarm(String socialId, ReqUpdateDiaryAlarm reqUpdateDiaryAlarm) { | ||
// socialId 로 유저 조회 | ||
Member member = memberRepository.findMember(socialId); | ||
|
||
Alarm alarm = member.getAlarm(); | ||
|
||
alarm.updateDiaryAlarm(reqUpdateDiaryAlarm); | ||
} | ||
|
||
public void updateRetrospectAlarm(String socialId, ReqUpdateRetrospectAlarm reqUpdateRetrospectAlarm) { | ||
// socialId 로 유저 조회 | ||
Member member = memberRepository.findMember(socialId); | ||
|
||
Alarm alarm = member.getAlarm(); | ||
|
||
alarm.updateRetrospectAlarm(reqUpdateRetrospectAlarm); | ||
} | ||
} |
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
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
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
Oops, something went wrong.