dev.crashteam.openapi.analytics.api.CategoriesApi Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of openapi-analytics Show documentation
Show all versions of openapi-analytics Show documentation
Generates jar artifact containing compiled openapi classes based on generated openapi yaml files
The newest version!
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.4.0).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package dev.crashteam.openapi.analytics.api;
import dev.crashteam.openapi.analytics.model.Categories;
import dev.crashteam.openapi.analytics.model.Category;
import dev.crashteam.openapi.analytics.model.CategoryProductsAnalytics;
import dev.crashteam.openapi.analytics.model.DailyCategoryAnalytics;
import org.springframework.format.annotation.DateTimeFormat;
import dev.crashteam.openapi.analytics.model.Error;
import dev.crashteam.openapi.analytics.model.GetCategories400Response;
import java.time.LocalDate;
import dev.crashteam.openapi.analytics.model.Marketplace;
import dev.crashteam.openapi.analytics.model.QueryPeriod;
import java.util.UUID;
import io.swagger.v3.oas.annotations.ExternalDocumentation;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.server.ServerWebExchange;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import org.springframework.http.codec.multipart.Part;
import javax.validation.Valid;
import javax.validation.constraints.*;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Generated;
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-04-04T20:14:40.494067127Z[Etc/UTC]", comments = "Generator version: 7.4.0")
@Validated
@Tag(name = "category", description = "the category API")
public interface CategoriesApi {
/**
* GET /categories/stats : Получение списка категорий
*
* @param xRequestID Уникальный идентификатор запроса к системе (required)
* @param mp (required)
* @param period (required)
* @param id Id категории (optional)
* @param sort Массив полей для сортировки. Если необходимо отсортировать по убыванию, то передавать перед именем параметра \"-\". Если по возрастанию - \"+\". Пример - \"?sort=+price,-count\". Это значит, что поле price отсортировано по возрастанию, а поле count по убиванию. (optional)
* @return Получен список категорий (status code 200)
* or Переданы ошибочные данные (status code 400)
* or Несанкционированный доступ, использовались неверные учетные данные. (status code 401)
* or Доступ запрещен. (status code 403)
* or Resource was not found (status code 404)
*/
@Operation(
operationId = "getCategories",
summary = "Получение списка категорий",
tags = { "category" },
responses = {
@ApiResponse(responseCode = "200", description = "Получен список категорий", content = {
@Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = Categories.class)))
}),
@ApiResponse(responseCode = "400", description = "Переданы ошибочные данные", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = GetCategories400Response.class))
}),
@ApiResponse(responseCode = "401", description = "Несанкционированный доступ, использовались неверные учетные данные.", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = Error.class))
}),
@ApiResponse(responseCode = "403", description = "Доступ запрещен.", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = Error.class))
}),
@ApiResponse(responseCode = "404", description = "Resource was not found", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = Error.class))
})
},
security = {
@SecurityRequirement(name = "bearer")
}
)
@RequestMapping(
method = RequestMethod.GET,
value = "/categories/stats",
produces = { "application/json" }
)
default Mono>> getCategories(
@NotNull @Parameter(name = "X-Request-ID", description = "Уникальный идентификатор запроса к системе", required = true, in = ParameterIn.HEADER) @RequestHeader(value = "X-Request-ID", required = true) UUID xRequestID,
@NotNull @Parameter(name = "mp", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "mp", required = true) Marketplace mp,
@NotNull @Parameter(name = "period", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "period", required = true) QueryPeriod period,
@Parameter(name = "id", description = "Id категории", in = ParameterIn.QUERY) @Valid @RequestParam(value = "id", required = false) Long id,
@Parameter(name = "sort", description = "Массив полей для сортировки. Если необходимо отсортировать по убыванию, то передавать перед именем параметра \"-\". Если по возрастанию - \"+\". Пример - \"?sort=+price,-count\". Это значит, что поле price отсортировано по возрастанию, а поле count по убиванию.", in = ParameterIn.QUERY) @Valid @RequestParam(value = "sort", required = false) List sort,
@Parameter(hidden = true) final ServerWebExchange exchange
) {
Mono result = Mono.empty();
exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED);
for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) {
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
String exampleString = "[ { \"analytics\" : { \"revenue\" : 5.962133916683182, \"revenue_per_product\" : 5.637376656633329, \"product_count\" : 7, \"order_amount\" : 2, \"order_per_product\" : 9.301444243932576, \"average_bill\" : 3.616076749251911, \"order_per_seller\" : 4.145608029883936, \"seller_count\" : 2 }, \"difference_percent\" : { \"revenue\" : 7.386281948385884, \"revenue_per_product\" : 1.2315135367772556, \"product_count\" : 1.4894159098541704, \"order_amount\" : 1.0246457001441578, \"order_per_product\" : 6.84685269835264, \"average_bill\" : 7.457744773683766, \"order_per_seller\" : 4.965218492984954, \"seller_count\" : 1.1730742509559433 }, \"previous_period_analytics\" : { \"revenue\" : 5.962133916683182, \"revenue_per_product\" : 5.637376656633329, \"product_count\" : 7, \"order_amount\" : 2, \"order_per_product\" : 9.301444243932576, \"average_bill\" : 3.616076749251911, \"order_per_seller\" : 4.145608029883936, \"seller_count\" : 2 }, \"category\" : { \"childrens\" : [ 1, 1 ], \"parent_id\" : 6, \"name\" : \"name\", \"id\" : 0 } }, { \"analytics\" : { \"revenue\" : 5.962133916683182, \"revenue_per_product\" : 5.637376656633329, \"product_count\" : 7, \"order_amount\" : 2, \"order_per_product\" : 9.301444243932576, \"average_bill\" : 3.616076749251911, \"order_per_seller\" : 4.145608029883936, \"seller_count\" : 2 }, \"difference_percent\" : { \"revenue\" : 7.386281948385884, \"revenue_per_product\" : 1.2315135367772556, \"product_count\" : 1.4894159098541704, \"order_amount\" : 1.0246457001441578, \"order_per_product\" : 6.84685269835264, \"average_bill\" : 7.457744773683766, \"order_per_seller\" : 4.965218492984954, \"seller_count\" : 1.1730742509559433 }, \"previous_period_analytics\" : { \"revenue\" : 5.962133916683182, \"revenue_per_product\" : 5.637376656633329, \"product_count\" : 7, \"order_amount\" : 2, \"order_per_product\" : 9.301444243932576, \"average_bill\" : 3.616076749251911, \"order_per_seller\" : 4.145608029883936, \"seller_count\" : 2 }, \"category\" : { \"childrens\" : [ 1, 1 ], \"parent_id\" : 6, \"name\" : \"name\", \"id\" : 0 } } ]";
result = ApiUtil.getExampleResponse(exchange, MediaType.valueOf("application/json"), exampleString);
break;
}
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
String exampleString = "{ \"code\" : \"invalidRequest\", \"message\" : \"message\" }";
result = ApiUtil.getExampleResponse(exchange, MediaType.valueOf("application/json"), exampleString);
break;
}
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
String exampleString = "{ \"error\" : \"error\", \"type\" : \"type\", \"title\" : \"title\", \"status\" : 351 }";
result = ApiUtil.getExampleResponse(exchange, MediaType.valueOf("application/json"), exampleString);
break;
}
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
String exampleString = "{ \"error\" : \"error\", \"type\" : \"type\", \"title\" : \"title\", \"status\" : 351 }";
result = ApiUtil.getExampleResponse(exchange, MediaType.valueOf("application/json"), exampleString);
break;
}
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
String exampleString = "{ \"error\" : \"error\", \"type\" : \"type\", \"title\" : \"title\", \"status\" : 351 }";
result = ApiUtil.getExampleResponse(exchange, MediaType.valueOf("application/json"), exampleString);
break;
}
}
return result.then(Mono.empty());
}
/**
* GET /categories/{id}/products/stats : Получение списка товаров в категории
*
* @param xRequestID Уникальный идентификатор запроса к системе (required)
* @param mp (required)
* @param id Id категории (required)
* @param period (required)
* @param sort Массив полей для сортировки. Если необходимо отсортировать по убыванию, то передавать перед именем параметра \"-\". Если по возрастанию - \"+\". Пример - \"?sort=+price,-count\". Это значит, что поле price отсортировано по возрастанию, а поле count по убиванию. (optional)
* @param filter Fields and values in the filter are separated with :: ?filter=firstName:John. Multiple filters are separated with ;: ?filter=firstName:John;lastName:Doe. They are joined with AND logic. Example: firstName:John AND lastName:Doe. To use multiple values, use , as values separators: ?filter=firstName:John,Bob. Multiple values specified for a field are joined with OR logic. Example: firstName:John OR firstName:Bob. To negate the filter, use !: ?filter=firstName:!John. To negate the filter, use ~ ?filter=firstName:~John. To negate multiple values, use: ?filter=firstName:!John,!Bob. This filter rule excludes all Johns and Bobs from the response. To use range filters, use: ?filter=amount:1..10. To use a gte (greater than or equals) filter, use: ?filter=amount:1... This also works for datetime-based fields. To use a lte (less than or equals) filter, use: ?filter=amount:..10. This also works for datetime-based fields. (optional)
* @param page Текущая страница (optional)
* @param limit Кол-во записей на странице (optional)
* @return Получен список товаров категории (status code 200)
* or Переданы ошибочные данные (status code 400)
* or Несанкционированный доступ, использовались неверные учетные данные. (status code 401)
* or Доступ запрещен. (status code 403)
* or Resource was not found (status code 404)
*/
@Operation(
operationId = "getCategoriesProducts",
summary = "Получение списка товаров в категории",
tags = { "category" },
responses = {
@ApiResponse(responseCode = "200", description = "Получен список товаров категории", content = {
@Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = CategoryProductsAnalytics.class)))
}),
@ApiResponse(responseCode = "400", description = "Переданы ошибочные данные", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = GetCategories400Response.class))
}),
@ApiResponse(responseCode = "401", description = "Несанкционированный доступ, использовались неверные учетные данные.", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = Error.class))
}),
@ApiResponse(responseCode = "403", description = "Доступ запрещен.", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = Error.class))
}),
@ApiResponse(responseCode = "404", description = "Resource was not found", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = Error.class))
})
},
security = {
@SecurityRequirement(name = "bearer")
}
)
@RequestMapping(
method = RequestMethod.GET,
value = "/categories/{id}/products/stats",
produces = { "application/json" }
)
default Mono>> getCategoriesProducts(
@NotNull @Parameter(name = "X-Request-ID", description = "Уникальный идентификатор запроса к системе", required = true, in = ParameterIn.HEADER) @RequestHeader(value = "X-Request-ID", required = true) UUID xRequestID,
@NotNull @Parameter(name = "mp", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "mp", required = true) Marketplace mp,
@Parameter(name = "id", description = "Id категории", required = true, in = ParameterIn.PATH) @PathVariable("id") Long id,
@NotNull @Parameter(name = "period", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "period", required = true) QueryPeriod period,
@Parameter(name = "sort", description = "Массив полей для сортировки. Если необходимо отсортировать по убыванию, то передавать перед именем параметра \"-\". Если по возрастанию - \"+\". Пример - \"?sort=+price,-count\". Это значит, что поле price отсортировано по возрастанию, а поле count по убиванию.", in = ParameterIn.QUERY) @Valid @RequestParam(value = "sort", required = false) List sort,
@Parameter(name = "filter", description = "Fields and values in the filter are separated with :: ?filter=firstName:John. Multiple filters are separated with ;: ?filter=firstName:John;lastName:Doe. They are joined with AND logic. Example: firstName:John AND lastName:Doe. To use multiple values, use , as values separators: ?filter=firstName:John,Bob. Multiple values specified for a field are joined with OR logic. Example: firstName:John OR firstName:Bob. To negate the filter, use !: ?filter=firstName:!John. To negate the filter, use ~ ?filter=firstName:~John. To negate multiple values, use: ?filter=firstName:!John,!Bob. This filter rule excludes all Johns and Bobs from the response. To use range filters, use: ?filter=amount:1..10. To use a gte (greater than or equals) filter, use: ?filter=amount:1... This also works for datetime-based fields. To use a lte (less than or equals) filter, use: ?filter=amount:..10. This also works for datetime-based fields.", in = ParameterIn.QUERY) @Valid @RequestParam(value = "filter", required = false) String filter,
@Parameter(name = "page", description = "Текущая страница", in = ParameterIn.QUERY) @Valid @RequestParam(value = "page", required = false) Long page,
@Parameter(name = "limit", description = "Кол-во записей на странице", in = ParameterIn.QUERY) @Valid @RequestParam(value = "limit", required = false) Long limit,
@Parameter(hidden = true) final ServerWebExchange exchange
) {
Mono result = Mono.empty();
exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED);
for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) {
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
String exampleString = "[ { \"revenue\" : 6.027456183070403, \"reviews_amount\" : 7, \"image_url\" : \"image_url\", \"price\" : 5.962133916683182, \"product_id\" : 0, \"order_amount\" : 1, \"rating\" : 2.3021358869347655, \"sales_chart\" : \"\", \"available_amount\" : 5, \"title\" : \"title\" }, { \"revenue\" : 6.027456183070403, \"reviews_amount\" : 7, \"image_url\" : \"image_url\", \"price\" : 5.962133916683182, \"product_id\" : 0, \"order_amount\" : 1, \"rating\" : 2.3021358869347655, \"sales_chart\" : \"\", \"available_amount\" : 5, \"title\" : \"title\" } ]";
result = ApiUtil.getExampleResponse(exchange, MediaType.valueOf("application/json"), exampleString);
break;
}
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
String exampleString = "{ \"code\" : \"invalidRequest\", \"message\" : \"message\" }";
result = ApiUtil.getExampleResponse(exchange, MediaType.valueOf("application/json"), exampleString);
break;
}
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
String exampleString = "{ \"error\" : \"error\", \"type\" : \"type\", \"title\" : \"title\", \"status\" : 351 }";
result = ApiUtil.getExampleResponse(exchange, MediaType.valueOf("application/json"), exampleString);
break;
}
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
String exampleString = "{ \"error\" : \"error\", \"type\" : \"type\", \"title\" : \"title\", \"status\" : 351 }";
result = ApiUtil.getExampleResponse(exchange, MediaType.valueOf("application/json"), exampleString);
break;
}
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
String exampleString = "{ \"error\" : \"error\", \"type\" : \"type\", \"title\" : \"title\", \"status\" : 351 }";
result = ApiUtil.getExampleResponse(exchange, MediaType.valueOf("application/json"), exampleString);
break;
}
}
return result.then(Mono.empty());
}
/**
* GET /categories/{id}/info : Получение данных о категории
*
* @param xRequestID Уникальный идентификатор запроса к системе (required)
* @param id Id категории (required)
* @param mp (required)
* @return Получены данных по категории (status code 200)
* or Переданы ошибочные данные (status code 400)
* or Несанкционированный доступ, использовались неверные учетные данные. (status code 401)
* or Доступ запрещен. (status code 403)
* or Resource was not found (status code 404)
*/
@Operation(
operationId = "getCategoryInfo",
summary = "Получение данных о категории",
tags = { "category" },
responses = {
@ApiResponse(responseCode = "200", description = "Получены данных по категории", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = Category.class))
}),
@ApiResponse(responseCode = "400", description = "Переданы ошибочные данные", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = GetCategories400Response.class))
}),
@ApiResponse(responseCode = "401", description = "Несанкционированный доступ, использовались неверные учетные данные.", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = Error.class))
}),
@ApiResponse(responseCode = "403", description = "Доступ запрещен.", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = Error.class))
}),
@ApiResponse(responseCode = "404", description = "Resource was not found", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = Error.class))
})
},
security = {
@SecurityRequirement(name = "bearer")
}
)
@RequestMapping(
method = RequestMethod.GET,
value = "/categories/{id}/info",
produces = { "application/json" }
)
default Mono> getCategoryInfo(
@NotNull @Parameter(name = "X-Request-ID", description = "Уникальный идентификатор запроса к системе", required = true, in = ParameterIn.HEADER) @RequestHeader(value = "X-Request-ID", required = true) UUID xRequestID,
@Parameter(name = "id", description = "Id категории", required = true, in = ParameterIn.PATH) @PathVariable("id") Long id,
@NotNull @Parameter(name = "mp", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "mp", required = true) Marketplace mp,
@Parameter(hidden = true) final ServerWebExchange exchange
) {
Mono result = Mono.empty();
exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED);
for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) {
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
String exampleString = "{ \"childrens\" : [ 1, 1 ], \"parent_id\" : 6, \"name\" : \"name\", \"id\" : 0 }";
result = ApiUtil.getExampleResponse(exchange, MediaType.valueOf("application/json"), exampleString);
break;
}
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
String exampleString = "{ \"code\" : \"invalidRequest\", \"message\" : \"message\" }";
result = ApiUtil.getExampleResponse(exchange, MediaType.valueOf("application/json"), exampleString);
break;
}
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
String exampleString = "{ \"error\" : \"error\", \"type\" : \"type\", \"title\" : \"title\", \"status\" : 351 }";
result = ApiUtil.getExampleResponse(exchange, MediaType.valueOf("application/json"), exampleString);
break;
}
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
String exampleString = "{ \"error\" : \"error\", \"type\" : \"type\", \"title\" : \"title\", \"status\" : 351 }";
result = ApiUtil.getExampleResponse(exchange, MediaType.valueOf("application/json"), exampleString);
break;
}
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
String exampleString = "{ \"error\" : \"error\", \"type\" : \"type\", \"title\" : \"title\", \"status\" : 351 }";
result = ApiUtil.getExampleResponse(exchange, MediaType.valueOf("application/json"), exampleString);
break;
}
}
return result.then(Mono.empty());
}
/**
* GET /categories/{id}/stats : Получение аналитики категории
*
* @param xRequestID Уникальный идентификатор запроса к системе (required)
* @param id Id категории (required)
* @param mp (required)
* @param startDate (required)
* @param endDate (required)
* @return Получена аналитика по категории (status code 200)
* or Переданы ошибочные данные (status code 400)
* or Несанкционированный доступ, использовались неверные учетные данные. (status code 401)
* or Доступ запрещен. (status code 403)
* or Resource was not found (status code 404)
*/
@Operation(
operationId = "getCurrentCategories",
summary = "Получение аналитики категории",
tags = { "category" },
responses = {
@ApiResponse(responseCode = "200", description = "Получена аналитика по категории", content = {
@Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = DailyCategoryAnalytics.class)))
}),
@ApiResponse(responseCode = "400", description = "Переданы ошибочные данные", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = GetCategories400Response.class))
}),
@ApiResponse(responseCode = "401", description = "Несанкционированный доступ, использовались неверные учетные данные.", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = Error.class))
}),
@ApiResponse(responseCode = "403", description = "Доступ запрещен.", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = Error.class))
}),
@ApiResponse(responseCode = "404", description = "Resource was not found", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = Error.class))
})
},
security = {
@SecurityRequirement(name = "bearer")
}
)
@RequestMapping(
method = RequestMethod.GET,
value = "/categories/{id}/stats",
produces = { "application/json" }
)
default Mono>> getCurrentCategories(
@NotNull @Parameter(name = "X-Request-ID", description = "Уникальный идентификатор запроса к системе", required = true, in = ParameterIn.HEADER) @RequestHeader(value = "X-Request-ID", required = true) UUID xRequestID,
@Parameter(name = "id", description = "Id категории", required = true, in = ParameterIn.PATH) @PathVariable("id") Long id,
@NotNull @Parameter(name = "mp", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "mp", required = true) Marketplace mp,
@NotNull @Pattern(regexp = "YYYY-MM-DD") @Parameter(name = "startDate", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "startDate", required = true) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate startDate,
@NotNull @Pattern(regexp = "YYYY-MM-DD") @Parameter(name = "endDate", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "endDate", required = true) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate endDate,
@Parameter(hidden = true) final ServerWebExchange exchange
) {
Mono result = Mono.empty();
exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED);
for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) {
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
String exampleString = "[ { \"date\" : \"2017-01-01\", \"remainings\" : 5, \"revenue\" : 0.8008281904610115, \"average_bill\" : 6.027456183070403, \"sales\" : 1 }, { \"date\" : \"2017-01-01\", \"remainings\" : 5, \"revenue\" : 0.8008281904610115, \"average_bill\" : 6.027456183070403, \"sales\" : 1 } ]";
result = ApiUtil.getExampleResponse(exchange, MediaType.valueOf("application/json"), exampleString);
break;
}
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
String exampleString = "{ \"code\" : \"invalidRequest\", \"message\" : \"message\" }";
result = ApiUtil.getExampleResponse(exchange, MediaType.valueOf("application/json"), exampleString);
break;
}
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
String exampleString = "{ \"error\" : \"error\", \"type\" : \"type\", \"title\" : \"title\", \"status\" : 351 }";
result = ApiUtil.getExampleResponse(exchange, MediaType.valueOf("application/json"), exampleString);
break;
}
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
String exampleString = "{ \"error\" : \"error\", \"type\" : \"type\", \"title\" : \"title\", \"status\" : 351 }";
result = ApiUtil.getExampleResponse(exchange, MediaType.valueOf("application/json"), exampleString);
break;
}
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
String exampleString = "{ \"error\" : \"error\", \"type\" : \"type\", \"title\" : \"title\", \"status\" : 351 }";
result = ApiUtil.getExampleResponse(exchange, MediaType.valueOf("application/json"), exampleString);
break;
}
}
return result.then(Mono.empty());
}
}