36.1 Test endpoint for security - Forbidden (#2)
This commit is contained in:
@ -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";
|
||||
}
|
||||
}
|
||||
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user