-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #93 from nhnacademy-be5-T3Team/feature/page_admin_…
…book Feature/page admin book
- Loading branch information
Showing
12 changed files
with
282 additions
and
12 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
src/main/java/com/t3t/frontserver/book/model/dto/PublisherDto.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,17 @@ | ||
package com.t3t.frontserver.book.model.dto; | ||
|
||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.Getter; | ||
|
||
import javax.validation.constraints.NotNull; | ||
|
||
@Data | ||
@Getter | ||
@Builder | ||
public class PublisherDto { | ||
@NotNull | ||
private Long publisherId; | ||
private String publisherName; | ||
private String publisherEmail; | ||
} |
25 changes: 25 additions & 0 deletions
25
src/main/java/com/t3t/frontserver/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,25 @@ | ||
package com.t3t.frontserver.category.controller; | ||
|
||
import com.t3t.frontserver.category.client.CategoryApiClient; | ||
import com.t3t.frontserver.category.response.CategoryTreeResponse; | ||
import com.t3t.frontserver.model.response.BaseResponse; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.stereotype.Controller; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
|
||
import java.util.List; | ||
|
||
@Slf4j | ||
@RequiredArgsConstructor | ||
@Controller | ||
public class CategoryController { | ||
private final CategoryApiClient categoryApiClient; | ||
|
||
@GetMapping("/categories") | ||
ResponseEntity<BaseResponse<List<CategoryTreeResponse>>> getCategoryTreeByDepth(@RequestParam Integer startDepth, @RequestParam Integer maxDepth) { | ||
return categoryApiClient.getCategoryTreeByDepth(startDepth, maxDepth); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/main/java/com/t3t/frontserver/participant/client/ParticipantApiClient.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,26 @@ | ||
package com.t3t.frontserver.participant.client; | ||
|
||
import com.t3t.frontserver.model.response.BaseResponse; | ||
import com.t3t.frontserver.model.response.PageResponse; | ||
import com.t3t.frontserver.participant.dto.ParticipantDto; | ||
import com.t3t.frontserver.participant.dto.ParticipantRoleDto; | ||
import org.springframework.cloud.openfeign.FeignClient; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
|
||
@FeignClient(name = "categoryApiClient", url = "${t3t.feignClient.url}") | ||
public interface ParticipantApiClient { | ||
|
||
@GetMapping("/t3t/bookstore/participants") | ||
ResponseEntity<BaseResponse<PageResponse<ParticipantDto>>> getParticipantList( | ||
@RequestParam(value = "pageNo", defaultValue = "0", required = false) int pageNo, | ||
@RequestParam(value = "pageSize", defaultValue = "10", required = false) int pageSize, | ||
@RequestParam(value = "sortBy", defaultValue = "participantId", required = false) String sortBy); | ||
|
||
@GetMapping("/t3t/bookstore/participantRoles") | ||
ResponseEntity<BaseResponse<PageResponse<ParticipantRoleDto>>> getParticipantRoleList( | ||
@RequestParam(value = "pageNo", defaultValue = "0", required = false) int pageNo, | ||
@RequestParam(value = "pageSize", defaultValue = "10", required = false) int pageSize, | ||
@RequestParam(value = "sortBy", defaultValue = "participantRoleId", required = false) String sortBy); | ||
} |
38 changes: 38 additions & 0 deletions
38
src/main/java/com/t3t/frontserver/participant/controller/ParticipantController.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,38 @@ | ||
package com.t3t.frontserver.participant.controller; | ||
|
||
import com.t3t.frontserver.model.response.BaseResponse; | ||
import com.t3t.frontserver.model.response.PageResponse; | ||
import com.t3t.frontserver.participant.client.ParticipantApiClient; | ||
import com.t3t.frontserver.participant.dto.ParticipantDto; | ||
import com.t3t.frontserver.participant.dto.ParticipantRoleDto; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.stereotype.Controller; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
|
||
@Slf4j | ||
@RequiredArgsConstructor | ||
@Controller | ||
public class ParticipantController { | ||
private final ParticipantApiClient participantApiClient; | ||
|
||
@GetMapping("/participants") | ||
ResponseEntity<BaseResponse<PageResponse<ParticipantDto>>> getParticipantList( | ||
@RequestParam(value = "pageNo", defaultValue = "0", required = false) int pageNo, | ||
@RequestParam(value = "pageSize", defaultValue = "10", required = false) int pageSize, | ||
@RequestParam(value = "sortBy", defaultValue = "participantId", required = false) String sortBy) { | ||
|
||
return participantApiClient.getParticipantList(pageNo, pageSize, sortBy); | ||
} | ||
|
||
@GetMapping("/participantRoles") | ||
ResponseEntity<BaseResponse<PageResponse<ParticipantRoleDto>>> getParticipantRoleList( | ||
@RequestParam(value = "pageNo", defaultValue = "0", required = false) int pageNo, | ||
@RequestParam(value = "pageSize", defaultValue = "10", required = false) int pageSize, | ||
@RequestParam(value = "sortBy", defaultValue = "participantRoleId", required = false) String sortBy) { | ||
|
||
return participantApiClient.getParticipantRoleList(pageNo, pageSize, sortBy); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
src/main/java/com/t3t/frontserver/participant/dto/ParticipantDto.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,21 @@ | ||
package com.t3t.frontserver.participant.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
/** | ||
* 도서 참여자에 대한 데이터 전송 객체(DTO) <br> | ||
* 각 객체는 도서 참여자의 식별자(ID)와 이름, 이메일을 가지고 있음 | ||
* @author Yujin-nKim(김유진) | ||
*/ | ||
@Getter | ||
@Builder | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class ParticipantDto { | ||
private Long id; | ||
private String name; | ||
private String email; | ||
} |
21 changes: 21 additions & 0 deletions
21
src/main/java/com/t3t/frontserver/participant/dto/ParticipantRoleDto.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,21 @@ | ||
package com.t3t.frontserver.participant.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
/** | ||
* 도서 참여자 역할에 대한 데이터 전송 객체(DTO) <br> | ||
* 각 객체는 도서 참여자 역할의 식별자(ID)와 영어 이름, 한국어 이름을 가지고 있음 | ||
* @author Yujin-nKim(김유진) | ||
*/ | ||
@Getter | ||
@Builder | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class ParticipantRoleDto { | ||
private Integer id; | ||
private String roleNameEn; | ||
private String roleNameKr; | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/com/t3t/frontserver/publishers/client/PublisherApiClient.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.t3t.frontserver.publishers.client; | ||
|
||
import com.t3t.frontserver.book.model.dto.PublisherDto; | ||
import com.t3t.frontserver.model.response.BaseResponse; | ||
import com.t3t.frontserver.model.response.PageResponse; | ||
import org.springframework.cloud.openfeign.FeignClient; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
|
||
@FeignClient(name = "publisherApiClient", url = "${t3t.feignClient.url}") | ||
public interface PublisherApiClient { | ||
@GetMapping("t3t/bookstore/publishers") | ||
ResponseEntity<BaseResponse<PageResponse<PublisherDto>>> getPublisherList( | ||
@RequestParam(value = "pageNo", defaultValue = "0", required = false) int pageNo, | ||
@RequestParam(value = "pageSize", defaultValue = "10", required = false) int pageSize, | ||
@RequestParam(value = "sortBy", defaultValue = "publisherId", required = false) String sortBy); | ||
} |
29 changes: 29 additions & 0 deletions
29
src/main/java/com/t3t/frontserver/publishers/controller/PublisherController.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,29 @@ | ||
package com.t3t.frontserver.publishers.controller; | ||
|
||
import com.t3t.frontserver.book.model.dto.PublisherDto; | ||
import com.t3t.frontserver.model.response.BaseResponse; | ||
import com.t3t.frontserver.model.response.PageResponse; | ||
import com.t3t.frontserver.publishers.client.PublisherApiClient; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.stereotype.Controller; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
|
||
@Slf4j | ||
@RequiredArgsConstructor | ||
@Controller | ||
public class PublisherController { | ||
|
||
private final PublisherApiClient publisherApiClient; | ||
|
||
@GetMapping("/publishers") | ||
public ResponseEntity<BaseResponse<PageResponse<PublisherDto>>> getPublisherList( | ||
@RequestParam(value = "pageNo", defaultValue = "0", required = false) int pageNo, | ||
@RequestParam(value = "pageSize", defaultValue = "10", required = false) int pageSize, | ||
@RequestParam(value = "sortBy", defaultValue = "publisherId", required = false) String sortBy) { | ||
|
||
return publisherApiClient.getPublisherList(pageNo, pageSize, sortBy); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
src/main/java/com/t3t/frontserver/tag/client/TagApiClient.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,20 @@ | ||
package com.t3t.frontserver.tag.client; | ||
|
||
import com.t3t.frontserver.book.model.dto.TagDto; | ||
import com.t3t.frontserver.model.response.BaseResponse; | ||
import com.t3t.frontserver.model.response.PageResponse; | ||
import org.springframework.cloud.openfeign.FeignClient; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
|
||
@FeignClient(name = "tagApiClient", url = "${t3t.feignClient.url}") | ||
public interface TagApiClient { | ||
|
||
@GetMapping(value = "/t3t/bookstore/tags") | ||
ResponseEntity<BaseResponse<PageResponse<TagDto>>> getTagList( | ||
@RequestParam(value = "pageNo", defaultValue = "0", required = false) int pageNo, | ||
@RequestParam(value = "pageSize", defaultValue = "10", required = false) int pageSize, | ||
@RequestParam(value = "sortBy", defaultValue = "tagId", required = false) String sortBy); | ||
|
||
} |
28 changes: 28 additions & 0 deletions
28
src/main/java/com/t3t/frontserver/tag/controller/TagController.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.t3t.frontserver.tag.controller; | ||
|
||
import com.t3t.frontserver.book.model.dto.TagDto; | ||
import com.t3t.frontserver.model.response.BaseResponse; | ||
import com.t3t.frontserver.model.response.PageResponse; | ||
import com.t3t.frontserver.tag.client.TagApiClient; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.stereotype.Controller; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
|
||
@Slf4j | ||
@RequiredArgsConstructor | ||
@Controller | ||
public class TagController { | ||
private final TagApiClient tagApiClient; | ||
|
||
@GetMapping("/tags") | ||
public ResponseEntity<BaseResponse<PageResponse<TagDto>>> getTagList( | ||
@RequestParam(value = "pageNo", defaultValue = "0", required = false) int pageNo, | ||
@RequestParam(value = "pageSize", defaultValue = "10", required = false) int pageSize, | ||
@RequestParam(value = "sortBy", defaultValue = "tagId", required = false) String sortBy) { | ||
|
||
return tagApiClient.getTagList(pageNo, pageSize, sortBy); | ||
} | ||
} |
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