36.1 Test endpoint for security - Forbidden (#2)

This commit is contained in:
Art
2021-09-06 08:07:10 +03:00
parent be012f222e
commit 0656dc9969
4 changed files with 62 additions and 1 deletions

View File

@ -0,0 +1,15 @@
package net.shyshkin.study.fullstack.supportportal.backend.controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("user")
public class UserResource {
@GetMapping("home")
public String showUser() {
return "Application works";
}
}

View File

@ -6,11 +6,15 @@ import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.http.HttpStatus;
import java.time.LocalDateTime;
@NoArgsConstructor
@AllArgsConstructor
@Data
@Builder
public class HttpResponse {
// @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'hh:mm:ss.SSS")
private final LocalDateTime timestamp = LocalDateTime.now();
private int httpStatusCode; // 200, 201, 400, 500
private HttpStatus httpStatus;
private String reason;