Changeset 204464d for src/main


Ignore:
Timestamp:
10/18/22 00:50:33 (2 years ago)
Author:
Gjoko <goko_kostadinov@…>
Branches:
master
Children:
763289e
Parents:
401a211
Message:

Adding register customer functionality

Location:
src/main
Files:
10 added
6 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/edu/gjoko/schedlr/SchedlrApplication.java

    r401a211 r204464d  
    33import org.springframework.boot.SpringApplication;
    44import org.springframework.boot.autoconfigure.SpringBootApplication;
     5import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
    56
    67@SpringBootApplication
     8@EnableJpaAuditing
    79public class SchedlrApplication {
    810
  • src/main/java/edu/gjoko/schedlr/config/AppSecurityConfig.java

    r401a211 r204464d  
    4747                .authorizeRequests()
    4848                .antMatchers("/login*").permitAll()
     49                .antMatchers("/register_customer").permitAll()
     50                .antMatchers("/register_business").permitAll()
    4951                .antMatchers("/css/**").permitAll()
    5052                .antMatchers("/anonymous*").anonymous()
  • src/main/java/edu/gjoko/schedlr/config/MvcConfig.java

    r401a211 r204464d  
    1111    public void addViewControllers(ViewControllerRegistry registry) {
    1212        registry.addViewController("/login").setViewName("login");
    13         registry.addViewController("/register/user").setViewName("register_user");
    14         registry.addViewController("/register/business").setViewName("register_business");
     13        registry.addViewController("/register_customer").setViewName("register_customer");
     14        registry.addViewController("/register_business").setViewName("register_business");
    1515        registry.addViewController("/homepage").setViewName("homepage");
    1616    }
  • src/main/java/edu/gjoko/schedlr/entity/Business.java

    r401a211 r204464d  
    3535    private LocalDateTime closingTime;
    3636
    37     @OneToOne(cascade = CascadeType.ALL)
    38     @JoinColumn(name = "owner_id", referencedColumnName = "id")
     37    @ManyToOne
     38    @JoinColumn(name = "owner_id", referencedColumnName = "id", nullable = false)
    3939    private Stakeholder owner;
    4040
  • src/main/java/edu/gjoko/schedlr/entity/Service.java

    r401a211 r204464d  
    55import lombok.NoArgsConstructor;
    66import lombok.Setter;
     7import org.springframework.data.annotation.CreatedDate;
     8import org.springframework.data.annotation.LastModifiedDate;
     9import org.springframework.data.jpa.domain.support.AuditingEntityListener;
    710
    811import javax.persistence.*;
     12import java.sql.Timestamp;
     13import java.time.LocalDateTime;
    914
    1015@Entity
     16@EntityListeners(AuditingEntityListener.class)
    1117@Table(name = "service")
    1218@Getter
     
    3238    @JoinColumn(name = "business_id")
    3339    private Business business;
     40
     41    @Column(name = "created")
     42    @CreatedDate
     43    private LocalDateTime created;
     44
     45    @Column(name = "modified")
     46    @LastModifiedDate
     47    private LocalDateTime modified;
    3448}
  • src/main/java/edu/gjoko/schedlr/entity/Stakeholder.java

    r401a211 r204464d  
    55import lombok.NoArgsConstructor;
    66import lombok.Setter;
     7import org.springframework.data.annotation.CreatedDate;
     8import org.springframework.data.annotation.LastModifiedDate;
     9import org.springframework.data.jpa.domain.support.AuditingEntityListener;
    710
    811import javax.persistence.*;
     
    1013
    1114@Entity
     15@EntityListeners(AuditingEntityListener.class)
    1216@Table(name = "stakeholder")
    1317@Getter
     
    4145
    4246    @Column(name = "created")
     47    @CreatedDate
    4348    private LocalDateTime created;
    4449
    4550    @Column(name = "modified")
     51    @LastModifiedDate
    4652    private LocalDateTime modified;
    4753}
Note: See TracChangeset for help on using the changeset viewer.