-
Notifications
You must be signed in to change notification settings - Fork 0
Added internal store for tasks #5
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| .env | ||
| *.db |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| package masecla.remindify.repository; | ||
|
|
||
| import masecla.remindify.dto.TaskDto; | ||
| import org.springframework.data.jpa.repository.JpaRepository; | ||
|
|
||
| public interface TaskRepository extends JpaRepository<TaskDto, Long> { | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| package masecla.remindify.services; | ||
|
|
||
| import lombok.AllArgsConstructor; | ||
| import lombok.extern.slf4j.Slf4j; | ||
| import masecla.remindify.dto.TaskDto; | ||
| import masecla.remindify.repository.TaskRepository; | ||
| import org.springframework.beans.factory.annotation.Autowired; | ||
| import org.springframework.stereotype.Service; | ||
|
|
||
| @Slf4j | ||
| @Service | ||
| @AllArgsConstructor(onConstructor_ = @Autowired) | ||
| public class TaskService { | ||
|
|
||
| private TaskRepository taskRepository; | ||
|
|
||
| public void saveTask(TaskDto task) { | ||
| TaskDto persisted = task.getId() == null ? taskRepository.save(task) : task; | ||
| log.info("Task with id {} has been created.", persisted.getId()); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,12 @@ | ||
| spring.application.name=remindify | ||
| todoist.api.token=your_todoist_api_token_here | ||
| todoist.api.token=your_todoist_api_token_here | ||
|
|
||
| spring.datasource.url=jdbc:h2:file:./data/remindify-new | ||
| spring.datasource.driver-class-name=org.h2.Driver | ||
| spring.datasource.username=username | ||
| spring.datasource.password=password | ||
|
|
||
| spring.jpa.hibernate.ddl-auto=update | ||
|
|
||
| spring.h2.console.enabled=true | ||
| spring.h2.console.path=/h2-console | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please document how these are meant to be used / switch from local to remote mysql