Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix :: 과제 생성 시 데이터를 Form으로 받는 버그 #340

Merged
merged 2 commits into from
Oct 22, 2024
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 @@ -9,6 +9,7 @@ import com.seugi.api.global.response.BaseResponse
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.PathVariable
import org.springframework.web.bind.annotation.PostMapping
import org.springframework.web.bind.annotation.RequestBody
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController

Expand All @@ -19,11 +20,9 @@ class TaskController (
) {

@PostMapping
fun createTask(dto: CreateTaskRequest): BaseResponse<Unit> {
return BaseResponse (
message = "과제 만들기 성공 !",
data = service.createTask(dto)
)
fun createTask(@RequestBody dto: CreateTaskRequest): BaseResponse<Unit> {
service.createTask(dto)
return BaseResponse (message = "과제 만들기 성공 !")
}

@GetMapping("/{workspaceId}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,16 @@ import java.time.LocalDateTime

class CreateTaskRequest (

@JsonProperty("workspaceId") val workspaceId: String,
@JsonProperty("title") val title: String,
@JsonProperty("description") val description: String?,
@JsonProperty("dueDate") val dueDate: LocalDateTime?
@JsonProperty("workspaceId")
val workspaceId: String,

@JsonProperty("title")
val title: String,

@JsonProperty("description")
val description: String?,

@JsonProperty("dueDate")
val dueDate: LocalDateTime?

)
Loading