feat: rename packages
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { API_TOKEN } from '../app-constants/app-constants';
|
||||
import { CsrfToken } from '../types/CsrfToken';
|
||||
|
||||
/**
|
||||
* Retrieves the API token from local storage.
|
||||
@@ -10,6 +11,16 @@ function getToken(): string {
|
||||
return tokenState ?? '';
|
||||
}
|
||||
|
||||
function getHeaders(csrf?: CsrfToken): Headers {
|
||||
const headers: Headers = new Headers();
|
||||
headers.append('Content-Type', 'application/json');
|
||||
headers.append('Authorization', `Bearer ${getToken()}`);
|
||||
if (csrf) {
|
||||
headers.append('X-CSRF-TOKEN', csrf.token);
|
||||
}
|
||||
return headers;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@@ -44,14 +55,38 @@ const api = {
|
||||
return false;
|
||||
},
|
||||
|
||||
getCSRF: async (url: string) => {
|
||||
const csrfReq = await fetch(url, {
|
||||
method: 'GET',
|
||||
mode: 'cors',
|
||||
headers: getHeaders()
|
||||
});
|
||||
if (csrfReq.ok) {
|
||||
const data = await csrfReq.json();
|
||||
return data;
|
||||
}
|
||||
handleError(csrfReq.status);
|
||||
return false;
|
||||
},
|
||||
|
||||
postJSON: async (url: string, payload: object) => {
|
||||
let token = document.cookie
|
||||
.split('; ')
|
||||
.find(row => row.startsWith('XSRF-TOKEN='))
|
||||
?.split('=')[1];
|
||||
|
||||
if (!token) token = '';
|
||||
console.log("sending token", token);
|
||||
|
||||
const response = await fetch(url, {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: `Bearer ${getToken()}`
|
||||
Authorization: `Bearer ${getToken()}`,
|
||||
'X-CSRF-TOKEN': token
|
||||
},
|
||||
credentials: 'include',
|
||||
body: JSON.stringify(payload)
|
||||
});
|
||||
if (response.ok) {
|
||||
|
||||
@@ -10,6 +10,8 @@ const ApiConfig = {
|
||||
|
||||
refreshTokenUrl: `${server}/rest/user-sessions/refresh`,
|
||||
|
||||
csrfTokenUrl: `${server}/rest/user-sessions/csrf`,
|
||||
|
||||
tasksUrl: `${server}/rest/tasks`,
|
||||
|
||||
homeUrl: `${server}/rest/home`,
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
export type CsrfToken = {
|
||||
headerName: string;
|
||||
parameterName: string;
|
||||
token: string;
|
||||
};
|
||||
@@ -7,6 +7,7 @@ import { TaskResponse } from '../../types/TaskResponse';
|
||||
import api from '../../api-service/api';
|
||||
import ApiConfig from '../../api-service/apiConfig';
|
||||
import './style.css';
|
||||
import { CsrfToken } from '../../types/CsrfToken';
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -27,12 +28,21 @@ function Task(): JSX.Element {
|
||||
}
|
||||
};
|
||||
|
||||
const getCsrf = async () => {
|
||||
try {
|
||||
const token: CsrfToken = await api.getCSRF(ApiConfig.csrfTokenUrl);
|
||||
return token;
|
||||
} catch (e) {
|
||||
handleError(e);
|
||||
}
|
||||
};
|
||||
|
||||
const loadTasks = async () => {
|
||||
const tasksFetched: TaskResponse[] | Error = await api.getJSON(ApiConfig.tasksUrl);
|
||||
if (tasksFetched instanceof Error) {
|
||||
handleError(tasksFetched);
|
||||
} else {
|
||||
try {
|
||||
const tasksFetched: TaskResponse[] = await api.getJSON(ApiConfig.tasksUrl);
|
||||
setTasks(tasksFetched);
|
||||
} catch (e) {
|
||||
handleError(e);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -41,6 +51,11 @@ function Task(): JSX.Element {
|
||||
description: desc,
|
||||
urls: url ? [url] : []
|
||||
};
|
||||
// const csrf: CsrfToken | undefined = await getCsrf();
|
||||
// if (!csrf) {
|
||||
// handleError('Unable to get server resources!');
|
||||
// return false;
|
||||
// }
|
||||
try {
|
||||
await api.postJSON(ApiConfig.tasksUrl, payload);
|
||||
loadTasks();
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
package br.com.tasknoteapp.java_api.config;
|
||||
|
||||
import br.com.tasknoteapp.java_api.request.LoginRequest;
|
||||
import br.com.tasknoteapp.java_api.request.NotePatchRequest;
|
||||
import br.com.tasknoteapp.java_api.request.NoteRequest;
|
||||
import br.com.tasknoteapp.java_api.request.NoteUrlPatchRequest;
|
||||
import br.com.tasknoteapp.java_api.request.TaskPatchRequest;
|
||||
import br.com.tasknoteapp.java_api.request.TaskRequest;
|
||||
import br.com.tasknoteapp.java_api.request.TaskUrlPatchRequest;
|
||||
import br.com.tasknoteapp.java_api.response.JwtAuthenticationResponse;
|
||||
import br.com.tasknoteapp.java_api.response.NoteResponse;
|
||||
import br.com.tasknoteapp.java_api.response.NoteUrlResponse;
|
||||
import br.com.tasknoteapp.java_api.response.SearchResponse;
|
||||
import br.com.tasknoteapp.java_api.response.SummaryResponse;
|
||||
import br.com.tasknoteapp.java_api.response.TaskResponse;
|
||||
import br.com.tasknoteapp.java_api.response.TaskUrlResponse;
|
||||
import br.com.tasknoteapp.java_api.response.UserResponse;
|
||||
import org.springframework.aot.hint.annotation.RegisterReflectionForBinding;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.ImportRuntimeHints;
|
||||
|
||||
@Configuration
|
||||
@RegisterReflectionForBinding({
|
||||
LoginRequest.class,
|
||||
NotePatchRequest.class,
|
||||
NoteRequest.class,
|
||||
NoteUrlPatchRequest.class,
|
||||
TaskPatchRequest.class,
|
||||
TaskRequest.class,
|
||||
TaskUrlPatchRequest.class,
|
||||
JwtAuthenticationResponse.class,
|
||||
NoteResponse.class,
|
||||
NoteUrlResponse.class,
|
||||
SearchResponse.class,
|
||||
SummaryResponse.class,
|
||||
TaskResponse.class,
|
||||
TaskUrlResponse.class,
|
||||
UserResponse.class,
|
||||
io.jsonwebtoken.Claims.class,
|
||||
io.jsonwebtoken.Jwts.class,
|
||||
io.jsonwebtoken.impl.security.StandardSecureDigestAlgorithms.class,
|
||||
})
|
||||
@ImportRuntimeHints(value = {HttpServletRequestRuntimeHint.class})
|
||||
public class CloudNativeConfig {}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package br.com.tasknoteapp.java_api;
|
||||
package br.com.tasknoteapp.server;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
@@ -0,0 +1,44 @@
|
||||
package br.com.tasknoteapp.server.config;
|
||||
|
||||
import br.com.tasknoteapp.server.request.LoginRequest;
|
||||
import br.com.tasknoteapp.server.request.NotePatchRequest;
|
||||
import br.com.tasknoteapp.server.request.NoteRequest;
|
||||
import br.com.tasknoteapp.server.request.NoteUrlPatchRequest;
|
||||
import br.com.tasknoteapp.server.request.TaskPatchRequest;
|
||||
import br.com.tasknoteapp.server.request.TaskRequest;
|
||||
import br.com.tasknoteapp.server.request.TaskUrlPatchRequest;
|
||||
import br.com.tasknoteapp.server.response.JwtAuthenticationResponse;
|
||||
import br.com.tasknoteapp.server.response.NoteResponse;
|
||||
import br.com.tasknoteapp.server.response.NoteUrlResponse;
|
||||
import br.com.tasknoteapp.server.response.SearchResponse;
|
||||
import br.com.tasknoteapp.server.response.SummaryResponse;
|
||||
import br.com.tasknoteapp.server.response.TaskResponse;
|
||||
import br.com.tasknoteapp.server.response.TaskUrlResponse;
|
||||
import br.com.tasknoteapp.server.response.UserResponse;
|
||||
import org.springframework.aot.hint.annotation.RegisterReflectionForBinding;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.ImportRuntimeHints;
|
||||
|
||||
@Configuration
|
||||
@RegisterReflectionForBinding({
|
||||
LoginRequest.class,
|
||||
NotePatchRequest.class,
|
||||
NoteRequest.class,
|
||||
NoteUrlPatchRequest.class,
|
||||
TaskPatchRequest.class,
|
||||
TaskRequest.class,
|
||||
TaskUrlPatchRequest.class,
|
||||
JwtAuthenticationResponse.class,
|
||||
NoteResponse.class,
|
||||
NoteUrlResponse.class,
|
||||
SearchResponse.class,
|
||||
SummaryResponse.class,
|
||||
TaskResponse.class,
|
||||
TaskUrlResponse.class,
|
||||
UserResponse.class,
|
||||
io.jsonwebtoken.Claims.class,
|
||||
io.jsonwebtoken.Jwts.class,
|
||||
io.jsonwebtoken.impl.security.StandardSecureDigestAlgorithms.class,
|
||||
})
|
||||
@ImportRuntimeHints(value = {HttpServletRequestRuntimeHint.class})
|
||||
public class CloudNativeConfig {}
|
||||
+2
-1
@@ -1,4 +1,4 @@
|
||||
package br.com.tasknoteapp.java_api.config;
|
||||
package br.com.tasknoteapp.server.config;
|
||||
|
||||
import java.util.Arrays;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -28,6 +28,7 @@ public class CorsConfig implements WebMvcConfigurer {
|
||||
registry
|
||||
.addMapping("/**")
|
||||
.allowedOrigins(allowedOrigins)
|
||||
.allowCredentials(true)
|
||||
.allowedMethods("GET", "PUT", "POST", "DELETE", "OPTIONS", "HEAD", "PATCH");
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package br.com.tasknoteapp.java_api.config;
|
||||
package br.com.tasknoteapp.server.config;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import org.springframework.aot.hint.ProxyHints;
|
||||
+9
-7
@@ -1,7 +1,7 @@
|
||||
package br.com.tasknoteapp.java_api.config;
|
||||
package br.com.tasknoteapp.server.config;
|
||||
|
||||
import br.com.tasknoteapp.java_api.filter.JwtAuthenticationFilter;
|
||||
import br.com.tasknoteapp.java_api.service.UserService;
|
||||
import br.com.tasknoteapp.server.filter.JwtAuthenticationFilter;
|
||||
import br.com.tasknoteapp.server.service.UserService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
@@ -14,11 +14,11 @@ import org.springframework.security.config.annotation.authentication.configurati
|
||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
||||
import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer;
|
||||
import org.springframework.security.config.http.SessionCreationPolicy;
|
||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
import org.springframework.security.web.SecurityFilterChain;
|
||||
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
|
||||
import org.springframework.security.web.csrf.CookieCsrfTokenRepository;
|
||||
|
||||
/** This class contains security configurations. */
|
||||
@Configuration
|
||||
@@ -40,7 +40,11 @@ public class SecurityConfig {
|
||||
@Bean
|
||||
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
||||
http.cors(Customizer.withDefaults())
|
||||
.csrf(custom -> custom.ignoringRequestMatchers("/auth/**"))
|
||||
.csrf(
|
||||
custom ->
|
||||
custom
|
||||
.ignoringRequestMatchers("/auth/**")
|
||||
.csrfTokenRepository(CookieCsrfTokenRepository.withHttpOnlyFalse()))
|
||||
.authorizeHttpRequests(
|
||||
request ->
|
||||
request
|
||||
@@ -52,8 +56,6 @@ public class SecurityConfig {
|
||||
.permitAll()
|
||||
.anyRequest()
|
||||
.permitAll())
|
||||
.sessionManagement(
|
||||
manager -> manager.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
|
||||
.httpBasic(AbstractHttpConfigurer::disable)
|
||||
.formLogin(AbstractHttpConfigurer::disable)
|
||||
.addFilterBefore(jwtAuthenticationFilter, UsernamePasswordAuthenticationFilter.class)
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package br.com.tasknoteapp.java_api.config;
|
||||
package br.com.tasknoteapp.server.config;
|
||||
|
||||
import io.swagger.v3.oas.models.Components;
|
||||
import io.swagger.v3.oas.models.OpenAPI;
|
||||
+6
-6
@@ -1,10 +1,10 @@
|
||||
package br.com.tasknoteapp.java_api.controller;
|
||||
package br.com.tasknoteapp.server.controller;
|
||||
|
||||
import br.com.tasknoteapp.java_api.exception.UserAlreadyExistsException;
|
||||
import br.com.tasknoteapp.java_api.exception.UserNotFoundException;
|
||||
import br.com.tasknoteapp.java_api.request.LoginRequest;
|
||||
import br.com.tasknoteapp.java_api.response.JwtAuthenticationResponse;
|
||||
import br.com.tasknoteapp.java_api.service.AuthService;
|
||||
import br.com.tasknoteapp.server.exception.UserAlreadyExistsException;
|
||||
import br.com.tasknoteapp.server.exception.UserNotFoundException;
|
||||
import br.com.tasknoteapp.server.request.LoginRequest;
|
||||
import br.com.tasknoteapp.server.response.JwtAuthenticationResponse;
|
||||
import br.com.tasknoteapp.server.service.AuthService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Content;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
+4
-4
@@ -1,8 +1,8 @@
|
||||
package br.com.tasknoteapp.java_api.controller;
|
||||
package br.com.tasknoteapp.server.controller;
|
||||
|
||||
import br.com.tasknoteapp.java_api.response.SearchResponse;
|
||||
import br.com.tasknoteapp.java_api.response.SummaryResponse;
|
||||
import br.com.tasknoteapp.java_api.service.HomeService;
|
||||
import br.com.tasknoteapp.server.response.SearchResponse;
|
||||
import br.com.tasknoteapp.server.response.SummaryResponse;
|
||||
import br.com.tasknoteapp.server.service.HomeService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.enums.ParameterIn;
|
||||
+6
-6
@@ -1,10 +1,10 @@
|
||||
package br.com.tasknoteapp.java_api.controller;
|
||||
package br.com.tasknoteapp.server.controller;
|
||||
|
||||
import br.com.tasknoteapp.java_api.entity.NoteEntity;
|
||||
import br.com.tasknoteapp.java_api.request.NotePatchRequest;
|
||||
import br.com.tasknoteapp.java_api.request.NoteRequest;
|
||||
import br.com.tasknoteapp.java_api.response.NoteResponse;
|
||||
import br.com.tasknoteapp.java_api.service.NoteService;
|
||||
import br.com.tasknoteapp.server.entity.NoteEntity;
|
||||
import br.com.tasknoteapp.server.request.NotePatchRequest;
|
||||
import br.com.tasknoteapp.server.request.NoteRequest;
|
||||
import br.com.tasknoteapp.server.response.NoteResponse;
|
||||
import br.com.tasknoteapp.server.service.NoteService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.enums.ParameterIn;
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package br.com.tasknoteapp.java_api.controller;
|
||||
package br.com.tasknoteapp.server.controller;
|
||||
|
||||
import br.com.tasknoteapp.java_api.response.ValidationExceptionResponse;
|
||||
import br.com.tasknoteapp.server.response.ValidationExceptionResponse;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.MethodArgumentNotValidException;
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
+7
-7
@@ -1,11 +1,11 @@
|
||||
package br.com.tasknoteapp.java_api.controller;
|
||||
package br.com.tasknoteapp.server.controller;
|
||||
|
||||
import br.com.tasknoteapp.java_api.entity.TaskEntity;
|
||||
import br.com.tasknoteapp.java_api.exception.TaskNotFoundException;
|
||||
import br.com.tasknoteapp.java_api.request.TaskPatchRequest;
|
||||
import br.com.tasknoteapp.java_api.request.TaskRequest;
|
||||
import br.com.tasknoteapp.java_api.response.TaskResponse;
|
||||
import br.com.tasknoteapp.java_api.service.TaskService;
|
||||
import br.com.tasknoteapp.server.entity.TaskEntity;
|
||||
import br.com.tasknoteapp.server.exception.TaskNotFoundException;
|
||||
import br.com.tasknoteapp.server.request.TaskPatchRequest;
|
||||
import br.com.tasknoteapp.server.request.TaskRequest;
|
||||
import br.com.tasknoteapp.server.response.TaskResponse;
|
||||
import br.com.tasknoteapp.server.service.TaskService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.enums.ParameterIn;
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
package br.com.tasknoteapp.java_api.controller;
|
||||
package br.com.tasknoteapp.server.controller;
|
||||
|
||||
import br.com.tasknoteapp.java_api.response.UserResponse;
|
||||
import br.com.tasknoteapp.java_api.service.AuthService;
|
||||
import br.com.tasknoteapp.server.response.UserResponse;
|
||||
import br.com.tasknoteapp.server.service.AuthService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Content;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
+37
-5
@@ -1,19 +1,25 @@
|
||||
package br.com.tasknoteapp.java_api.controller;
|
||||
package br.com.tasknoteapp.server.controller;
|
||||
|
||||
import br.com.tasknoteapp.java_api.exception.UserNotFoundException;
|
||||
import br.com.tasknoteapp.java_api.response.JwtAuthenticationResponse;
|
||||
import br.com.tasknoteapp.java_api.service.AuthService;
|
||||
import br.com.tasknoteapp.server.exception.UserNotFoundException;
|
||||
import br.com.tasknoteapp.server.response.JwtAuthenticationResponse;
|
||||
import br.com.tasknoteapp.server.service.AuthService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Content;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.springframework.security.web.csrf.CsrfToken;
|
||||
import org.springframework.security.web.csrf.CsrfTokenRepository;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/** This class contains resources for handling user sessions. */
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/rest/user-sessions")
|
||||
@AllArgsConstructor
|
||||
@@ -28,7 +34,7 @@ public class UserSessionController {
|
||||
* @return JwtAuthenticationResponse with token created.
|
||||
* @throws UserNotFoundException if user not found
|
||||
*/
|
||||
@GetMapping(path = "/refresh")
|
||||
@GetMapping("/refresh")
|
||||
@Operation(
|
||||
summary = "Refresh an existing user session",
|
||||
description = "Refresh an existing user session, generating a new token",
|
||||
@@ -47,4 +53,30 @@ public class UserSessionController {
|
||||
String token = authService.refreshCurrentUserToken();
|
||||
return new JwtAuthenticationResponse(token);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the CSRF token.
|
||||
*
|
||||
* @param token The token injected by Spring Security
|
||||
* @return The token
|
||||
*/
|
||||
@GetMapping(path = "/csrf", produces = "application/json")
|
||||
@Operation(
|
||||
summary = "Gets the CSRF token",
|
||||
description = "Gets the CSRF token to be used for requests",
|
||||
responses = {
|
||||
@ApiResponse(responseCode = "200", description = "Token successfully retrieved"),
|
||||
@ApiResponse(
|
||||
responseCode = "403",
|
||||
description = "Forbidden. Access Denied",
|
||||
content = @Content(schema = @Schema(implementation = Void.class))),
|
||||
@ApiResponse(
|
||||
responseCode = "404",
|
||||
description = "User not found",
|
||||
content = @Content(schema = @Schema(implementation = Void.class)))
|
||||
})
|
||||
public CsrfToken getCsrfToken(CsrfToken token) {
|
||||
log.info("Getting CSRF token {}", token);
|
||||
return token;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package br.com.tasknoteapp.java_api.entity;
|
||||
package br.com.tasknoteapp.server.entity;
|
||||
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.FetchType;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package br.com.tasknoteapp.java_api.entity;
|
||||
package br.com.tasknoteapp.server.entity;
|
||||
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.FetchType;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package br.com.tasknoteapp.java_api.entity;
|
||||
package br.com.tasknoteapp.server.entity;
|
||||
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.FetchType;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package br.com.tasknoteapp.java_api.entity;
|
||||
package br.com.tasknoteapp.server.entity;
|
||||
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.FetchType;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package br.com.tasknoteapp.java_api.entity;
|
||||
package br.com.tasknoteapp.server.entity;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package br.com.tasknoteapp.java_api.exception;
|
||||
package br.com.tasknoteapp.server.exception;
|
||||
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package br.com.tasknoteapp.java_api.exception;
|
||||
package br.com.tasknoteapp.server.exception;
|
||||
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package br.com.tasknoteapp.java_api.exception;
|
||||
package br.com.tasknoteapp.server.exception;
|
||||
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package br.com.tasknoteapp.java_api.exception;
|
||||
package br.com.tasknoteapp.server.exception;
|
||||
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package br.com.tasknoteapp.java_api.exception;
|
||||
package br.com.tasknoteapp.server.exception;
|
||||
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package br.com.tasknoteapp.java_api.exception;
|
||||
package br.com.tasknoteapp.server.exception;
|
||||
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
package br.com.tasknoteapp.java_api.filter;
|
||||
package br.com.tasknoteapp.server.filter;
|
||||
|
||||
import br.com.tasknoteapp.java_api.service.JwtService;
|
||||
import br.com.tasknoteapp.java_api.service.UserService;
|
||||
import br.com.tasknoteapp.server.service.JwtService;
|
||||
import br.com.tasknoteapp.server.service.UserService;
|
||||
import jakarta.servlet.FilterChain;
|
||||
import jakarta.servlet.ServletException;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package br.com.tasknoteapp.java_api.repository;
|
||||
package br.com.tasknoteapp.server.repository;
|
||||
|
||||
import br.com.tasknoteapp.java_api.entity.NoteEntity;
|
||||
import br.com.tasknoteapp.server.entity.NoteEntity;
|
||||
import java.util.List;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package br.com.tasknoteapp.java_api.repository;
|
||||
package br.com.tasknoteapp.server.repository;
|
||||
|
||||
import br.com.tasknoteapp.java_api.entity.NoteUrlEntity;
|
||||
import br.com.tasknoteapp.server.entity.NoteUrlEntity;
|
||||
import java.util.List;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package br.com.tasknoteapp.java_api.repository;
|
||||
package br.com.tasknoteapp.server.repository;
|
||||
|
||||
import br.com.tasknoteapp.java_api.entity.TaskEntity;
|
||||
import br.com.tasknoteapp.server.entity.TaskEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package br.com.tasknoteapp.java_api.repository;
|
||||
package br.com.tasknoteapp.server.repository;
|
||||
|
||||
import br.com.tasknoteapp.java_api.entity.TaskUrlEntity;
|
||||
import br.com.tasknoteapp.server.entity.TaskUrlEntity;
|
||||
import java.util.List;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package br.com.tasknoteapp.java_api.repository;
|
||||
package br.com.tasknoteapp.server.repository;
|
||||
|
||||
import br.com.tasknoteapp.java_api.entity.UserEntity;
|
||||
import br.com.tasknoteapp.server.entity.UserEntity;
|
||||
import java.util.Optional;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package br.com.tasknoteapp.java_api.request;
|
||||
package br.com.tasknoteapp.server.request;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.Email;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package br.com.tasknoteapp.java_api.request;
|
||||
package br.com.tasknoteapp.server.request;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.util.List;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package br.com.tasknoteapp.java_api.request;
|
||||
package br.com.tasknoteapp.server.request;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
package br.com.tasknoteapp.java_api.request;
|
||||
package br.com.tasknoteapp.server.request;
|
||||
|
||||
public record NoteUrlPatchRequest(Long id, String url) {}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package br.com.tasknoteapp.java_api.request;
|
||||
package br.com.tasknoteapp.server.request;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.util.List;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package br.com.tasknoteapp.java_api.request;
|
||||
package br.com.tasknoteapp.server.request;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
package br.com.tasknoteapp.java_api.request;
|
||||
package br.com.tasknoteapp.server.request;
|
||||
|
||||
public record TaskUrlPatchRequest(Long id, String url) {}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package br.com.tasknoteapp.java_api.response;
|
||||
package br.com.tasknoteapp.server.response;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
package br.com.tasknoteapp.java_api.response;
|
||||
package br.com.tasknoteapp.server.response;
|
||||
|
||||
public record JwtAuthenticationResponse(String token) {}
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
package br.com.tasknoteapp.java_api.response;
|
||||
package br.com.tasknoteapp.server.response;
|
||||
|
||||
import br.com.tasknoteapp.java_api.entity.NoteEntity;
|
||||
import br.com.tasknoteapp.java_api.entity.NoteUrlEntity;
|
||||
import br.com.tasknoteapp.server.entity.NoteEntity;
|
||||
import br.com.tasknoteapp.server.entity.NoteUrlEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package br.com.tasknoteapp.java_api.response;
|
||||
package br.com.tasknoteapp.server.response;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package br.com.tasknoteapp.java_api.response;
|
||||
package br.com.tasknoteapp.server.response;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
package br.com.tasknoteapp.java_api.response;
|
||||
package br.com.tasknoteapp.server.response;
|
||||
|
||||
public record SummaryResponse(Integer pendingTaskCount, Integer doneTaskCount) {}
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
package br.com.tasknoteapp.java_api.response;
|
||||
package br.com.tasknoteapp.server.response;
|
||||
|
||||
import br.com.tasknoteapp.java_api.entity.TaskEntity;
|
||||
import br.com.tasknoteapp.java_api.entity.TaskUrlEntity;
|
||||
import br.com.tasknoteapp.server.entity.TaskEntity;
|
||||
import br.com.tasknoteapp.server.entity.TaskUrlEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package br.com.tasknoteapp.java_api.response;
|
||||
package br.com.tasknoteapp.server.response;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package br.com.tasknoteapp.java_api.response;
|
||||
package br.com.tasknoteapp.server.response;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.time.LocalDateTime;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package br.com.tasknoteapp.java_api.response;
|
||||
package br.com.tasknoteapp.server.response;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
+4
-4
@@ -1,8 +1,8 @@
|
||||
package br.com.tasknoteapp.java_api.service;
|
||||
package br.com.tasknoteapp.server.service;
|
||||
|
||||
import br.com.tasknoteapp.java_api.entity.UserEntity;
|
||||
import br.com.tasknoteapp.java_api.request.LoginRequest;
|
||||
import br.com.tasknoteapp.java_api.response.UserResponse;
|
||||
import br.com.tasknoteapp.server.entity.UserEntity;
|
||||
import br.com.tasknoteapp.server.request.LoginRequest;
|
||||
import br.com.tasknoteapp.server.response.UserResponse;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import org.springframework.security.core.userdetails.User;
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
package br.com.tasknoteapp.java_api.service;
|
||||
package br.com.tasknoteapp.server.service;
|
||||
|
||||
import br.com.tasknoteapp.java_api.response.SearchResponse;
|
||||
import br.com.tasknoteapp.java_api.response.SummaryResponse;
|
||||
import br.com.tasknoteapp.server.response.SearchResponse;
|
||||
import br.com.tasknoteapp.server.response.SummaryResponse;
|
||||
|
||||
/** This interface contains methods for handling user Home requests. */
|
||||
public interface HomeService {
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package br.com.tasknoteapp.java_api.service;
|
||||
package br.com.tasknoteapp.server.service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Map;
|
||||
+5
-5
@@ -1,9 +1,9 @@
|
||||
package br.com.tasknoteapp.java_api.service;
|
||||
package br.com.tasknoteapp.server.service;
|
||||
|
||||
import br.com.tasknoteapp.java_api.entity.NoteEntity;
|
||||
import br.com.tasknoteapp.java_api.request.NotePatchRequest;
|
||||
import br.com.tasknoteapp.java_api.request.NoteRequest;
|
||||
import br.com.tasknoteapp.java_api.response.NoteResponse;
|
||||
import br.com.tasknoteapp.server.entity.NoteEntity;
|
||||
import br.com.tasknoteapp.server.request.NotePatchRequest;
|
||||
import br.com.tasknoteapp.server.request.NoteRequest;
|
||||
import br.com.tasknoteapp.server.response.NoteResponse;
|
||||
import java.util.List;
|
||||
|
||||
public interface NoteService {
|
||||
+5
-5
@@ -1,9 +1,9 @@
|
||||
package br.com.tasknoteapp.java_api.service;
|
||||
package br.com.tasknoteapp.server.service;
|
||||
|
||||
import br.com.tasknoteapp.java_api.entity.TaskEntity;
|
||||
import br.com.tasknoteapp.java_api.request.TaskPatchRequest;
|
||||
import br.com.tasknoteapp.java_api.request.TaskRequest;
|
||||
import br.com.tasknoteapp.java_api.response.TaskResponse;
|
||||
import br.com.tasknoteapp.server.entity.TaskEntity;
|
||||
import br.com.tasknoteapp.server.request.TaskPatchRequest;
|
||||
import br.com.tasknoteapp.server.request.TaskRequest;
|
||||
import br.com.tasknoteapp.server.response.TaskResponse;
|
||||
import java.util.List;
|
||||
|
||||
/** This interface contains methods for handling user user Tasks. */
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package br.com.tasknoteapp.java_api.service;
|
||||
package br.com.tasknoteapp.server.service;
|
||||
|
||||
import org.springframework.security.core.userdetails.UserDetailsService;
|
||||
|
||||
+12
-12
@@ -1,16 +1,16 @@
|
||||
package br.com.tasknoteapp.java_api.service.impl;
|
||||
package br.com.tasknoteapp.server.service.impl;
|
||||
|
||||
import br.com.tasknoteapp.java_api.entity.UserEntity;
|
||||
import br.com.tasknoteapp.java_api.exception.BadPasswordException;
|
||||
import br.com.tasknoteapp.java_api.exception.UserAlreadyExistsException;
|
||||
import br.com.tasknoteapp.java_api.exception.UserForbiddenException;
|
||||
import br.com.tasknoteapp.java_api.exception.UserNotFoundException;
|
||||
import br.com.tasknoteapp.java_api.repository.UserRepository;
|
||||
import br.com.tasknoteapp.java_api.request.LoginRequest;
|
||||
import br.com.tasknoteapp.java_api.response.UserResponse;
|
||||
import br.com.tasknoteapp.java_api.service.AuthService;
|
||||
import br.com.tasknoteapp.java_api.service.JwtService;
|
||||
import br.com.tasknoteapp.java_api.util.AuthUtil;
|
||||
import br.com.tasknoteapp.server.entity.UserEntity;
|
||||
import br.com.tasknoteapp.server.exception.BadPasswordException;
|
||||
import br.com.tasknoteapp.server.exception.UserAlreadyExistsException;
|
||||
import br.com.tasknoteapp.server.exception.UserForbiddenException;
|
||||
import br.com.tasknoteapp.server.exception.UserNotFoundException;
|
||||
import br.com.tasknoteapp.server.repository.UserRepository;
|
||||
import br.com.tasknoteapp.server.request.LoginRequest;
|
||||
import br.com.tasknoteapp.server.response.UserResponse;
|
||||
import br.com.tasknoteapp.server.service.AuthService;
|
||||
import br.com.tasknoteapp.server.service.JwtService;
|
||||
import br.com.tasknoteapp.server.util.AuthUtil;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
+8
-8
@@ -1,12 +1,12 @@
|
||||
package br.com.tasknoteapp.java_api.service.impl;
|
||||
package br.com.tasknoteapp.server.service.impl;
|
||||
|
||||
import br.com.tasknoteapp.java_api.response.NoteResponse;
|
||||
import br.com.tasknoteapp.java_api.response.SearchResponse;
|
||||
import br.com.tasknoteapp.java_api.response.SummaryResponse;
|
||||
import br.com.tasknoteapp.java_api.response.TaskResponse;
|
||||
import br.com.tasknoteapp.java_api.service.HomeService;
|
||||
import br.com.tasknoteapp.java_api.service.NoteService;
|
||||
import br.com.tasknoteapp.java_api.service.TaskService;
|
||||
import br.com.tasknoteapp.server.response.NoteResponse;
|
||||
import br.com.tasknoteapp.server.response.SearchResponse;
|
||||
import br.com.tasknoteapp.server.response.SummaryResponse;
|
||||
import br.com.tasknoteapp.server.response.TaskResponse;
|
||||
import br.com.tasknoteapp.server.service.HomeService;
|
||||
import br.com.tasknoteapp.server.service.NoteService;
|
||||
import br.com.tasknoteapp.server.service.TaskService;
|
||||
import java.util.List;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package br.com.tasknoteapp.java_api.service.impl;
|
||||
package br.com.tasknoteapp.server.service.impl;
|
||||
|
||||
import br.com.tasknoteapp.java_api.service.JwtService;
|
||||
import br.com.tasknoteapp.server.service.JwtService;
|
||||
import io.jsonwebtoken.Claims;
|
||||
import io.jsonwebtoken.Jwts;
|
||||
import io.jsonwebtoken.MalformedJwtException;
|
||||
+14
-14
@@ -1,18 +1,18 @@
|
||||
package br.com.tasknoteapp.java_api.service.impl;
|
||||
package br.com.tasknoteapp.server.service.impl;
|
||||
|
||||
import br.com.tasknoteapp.java_api.entity.NoteEntity;
|
||||
import br.com.tasknoteapp.java_api.entity.NoteUrlEntity;
|
||||
import br.com.tasknoteapp.java_api.entity.UserEntity;
|
||||
import br.com.tasknoteapp.java_api.exception.NoteNotFoundException;
|
||||
import br.com.tasknoteapp.java_api.repository.NoteRepository;
|
||||
import br.com.tasknoteapp.java_api.repository.NoteUrlRepository;
|
||||
import br.com.tasknoteapp.java_api.request.NotePatchRequest;
|
||||
import br.com.tasknoteapp.java_api.request.NoteRequest;
|
||||
import br.com.tasknoteapp.java_api.request.NoteUrlPatchRequest;
|
||||
import br.com.tasknoteapp.java_api.response.NoteResponse;
|
||||
import br.com.tasknoteapp.java_api.service.AuthService;
|
||||
import br.com.tasknoteapp.java_api.service.NoteService;
|
||||
import br.com.tasknoteapp.java_api.util.AuthUtil;
|
||||
import br.com.tasknoteapp.server.entity.NoteEntity;
|
||||
import br.com.tasknoteapp.server.entity.NoteUrlEntity;
|
||||
import br.com.tasknoteapp.server.entity.UserEntity;
|
||||
import br.com.tasknoteapp.server.exception.NoteNotFoundException;
|
||||
import br.com.tasknoteapp.server.repository.NoteRepository;
|
||||
import br.com.tasknoteapp.server.repository.NoteUrlRepository;
|
||||
import br.com.tasknoteapp.server.request.NotePatchRequest;
|
||||
import br.com.tasknoteapp.server.request.NoteRequest;
|
||||
import br.com.tasknoteapp.server.request.NoteUrlPatchRequest;
|
||||
import br.com.tasknoteapp.server.response.NoteResponse;
|
||||
import br.com.tasknoteapp.server.service.AuthService;
|
||||
import br.com.tasknoteapp.server.service.NoteService;
|
||||
import br.com.tasknoteapp.server.util.AuthUtil;
|
||||
import jakarta.transaction.Transactional;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
+14
-14
@@ -1,18 +1,18 @@
|
||||
package br.com.tasknoteapp.java_api.service.impl;
|
||||
package br.com.tasknoteapp.server.service.impl;
|
||||
|
||||
import br.com.tasknoteapp.java_api.entity.TaskEntity;
|
||||
import br.com.tasknoteapp.java_api.entity.TaskUrlEntity;
|
||||
import br.com.tasknoteapp.java_api.entity.UserEntity;
|
||||
import br.com.tasknoteapp.java_api.exception.TaskNotFoundException;
|
||||
import br.com.tasknoteapp.java_api.repository.TaskRepository;
|
||||
import br.com.tasknoteapp.java_api.repository.TaskUrlRepository;
|
||||
import br.com.tasknoteapp.java_api.request.TaskPatchRequest;
|
||||
import br.com.tasknoteapp.java_api.request.TaskRequest;
|
||||
import br.com.tasknoteapp.java_api.request.TaskUrlPatchRequest;
|
||||
import br.com.tasknoteapp.java_api.response.TaskResponse;
|
||||
import br.com.tasknoteapp.java_api.service.AuthService;
|
||||
import br.com.tasknoteapp.java_api.service.TaskService;
|
||||
import br.com.tasknoteapp.java_api.util.AuthUtil;
|
||||
import br.com.tasknoteapp.server.entity.TaskEntity;
|
||||
import br.com.tasknoteapp.server.entity.TaskUrlEntity;
|
||||
import br.com.tasknoteapp.server.entity.UserEntity;
|
||||
import br.com.tasknoteapp.server.exception.TaskNotFoundException;
|
||||
import br.com.tasknoteapp.server.repository.TaskRepository;
|
||||
import br.com.tasknoteapp.server.repository.TaskUrlRepository;
|
||||
import br.com.tasknoteapp.server.request.TaskPatchRequest;
|
||||
import br.com.tasknoteapp.server.request.TaskRequest;
|
||||
import br.com.tasknoteapp.server.request.TaskUrlPatchRequest;
|
||||
import br.com.tasknoteapp.server.response.TaskResponse;
|
||||
import br.com.tasknoteapp.server.service.AuthService;
|
||||
import br.com.tasknoteapp.server.service.TaskService;
|
||||
import br.com.tasknoteapp.server.util.AuthUtil;
|
||||
import jakarta.transaction.Transactional;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
+4
-4
@@ -1,8 +1,8 @@
|
||||
package br.com.tasknoteapp.java_api.service.impl;
|
||||
package br.com.tasknoteapp.server.service.impl;
|
||||
|
||||
import br.com.tasknoteapp.java_api.entity.UserEntity;
|
||||
import br.com.tasknoteapp.java_api.repository.UserRepository;
|
||||
import br.com.tasknoteapp.java_api.service.UserService;
|
||||
import br.com.tasknoteapp.server.entity.UserEntity;
|
||||
import br.com.tasknoteapp.server.repository.UserRepository;
|
||||
import br.com.tasknoteapp.server.service.UserService;
|
||||
import java.util.Optional;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package br.com.tasknoteapp.java_api.util;
|
||||
package br.com.tasknoteapp.server.util;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package br.com.tasknoteapp.java_api;
|
||||
package br.com.tasknoteapp.server;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
+4
-4
@@ -1,4 +1,4 @@
|
||||
package br.com.tasknoteapp.java_api.controller;
|
||||
package br.com.tasknoteapp.server.controller;
|
||||
|
||||
import static org.mockito.Mockito.when;
|
||||
import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.csrf;
|
||||
@@ -7,9 +7,9 @@ import static org.springframework.test.web.servlet.request.MockMvcRequestBuilder
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||
|
||||
import br.com.tasknoteapp.java_api.exception.UserAlreadyExistsException;
|
||||
import br.com.tasknoteapp.java_api.request.LoginRequest;
|
||||
import br.com.tasknoteapp.java_api.service.AuthService;
|
||||
import br.com.tasknoteapp.server.exception.UserAlreadyExistsException;
|
||||
import br.com.tasknoteapp.server.request.LoginRequest;
|
||||
import br.com.tasknoteapp.server.service.AuthService;
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
+6
-6
@@ -1,4 +1,4 @@
|
||||
package br.com.tasknoteapp.java_api.controller;
|
||||
package br.com.tasknoteapp.server.controller;
|
||||
|
||||
import static org.mockito.Mockito.when;
|
||||
import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.csrf;
|
||||
@@ -6,11 +6,11 @@ import static org.springframework.test.web.servlet.request.MockMvcRequestBuilder
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||
|
||||
import br.com.tasknoteapp.java_api.response.NoteResponse;
|
||||
import br.com.tasknoteapp.java_api.response.SearchResponse;
|
||||
import br.com.tasknoteapp.java_api.response.SummaryResponse;
|
||||
import br.com.tasknoteapp.java_api.response.TaskResponse;
|
||||
import br.com.tasknoteapp.java_api.service.HomeService;
|
||||
import br.com.tasknoteapp.server.response.NoteResponse;
|
||||
import br.com.tasknoteapp.server.response.SearchResponse;
|
||||
import br.com.tasknoteapp.server.response.SummaryResponse;
|
||||
import br.com.tasknoteapp.server.response.TaskResponse;
|
||||
import br.com.tasknoteapp.server.service.HomeService;
|
||||
import java.util.List;
|
||||
import org.hamcrest.Matchers;
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
Reference in New Issue
Block a user