-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: get popup detail & category info & region info
- Loading branch information
1 parent
1690617
commit 4409c84
Showing
44 changed files
with
1,343 additions
and
387 deletions.
There are no files selected for viewing
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
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
31 changes: 0 additions & 31 deletions
31
src/main/java/com/todaypopup/todaypopup/controller/PopupController.java
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...pup/todaypopup/dto/PaginationInfoDto.java → ...odaypopup/core/dto/PaginationInfoDto.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
2 changes: 1 addition & 1 deletion
2
...up/todaypopup/dto/PaginationQueryDto.java → ...daypopup/core/dto/PaginationQueryDto.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
2 changes: 1 addition & 1 deletion
2
...todaypopup/dto/PaginationResponseDto.java → ...popup/core/dto/PaginationResponseDto.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
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
2 changes: 1 addition & 1 deletion
2
...opup/todaypopup/model/CategoryEntity.java → ...todaypopup/core/model/CategoryEntity.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
2 changes: 1 addition & 1 deletion
2
...aypopup/todaypopup/model/ImageEntity.java → ...up/todaypopup/core/model/ImageEntity.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
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
2 changes: 1 addition & 1 deletion
2
...todaypopup/util/CursorEncryptionUtil.java → ...popup/core/util/CursorEncryptionUtil.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
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
28 changes: 28 additions & 0 deletions
28
src/main/java/com/todaypopup/todaypopup/domain/category/controller/CategoryController.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,28 @@ | ||
package com.todaypopup.todaypopup.domain.category.controller; | ||
|
||
import com.todaypopup.todaypopup.domain.category.dto.GetCategoryInfoRequestDto; | ||
import com.todaypopup.todaypopup.domain.category.dto.GetCategoryInfoResponseDto; | ||
import com.todaypopup.todaypopup.domain.category.service.CategoryService; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.ModelAttribute; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RestController | ||
public class CategoryController { | ||
|
||
private final CategoryService categoryService; | ||
|
||
public CategoryController(CategoryService categoryService) { | ||
this.categoryService = categoryService; | ||
} | ||
|
||
@GetMapping("/v1/category") | ||
public ResponseEntity<GetCategoryInfoResponseDto> getCategoryInfo( | ||
@ModelAttribute GetCategoryInfoRequestDto queryDto) throws Exception { | ||
|
||
GetCategoryInfoResponseDto response = this.categoryService.GetCategoryInfo(queryDto); | ||
|
||
return ResponseEntity.ok().body(response); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/main/java/com/todaypopup/todaypopup/domain/category/dto/GetCategoryInfoRequestDto.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,14 @@ | ||
package com.todaypopup.todaypopup.domain.category.dto; | ||
|
||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import lombok.experimental.SuperBuilder; | ||
|
||
@Data | ||
@SuperBuilder | ||
@NoArgsConstructor | ||
public class GetCategoryInfoRequestDto { | ||
|
||
private Long categoryId; | ||
} | ||
|
18 changes: 18 additions & 0 deletions
18
src/main/java/com/todaypopup/todaypopup/domain/category/dto/GetCategoryInfoResponseDto.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,18 @@ | ||
package com.todaypopup.todaypopup.domain.category.dto; | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.todaypopup.todaypopup.core.model.CategoryEntity; | ||
import java.util.List; | ||
import java.util.Optional; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
|
||
@Data | ||
@Builder | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
public class GetCategoryInfoResponseDto { | ||
|
||
private List<CategoryEntity> categoryList; | ||
private Optional<CategoryEntity> category; | ||
|
||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/com/todaypopup/todaypopup/domain/category/repository/CategoryRepository.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.todaypopup.todaypopup.domain.category.repository; | ||
|
||
import com.todaypopup.todaypopup.core.model.CategoryEntity; | ||
import java.util.List; | ||
import java.util.Optional; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface CategoryRepository extends JpaRepository<CategoryEntity, Long> { | ||
|
||
@Override | ||
List<CategoryEntity> findAll(); | ||
|
||
@Override | ||
Optional<CategoryEntity> findById(Long aLong); | ||
} |
9 changes: 9 additions & 0 deletions
9
src/main/java/com/todaypopup/todaypopup/domain/category/service/CategoryService.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,9 @@ | ||
package com.todaypopup.todaypopup.domain.category.service; | ||
|
||
import com.todaypopup.todaypopup.domain.category.dto.GetCategoryInfoRequestDto; | ||
import com.todaypopup.todaypopup.domain.category.dto.GetCategoryInfoResponseDto; | ||
|
||
public interface CategoryService { | ||
|
||
GetCategoryInfoResponseDto GetCategoryInfo(GetCategoryInfoRequestDto queryDto) throws Exception; | ||
} |
32 changes: 32 additions & 0 deletions
32
src/main/java/com/todaypopup/todaypopup/domain/category/service/CategoryServiceImpl.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,32 @@ | ||
package com.todaypopup.todaypopup.domain.category.service; | ||
|
||
import com.todaypopup.todaypopup.domain.category.dto.GetCategoryInfoRequestDto; | ||
import com.todaypopup.todaypopup.domain.category.dto.GetCategoryInfoResponseDto; | ||
import com.todaypopup.todaypopup.domain.category.repository.CategoryRepository; | ||
import org.springframework.stereotype.Service; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
@Service | ||
@Transactional | ||
public class CategoryServiceImpl implements CategoryService { | ||
|
||
private final CategoryRepository categoryRepository; | ||
|
||
public CategoryServiceImpl(CategoryRepository categoryRepository) { | ||
this.categoryRepository = categoryRepository; | ||
} | ||
|
||
@Override | ||
public GetCategoryInfoResponseDto GetCategoryInfo(GetCategoryInfoRequestDto queryDto) { | ||
if (queryDto.getCategoryId() == null) { | ||
return GetCategoryInfoResponseDto.builder() | ||
.categoryList(this.categoryRepository.findAll()) | ||
.build(); | ||
} | ||
|
||
return GetCategoryInfoResponseDto.builder() | ||
.category(this.categoryRepository.findById(queryDto.getCategoryId())) | ||
.build(); | ||
} | ||
|
||
} |
Oops, something went wrong.