Skip to content

Commit

Permalink
Merge pull request #121 from Guzzing/academy-schedules
Browse files Browse the repository at this point in the history
[Academy schedules] 학원 Location 관련 목록 조회 쿼리 개선
  • Loading branch information
byeolhaha authored Dec 9, 2023
2 parents e30e42e + b87f203 commit 34d637c
Show file tree
Hide file tree
Showing 27 changed files with 47 additions and 926 deletions.
Original file line number Diff line number Diff line change
@@ -1,25 +1,19 @@
package org.guzzing.studayserver.domain.academy.controller;

import jakarta.validation.Valid;
import org.guzzing.studayserver.domain.academy.controller.dto.request.AcademiesByLocationRequest;
import org.guzzing.studayserver.domain.academy.controller.dto.request.AcademiesByNameRequest;
import org.guzzing.studayserver.domain.academy.controller.dto.request.AcademyByLocationWithScrollRequest;
import org.guzzing.studayserver.domain.academy.controller.dto.request.AcademyFilterRequest;
import org.guzzing.studayserver.domain.academy.controller.dto.request.AcademyFilterWithScrollRequest;
import org.guzzing.studayserver.domain.academy.controller.dto.response.AcademiesByLocationResponses;
import org.guzzing.studayserver.domain.academy.controller.dto.response.AcademiesByLocationWithScrollResponses;
import org.guzzing.studayserver.domain.academy.controller.dto.response.AcademiesByNameResponses;
import org.guzzing.studayserver.domain.academy.controller.dto.response.AcademiesFilterWithScrollResponses;
import org.guzzing.studayserver.domain.academy.controller.dto.response.AcademyFilterResponses;
import org.guzzing.studayserver.domain.academy.controller.dto.response.AcademyGetResponse;
import org.guzzing.studayserver.domain.academy.controller.dto.response.LessonInfoToCreateDashboardResponses;
import org.guzzing.studayserver.domain.academy.facade.AcademyFacade;
import org.guzzing.studayserver.domain.academy.facade.dto.AcademiesByLocationFacadeResult;
import org.guzzing.studayserver.domain.academy.facade.dto.AcademiesByLocationWithScrollFacadeResult;
import org.guzzing.studayserver.domain.academy.service.AcademyService;
import org.guzzing.studayserver.domain.academy.service.dto.result.AcademiesByNameResults;
import org.guzzing.studayserver.domain.academy.service.dto.result.AcademiesFilterWithScrollResults;
import org.guzzing.studayserver.domain.academy.service.dto.result.AcademyFilterResults;
import org.guzzing.studayserver.domain.academy.service.dto.result.LessonInfoToCreateDashboardResults;
import org.guzzing.studayserver.domain.auth.memberId.MemberId;
import org.springframework.http.HttpStatus;
Expand Down Expand Up @@ -54,20 +48,6 @@ public ResponseEntity<AcademyGetResponse> getAcademy(
.body(AcademyGetResponse.from(academyService.getAcademy(academyId, memberId)));
}

@GetMapping(
path = "/complexes",
produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<AcademiesByLocationResponses> findByLocation(
@ModelAttribute @Valid AcademiesByLocationRequest request,
@MemberId Long memberId
) {
AcademiesByLocationFacadeResult response = academyFacade.findByLocation(
AcademiesByLocationRequest.to(request, memberId));

return ResponseEntity.status(HttpStatus.OK)
.body(AcademiesByLocationResponses.from(response));
}

@GetMapping(
path = "/complexes-scroll",
produces = MediaType.APPLICATION_JSON_VALUE)
Expand Down Expand Up @@ -95,20 +75,6 @@ public ResponseEntity<AcademiesByNameResponses> findByName(
.body(AcademiesByNameResponses.from(academiesByNameResults));
}

@GetMapping(
path = "/filter",
produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<AcademyFilterResponses> filterAcademies(
@ModelAttribute @Valid AcademyFilterRequest request,
@MemberId Long memberId
) {
AcademyFilterResults academyFilterResults = academyService.filterAcademies(
AcademyFilterRequest.to(request), memberId);

return ResponseEntity.status(HttpStatus.OK)
.body(AcademyFilterResponses.from(academyFilterResults));
}

@GetMapping(
path = "/filter-scroll",
produces = MediaType.APPLICATION_JSON_VALUE)
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ public static AcademiesByLocationWithScrollResponses from(
return new AcademiesByLocationWithScrollResponses(
academiesByLocationResult.academiesByLocationResults()
.stream()
.map(academiesByLocationFacadeResult ->
AcademyByLocationWithScrollResponse.from(
academiesByLocationFacadeResult))
.map(AcademyByLocationWithScrollResponse::from)
.toList(),
academiesByLocationResult.sido(),
academiesByLocationResult.sigungu(),
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
package org.guzzing.studayserver.domain.academy.facade;

import org.guzzing.studayserver.domain.academy.facade.dto.AcademiesByLocationFacadeParam;
import org.guzzing.studayserver.domain.academy.facade.dto.AcademiesByLocationFacadeResult;
import org.guzzing.studayserver.domain.academy.facade.dto.AcademiesByLocationWithScrollFacadeParam;
import org.guzzing.studayserver.domain.academy.facade.dto.AcademiesByLocationWithScrollFacadeResult;
import org.guzzing.studayserver.domain.academy.service.AcademyService;
import org.guzzing.studayserver.domain.academy.service.dto.result.AcademiesByLocationResults;
import org.guzzing.studayserver.domain.academy.service.dto.result.AcademiesByLocationWithScrollResults;
import org.guzzing.studayserver.domain.academy.util.GeometryUtil;
import org.guzzing.studayserver.domain.region.service.RegionService;
Expand All @@ -23,21 +20,7 @@ public AcademyFacade(RegionService regionService, AcademyService academyService)
this.academyService = academyService;
}

public AcademiesByLocationFacadeResult findByLocation(AcademiesByLocationFacadeParam param) {
AcademiesByLocationResults academiesByLocation = academyService.findAcademiesByLocation(
AcademiesByLocationFacadeParam.to(param));

RegionResult regionContainingPoint = regionService.findRegionContainingPoint(
GeometryUtil.createPoint(
param.lat(),
param.lng()));

return AcademiesByLocationFacadeResult.from(academiesByLocation, regionContainingPoint);
}


public AcademiesByLocationWithScrollFacadeResult findByLocationWithScroll(
AcademiesByLocationWithScrollFacadeParam param) {
public AcademiesByLocationWithScrollFacadeResult findByLocationWithScroll(AcademiesByLocationWithScrollFacadeParam param) {
AcademiesByLocationWithScrollResults academiesByLocationWithScroll = academyService.findAcademiesByLocationWithScroll(
AcademiesByLocationWithScrollFacadeParam.to(param));

Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
package org.guzzing.studayserver.domain.academy.repository.academy;

import java.util.List;
import org.guzzing.studayserver.domain.academy.repository.dto.AcademiesByFilterWithScroll;
import org.guzzing.studayserver.domain.academy.repository.dto.AcademiesByLocation;
import org.guzzing.studayserver.domain.academy.repository.dto.AcademiesByLocationWithScroll;
import org.guzzing.studayserver.domain.academy.repository.dto.AcademyByFiltering;
import org.guzzing.studayserver.domain.academy.repository.dto.AcademyFilterCondition;

public interface AcademyQueryRepository {

List<AcademiesByLocation> findAcademiesByLocation(String pointFormat, Long memberId);

List<AcademyByFiltering> filterAcademies(AcademyFilterCondition academyFilterCondition, Long memberId);

AcademiesByLocationWithScroll findAcademiesByLocation(
String pointFormat,
Long memberId,
Expand Down
Loading

0 comments on commit 34d637c

Please sign in to comment.