Changeset 967b414 in Git for src/main/java
- Timestamp:
- 02/09/22 03:21:13 (3 years ago)
- Branches:
- main
- Children:
- 6f91f99
- Parents:
- 0226942 (diff), 3fe36de (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - git-author:
- Mato-77 <56981531+Mato-77@…> (02/09/22 03:21:13)
- git-committer:
- GitHub <noreply@…> (02/09/22 03:21:13)
- Location:
- src/main/java/com/wediscussmovies/project
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/wediscussmovies/project/configuration/SecurityConfig.java
r0226942 r967b414 29 29 http.csrf().disable() 30 30 .authorizeRequests() 31 .antMatchers("/movies","/movies/**/","/actors","/persons/**/","/directors","/discussions","/ discussions/**/","/discussions/all/**/","/replies","/register","/genres", "/css/**","/img/**", "/js/**").permitAll()31 .antMatchers("/movies","/movies/**/","/actors","/persons/**/","/directors","/discussions","/profiles/**","/discussions/**/","/discussions/all/**/","/replies","/register","/genres", "/css/**","/img/**", "/js/**").permitAll() 32 32 .anyRequest() 33 33 .authenticated() -
src/main/java/com/wediscussmovies/project/model/Movie.java
r0226942 r967b414 95 95 96 96 97 97 public String getShortTitle(){ 98 int to = 20; 99 if (title.length() < to) 100 to = title.length(); 101 if(to<20) 102 return title; 103 return title.substring(0, to) + "..."; 104 } 98 105 99 106 -
src/main/java/com/wediscussmovies/project/model/Person.java
r0226942 r967b414 92 92 } 93 93 94 public boolean hasGradeFromUser(User user){ 95 for(PersonRates p: personRates){ 96 if(p.getUser().getUserId() == user.getUserId()) 97 return true; 98 } 99 return false; 100 } 101 94 102 } -
src/main/java/com/wediscussmovies/project/service/UserService.java
r0226942 r967b414 10 10 User findByUsername(String username); 11 11 User register(String email, String username, String password, String confirmPassword, String name, String surname); 12 13 User findById(Integer id); 12 14 } -
src/main/java/com/wediscussmovies/project/service/impl/UserServiceImpl.java
r0226942 r967b414 48 48 49 49 @Override 50 public User findById(Integer id) { 51 return userRepository.findById(id).orElseThrow(() -> new UserNotExistException(id.toString())); 52 } 53 54 @Override 50 55 public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { 51 56 return this.findByUsername(username); -
src/main/java/com/wediscussmovies/project/web/controller/PersonController.java
r0226942 r967b414 55 55 //Error handling, could be null!!!!!!!!! 56 56 model.addAttribute("person", person); 57 57 addModelPropertiesForUser(model); 58 58 model.addAttribute("contentTemplate", "personShow"); 59 59 return "template"; -
src/main/java/com/wediscussmovies/project/web/controller/UsersController.java
r0226942 r967b414 11 11 import org.springframework.stereotype.Controller; 12 12 import org.springframework.ui.Model; 13 import org.springframework.web.bind.annotation.GetMapping; 14 import org.springframework.web.bind.annotation.PostMapping; 15 import org.springframework.web.bind.annotation.RequestMapping; 16 import org.springframework.web.bind.annotation.RequestParam; 13 import org.springframework.web.bind.annotation.*; 17 14 18 15 import java.util.ArrayList; … … 42 39 return "redirect:/register?error=" + exception.getMessage(); 43 40 } 41 } 42 @GetMapping("/profiles/{id}") 43 public String getProfilePage(@PathVariable Integer id, Model model){ 44 model.addAttribute("user",userService.findById(id)); 45 model.addAttribute("contentTemplate","usersShow"); 46 return "template"; 44 47 } 45 48 @GetMapping("/register")
Note:
See TracChangeset
for help on using the changeset viewer.