Changeset 27adfc8 for src/main/java/com/example/moviezone/service
- Timestamp:
- 02/04/23 18:48:07 (23 months ago)
- Branches:
- master
- Children:
- 6032d44
- Parents:
- adf250d
- Location:
- src/main/java/com/example/moviezone/service
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/example/moviezone/service/Impl/UserServiceImpl.java
radf250d r27adfc8 1 1 package com.example.moviezone.service.Impl; 2 2 3 import com.example.moviezone.model.Customer; 3 4 import com.example.moviezone.model.User; 5 import com.example.moviezone.model.Worker; 4 6 import com.example.moviezone.model.exceptions.UserNotFoundException; 5 7 import com.example.moviezone.repository.UserRepository; 6 8 import com.example.moviezone.service.UserService; 9 import org.springframework.security.crypto.password.PasswordEncoder; 7 10 import org.springframework.stereotype.Service; 8 11 … … 13 16 14 17 private final UserRepository userRepository; 18 private final PasswordEncoder passwordEncoder; 15 19 16 public UserServiceImpl(UserRepository userRepository ) {20 public UserServiceImpl(UserRepository userRepository, PasswordEncoder passwordEncoder) { 17 21 this.userRepository = userRepository; 22 this.passwordEncoder = passwordEncoder; 18 23 } 19 24 … … 33 38 } 34 39 40 // @Override 41 // public User register(String first_name, String last_name, String username, String email, String number, String password, String role) { 42 // if(role.equals("worker")) 43 // { 44 // return userRepository.save(new Worker(passwordEncoder.encode(password),first_name,last_name,username,email,number)); 45 // } 46 // else if (role.equals("user")) 47 // return userRepository.save(new Customer(passwordEncoder.encode(password),first_name,last_name,username,email,number)); 48 // } 49 35 50 36 51 } -
src/main/java/com/example/moviezone/service/UserService.java
radf250d r27adfc8 9 9 User findById(Integer user_id); 10 10 User findByUsername(String username); 11 12 // User register(String first_name, String last_name,String username, String email, String number, String password, String role); 13 11 14 }
Note:
See TracChangeset
for help on using the changeset viewer.