From fcc72800ce23018bb4dbf84b41b0e9a427f50881 Mon Sep 17 00:00:00 2001 From: yujinKim Date: Fri, 10 May 2024 00:53:39 +0900 Subject: [PATCH 1/3] =?UTF-8?q?fix=20:=20=EB=8F=84=EC=84=9C=20=EC=83=81?= =?UTF-8?q?=EC=84=B8=20=EC=A1=B0=ED=9A=8C=EC=8B=9C=20toast=20ui=20viewer?= =?UTF-8?q?=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/templates/main/page/detail.html | 36 +++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/src/main/resources/templates/main/page/detail.html b/src/main/resources/templates/main/page/detail.html index 1318191..2d0049a 100644 --- a/src/main/resources/templates/main/page/detail.html +++ b/src/main/resources/templates/main/page/detail.html @@ -5,6 +5,12 @@ layout:decorate="main/layout/layout"> + + + + + +
@@ -71,7 +77,8 @@

Book Name

-

Lorem ipsum dolor sit amet consectetur adipisicing elit. Praesentium at dolorem quidem modi. Nam sequi consequatur obcaecati excepturi alias magni, accusamus eius blanditiis delectus ipsam minima ea iste laborum vero?

+ +
@@ -170,7 +177,8 @@

도서 기본 정보

도서 목차

-

+ +
@@ -217,5 +225,29 @@

등록된 리뷰가 없습니다.

+ +
\ No newline at end of file From 04ca301649d845e258737986d6034c141ed0b088 Mon Sep 17 00:00:00 2001 From: yujinKim Date: Fri, 10 May 2024 07:21:09 +0900 Subject: [PATCH 2/3] =?UTF-8?q?fix=20:=20api=20=EC=9A=94=EC=B2=AD=20url=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/static/assets/admin/js/api.js | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/main/resources/static/assets/admin/js/api.js b/src/main/resources/static/assets/admin/js/api.js index 2e5d17d..9c7453d 100644 --- a/src/main/resources/static/assets/admin/js/api.js +++ b/src/main/resources/static/assets/admin/js/api.js @@ -12,8 +12,7 @@ const APP_KEY = document.querySelector("#appKey").getAttribute("data-contextPath */ function fetchPublishersAndUpdateModal() { $.ajax({ - // url: 'http://localhost:8081/publishers', - url: APP_KEY + '/t3t/bookstore/publishers', + url : '/publishers', type: 'GET', data: { pageNo: currentPage, @@ -47,8 +46,7 @@ function fetchPublishersAndUpdateModal() { */ function fetchParticipantsAndUpdateModal() { $.ajax({ - // url: 'http://localhost:8081/participants', - url: APP_KEY + '/t3t/bookstore/participants', + url: '/participants', type: 'GET', data: { pageNo: currentPage, @@ -82,8 +80,7 @@ function fetchParticipantsAndUpdateModal() { */ function fetchParticipantRolesAndUpdateModal() { $.ajax({ - // url: 'http://localhost:8081/participantRoles', - url: APP_KEY + '/t3t/bookstore/participantRoles', + url: '/participantRoles', type: 'GET', data: { pageNo: currentPage, @@ -116,8 +113,7 @@ function fetchParticipantRolesAndUpdateModal() { */ function fetchCategoriesAndUpdateModal(startDepth, maxDepth) { $.ajax({ - // url: 'http://localhost:8081/categories', - url: APP_KEY + '/t3t/bookstore/categories', + url: '/categories', type: 'GET', data: { startDepth: startDepth, @@ -148,8 +144,7 @@ function fetchCategoriesAndUpdateModal(startDepth, maxDepth) { */ function fetchTagsAndUpdateModal() { $.ajax({ - // url: 'http://localhost:8081/tags', - url: APP_KEY + '/t3t/bookstore/tags', + url: '/tags', type: 'GET', data: { pageNo: currentPage, From 7e27aeb2f66f5e75adf693bc8c748ead401452d7 Mon Sep 17 00:00:00 2001 From: yujinKim Date: Fri, 10 May 2024 07:25:05 +0900 Subject: [PATCH 3/3] =?UTF-8?q?feat=20:=20=EB=AA=A9=EB=A1=9D=20=EC=9A=94?= =?UTF-8?q?=EC=B2=AD=20api=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../book/model/dto/PublisherDto.java | 17 +++++++++ .../controller/CategoryController.java | 25 ++++++++++++ .../client/ParticipantApiClient.java | 26 +++++++++++++ .../controller/ParticipantController.java | 38 +++++++++++++++++++ .../participant/dto/ParticipantDto.java | 21 ++++++++++ .../participant/dto/ParticipantRoleDto.java | 21 ++++++++++ .../publishers/client/PublisherApiClient.java | 18 +++++++++ .../controller/PublisherController.java | 29 ++++++++++++++ .../frontserver/tag/client/TagApiClient.java | 20 ++++++++++ .../tag/controller/TagController.java | 28 ++++++++++++++ 10 files changed, 243 insertions(+) create mode 100644 src/main/java/com/t3t/frontserver/book/model/dto/PublisherDto.java create mode 100644 src/main/java/com/t3t/frontserver/category/controller/CategoryController.java create mode 100644 src/main/java/com/t3t/frontserver/participant/client/ParticipantApiClient.java create mode 100644 src/main/java/com/t3t/frontserver/participant/controller/ParticipantController.java create mode 100644 src/main/java/com/t3t/frontserver/participant/dto/ParticipantDto.java create mode 100644 src/main/java/com/t3t/frontserver/participant/dto/ParticipantRoleDto.java create mode 100644 src/main/java/com/t3t/frontserver/publishers/client/PublisherApiClient.java create mode 100644 src/main/java/com/t3t/frontserver/publishers/controller/PublisherController.java create mode 100644 src/main/java/com/t3t/frontserver/tag/client/TagApiClient.java create mode 100644 src/main/java/com/t3t/frontserver/tag/controller/TagController.java diff --git a/src/main/java/com/t3t/frontserver/book/model/dto/PublisherDto.java b/src/main/java/com/t3t/frontserver/book/model/dto/PublisherDto.java new file mode 100644 index 0000000..98f4f44 --- /dev/null +++ b/src/main/java/com/t3t/frontserver/book/model/dto/PublisherDto.java @@ -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; +} diff --git a/src/main/java/com/t3t/frontserver/category/controller/CategoryController.java b/src/main/java/com/t3t/frontserver/category/controller/CategoryController.java new file mode 100644 index 0000000..57a8c7c --- /dev/null +++ b/src/main/java/com/t3t/frontserver/category/controller/CategoryController.java @@ -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>> getCategoryTreeByDepth(@RequestParam Integer startDepth, @RequestParam Integer maxDepth) { + return categoryApiClient.getCategoryTreeByDepth(startDepth, maxDepth); + } +} diff --git a/src/main/java/com/t3t/frontserver/participant/client/ParticipantApiClient.java b/src/main/java/com/t3t/frontserver/participant/client/ParticipantApiClient.java new file mode 100644 index 0000000..a2e3a91 --- /dev/null +++ b/src/main/java/com/t3t/frontserver/participant/client/ParticipantApiClient.java @@ -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>> 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>> 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); +} diff --git a/src/main/java/com/t3t/frontserver/participant/controller/ParticipantController.java b/src/main/java/com/t3t/frontserver/participant/controller/ParticipantController.java new file mode 100644 index 0000000..0932849 --- /dev/null +++ b/src/main/java/com/t3t/frontserver/participant/controller/ParticipantController.java @@ -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>> 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>> 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); + } +} diff --git a/src/main/java/com/t3t/frontserver/participant/dto/ParticipantDto.java b/src/main/java/com/t3t/frontserver/participant/dto/ParticipantDto.java new file mode 100644 index 0000000..cb30e38 --- /dev/null +++ b/src/main/java/com/t3t/frontserver/participant/dto/ParticipantDto.java @@ -0,0 +1,21 @@ +package com.t3t.frontserver.participant.dto; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; + +/** + * 도서 참여자에 대한 데이터 전송 객체(DTO)
+ * 각 객체는 도서 참여자의 식별자(ID)와 이름, 이메일을 가지고 있음 + * @author Yujin-nKim(김유진) + */ +@Getter +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class ParticipantDto { + private Long id; + private String name; + private String email; +} diff --git a/src/main/java/com/t3t/frontserver/participant/dto/ParticipantRoleDto.java b/src/main/java/com/t3t/frontserver/participant/dto/ParticipantRoleDto.java new file mode 100644 index 0000000..28ccf2b --- /dev/null +++ b/src/main/java/com/t3t/frontserver/participant/dto/ParticipantRoleDto.java @@ -0,0 +1,21 @@ +package com.t3t.frontserver.participant.dto; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; + +/** + * 도서 참여자 역할에 대한 데이터 전송 객체(DTO)
+ * 각 객체는 도서 참여자 역할의 식별자(ID)와 영어 이름, 한국어 이름을 가지고 있음 + * @author Yujin-nKim(김유진) + */ +@Getter +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class ParticipantRoleDto { + private Integer id; + private String roleNameEn; + private String roleNameKr; +} diff --git a/src/main/java/com/t3t/frontserver/publishers/client/PublisherApiClient.java b/src/main/java/com/t3t/frontserver/publishers/client/PublisherApiClient.java new file mode 100644 index 0000000..97548ac --- /dev/null +++ b/src/main/java/com/t3t/frontserver/publishers/client/PublisherApiClient.java @@ -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>> 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); +} diff --git a/src/main/java/com/t3t/frontserver/publishers/controller/PublisherController.java b/src/main/java/com/t3t/frontserver/publishers/controller/PublisherController.java new file mode 100644 index 0000000..9b40ca2 --- /dev/null +++ b/src/main/java/com/t3t/frontserver/publishers/controller/PublisherController.java @@ -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>> 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); + } +} diff --git a/src/main/java/com/t3t/frontserver/tag/client/TagApiClient.java b/src/main/java/com/t3t/frontserver/tag/client/TagApiClient.java new file mode 100644 index 0000000..a8dfdc4 --- /dev/null +++ b/src/main/java/com/t3t/frontserver/tag/client/TagApiClient.java @@ -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>> 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); + +} diff --git a/src/main/java/com/t3t/frontserver/tag/controller/TagController.java b/src/main/java/com/t3t/frontserver/tag/controller/TagController.java new file mode 100644 index 0000000..e16badc --- /dev/null +++ b/src/main/java/com/t3t/frontserver/tag/controller/TagController.java @@ -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>> 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); + } +}