Changeset be26658
- Timestamp:
- 01/23/25 19:48:46 (3 months ago)
- Branches:
- master
- Children:
- d10a9aa
- Parents:
- a0e93df
- Location:
- ReserveNGo-backend/src/main/java/mk/ukim/finki/it/reservengo
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
ReserveNGo-backend/src/main/java/mk/ukim/finki/it/reservengo/model/Admin.java
ra0e93df rbe26658 9 9 10 10 @EqualsAndHashCode(callSuper = true) 11 @Data12 11 @Entity 13 @NoArgsConstructor14 12 public class Admin extends User { 15 13 public Admin(String email, String password, Role userRole) { 16 14 super(null, null, email, password, null, userRole); 17 15 } 16 17 public Admin() { 18 } 18 19 } -
ReserveNGo-backend/src/main/java/mk/ukim/finki/it/reservengo/model/Customer.java
ra0e93df rbe26658 12 12 import java.util.List; 13 13 14 15 14 @EqualsAndHashCode(callSuper = true) 16 17 15 @Entity 18 16 public class Customer extends User { … … 22 20 23 21 public Customer() { 24 }25 26 public Customer(List<Reservation> reservations, List<Local> favouriteLocals) {27 this.reservations = reservations;28 this.favouriteLocals = favouriteLocals;29 22 } 30 23 -
ReserveNGo-backend/src/main/java/mk/ukim/finki/it/reservengo/model/Local.java
ra0e93df rbe26658 31 31 32 32 public Local() { 33 }34 35 public Local(Long id, String name, String description, String address, String workingHours, List<Service> availableServices, Map<Long, Integer> ratings, List<Event> events, List<String> localPhotos, String menuPhoto, String menuLink, Contact contact, List<Reservation> reservations, List<LocalWorker> workers) {36 this.id = id;37 this.name = name;38 this.description = description;39 this.address = address;40 this.workingHours = workingHours;41 this.availableServices = availableServices;42 this.ratings = ratings;43 this.events = events;44 this.localPhotos = localPhotos;45 this.menuPhoto = menuPhoto;46 this.menuLink = menuLink;47 this.contact = contact;48 this.reservations = reservations;49 this.workers = workers;50 33 } 51 34 -
ReserveNGo-backend/src/main/java/mk/ukim/finki/it/reservengo/model/LocalManager.java
ra0e93df rbe26658 10 10 11 11 @EqualsAndHashCode(callSuper = true) 12 @Data13 12 @Entity 14 @NoArgsConstructor15 13 public class LocalManager extends LocalWorker { 16 14 public LocalManager(String firstName, String lastName, String email, String password, String phoneNumber, Role userRole) { 17 15 super(firstName, lastName, email, password, phoneNumber, userRole); 18 16 } 17 18 public LocalManager() { 19 } 19 20 } -
ReserveNGo-backend/src/main/java/mk/ukim/finki/it/reservengo/model/LocalWorker.java
ra0e93df rbe26658 10 10 11 11 @EqualsAndHashCode(callSuper = true) 12 @Data13 12 @Entity 14 @AllArgsConstructor15 @NoArgsConstructor16 13 public class LocalWorker extends User { 17 14 public LocalWorker(String firstName, String lastName, String email, String password, String phoneNumber, Role userRole) { 18 15 super(firstName, lastName, email, password, phoneNumber, userRole); 16 } 17 18 public LocalWorker() { 19 19 } 20 20 … … 24 24 @Enumerated(EnumType.STRING) 25 25 private Position position; 26 27 public Local getLocal() { 28 return local; 29 } 30 31 public Position getPosition() { 32 return position; 33 } 26 34 } -
ReserveNGo-backend/src/main/java/mk/ukim/finki/it/reservengo/model/User.java
ra0e93df rbe26658 14 14 import java.util.List; 15 15 16 17 16 @Entity 18 17 @Inheritance(strategy = InheritanceType.JOINED) … … 26 25 this.phoneNumber = phoneNumber; 27 26 this.userRole = userRole; 27 } 28 29 public User() { 28 30 } 29 31 … … 48 50 @Override 49 51 public Collection<? extends GrantedAuthority> getAuthorities() { 50 return List.of(new SimpleGrantedAuthority(userRole.name())); //check here:IMPORTANT 51 } 52 53 public User() {} 54 55 public User(Long id, String firstName, String lastName, String email, String password, String phoneNumber, Role userRole) { 56 this.id = id; 57 this.firstName = firstName; 58 this.lastName = lastName; 59 this.email = email; 60 this.password = password; 61 this.phoneNumber = phoneNumber; 62 this.userRole = userRole; 52 return List.of(new SimpleGrantedAuthority(userRole.name())); 63 53 } 64 54 … … 116 106 return userRole; 117 107 } 118 119 // @Override120 // public String toString() {121 // return "User{" +122 // "id=" + id +123 // ", firstName='" + firstName + '\'' +124 // ", lastName='" + lastName + '\'' +125 // ", email='" + email + '\'' +126 // ", password='" + password + '\'' +127 // ", phoneNumber='" + phoneNumber + '\'' +128 // ", userRole=" + userRole +129 // '}';130 // }131 108 } -
ReserveNGo-backend/src/main/java/mk/ukim/finki/it/reservengo/service/impl/AuthServiceImpl.java
ra0e93df rbe26658 104 104 jwt); 105 105 } 106 107 106 }
Note:
See TracChangeset
for help on using the changeset viewer.