Skip to content

Commit

Permalink
Merge branch 'main' into init-workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
MrSebastian committed Feb 21, 2024
2 parents 3c4eb9b + 48ad88e commit e4f7991
Show file tree
Hide file tree
Showing 31 changed files with 56 additions and 76 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
# TodoAppOSSDemo
# TodoAppOSSDemo

## IDE Setup

### IntelliJ

- import checkstyle to `code stlye` for `java`
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
*/
package de.mrsebastian.todoappdemo.backend.configuration;

import static org.springframework.security.web.util.matcher.AntPathRequestMatcher.antMatcher;

import org.springframework.boot.autoconfigure.security.servlet.PathRequest;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand All @@ -14,8 +16,6 @@
import org.springframework.security.config.annotation.web.configurers.HeadersConfigurer;
import org.springframework.security.web.SecurityFilterChain;

import static org.springframework.security.web.util.matcher.AntPathRequestMatcher.antMatcher;

@Configuration
@Profile("no-security")
@EnableWebSecurity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
*/
package de.mrsebastian.todoappdemo.backend.configuration;

import static org.springframework.security.web.util.matcher.AntPathRequestMatcher.antMatcher;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.security.servlet.PathRequest;
import org.springframework.boot.autoconfigure.web.client.RestTemplateAutoConfiguration;
Expand All @@ -17,8 +19,6 @@
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.web.SecurityFilterChain;

import static org.springframework.security.web.util.matcher.AntPathRequestMatcher.antMatcher;

/**
* The central class for configuration of all security aspects.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
*/
package de.mrsebastian.todoappdemo.backend.configuration.nfcconverter;

import de.mrsebastian.todoappdemo.backend.exception.NfcException;
import java.io.CharArrayReader;
import java.io.IOException;
import java.io.Reader;

import de.mrsebastian.todoappdemo.backend.exception.NfcException;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils;
import org.springframework.lang.NonNull;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
package de.mrsebastian.todoappdemo.backend.domain.document;

import java.util.UUID;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;

import java.util.UUID;

@Data
@NoArgsConstructor
@AllArgsConstructor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package de.mrsebastian.todoappdemo.backend.exception;

import java.util.UUID;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;

import java.util.UUID;

@Getter
@EqualsAndHashCode(callSuper = true)
@ToString
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@
import de.mrsebastian.todoappdemo.backend.person.service.PersonService;
import de.mrsebastian.todoappdemo.backend.task.rest.TaskDTO;
import de.mrsebastian.todoappdemo.backend.task.service.TaskService;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.graphql.data.method.annotation.QueryMapping;
import org.springframework.stereotype.Controller;

import java.util.List;

@Controller
@RequiredArgsConstructor
public class PostController {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package de.mrsebastian.todoappdemo.backend.person.dataaccess;

import jakarta.validation.constraints.NotNull;
import lombok.Builder;

import java.util.UUID;
import lombok.Builder;

@Builder
public record PersonDao(@NotNull UUID id, String firstname, String lastname, @NotNull String email) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package de.mrsebastian.todoappdemo.backend.person.dataaccess.document;

import de.mrsebastian.todoappdemo.backend.configuration.Profiles;
import java.util.UUID;
import org.springframework.context.annotation.Profile;
import org.springframework.data.mongodb.repository.MongoRepository;

import java.util.UUID;

@Profile(Profiles.PROFILE_MONGO)
public interface PersonDocumentRepository extends MongoRepository<PersonDocument, UUID> {
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@
import de.mrsebastian.todoappdemo.backend.person.dataaccess.PersonCreateDao;
import de.mrsebastian.todoappdemo.backend.person.dataaccess.PersonDao;
import de.mrsebastian.todoappdemo.backend.person.dataaccess.PersonDataAccessService;
import java.util.List;
import java.util.UUID;
import lombok.RequiredArgsConstructor;
import lombok.val;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.UUID;

@Service
@Profile(Profiles.PROFILE_MONGO)
@RequiredArgsConstructor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package de.mrsebastian.todoappdemo.backend.person.dataaccess.entity;

import org.springframework.data.jpa.repository.JpaRepository;

import java.util.UUID;
import org.springframework.data.jpa.repository.JpaRepository;

public interface PersonRepository extends JpaRepository<Person, UUID> {
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@
import de.mrsebastian.todoappdemo.backend.person.dataaccess.PersonCreateDao;
import de.mrsebastian.todoappdemo.backend.person.dataaccess.PersonDao;
import de.mrsebastian.todoappdemo.backend.person.dataaccess.PersonDataAccessService;
import java.util.List;
import java.util.UUID;
import lombok.RequiredArgsConstructor;
import lombok.val;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.UUID;

@Service
@Profile(Profiles.PROFILE_SQL)
@RequiredArgsConstructor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package de.mrsebastian.todoappdemo.backend.person.rest;

import jakarta.validation.constraints.NotNull;
import lombok.Builder;

import java.util.UUID;
import lombok.Builder;

@Builder
public record PersonDTO(@NotNull UUID id, String firstname, String lastname, @NotNull String email) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
import de.mrsebastian.todoappdemo.backend.person.dataaccess.entity.Person;
import de.mrsebastian.todoappdemo.backend.person.rest.PersonCreateDTO;
import de.mrsebastian.todoappdemo.backend.person.rest.PersonDTO;
import java.util.List;
import java.util.UUID;
import lombok.RequiredArgsConstructor;
import lombok.val;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.UUID;

@Service
@RequiredArgsConstructor
public class PersonService {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package de.mrsebastian.todoappdemo.backend.task.dataaccess;

import jakarta.validation.constraints.NotNull;
import lombok.Builder;

import java.time.LocalDate;
import java.util.UUID;
import lombok.Builder;

@Builder
public record TaskCreateDao(@NotNull String title, @NotNull String description, LocalDate dueDate, UUID creatorId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

import de.mrsebastian.todoappdemo.backend.person.rest.PersonDTO;
import jakarta.validation.constraints.NotNull;
import lombok.Builder;

import java.time.LocalDate;
import java.util.UUID;
import lombok.Builder;

@Builder
public record TaskDao(@NotNull UUID id, @NotNull String title, @NotNull String description, LocalDate dueDate, PersonDTO creator) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package de.mrsebastian.todoappdemo.backend.task.dataaccess;

import jakarta.validation.constraints.NotNull;

import java.time.LocalDate;

public record TaskUpdateDao(@NotNull String title, @NotNull String description, LocalDate dueDate) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
import de.mrsebastian.todoappdemo.backend.domain.document.BaseDocument;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import java.time.LocalDate;
import lombok.Data;
import org.springframework.data.mongodb.core.mapping.Document;

import java.time.LocalDate;

@Document
@Data
public class TaskDocument extends BaseDocument {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package de.mrsebastian.todoappdemo.backend.task.dataaccess.document;

import de.mrsebastian.todoappdemo.backend.configuration.Profiles;
import java.util.UUID;
import org.springframework.context.annotation.Profile;
import org.springframework.data.mongodb.repository.MongoRepository;

import java.util.UUID;

@Profile(Profiles.PROFILE_MONGO)
public interface TaskDocumentRepository extends MongoRepository<TaskDocument, UUID> {
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@
import de.mrsebastian.todoappdemo.backend.task.dataaccess.TaskDao;
import de.mrsebastian.todoappdemo.backend.task.dataaccess.TaskDataAccessService;
import de.mrsebastian.todoappdemo.backend.task.dataaccess.TaskUpdateDao;
import java.util.List;
import java.util.UUID;
import lombok.RequiredArgsConstructor;
import lombok.val;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.UUID;

@Service
@Profile(Profiles.PROFILE_MONGO)
@RequiredArgsConstructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@
import jakarta.persistence.Table;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import java.time.LocalDate;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.time.LocalDate;

@Entity
@Table(name = "tasks")
@NoArgsConstructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@
import de.mrsebastian.todoappdemo.backend.task.dataaccess.TaskDao;
import de.mrsebastian.todoappdemo.backend.task.dataaccess.TaskDataAccessService;
import de.mrsebastian.todoappdemo.backend.task.dataaccess.TaskUpdateDao;
import java.util.List;
import java.util.UUID;
import lombok.RequiredArgsConstructor;
import lombok.val;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.UUID;

@Service
@Profile({ Profiles.PROFILE_SQL })
@RequiredArgsConstructor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package de.mrsebastian.todoappdemo.backend.task.dataaccess.entity;

import org.springframework.data.jpa.repository.JpaRepository;

import java.util.UUID;
import org.springframework.data.jpa.repository.JpaRepository;

public interface TaskRepository extends JpaRepository<Task, UUID> {
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import de.mrsebastian.todoappdemo.backend.task.service.TaskService;
import jakarta.validation.Valid;
import java.util.List;
import java.util.UUID;
import lombok.AllArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.DeleteMapping;
Expand All @@ -14,9 +16,6 @@
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.UUID;

@RestController
@RequestMapping("tasks")
@AllArgsConstructor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package de.mrsebastian.todoappdemo.backend.task.rest;

import jakarta.validation.constraints.NotNull;
import lombok.Builder;

import java.time.LocalDate;
import java.util.UUID;
import lombok.Builder;

@Builder
public record TaskCreateDTO(@NotNull String title, @NotNull String description, LocalDate dueDate, UUID creatorId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

import de.mrsebastian.todoappdemo.backend.person.rest.PersonDTO;
import jakarta.validation.constraints.NotNull;

import java.time.LocalDate;
import java.util.UUID;

public record TaskDTO (@NotNull UUID id, @NotNull String title, @NotNull String description, LocalDate dueDate, PersonDTO creator) {
public record TaskDTO(@NotNull UUID id, @NotNull String title, @NotNull String description, LocalDate dueDate, PersonDTO creator) {
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package de.mrsebastian.todoappdemo.backend.task.rest;

import jakarta.validation.constraints.NotNull;

import java.time.LocalDate;

public record TaskUpdateDTO(@NotNull String title, @NotNull String description, LocalDate dueDate) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@
import de.mrsebastian.todoappdemo.backend.task.rest.TaskCreateDTO;
import de.mrsebastian.todoappdemo.backend.task.rest.TaskDTO;
import de.mrsebastian.todoappdemo.backend.task.rest.TaskUpdateDTO;
import java.util.List;
import java.util.UUID;
import lombok.AllArgsConstructor;
import lombok.val;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.UUID;

@Service
@AllArgsConstructor
public class TaskService {
Expand Down
Loading

0 comments on commit e4f7991

Please sign in to comment.