- Timestamp:
- 02/04/23 00:39:48 (23 months ago)
- Branches:
- master
- Children:
- 2269653
- Parents:
- ac25203
- Location:
- src/main
- Files:
-
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/example/moviezone/MovieZoneApplication.java
rac25203 reb226b2 3 3 import org.springframework.boot.SpringApplication; 4 4 import org.springframework.boot.autoconfigure.SpringBootApplication; 5 import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; 6 import org.springframework.context.annotation.Bean; 7 import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; 8 import org.springframework.security.crypto.password.PasswordEncoder; 9 import org.thymeleaf.extras.springsecurity5.dialect.SpringSecurityDialect; 5 10 6 @SpringBootApplication 11 12 @SpringBootApplication() 7 13 public class MovieZoneApplication { 8 14 … … 10 16 SpringApplication.run(MovieZoneApplication.class, args); 11 17 } 18 @Bean 19 PasswordEncoder passwordEncoder() { 20 return new BCryptPasswordEncoder(10); 21 } 22 @Bean 23 public SpringSecurityDialect securityDialect() { 24 return new SpringSecurityDialect(); 25 } 12 26 13 27 } -
src/main/java/com/example/moviezone/config/WebSecurityConfig.java
rac25203 reb226b2 30 30 http.csrf().disable() 31 31 .authorizeRequests() 32 .antMatchers("/", "/home", "/assets/**", "/register", "/ products", "/api/**").permitAll()32 .antMatchers("/", "/home", "/assets/**", "/register", "/api/**").permitAll() 33 33 .antMatchers("/admin/**").hasRole("ADMIN") 34 34 .anyRequest() … … 42 42 .logout() 43 43 .logoutUrl("/logout") 44 .clearAuthentication(true)45 44 .invalidateHttpSession(true) 46 45 .deleteCookies("JSESSIONID") -
src/main/java/com/example/moviezone/model/Film.java
rac25203 reb226b2 24 24 String genre; 25 25 String age_category; 26 26 String url; 27 27 String director; 28 28 LocalDate start_date; -
src/main/java/com/example/moviezone/model/Projection.java
rac25203 reb226b2 24 24 LocalDate date_time_end; 25 25 @ManyToOne 26 @JoinColumn(name = "id_film") 26 27 Film film; 27 28 @ManyToOne 29 @JoinColumn(name = "id_event") 28 30 Event event; 29 31 @ManyToOne 32 @JoinColumn(name = "id_discount") 30 33 Discount discount; 31 34 -
src/main/java/com/example/moviezone/model/Projection_Room.java
rac25203 reb226b2 20 20 Integer projection_room_number; 21 21 @ManyToOne 22 @JoinColumn(name = "id_cinema") 22 23 Cinema cinema; 23 24 -
src/main/java/com/example/moviezone/model/Salary.java
rac25203 reb226b2 24 24 25 25 @ManyToOne 26 @JoinColumn(name = "id_worker") 26 27 Worker worker; 27 28 } -
src/main/java/com/example/moviezone/model/Seat.java
rac25203 reb226b2 18 18 Integer seat_number; 19 19 @ManyToOne 20 @JoinColumn(name = "id_room") 20 21 Projection_Room projection_room; 21 22 @ManyToOne 23 @JoinColumn(name = "id_category") 22 24 Category category; 23 25 -
src/main/java/com/example/moviezone/model/Ticket.java
rac25203 reb226b2 6 6 import lombok.ToString; 7 7 8 import java.time.LocalDate; 8 9 import java.time.LocalDateTime; 9 10 … … 20 21 21 22 Integer price; 22 LocalDate Timedate_reserved;23 LocalDate date_reserved; 23 24 24 25 @ManyToOne 26 @JoinColumn(name = "id_customer") 25 27 Customer customer; 26 28 -
src/main/java/com/example/moviezone/model/User.java
rac25203 reb226b2 9 9 10 10 import javax.management.relation.Role; 11 import java.time.LocalDate; 11 12 import java.time.LocalDateTime; 12 13 import java.util.Collection; … … 29 30 String contact_number; 30 31 String username; 31 LocalDate Timedate_created;32 LocalDate date_created; 32 33 33 private boolean isAccountNonExpired = true;34 private boolean isAccountNonLocked = true;35 private boolean isCredentialsNonExpired = true;36 private boolean isEnabled = true;37 34 38 @Enumerated(value = EnumType.STRING) 39 private Role role; 40 41 public User(Integer id_user, String password, String first_name, String last_name, String address, String contact_number, String username, LocalDateTime date_created, Role role) { 35 public User(Integer id_user, String password, String first_name, String last_name, String address, String contact_number, String username, LocalDate date_created) { 42 36 this.id_user = id_user; 43 37 this.password = password; … … 48 42 this.username = username; 49 43 this.date_created = date_created; 50 this.role = role;51 44 } 52 45 … … 63 56 @Override 64 57 public boolean isAccountNonExpired() { 65 return isAccountNonExpired;58 return true; 66 59 } 67 60 68 61 @Override 69 62 public boolean isAccountNonLocked() { 70 return isAccountNonLocked;63 return true; 71 64 } 72 65 73 66 @Override 74 67 public boolean isCredentialsNonExpired() { 75 return isCredentialsNonExpired;68 return true; 76 69 } 77 70 78 71 @Override 79 72 public boolean isEnabled() { 80 return isEnabled;73 return true; 81 74 } 82 75 -
src/main/java/com/example/moviezone/model/Work_Hours_Weekly.java
rac25203 reb226b2 30 30 31 31 @ManyToOne 32 @JoinColumn(name = "id_worker") 32 33 Worker worker; 33 34 } -
src/main/java/com/example/moviezone/model/Worker.java
rac25203 reb226b2 23 23 String work_hours_to; 24 24 25 @ManyToOne() 25 @ManyToOne 26 @JoinColumn(name = "id_cinema") 26 27 Cinema cinema; 27 28 @Override -
src/main/java/com/example/moviezone/model/manytomany/CustomerIsInterestedInEvent.java
rac25203 reb226b2 13 13 @RequiredArgsConstructor 14 14 @Table(name = "`customer_is_interested_in_event`") 15 @IdClass(C inemaPlaysFilmId.class)15 @IdClass(CustomerIsInterestedInEventId.class) 16 16 public class CustomerIsInterestedInEvent { 17 17 @Id -
src/main/java/com/example/moviezone/repository/CategoryRepository.java
rac25203 reb226b2 5 5 import org.springframework.stereotype.Repository; 6 6 7 7 @Repository 8 8 public interface CategoryRepository extends JpaRepository<Category,Integer>{ 9 9 } -
src/main/java/com/example/moviezone/repository/CinemaOrganizesEventRepository.java
rac25203 reb226b2 4 4 import com.example.moviezone.model.manytomany.CinemaOrganizesEventId; 5 5 import org.springframework.data.jpa.repository.JpaRepository; 6 import org.springframework.stereotype.Repository; 6 7 8 @Repository 7 9 public interface CinemaOrganizesEventRepository extends JpaRepository<CinemaOrganizesEvent, CinemaOrganizesEventId> { 8 10 } -
src/main/java/com/example/moviezone/repository/CinemaPlaysFilmRepository.java
rac25203 reb226b2 4 4 import com.example.moviezone.model.manytomany.CinemaPlaysFilmId; 5 5 import org.springframework.data.jpa.repository.JpaRepository; 6 import org.springframework.stereotype.Repository; 6 7 8 @Repository 7 9 public interface CinemaPlaysFilmRepository extends JpaRepository<CinemaPlaysFilm, CinemaPlaysFilmId> { 8 10 } -
src/main/java/com/example/moviezone/repository/CinemaRepository.java
rac25203 reb226b2 3 3 import com.example.moviezone.model.Cinema; 4 4 import org.springframework.data.jpa.repository.JpaRepository; 5 import org.springframework.stereotype.Repository; 5 6 6 7 7 8 @Repository 8 9 public interface CinemaRepository extends JpaRepository<Cinema,Integer> { 9 10 } -
src/main/java/com/example/moviezone/repository/CustomerIsInterestedInEventRepository.java
rac25203 reb226b2 4 4 import com.example.moviezone.model.manytomany.CustomerIsInterestedInEventId; 5 5 import org.springframework.data.jpa.repository.JpaRepository; 6 import org.springframework.stereotype.Repository; 6 7 8 @Repository 7 9 public interface CustomerIsInterestedInEventRepository extends JpaRepository<CustomerIsInterestedInEvent, CustomerIsInterestedInEventId> { 8 10 } -
src/main/java/com/example/moviezone/repository/CustomerRatesFilmRepository.java
rac25203 reb226b2 4 4 import com.example.moviezone.model.manytomany.CustomerRatesFilmId; 5 5 import org.springframework.data.jpa.repository.JpaRepository; 6 import org.springframework.stereotype.Repository; 6 7 8 @Repository 7 9 public interface CustomerRatesFilmRepository extends JpaRepository<CustomerRatesFilm, CustomerRatesFilmId> { 8 10 } -
src/main/java/com/example/moviezone/repository/CustomerRepository.java
rac25203 reb226b2 3 3 import com.example.moviezone.model.Customer; 4 4 import org.springframework.data.jpa.repository.JpaRepository; 5 import org.springframework.stereotype.Repository; 5 6 7 @Repository 6 8 public interface CustomerRepository extends JpaRepository<Customer,Integer> { 7 9 } -
src/main/java/com/example/moviezone/repository/SeatRepository.java
rac25203 reb226b2 3 3 import com.example.moviezone.model.Seat; 4 4 import org.springframework.data.jpa.repository.JpaRepository; 5 import org.springframework.stereotype.Repository; 5 6 7 @Repository 6 8 public interface SeatRepository extends JpaRepository<Seat,Integer> { 7 9 } -
src/main/java/com/example/moviezone/repository/TicketRepository.java
rac25203 reb226b2 4 4 import com.example.moviezone.model.Ticket; 5 5 import org.springframework.data.jpa.repository.JpaRepository; 6 import org.springframework.stereotype.Repository; 6 7 7 8 import java.util.List; 8 9 @Repository 9 10 public interface TicketRepository extends JpaRepository<Ticket,Integer> { 10 11 List<Ticket> findAllByCustomer(Customer customer); -
src/main/java/com/example/moviezone/repository/UserRepository.java
rac25203 reb226b2 4 4 import com.example.moviezone.model.User; 5 5 import org.springframework.data.jpa.repository.JpaRepository; 6 import org.springframework.stereotype.Repository; 6 7 7 8 import java.util.List; 8 9 @Repository 9 10 public interface UserRepository extends JpaRepository<User,Integer> { 10 11 User findByUsername(String username); -
src/main/java/com/example/moviezone/repository/Work_Hours_WeeklyRepository.java
rac25203 reb226b2 4 4 import com.example.moviezone.model.Work_Hours_Weekly; 5 5 import org.springframework.data.jpa.repository.JpaRepository; 6 import org.springframework.stereotype.Repository; 6 7 8 @Repository 7 9 public interface Work_Hours_WeeklyRepository extends JpaRepository<Work_Hours_Weekly,Integer> { 8 10 } -
src/main/java/com/example/moviezone/repository/WorkerRepository.java
rac25203 reb226b2 3 3 import com.example.moviezone.model.Worker; 4 4 import org.springframework.data.jpa.repository.JpaRepository; 5 import org.springframework.stereotype.Repository; 5 6 7 @Repository 6 8 public interface WorkerRepository extends JpaRepository<Worker,Integer> { 7 9 } -
src/main/java/com/example/moviezone/service/CustomerService.java
rac25203 reb226b2 2 2 3 3 import com.example.moviezone.model.Customer; 4 import org.springframework.stereotype.Repository; 4 5 5 6 import java.util.List; 6 7 @Repository 7 8 public interface CustomerService { 8 9 List<Customer> findAllCustomers(); -
src/main/resources/application.properties
rac25203 reb226b2 1 server.port=9091 1 2 3 spring.profiles.active=prod 4 spring.jpa.properties.hibernate.default_schema=project
Note:
See TracChangeset
for help on using the changeset viewer.