Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ data class SaveDisastersRequest(
)

data class DisasterRequest(
@Schema(description = "재난 발생 시간", example = "2021-08-01T00:00:00")
@Schema(description = "재난 알림 시간", example = "2021-08-01T00:00:00")
val generatedAt: LocalDateTime,

@Schema(description = "재난 메시지 ID", example = "1")
Expand All @@ -20,7 +20,7 @@ data class DisasterRequest(
)
val message: String,

@Schema(description = "재난 발생 위치", example = "서울특별시 종로구")
@Schema(description = "재난 알림 위치", example = "서울특별시 종로구")
val locationStr: String,

@Schema(description = "재난 종류", example = "지진")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class DataCollectorService(
notificationService.sendNotification(
uniqueUsers,
NotificationCategory.DISASTER,
"${disaster.address.toFullAddress()} ${disaster.disasterType.type.korean} 발생",
"${disaster.address.toFullAddress()} ${disaster.disasterType.type.korean} 알림",
"대피로에서 ${disaster.disasterType.type.korean} 행동요령을 확인해보세요."
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ class Disaster(
}

fun getTitle(): String {
return "${address.toFullAddress()} ${disasterType.type.korean} 발생"
return "${address.toFullAddress()} ${disasterType.type.korean} 알림"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ data class DisasterSituationResponse(
@Schema(description = "재난 종류 id", example = "호우")
val typeId: Long,

@Schema(description = "제목", example = "서울특별시 성북구 쌍문동 호우 발생")
@Schema(description = "제목", example = "서울특별시 성북구 쌍문동 호우 알림")
val title: String,

@Schema(description = "내용", example = "금일 10.23. 19:39경 소촌동 855 화재 발생, 인근주민은 안전 유의 및 차량우회바랍니다. 960-8222")
Expand All @@ -25,7 +25,7 @@ data class DisasterSituationResponse(
@Schema(description = "위치", example = "서울특별시 성북구")
val location: String,

@Schema(description = "발생 시간", example = "2024-10-23T19:53:00")
@Schema(description = "알림 시간", example = "2024-10-23T19:53:00")
val time: LocalDateTime,

@Schema(description = "댓글 수", example = "3")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ interface HomeApiV1 {
): ApiResult<List<ArticleListResponse>>

@GetMapping("/warnings")
@Operation(summary = "(재난 발생 시) 홈 현재 발생 재난 피드 조회", description = "홈 화면에 표시할 현재 발생 중인 재난을 조회합니다.")
@Operation(summary = "(재난 알림 시) 홈 현재 알림 재난 피드 조회", description = "홈 화면에 표시할 현재 알림 중인 재난을 조회합니다.")
fun getWarning(): ApiResult<GetWarningResponse>

@GetMapping("/status")
@Operation(summary = "현재 재난 발생 유무 조회", description = "현재 재난이 발생 중인지 조회합니다.")
@Operation(summary = "현재 재난 알림 유무 조회", description = "현재 재난이 알림 중인지 조회합니다.")
fun getStatus(): ApiResult<GetStatusResponse>

@GetMapping("/shelters/{type}")
@Operation(summary = "(재난 발생 시) 홈 대피소 피드 조회", description = """
@Operation(summary = "(재난 알림 시) 홈 대피소 피드 조회", description = """
대피소 목록을 조회합니다.
""")
fun getShelters(
Expand All @@ -64,7 +64,7 @@ interface HomeApiV1 {

@GetMapping("/tip/{disasterId}")
@Operation(
summary = "(재난 발생 시) 홈 행동요령 피드 조회", description = """
summary = "(재난 알림 시) 홈 행동요령 피드 조회", description = """
홈 행동요령 피드를 조회합니다.
현재 발생한 재난 조회 api에서 얻은 재난유형 id값을 입력해주세요.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ package com.numberone.daepiro.domain.home.dto.response
import io.swagger.v3.oas.annotations.media.Schema

data class GetStatusResponse(
@Schema(description = "현재 재난 발생 유무", example = "true")
@Schema(description = "현재 재난 알림 유무", example = "true")
val isOccurred: Boolean
)
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@ data class GetWarningResponse(
@Schema(description="재난유형 id", example="26")
val disasterTypeId: Long,

@Schema(description = "제목", example = "서울시 성북구 쌍문동 호우 발생")
@Schema(description = "제목", example = "서울시 성북구 쌍문동 호우 알림")
val title: String,

@Schema(description = "내용", example = "금일 10.23. 19:39경 소촌동 855 화재 발생, 인근주민은 안전유의 및 차량우회바랍니다. 960-8222")
val content: String,

@Schema(description = "발생 시간", example = "2024-10-23T19:53:00")
@Schema(description = "알림 시간", example = "2024-10-23T19:53:00")
val time: LocalDateTime
) {
companion object {
fun from(disaster: Disaster): GetWarningResponse {
return GetWarningResponse(
disasterType = disaster.disasterType.type.korean,
disasterTypeId = disaster.disasterType.id!!,
title = "${disaster.address.toFullAddress()} ${disaster.disasterType.type.korean} 발생",
title = "${disaster.address.toFullAddress()} ${disaster.disasterType.type.korean} 알림",
content = disaster.message,
time = disaster.generatedAt
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@ data class HomeDisasterFeed(
@Schema(description = "재난 종류 ID", example = "26")
val disasterTypeId: Long,

@Schema(description = "제목", example = "서울시 성북구 쌍문동 호우 발생")
@Schema(description = "제목", example = "서울시 성북구 쌍문동 호우 알림")
val title: String,

@Schema(description = "내용", example = "금일 10.23. 19:39경 소촌동 855 화재 발생, 인근주민은 안전유의 및 차량우회바랍니다. 960-8222")
val content: String,

@Schema(description = "발생 시간", example = "2024-10-23T19:53:00")
@Schema(description = "알림 시간", example = "2024-10-23T19:53:00")
val time: LocalDateTime
) {
companion object {
fun from(disaster: Disaster): HomeDisasterFeed {
return HomeDisasterFeed(
disasterType = disaster.disasterType.type.korean,
disasterTypeId = disaster.disasterType.id!!,
title = "${disaster.address.toFullAddress()} ${disaster.disasterType.type.korean} 발생",
title = "${disaster.address.toFullAddress()} ${disaster.disasterType.type.korean} 알림",
content = disaster.message,
time = disaster.generatedAt
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class HomeService(
fun getHomeDisasters(userId: Long): ApiResult<List<HomeDisasterFeed>> {
val user = userRepository.findByIdOrThrow(userId)
val disasters = disasterService.getDisasterByAddressAndType(
user.userAddresses.map { it.address } + user.address!!,
user.userAddresses.map { it.address },
user.userDisasterTypes.map { it.disasterType }
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@ data class DisasterResponse(
@Schema(description = "재난 종류 ID", example = "26")
val disasterTypeId:Long,

@Schema(description = "제목", example = "서울시 성북구 쌍문동 호우 발생")
@Schema(description = "제목", example = "서울시 성북구 쌍문동 호우 알림")
val title: String,

@Schema(description = "내용", example = "금일 10.23. 19:39경 소촌동 855 화재 발생, 인근주민은 안전유의 및 차량우회바랍니다. 960-8222")
val content: String,

@Schema(description = "발생 시간", example = "2024-10-23T19:53:00")
@Schema(description = "알림 시간", example = "2024-10-23T19:53:00")
val time: LocalDateTime
) {
companion object {
fun of(disaster: Disaster): DisasterResponse {
return DisasterResponse(
disasterType = disaster.disasterType.type.korean,
disasterTypeId = disaster.disasterType.id!!,
title = "${disaster.address.toFullAddress()} ${disaster.disasterType.type.korean} 발생",
title = "${disaster.address.toFullAddress()} ${disaster.disasterType.type.korean} 알림",
content = disaster.message,
time = disaster.generatedAt
)
Expand Down