Changeset eb226b2 for src/main/java


Ignore:
Timestamp:
02/04/23 00:39:48 (23 months ago)
Author:
DenicaKj <dkorvezir@…>
Branches:
master
Children:
2269653
Parents:
ac25203
Message:

Fixing errors

Location:
src/main/java/com/example/moviezone
Files:
25 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/com/example/moviezone/MovieZoneApplication.java

    rac25203 reb226b2  
    33import org.springframework.boot.SpringApplication;
    44import org.springframework.boot.autoconfigure.SpringBootApplication;
     5import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
     6import org.springframework.context.annotation.Bean;
     7import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
     8import org.springframework.security.crypto.password.PasswordEncoder;
     9import org.thymeleaf.extras.springsecurity5.dialect.SpringSecurityDialect;
    510
    6 @SpringBootApplication
     11
     12@SpringBootApplication()
    713public class MovieZoneApplication {
    814
     
    1016        SpringApplication.run(MovieZoneApplication.class, args);
    1117    }
     18    @Bean
     19    PasswordEncoder passwordEncoder() {
     20        return new BCryptPasswordEncoder(10);
     21    }
     22    @Bean
     23    public SpringSecurityDialect securityDialect() {
     24        return new SpringSecurityDialect();
     25    }
    1226
    1327}
  • src/main/java/com/example/moviezone/config/WebSecurityConfig.java

    rac25203 reb226b2  
    3030        http.csrf().disable()
    3131                .authorizeRequests()
    32                 .antMatchers("/", "/home", "/assets/**", "/register", "/products", "/api/**").permitAll()
     32                .antMatchers("/", "/home", "/assets/**", "/register", "/api/**").permitAll()
    3333                .antMatchers("/admin/**").hasRole("ADMIN")
    3434                .anyRequest()
     
    4242                .logout()
    4343                .logoutUrl("/logout")
    44                 .clearAuthentication(true)
    4544                .invalidateHttpSession(true)
    4645                .deleteCookies("JSESSIONID")
  • src/main/java/com/example/moviezone/model/Film.java

    rac25203 reb226b2  
    2424    String genre;
    2525    String age_category;
    26 
     26    String url;
    2727    String director;
    2828    LocalDate start_date;
  • src/main/java/com/example/moviezone/model/Projection.java

    rac25203 reb226b2  
    2424    LocalDate date_time_end;
    2525    @ManyToOne
     26    @JoinColumn(name = "id_film")
    2627    Film film;
    2728    @ManyToOne
     29    @JoinColumn(name = "id_event")
    2830    Event event;
    2931    @ManyToOne
     32    @JoinColumn(name = "id_discount")
    3033    Discount discount;
    3134
  • src/main/java/com/example/moviezone/model/Projection_Room.java

    rac25203 reb226b2  
    2020    Integer projection_room_number;
    2121    @ManyToOne
     22    @JoinColumn(name = "id_cinema")
    2223    Cinema cinema;
    2324
  • src/main/java/com/example/moviezone/model/Salary.java

    rac25203 reb226b2  
    2424
    2525    @ManyToOne
     26    @JoinColumn(name = "id_worker")
    2627    Worker worker;
    2728}
  • src/main/java/com/example/moviezone/model/Seat.java

    rac25203 reb226b2  
    1818    Integer seat_number;
    1919    @ManyToOne
     20    @JoinColumn(name = "id_room")
    2021    Projection_Room projection_room;
    2122    @ManyToOne
     23    @JoinColumn(name = "id_category")
    2224    Category category;
    2325
  • src/main/java/com/example/moviezone/model/Ticket.java

    rac25203 reb226b2  
    66import lombok.ToString;
    77
     8import java.time.LocalDate;
    89import java.time.LocalDateTime;
    910
     
    2021
    2122    Integer price;
    22     LocalDateTime date_reserved;
     23    LocalDate date_reserved;
    2324
    2425    @ManyToOne
     26    @JoinColumn(name = "id_customer")
    2527    Customer customer;
    2628
  • src/main/java/com/example/moviezone/model/User.java

    rac25203 reb226b2  
    99
    1010import javax.management.relation.Role;
     11import java.time.LocalDate;
    1112import java.time.LocalDateTime;
    1213import java.util.Collection;
     
    2930    String contact_number;
    3031    String username;
    31     LocalDateTime date_created;
     32    LocalDate date_created;
    3233
    33     private boolean isAccountNonExpired = true;
    34     private boolean isAccountNonLocked = true;
    35     private boolean isCredentialsNonExpired = true;
    36     private boolean isEnabled = true;
    3734
    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) {
    4236        this.id_user = id_user;
    4337        this.password = password;
     
    4842        this.username = username;
    4943        this.date_created = date_created;
    50         this.role = role;
    5144    }
    5245
     
    6356    @Override
    6457    public boolean isAccountNonExpired() {
    65         return isAccountNonExpired;
     58        return true;
    6659    }
    6760
    6861    @Override
    6962    public boolean isAccountNonLocked() {
    70         return isAccountNonLocked;
     63        return true;
    7164    }
    7265
    7366    @Override
    7467    public boolean isCredentialsNonExpired() {
    75         return isCredentialsNonExpired;
     68        return true;
    7669    }
    7770
    7871    @Override
    7972    public boolean isEnabled() {
    80         return isEnabled;
     73        return true;
    8174    }
    8275
  • src/main/java/com/example/moviezone/model/Work_Hours_Weekly.java

    rac25203 reb226b2  
    3030
    3131    @ManyToOne
     32    @JoinColumn(name = "id_worker")
    3233    Worker worker;
    3334}
  • src/main/java/com/example/moviezone/model/Worker.java

    rac25203 reb226b2  
    2323    String work_hours_to;
    2424
    25     @ManyToOne()
     25    @ManyToOne
     26    @JoinColumn(name = "id_cinema")
    2627    Cinema cinema;
    2728    @Override
  • src/main/java/com/example/moviezone/model/manytomany/CustomerIsInterestedInEvent.java

    rac25203 reb226b2  
    1313@RequiredArgsConstructor
    1414@Table(name = "`customer_is_interested_in_event`")
    15 @IdClass(CinemaPlaysFilmId.class)
     15@IdClass(CustomerIsInterestedInEventId.class)
    1616public class CustomerIsInterestedInEvent {
    1717    @Id
  • src/main/java/com/example/moviezone/repository/CategoryRepository.java

    rac25203 reb226b2  
    55import org.springframework.stereotype.Repository;
    66
    7 
     7@Repository
    88public interface CategoryRepository extends JpaRepository<Category,Integer>{
    99}
  • src/main/java/com/example/moviezone/repository/CinemaOrganizesEventRepository.java

    rac25203 reb226b2  
    44import com.example.moviezone.model.manytomany.CinemaOrganizesEventId;
    55import org.springframework.data.jpa.repository.JpaRepository;
     6import org.springframework.stereotype.Repository;
    67
     8@Repository
    79public interface CinemaOrganizesEventRepository extends JpaRepository<CinemaOrganizesEvent, CinemaOrganizesEventId> {
    810}
  • src/main/java/com/example/moviezone/repository/CinemaPlaysFilmRepository.java

    rac25203 reb226b2  
    44import com.example.moviezone.model.manytomany.CinemaPlaysFilmId;
    55import org.springframework.data.jpa.repository.JpaRepository;
     6import org.springframework.stereotype.Repository;
    67
     8@Repository
    79public interface CinemaPlaysFilmRepository extends JpaRepository<CinemaPlaysFilm, CinemaPlaysFilmId> {
    810}
  • src/main/java/com/example/moviezone/repository/CinemaRepository.java

    rac25203 reb226b2  
    33import com.example.moviezone.model.Cinema;
    44import org.springframework.data.jpa.repository.JpaRepository;
     5import org.springframework.stereotype.Repository;
    56
    67
    7 
     8@Repository
    89public interface CinemaRepository extends JpaRepository<Cinema,Integer> {
    910}
  • src/main/java/com/example/moviezone/repository/CustomerIsInterestedInEventRepository.java

    rac25203 reb226b2  
    44import com.example.moviezone.model.manytomany.CustomerIsInterestedInEventId;
    55import org.springframework.data.jpa.repository.JpaRepository;
     6import org.springframework.stereotype.Repository;
    67
     8@Repository
    79public interface CustomerIsInterestedInEventRepository extends JpaRepository<CustomerIsInterestedInEvent, CustomerIsInterestedInEventId> {
    810}
  • src/main/java/com/example/moviezone/repository/CustomerRatesFilmRepository.java

    rac25203 reb226b2  
    44import com.example.moviezone.model.manytomany.CustomerRatesFilmId;
    55import org.springframework.data.jpa.repository.JpaRepository;
     6import org.springframework.stereotype.Repository;
    67
     8@Repository
    79public interface CustomerRatesFilmRepository extends JpaRepository<CustomerRatesFilm, CustomerRatesFilmId> {
    810}
  • src/main/java/com/example/moviezone/repository/CustomerRepository.java

    rac25203 reb226b2  
    33import com.example.moviezone.model.Customer;
    44import org.springframework.data.jpa.repository.JpaRepository;
     5import org.springframework.stereotype.Repository;
    56
     7@Repository
    68public interface CustomerRepository extends JpaRepository<Customer,Integer> {
    79}
  • src/main/java/com/example/moviezone/repository/SeatRepository.java

    rac25203 reb226b2  
    33import com.example.moviezone.model.Seat;
    44import org.springframework.data.jpa.repository.JpaRepository;
     5import org.springframework.stereotype.Repository;
    56
     7@Repository
    68public interface SeatRepository extends JpaRepository<Seat,Integer> {
    79}
  • src/main/java/com/example/moviezone/repository/TicketRepository.java

    rac25203 reb226b2  
    44import com.example.moviezone.model.Ticket;
    55import org.springframework.data.jpa.repository.JpaRepository;
     6import org.springframework.stereotype.Repository;
    67
    78import java.util.List;
    8 
     9@Repository
    910public interface TicketRepository extends JpaRepository<Ticket,Integer> {
    1011    List<Ticket> findAllByCustomer(Customer customer);
  • src/main/java/com/example/moviezone/repository/UserRepository.java

    rac25203 reb226b2  
    44import com.example.moviezone.model.User;
    55import org.springframework.data.jpa.repository.JpaRepository;
     6import org.springframework.stereotype.Repository;
    67
    78import java.util.List;
    8 
     9@Repository
    910public interface UserRepository extends JpaRepository<User,Integer> {
    1011    User findByUsername(String username);
  • src/main/java/com/example/moviezone/repository/Work_Hours_WeeklyRepository.java

    rac25203 reb226b2  
    44import com.example.moviezone.model.Work_Hours_Weekly;
    55import org.springframework.data.jpa.repository.JpaRepository;
     6import org.springframework.stereotype.Repository;
    67
     8@Repository
    79public interface Work_Hours_WeeklyRepository extends JpaRepository<Work_Hours_Weekly,Integer> {
    810}
  • src/main/java/com/example/moviezone/repository/WorkerRepository.java

    rac25203 reb226b2  
    33import com.example.moviezone.model.Worker;
    44import org.springframework.data.jpa.repository.JpaRepository;
     5import org.springframework.stereotype.Repository;
    56
     7@Repository
    68public interface WorkerRepository extends JpaRepository<Worker,Integer> {
    79}
  • src/main/java/com/example/moviezone/service/CustomerService.java

    rac25203 reb226b2  
    22
    33import com.example.moviezone.model.Customer;
     4import org.springframework.stereotype.Repository;
    45
    56import java.util.List;
    6 
     7@Repository
    78public interface CustomerService {
    89    List<Customer> findAllCustomers();
Note: See TracChangeset for help on using the changeset viewer.