- 
                Notifications
    
You must be signed in to change notification settings  - Fork 22
 
Feature/comment #39
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?
Feature/comment #39
Conversation
# Conflicts: # src/main/java/com/huseynovvusal/springblogapi/controller/AuthenticationController.java
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.
Overall, appreciate your effort. After making proposed changes resubmit your work. Please, also make sure that you are working the latest version of this project.
| .authorizeHttpRequests( | ||
| req -> req | ||
| .requestMatchers("/api/auth/**") | ||
| .requestMatchers("/api/**") | 
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.
What is the purpose here?
| private final AuthenticationService authenticationService; | ||
| 
               | 
          ||
| @PostMapping("register") | ||
| @PostMapping("/api/auth/register") | 
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.
Why you changed back to this pattern? We already have RequestMapping.
| @RestController | ||
| @RequestMapping("/api/comments") | ||
| public class CommentController { | ||
| @Autowired | 
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.
Recommend using constructor injection (e.g., with Lombok's @RequiredArgsConstructor) instead of field injection using @Autowired. It is preferred option for testing.
| 
           In this section
         .requestMatchers("/api/auth/**")
         .requestMatchers("/api/**")
The change was made because the commented-out parameters don't have "auth,"
just "api." I removed it simply to avoid creating another section, ensuring
that resources are released without going through each REST request
separately.
I didn't change the RequestMapping; I probably saved it from an older
version without realizing it. 
…On Fri, Aug 29, 2025 at 4:10 AM Vusal Huseynov ***@***.***> wrote:
 ***@***.**** requested changes on this pull request.
 Overall, appreciate your effort. After making proposed changes resubmit
 your work. Please, also make sure that you are working the latest version
 of this project.
 ------------------------------
 In
 src/main/java/com/huseynovvusal/springblogapi/config/SecurityConfig.java
 <#39 (comment)>
 :
 > @@ -30,7 +30,7 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti
                  .csrf(AbstractHttpConfigurer::disable)
                  .authorizeHttpRequests(
                          req -> req
 -                                .requestMatchers("/api/auth/**")
 +                                .requestMatchers("/api/**")
 What is the purpose here?
 ------------------------------
 In
 src/main/java/com/huseynovvusal/springblogapi/controller/AuthenticationController.java
 <#39 (comment)>
 :
 >  public class AuthenticationController {
      private final AuthenticationService authenticationService;
 -    @PostMapping("register")
 +    @PostMapping("/api/auth/register")
 Why you changed back to this pattern? We already have RequestMapping.
 ------------------------------
 In
 src/main/java/com/huseynovvusal/springblogapi/controller/CommentController.java
 <#39 (comment)>
 :
 > +package com.huseynovvusal.springblogapi.controller;
 +
 +import com.huseynovvusal.springblogapi.dto.CommentRequest;
 +import com.huseynovvusal.springblogapi.model.Comment;
 +import com.huseynovvusal.springblogapi.service.CommentService;
 +import org.springframework.beans.factory.annotation.Autowired;
 +import org.springframework.data.domain.Pageable;
 +import org.springframework.data.web.PageableDefault;
 +import org.springframework.web.bind.annotation.*;
 +
 +import java.util.List;
 +
 ***@***.***
 ***@***.***("/api/comments")
 +public class CommentController {
 +    @Autowired
 Recommend using constructor injection (e.g., with Lombok's
 @requiredargsconstructor) instead of field injection using @Autowired. It
 is preferred option for testing.
 —
 Reply to this email directly, view it on GitHub
 <#39 (review)>,
 or unsubscribe
 <https://github.com/notifications/unsubscribe-auth/BCCT2RE3GLGVNFD3XZY4A7T3P74F7AVCNFSM6AAAAACFC6C6YSVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTCNRXGYYTGMRQGQ>
 .
 You are receiving this because you authored the thread.Message ID:
 ***@***.***>
 
 | 
    
CRUD creation of comments with pagination