Skip to content

Commit

Permalink
Merge pull request #109 from ClothingStoreService/develop
Browse files Browse the repository at this point in the history
Mybatis 제거, 각 도메인 및 기능 고도화
  • Loading branch information
Ogu1208 authored Jul 22, 2024
2 parents 1430814 + f408763 commit 896f5c1
Show file tree
Hide file tree
Showing 213 changed files with 6,359 additions and 3,814 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@ on:
push:
branches: develop
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0
- name: Build with Gradle
run: ./gradlew build
build:
runs-on: ubuntu-latest
steps:
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,6 @@ out/

### Custom Private Keys ###
src/main/resources/app.key
src/main/resources/app.pub
src/main/resources/app.pub

/src/main/generated/
6 changes: 6 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ dependencies {
//yml 암호화, 공식문서: https://github.com/ulisesbocchio/jasypt-spring-boot
//참고 블로그: https://velog.io/@bey1548/SpringBoot-application.yml-%EA%B0%92-%EC%95%94%ED%98%B8%ED%99%94%ED%95%98%EA%B8%B0jasypt
implementation 'com.github.ulisesbocchio:jasypt-spring-boot-starter:3.0.5'

//mail 전송 의존성
implementation 'org.springframework.boot:spring-boot-starter-mail'

//Redis 의존성
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
}

tasks.named('test') {
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion src/main/java/org/store/clothstar/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;

//@EnableJpaAuditing
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

import io.swagger.v3.oas.annotations.Operation;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Slice;
import org.springframework.data.web.PageableDefault;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
Expand All @@ -13,6 +17,8 @@
import org.store.clothstar.category.service.CategoryService;
import org.store.clothstar.common.dto.MessageDTO;
import org.store.clothstar.common.util.URIBuilder;
import org.store.clothstar.productLine.dto.response.ProductLineWithProductsResponse;
import org.store.clothstar.productLine.service.ProductLineService;

import java.net.URI;
import java.util.List;
Expand All @@ -23,6 +29,7 @@
public class CategoryController {

private final CategoryService categoryService;
private final ProductLineService productLineService;

@Operation(summary = "전체 카테고리 조회", description = "모든 카테고리를 조회한다.")
@GetMapping
Expand Down Expand Up @@ -58,4 +65,24 @@ public ResponseEntity<MessageDTO> updateCategories(

return ResponseEntity.ok().body(new MessageDTO(HttpStatus.OK.value(), "Category updated successfully"));
}

@Operation(summary = "카테고리별 상품 조회 (Offset Paging)", description = "카테고리 ID로 해당 카테고리에 속하는 모든 상품을 Offset Paging을 통해 조회한다.")
@GetMapping("/{categoryId}/productLines/offset")
public ResponseEntity<Page<ProductLineWithProductsResponse>> getProductLinesByCategory(
@PathVariable Long categoryId,
@PageableDefault(size = 18) Pageable pageable,
@RequestParam(required = false) String keyword) {
Page<ProductLineWithProductsResponse> productLineResponses = productLineService.getProductLinesByCategoryWithOffsetPaging(categoryId, pageable, keyword);
return ResponseEntity.ok().body(productLineResponses);
}

@Operation(summary = "카테고리별 상품 조회 (Slice Paging)", description = "카테고리 ID로 해당 카테고리에 속하는 모든 상품을 Slice Paging을 통해 조회한다.")
@GetMapping("/{categoryId}/productLines/slice")
public ResponseEntity<Slice<ProductLineWithProductsResponse>> getProductLinesByCategorySlice(
@PathVariable Long categoryId,
@PageableDefault(size = 18) Pageable pageable,
@RequestParam(required = false) String keyword) {
Slice<ProductLineWithProductsResponse> productLineResponses = productLineService.getProductLinesByCategoryWithSlicePaging(categoryId, pageable, keyword);
return ResponseEntity.ok().body(productLineResponses);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package org.store.clothstar.category.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class CategoryViewController {

@GetMapping("/categoryPagingOffset")
public String categoryPagingOffset() {
return "category-product_lines-offset";
}

@GetMapping("/categoryPagingSlice")
public String categoryPagingSlice() {
return "category-product_lines-slice";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.store.clothstar.category.domain.Category;
import org.store.clothstar.category.entity.CategoryEntity;

@Getter
@Builder
Expand All @@ -18,8 +18,8 @@ public class CreateCategoryRequest {
@NotBlank(message = "카테고리 타입을 입력해주세요.")
private String categoryType;

public Category toCategory() {
return Category.builder()
public CategoryEntity toCategoryEntity() {
return CategoryEntity.builder()
.categoryType(categoryType)
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

import lombok.Builder;
import lombok.Getter;
import org.store.clothstar.category.domain.Category;
import org.store.clothstar.category.entity.CategoryEntity;

@Getter
@Builder
public class CategoryDetailResponse {
private Long categoryId;
private String categoryType;

public static CategoryDetailResponse from(Category category) {
public static CategoryDetailResponse from(CategoryEntity category) {
return CategoryDetailResponse.builder()
.categoryId(category.getCategoryId())
.categoryType(category.getCategoryType())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import org.store.clothstar.category.domain.Category;
import org.store.clothstar.category.entity.CategoryEntity;

@Repository
public interface CategoryJpaRepository extends JpaRepository<Category, Long> {
public interface CategoryJpaRepository extends JpaRepository<CategoryEntity, Long> {

}

This file was deleted.

This file was deleted.

Loading

0 comments on commit 896f5c1

Please sign in to comment.