-
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.
- Loading branch information
Showing
9 changed files
with
82 additions
and
14 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
src/main/kotlin/com/namju/simple_todo/todo/controller/TodoAPIController.kt
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,28 @@ | ||
package com.namju.simple_todo.todo.controller | ||
|
||
import com.namju.simple_todo.todo.service.TodoSerivce | ||
import org.springframework.http.ResponseEntity | ||
import org.springframework.web.bind.annotation.PatchMapping | ||
import org.springframework.web.bind.annotation.PathVariable | ||
import org.springframework.web.bind.annotation.RequestMapping | ||
import org.springframework.web.bind.annotation.RestController | ||
import java.security.Principal | ||
|
||
|
||
@RestController | ||
@RequestMapping("/api/todo") | ||
class TodoAPIController( | ||
var todoService: TodoSerivce | ||
) { | ||
|
||
@PatchMapping("/{id}") | ||
fun updateTodo( | ||
@PathVariable id: Long, | ||
principal: Principal | ||
): ResponseEntity<String> { | ||
val username = principal.name | ||
|
||
todoService.changeDone(id) | ||
return ResponseEntity.ok("업데이트 완료") | ||
} | ||
} |
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 |
---|---|---|
@@ -1,9 +1,19 @@ | ||
-- email: cmsong111@naver.com , password: 1234 | ||
insert into user_entity (username, password, nickname) | ||
values ('cmsong111@naver.com', '$2a$10$PdmeJs3yBaHhy6YfTF0Zze1Pw9GnxGFA7syoe/NhOmnmx1jOw43RK', '김남주'); | ||
values ('cmsong111@naver.com', '$2a$10$PdmeJs3yBaHhy6YfTF0Zze1Pw9GnxGFA7syoe/NhOmnmx1jOw43RK', '김남주'); | ||
|
||
-- todo | ||
insert into todo_entity (title, content, is_done, user_idx) | ||
values ('할일1', '할일1 내용', false, 1), | ||
('할일2', '할일2 내용', false, 1), | ||
('할일3', '할일3 내용', true, 1); | ||
values ('할일1', '할일1 내용', false, 1), | ||
('할일2', '할일2 내용', false, 1), | ||
('할일3', '할일3 내용', true, 1), | ||
('할일3', '할일3 내용', true, 1), | ||
('할일3', '할일3 내용', true, 1), | ||
('할일3', '할일3 내용', true, 1), | ||
('할일3', '할일3 내용', true, 1), | ||
('할일3', '할일3 내용', true, 1), | ||
('할일3', '할일3 내용', true, 1), | ||
('할일3', '할일3 내용', true, 1), | ||
('할일3', '할일3 내용', true, 1), | ||
('할일5', '할일3 내용', true, 1), | ||
('할일101', '할일3 내용', true, 1); |
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
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