-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: 브랜드 카테고리 중복 가능, 상품 조회 시 찜 여부 추가
Feat: 브랜드 카테고리 중복 가능, 상품 조회 시 찜 여부 추가
- Loading branch information
Showing
17 changed files
with
2,741 additions
and
16 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
src/main/java/com/example/neoul/controller/DataController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package com.example.neoul.controller; | ||
|
||
import com.example.neoul.global.entity.ApiResponse; | ||
import com.example.neoul.global.exception.BadRequestException; | ||
import com.example.neoul.service.BrandService; | ||
import com.example.neoul.service.DataService; | ||
import io.swagger.annotations.Api; | ||
import io.swagger.annotations.ApiOperation; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.beans.factory.annotation.Required; | ||
import org.springframework.http.HttpStatus; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
@Slf4j | ||
@RestController | ||
@RequiredArgsConstructor | ||
@Api(tags={"06.data"}) | ||
@RequestMapping("/data") | ||
|
||
public class DataController { | ||
private final DataService dataService; | ||
|
||
@ApiOperation(value = "brand data 수신", notes = "brand data 수신") | ||
@PostMapping("/saveBrands") | ||
public void saveBrands(@RequestBody List<Map<String, Object>> brandDataList) { | ||
dataService.saveBrands(brandDataList); | ||
return; | ||
} | ||
@ApiOperation(value = "Product data 수신", notes = "Product data 수신") | ||
@PostMapping("/saveProducts") | ||
public void saveProducts(@RequestBody List<Map<String, Object>> productDataList) { | ||
dataService.saveProducts(productDataList); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
src/main/java/com/example/neoul/entity/brand/BrandCategoryV.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.example.neoul.entity.brand; | ||
|
||
import com.example.neoul.entity.category.CategoryV; | ||
import com.example.neoul.entity.user.User; | ||
import lombok.*; | ||
import org.hibernate.annotations.DynamicInsert; | ||
import org.hibernate.annotations.DynamicUpdate; | ||
|
||
import javax.persistence.*; | ||
|
||
@DynamicInsert | ||
@DynamicUpdate | ||
@Setter | ||
@Getter | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Table(name = "brand_category_v") | ||
@Entity | ||
public class BrandCategoryV { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Column(name = "id") | ||
private Long id; | ||
|
||
@JoinColumn(name = "brand_id") | ||
@ManyToOne(fetch = FetchType.LAZY) | ||
private Brand brand; | ||
|
||
@JoinColumn(name = "categoryv_id") | ||
@ManyToOne(fetch = FetchType.LAZY) | ||
private CategoryV categoryV; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/main/java/com/example/neoul/repository/BrandCategoryVRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.example.neoul.repository; | ||
|
||
import com.example.neoul.entity.brand.Brand; | ||
import com.example.neoul.entity.brand.BrandCategoryV; | ||
import com.example.neoul.entity.category.CategoryV; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
import java.util.List; | ||
|
||
public interface BrandCategoryVRepository extends JpaRepository<BrandCategoryV, Long> { | ||
|
||
List<BrandCategoryV> findAllByBrand(Brand brand); | ||
List<BrandCategoryV> findAllByCategoryV(CategoryV categoryV); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.