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
@@ -0,0 +1,8 @@
package com.example.attendanceapimono.adapter.present

import com.example.attendanceapimono.adapter.present.api.EventAPI
import org.springframework.web.bind.annotation.RestController

@RestController
class EventController: EventAPI {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.example.attendanceapimono.adapter.present.api

import io.swagger.v3.oas.annotations.tags.Tag

@Tag(name = "Event 관련 API")
interface EventAPI {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.example.attendanceapimono.adapter.present.api

import io.swagger.v3.oas.annotations.security.SecurityRequirement

@SecurityRequirement(name = "signedTokenV1")
annotation class JWTTokenV1
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,11 @@ interface UserAPI {
description = "토큰 체크 및 재생성 하는 기능",
content = [Content(
mediaType = MediaType.APPLICATION_JSON_VALUE,
schema = Schema(implementation = TokenResponse::class),
examples = [ExampleObject(TokenResponse.Example)]
schema = Schema(implementation = ReSignResponse::class),
examples = [ExampleObject(ReSignResponse.Example)]
)],
)
@JWTTokenV1
@ResponseStatus(HttpStatus.OK)
@GetMapping("/token")
suspend fun reSign(@LoginUserID userID: UUID): ResponseEntity<Mono<ReSignResponse>>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.example.attendanceapimono.application

import com.example.attendanceapimono.domain.attendance.AttendanceRepository
import com.example.attendanceapimono.domain.event.EventRepository
import org.springframework.stereotype.Service

@Service
class AttendanceService(
private val eventRepository: EventRepository,
private val attendanceRepository: AttendanceRepository,
) {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.example.attendanceapimono.application

import org.springframework.stereotype.Service

@Service
class EventService {
fun createEvent() {

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package com.example.attendanceapimono.application.dto.event

import io.swagger.v3.oas.annotations.media.Schema
import org.hibernate.validator.constraints.Length
import org.springframework.format.annotation.DateTimeFormat
import java.time.LocalDateTime

@Schema(
title = "이벤트 등록 요청",
description = "새로운 이벤트를 등록할 때 필요한 Body에 대한 DTO입니다.",
example = CreateEventRequest.Example
)
class CreateEventRequest(
@Schema(description = "DDD 기수 입니다.")
val generationID: Int,

@Schema(description = "이벤트 명")
@field:Length(min = 5, max = 255)
val title: String,

@Schema(description = "이벤트 설명")
@field:Length(max = 500)
val description: String,

@Schema(description = "예상 시작 일")
@field:DateTimeFormat
val expectedAt: String,

@Schema(description = "지각 기준 시간 (분)")
val lateDiffMinute: Int,

@Schema(description = "결석 기준 시간 (분)")
val absentDiffMinute: Int
) {
companion object {
const val Example = """
{
"generationID": 6,
"title": "오리엔테이션",
"description": "함께 모여 앞으로의 방향에 대해 이야기 나눠 보아요.",
"expectedAt": "2021-08-21T14:00:00.000",
"lateDiffMinute": 10,
"absentDiffMinute": 60
}
"""
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package com.example.attendanceapimono.application.dto.event

import com.example.attendanceapimono.domain.event.Event
import io.swagger.v3.oas.annotations.media.Schema

@Schema(
title = "이벤트 등록 후 반환",
description = "이벤트를 등록한 후, 반환해주는 Response에 대한 DTO 입니다.",
example = CreateEventResponse.Example,
)
data class CreateEventResponse (
@Schema(description = "생성된 event")
val event: Event,
) {
companion object {
const val Example = """
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"generationID": 6,
"title": "오리엔테이션",
"description": "함께 모여 앞으로의 방향에 대해 이야기 나눠 보아요.",
"isDone": false,
"expectedAt": "2021-08-21T14:00:00.000",
"lateDiffMinute": 10,
"absentDiffMinute": 60,
"startAt": null,
"createdAt": "2021-08-12T22:13:47.245",
"updatedAt": "2021-08-12T22:13:47.245"
}
"""
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.example.attendanceapimono.domain.attendance

import org.springframework.data.jpa.repository.JpaRepository
import org.springframework.stereotype.Repository
import java.util.*

@Repository
interface AttendanceRepository : JpaRepository<Attendance, UUID>
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ class Event(
var title: String,

@Column(length = 500, nullable = false)
var description: String,
var description: String = "",

@Column(nullable = false)
var isDone: Boolean,
var isDone: Boolean = false,

@Column(nullable = false)
val expectedAt: LocalDateTime,
Expand All @@ -36,7 +36,7 @@ class Event(
var absentDiffMinutes: Int,

@Column(nullable = false)
val startAt: LocalDateTime,
var startAt: LocalDateTime,

@Column(nullable = false)
val createdAt: LocalDateTime,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.example.attendanceapimono.domain.event

import org.springframework.data.jpa.repository.JpaRepository
import org.springframework.stereotype.Repository
import java.util.*

@Repository
interface EventRepository : JpaRepository<Event, UUID>