File tree
Expand file treeCollapse file tree11 files changed
+105
-96
lines changed Part-9.SpringBoot-React-Projects/Project-5.Spring-ReactJS-Ecommerce-Shopping/fullstack/backend/model
Expand file treeCollapse file tree11 files changed
+105
-96
lines changed Original file line number | Diff line number | Diff line change |
---|
|
112 | 112 | <artifactId>spring-boot-starter-cache</artifactId>
|
113 | 113 | </dependency>
|
114 | 114 | <!-- <!– https://mvnrepository.com/artifact/org.springframework/spring-jdbc –>-->
|
115 |
| -<!-- <dependency>--> |
116 |
| -<!-- <groupId>org.springframework</groupId>--> |
117 |
| -<!-- <artifactId>spring-jdbc</artifactId>--> |
118 |
| -<!-- <version>5.2.12.RELEASE</version>--> |
119 |
| -<!-- </dependency>--> |
| 115 | +<dependency> |
| 116 | +<groupId>org.springframework</groupId> |
| 117 | +<artifactId>spring-jdbc</artifactId> |
| 118 | +<version>5.2.12.RELEASE</version> |
| 119 | +</dependency> |
120 | 120 |
|
121 | 121 | <dependency>
|
122 | 122 | <groupId>io.springfox</groupId>
|
|
Original file line number | Diff line number | Diff line change |
---|
|
1 |
| -package com.urunov.config; |
2 |
| - |
3 |
| -import org.modelmapper.ModelMapper; |
4 |
| -import org.modelmapper.convention.MatchingStrategies; |
5 |
| -import org.springframework.context.annotation.Bean; |
6 |
| -import org.springframework.context.annotation.Configuration; |
7 |
| - |
8 |
| -/** |
9 |
| -* User: hamdamboy |
10 |
| -* Project: model |
11 |
| -* : @urunov |
12 |
| -*/ |
13 |
| -@Configuration |
14 |
| -public class AppConfig { |
15 |
| - |
16 |
| -@Bean |
17 |
| -public ModelMapper modelMapper() { |
18 |
| - |
19 |
| -ModelMapper modelMapper = new ModelMapper(); |
20 |
| -modelMapper.getConfiguration().setMatchingStrategy(MatchingStrategies.LOOSE); |
21 |
| -return modelMapper; |
22 |
| -} |
23 |
| -} |
| 1 | +//package com.urunov.config; |
| 2 | +// |
| 3 | +//import org.modelmapper.ModelMapper; |
| 4 | +//import org.modelmapper.convention.MatchingStrategies; |
| 5 | +//import org.springframework.context.annotation.Bean; |
| 6 | +//import org.springframework.context.annotation.Configuration; |
| 7 | +// |
| 8 | +///** |
| 9 | +// * User: hamdamboy |
| 10 | +// * Project: model |
| 11 | +// * : @urunov |
| 12 | +// */ |
| 13 | +//@Configuration |
| 14 | +//public class AppConfig { |
| 15 | +// |
| 16 | +// @Bean |
| 17 | +// public ModelMapper modelMapper() { |
| 18 | +// |
| 19 | +// ModelMapper modelMapper = new ModelMapper(); |
| 20 | +// modelMapper.getConfiguration().setMatchingStrategy(MatchingStrategies.LOOSE); |
| 21 | +// return modelMapper; |
| 22 | +// } |
| 23 | +//} |
Original file line number | Diff line number | Diff line change |
---|
|
1 |
| -package com.urunov.config; |
2 |
| - |
3 |
| -import org.springframework.context.annotation.Configuration; |
4 |
| -import org.springframework.web.servlet.config.annotation.CorsRegistry; |
5 |
| -import org.springframework.web.servlet.config.annotation.EnableWebMvc; |
6 |
| -import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; |
7 |
| - |
8 |
| -/** |
9 |
| -* User: hamdamboy |
10 |
| -* Project: model |
11 |
| -* : @urunov |
12 |
| -*/ |
13 |
| -@Configuration |
14 |
| -@EnableWebMvc |
15 |
| -public class CorsConfig implements WebMvcConfigurer { |
16 |
| - |
17 |
| -@Override |
18 |
| -public void addCorsMappings(CorsRegistry registry) { |
19 |
| -registry.addMapping("/**").allowedOrigins(System.getenv("REACT_CLIENT_URL")) |
20 |
| -.allowedMethods("GET", "POST"); |
21 |
| -} |
22 |
| -} |
| 1 | +//package com.urunov.config; |
| 2 | +// |
| 3 | +//import org.springframework.context.annotation.Configuration; |
| 4 | +//import org.springframework.web.servlet.config.annotation.CorsRegistry; |
| 5 | +//import org.springframework.web.servlet.config.annotation.EnableWebMvc; |
| 6 | +//import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; |
| 7 | +// |
| 8 | +///** |
| 9 | +// * User: hamdamboy |
| 10 | +// * Project: model |
| 11 | +// * : @urunov |
| 12 | +// */ |
| 13 | +//@Configuration |
| 14 | +//@EnableWebMvc |
| 15 | +//public class CorsConfig implements WebMvcConfigurer { |
| 16 | +// |
| 17 | +//// @Override |
| 18 | +//// public void addCorsMappings(CorsRegistry registry) { |
| 19 | +//// registry.addMapping("/**").allowedOrigins(System.getenv("REACT_CLIENT_URL")) |
| 20 | +//// .allowedMethods("GET", "POST"); |
| 21 | +//// } |
| 22 | +//} |
Original file line number | Diff line number | Diff line change |
---|
@@ -36,7 +36,5 @@ public class ApparelCategory implements Serializable {
|
36 | 36 | // @JsonIgnore
|
37 | 37 | // private List<ApparelImages> apparelImages;
|
38 | 38 |
|
39 |
| -public ApparelCategory(String apparel) { |
40 |
| -this.type = apparel; |
41 |
| -} |
| 39 | + |
42 | 40 | }
|
Original file line number | Diff line number | Diff line change |
---|
|
1 | 1 | package com.urunov.entity.elements.categories;
|
2 | 2 |
|
3 |
| -import com.fasterxml.jackson.annotation.JsonIgnore; |
4 |
| -import com.urunov.entity.elements.info.ProductInfo; |
5 | 3 | import lombok.*;
|
6 | 4 |
|
7 |
| -import javax.persistence.*; |
| 5 | +import javax.persistence.Entity; |
| 6 | +import javax.persistence.GeneratedValue; |
| 7 | +import javax.persistence.GenerationType; |
| 8 | +import javax.persistence.Id; |
8 | 9 | import java.io.Serializable;
|
9 |
| -import java.util.List; |
10 | 10 |
|
11 | 11 | /**
|
12 | 12 | * User: hamdamboy
|
@@ -29,14 +29,14 @@ public class PriceRangeCategory implements Serializable {
|
29 | 29 | private String type;
|
30 | 30 |
|
31 | 31 |
|
32 |
| -@OneToMany(cascade = CascadeType.ALL, orphanRemoval = true, mappedBy = "priceRangeCategory") |
33 |
| -@JsonIgnore |
34 |
| -private List<ProductInfo> productInfos; |
35 |
| - |
36 |
| - |
37 |
| -public PriceRangeCategory(int id, String type) { |
38 |
| - |
39 |
| -this.id = id; |
40 |
| -this.type = type; |
41 |
| -} |
| 32 | +// @OneToMany(cascade = CascadeType.ALL, orphanRemoval = true, mappedBy = "priceRangeCategory") |
| 33 | +// @JsonIgnore |
| 34 | +// private List<ProductInfo> productInfos; |
| 35 | +// |
| 36 | +// |
| 37 | +// public PriceRangeCategory(int id, String type) { |
| 38 | +// |
| 39 | +// this.id = id; |
| 40 | +// this.type = type; |
| 41 | +// } |
42 | 42 | }
|
Original file line number | Diff line number | Diff line change |
---|
|
6 | 6 | import javax.persistence.GeneratedValue;
|
7 | 7 | import javax.persistence.GenerationType;
|
8 | 8 | import javax.persistence.Id;
|
| 9 | +import java.io.Serializable; |
9 | 10 |
|
10 | 11 | /**
|
11 | 12 | * User: hamdamboy
|
|
19 | 20 | @AllArgsConstructor
|
20 | 21 | @NoArgsConstructor
|
21 | 22 | @Entity
|
22 |
| -public class Customer { |
| 23 | +public class Customer implements Serializable { |
23 | 24 |
|
24 | 25 | @Id
|
25 | 26 | @GeneratedValue(strategy = GenerationType.IDENTITY)
|
26 | 27 | private Integer id;
|
| 28 | + |
27 | 29 | private String name;
|
28 | 30 | private String image;
|
29 | 31 | private String email;
|
|
Original file line number | Diff line number | Diff line change |
---|
|
1 | 1 | package com.urunov.entity.elements.images;
|
2 | 2 |
|
3 |
| -import com.fasterxml.jackson.annotation.JsonIgnore; |
4 |
| -import com.urunov.entity.elements.categories.ApparelCategory; |
5 |
| -import com.urunov.entity.elements.categories.GenderCategory; |
6 |
| -import lombok.*; |
| 3 | +import lombok.Getter; |
| 4 | +import lombok.RequiredArgsConstructor; |
| 5 | +import lombok.Setter; |
| 6 | +import lombok.ToString; |
7 | 7 |
|
8 |
| -import javax.persistence.*; |
| 8 | +import javax.persistence.Entity; |
| 9 | +import javax.persistence.GeneratedValue; |
| 10 | +import javax.persistence.GenerationType; |
| 11 | +import javax.persistence.Id; |
| 12 | +import java.io.Serializable; |
9 | 13 |
|
10 | 14 | /**
|
11 | 15 | * User: hamdamboy
|
|
18 | 22 | @RequiredArgsConstructor
|
19 | 23 | @ToString
|
20 | 24 | @Entity
|
21 |
| -public class ApparelImages { |
| 25 | +public class ApparelImages implements Serializable { |
22 | 26 |
|
23 | 27 | @Id
|
24 | 28 | @GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
Original file line number | Diff line number | Diff line change |
---|
|
1 | 1 | package com.urunov.entity.elements.images;
|
2 | 2 |
|
3 |
| -import com.urunov.entity.elements.categories.ProductBrandCategory; |
4 | 3 | import lombok.*;
|
5 | 4 |
|
6 |
| -import javax.persistence.*; |
| 5 | +import javax.persistence.Entity; |
| 6 | +import javax.persistence.GeneratedValue; |
| 7 | +import javax.persistence.GenerationType; |
| 8 | +import javax.persistence.Id; |
| 9 | +import java.io.Serializable; |
7 | 10 |
|
8 | 11 | /**
|
9 | 12 | * User: hamdamboy
|
|
16 | 19 | @NoArgsConstructor
|
17 | 20 | @AllArgsConstructor
|
18 | 21 | @Entity
|
19 |
| -public class BrandImages { |
| 22 | +public class BrandImages implements Serializable { |
20 | 23 |
|
21 | 24 | @Id
|
22 | 25 | @GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
Original file line number | Diff line number | Diff line change |
---|
@@ -30,9 +30,9 @@ public class CarouselImages {
|
30 | 30 | private String imageURL;
|
31 | 31 |
|
32 | 32 |
|
33 |
| -public CarouselImages(String s, String imageLocalPath, String imageURL) { |
34 |
| -this.link = s; |
35 |
| -this.imageLocalPath = imageLocalPath; |
36 |
| -this.imageURL = imageURL; |
37 |
| -} |
| 33 | +// public CarouselImages(String link, String imageLocalPath, String imageURL) { |
| 34 | +// this.link = link; |
| 35 | +// this.imageLocalPath = imageLocalPath; |
| 36 | +// this.imageURL = imageURL; |
| 37 | +// } |
38 | 38 | }
|
Original file line number | Diff line number | Diff line change |
---|
@@ -37,5 +37,7 @@ public class ContactInfo {
|
37 | 37 | // @JsonIgnore
|
38 | 38 | // private List<BankInfo> banks;
|
39 | 39 |
|
| 40 | +// Customer OneToOne |
| 41 | + |
40 | 42 |
|
41 | 43 | }
|
Original file line number | Diff line number | Diff line change |
---|
|
1 |
| -package com.urunov.service.interfaces; |
2 |
| - |
3 |
| -import org.springframework.context.annotation.Configuration; |
4 |
| - |
5 |
| -/** |
6 |
| -* User: hamdamboy |
7 |
| -* Project: model |
8 |
| -* : @urunov |
9 |
| -*/ |
10 |
| -@Configuration |
11 |
| -public interface LoadFakeDataService { |
12 |
| - |
13 |
| -boolean loadTestData(); |
14 |
| -} |
| 1 | +//package com.urunov.service.interfaces; |
| 2 | +// |
| 3 | +//import org.springframework.context.annotation.Configuration; |
| 4 | +// |
| 5 | +///** |
| 6 | +// * User: hamdamboy |
| 7 | +// * Project: model |
| 8 | +// * : @urunov |
| 9 | +// */ |
| 10 | +//@Configuration |
| 11 | +//public interface LoadFakeDataService { |
| 12 | +// |
| 13 | +// boolean loadTestData(); |
| 14 | +//} |
You can’t perform that action at this time.
0 commit comments