-
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.
- Loading branch information
Showing
12 changed files
with
95 additions
and
254 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
16 changes: 5 additions & 11 deletions
16
src/main/java/ru/nsu/fit/directors/userservice/UserServiceApplication.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
106 changes: 0 additions & 106 deletions
106
src/main/java/ru/nsu/fit/directors/userservice/api/AbstractApi.java
This file was deleted.
Oops, something went wrong.
33 changes: 0 additions & 33 deletions
33
src/main/java/ru/nsu/fit/directors/userservice/api/DefaultApi.java
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
src/main/java/ru/nsu/fit/directors/userservice/api/EstablishmentApi.java
This file was deleted.
Oops, something went wrong.
43 changes: 43 additions & 0 deletions
43
src/main/java/ru/nsu/fit/directors/userservice/api/EstablishmentServiceClient.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,43 @@ | ||
package ru.nsu.fit.directors.userservice.api; | ||
|
||
import java.time.LocalDateTime; | ||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
import org.springframework.cloud.openfeign.FeignClient; | ||
import org.springframework.http.MediaType; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RequestMethod; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
import ru.nsu.fit.directors.userservice.dto.CompanyDto; | ||
import ru.nsu.fit.directors.userservice.dto.request.ReviewCreationDto; | ||
import ru.nsu.fit.directors.userservice.dto.response.EstablishmentListDto; | ||
import ru.nsu.fit.directors.userservice.dto.response.ResponseReviewDto; | ||
import ru.nsu.fit.directors.userservice.model.Company; | ||
|
||
@FeignClient("establishment-service") | ||
public interface EstablishmentServiceClient { | ||
@RequestMapping(method = RequestMethod.GET, value = "/establishment", produces = MediaType.APPLICATION_JSON_VALUE) | ||
Company getCompanyById(@RequestParam Long establishmentId); | ||
|
||
@RequestMapping(method = RequestMethod.GET, value = "/internal/establishment", produces = MediaType.APPLICATION_JSON_VALUE) | ||
List<CompanyDto> getCompaniesByIds(@RequestParam List<Long> ids); | ||
|
||
@RequestMapping(method = RequestMethod.GET, value = "/establishment/all", produces = MediaType.APPLICATION_JSON_VALUE) | ||
EstablishmentListDto searchEstablishments( | ||
@RequestParam Optional<String> name, | ||
@RequestParam Optional<Boolean> hasMap, | ||
@RequestParam Optional<Boolean> hasCardPayment, | ||
@RequestParam Optional<String> category | ||
); | ||
|
||
@RequestMapping(method = RequestMethod.GET, value = "/internal/review", produces = MediaType.APPLICATION_JSON_VALUE) | ||
List<ResponseReviewDto> getReviewsByExternalIds(@RequestParam List<Long> ids); | ||
|
||
@RequestMapping(method = RequestMethod.POST, value = "/internal/review", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) | ||
Long createReview(@RequestBody ReviewCreationDto reviewCreationDto); | ||
|
||
@RequestMapping(method = RequestMethod.GET, value = "/establishment/internal/time", produces = MediaType.APPLICATION_JSON_VALUE) | ||
List<LocalDateTime> getValidTimes(@RequestParam Long establishmentId); | ||
} |
13 changes: 0 additions & 13 deletions
13
src/main/java/ru/nsu/fit/directors/userservice/api/OrderApi.java
This file was deleted.
Oops, something went wrong.
20 changes: 20 additions & 0 deletions
20
src/main/java/ru/nsu/fit/directors/userservice/api/OrderServiceClient.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 ru.nsu.fit.directors.userservice.api; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
import org.springframework.cloud.openfeign.FeignClient; | ||
import org.springframework.http.MediaType; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RequestMethod; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
import ru.nsu.fit.directors.userservice.dto.response.ResponseOrderDto; | ||
|
||
@FeignClient("order-service") | ||
public interface OrderServiceClient { | ||
@RequestMapping(method = RequestMethod.GET, value = "/order", produces = MediaType.APPLICATION_JSON_VALUE) | ||
List<ResponseOrderDto> getUserOrders(@RequestParam Long userId, @RequestParam Optional<Integer> status); | ||
|
||
@RequestMapping(method = RequestMethod.GET, value = "/order/id", produces = MediaType.APPLICATION_JSON_VALUE) | ||
ResponseOrderDto getOrderById(@RequestParam Long id); | ||
} |
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
Oops, something went wrong.