Changeset bc20307 for sources/app
- Timestamp:
- 02/14/22 01:41:41 (2 years ago)
- Branches:
- master
- Children:
- 747e0ab
- Parents:
- e8b1076
- Location:
- sources/app
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
sources/app/.idea/misc.xml
re8b1076 rbc20307 8 8 </option> 9 9 </component> 10 <component name="ProjectRootManager" version="2" languageLevel="JDK_1 6" default="true" project-jdk-name="16" project-jdk-type="JavaSDK">10 <component name="ProjectRootManager" version="2" languageLevel="JDK_14" default="false" project-jdk-name="16" project-jdk-type="JavaSDK"> 11 11 <output url="file://$PROJECT_DIR$/classes" /> 12 12 </component> -
sources/app/src/main/java/parkup/configs/CustomAuthenticationFilter.java
re8b1076 rbc20307 80 80 } 81 81 case "Guest":{ 82 Guest user = (Guest) authentication.get Authorities();82 Guest user = (Guest) authentication.getPrincipal(); 83 83 email = user.getEmail(); 84 84 fullName="GuestUser"; -
sources/app/src/main/java/parkup/configs/webConfigs/WebSecurityConfig.java
re8b1076 rbc20307 42 42 auth.userDetailsService(workerService).passwordEncoder(bCryptPasswordEncoder); 43 43 auth.userDetailsService(administratorService).passwordEncoder(bCryptPasswordEncoder); 44 auth.userDetailsService(guestService) ;44 auth.userDetailsService(guestService).passwordEncoder(bCryptPasswordEncoder); 45 45 } 46 46 -
sources/app/src/main/java/parkup/controllers/GuestController.java
re8b1076 rbc20307 38 38 39 39 @PostMapping({"/guest"}) 40 public void addGuest(@RequestBody Guest guest) { 41 this.guestService.addGuest(guest); 40 public Guest addGuest(@RequestBody Guest guest) { 41 Guest guestToReturn = this.guestService.addGuest(guest); 42 return guestToReturn; 42 43 } 43 44 -
sources/app/src/main/java/parkup/entities/Guest.java
re8b1076 rbc20307 29 29 private int guestId; 30 30 31 @OneToOne 31 @OneToOne(cascade = {CascadeType.ALL}) 32 32 @JoinColumn(name = "tablickaId", nullable = false) 33 33 private Plate plate; … … 39 39 private String mobile; 40 40 41 @Column(name ="password")41 @Column(name="password") 42 42 private String password; 43 43 … … 49 49 50 50 51 public Guest() {this.role=UserRole.ROLE_USER;} 52 53 public Guest(int guestId, Plate plate,String password, String email, String mobile) { 54 this.guestId = guestId; 55 this.plate = plate; 56 this.email = email; 51 public Guest() { 52 this.role = UserRole.ROLE_USER; 53 this.session = null; 54 } 55 public Guest(Plate plate, String email,String mobile,String password,ParkingSession session){ 56 this.plate=plate; 57 this.email=email; 58 this.mobile=mobile; 57 59 this.password=password; 58 this. mobile = mobile;60 this.session=session; 59 61 this.role=UserRole.ROLE_USER; 60 62 } … … 64 66 this.email = email; 65 67 this.mobile = mobile; 68 this.password = ""; 66 69 this.role=UserRole.ROLE_USER; 67 70 } … … 135 138 @Override 136 139 public String getPassword() { 137 return null;140 return this.password; 138 141 } 139 142 … … 145 148 @Override 146 149 public boolean isAccountNonExpired() { 147 return false;150 return true; 148 151 } 149 152 150 153 @Override 151 154 public boolean isAccountNonLocked() { 152 return false;155 return true; 153 156 } 154 157 155 158 @Override 156 159 public boolean isCredentialsNonExpired() { 157 return false;160 return true; 158 161 } 159 162 160 163 @Override 161 164 public boolean isEnabled() { 162 return false;165 return true; 163 166 } 164 167 } -
sources/app/src/main/java/parkup/entities/RegisteredUser.java
re8b1076 rbc20307 63 63 this.plates = new ArrayList<Plate>(); 64 64 this.role = UserRole.ROLE_REG_USER; 65 session=null;65 this.session=null; 66 66 } 67 67 -
sources/app/src/main/java/parkup/services/GuestService.java
re8b1076 rbc20307 38 38 } else { 39 39 double random = Math.random()*10000; 40 guest.setPassword(passwordEncoder.encode(Integer.toString((int)random))); 41 this.guestRepository.save(guest); 40 42 guest.setPassword(Integer.toString((int)random)); 41 return this.guestRepository.save(guest);43 return guest; 42 44 } 43 45 } -
sources/app/src/main/resources/application.properties
re8b1076 rbc20307 1 1 spring.datasource.url=jdbc:postgresql://localhost:5432/parkupdb 2 2 spring.datasource.username=postgres 3 spring.datasource.password= 12343 spring.datasource.password=Lampion123 4 4 spring.jpa.hibernate.ddl-auto=create-drop 5 5 spring.jpa.show-sql=true -
sources/app/target/classes/application.properties
re8b1076 rbc20307 1 1 spring.datasource.url=jdbc:postgresql://localhost:5432/parkupdb 2 2 spring.datasource.username=postgres 3 spring.datasource.password= 12343 spring.datasource.password=Lampion123 4 4 spring.jpa.hibernate.ddl-auto=create-drop 5 5 spring.jpa.show-sql=true
Note:
See TracChangeset
for help on using the changeset viewer.