refactor(pcp-request-service): rename REST endpoints and DTOs for clarity
- GET /v1/requests/with-geometry → /v1/requests/map
- GET /v1/requests/{id}/with-cells → /v1/requests/{id}/cells
- GET /v1/cells/with-requests → /v1/cells/priority-map
- CreateRequestRequestDto → CreateRequestDto
- ListRequestsQueryDto → RequestListFilter
- RequestWithGeometry* → RequestMap* (RequestMapItemDto, RequestMapPageDto)
- CellsWithRequestsResponseDto → CellPriorityMapResponseDto
- DeleteRequestStatusDto removed; status field removed from DeleteRequestResponseDto
Updated all consumers (pcp-complex-mission-service, pcp-ui-service, slots-service),
tests, and OpenAPI YAML.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -10,6 +10,7 @@ info:
|
||||
- заявка создается через POST /v1/requests;
|
||||
- чтение одной заявки выполняется через GET /v1/requests/{id};
|
||||
- чтение списка заявок выполняется через GET /v1/requests;
|
||||
- чтение списка заявок с geometry выполняется через GET /v1/requests/map;
|
||||
- удаление заявки выполняется через DELETE /v1/requests/{id};
|
||||
- удаление является мягким: заявка получает status = DELETED и deletedAt;
|
||||
- заявка должна содержать хотя бы один payload-блок: optics или rsa;
|
||||
@@ -106,14 +107,15 @@ paths:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
/v1/cells/with-requests:
|
||||
/v1/cells/priority-map:
|
||||
get:
|
||||
tags:
|
||||
- Cells
|
||||
summary: Получить ячейки сетки с фрагментами заявок
|
||||
description: |
|
||||
Возвращает список ячеек сетки вместе с фрагментами заявок, пересекающими каждую ячейку.
|
||||
operationId: listCellsWithRequests
|
||||
Используется для построения тепловой карты приоритетов.
|
||||
operationId: listCellsPriorityMap
|
||||
parameters:
|
||||
- name: minImportance
|
||||
in: query
|
||||
@@ -143,7 +145,7 @@ paths:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/CellsWithRequestsResponse'
|
||||
$ref: '#/components/schemas/CellPriorityMapResponse'
|
||||
'400':
|
||||
description: Некорректные query parameters
|
||||
content:
|
||||
@@ -304,7 +306,8 @@ paths:
|
||||
Возвращает постраничный список заявок.
|
||||
|
||||
По умолчанию удаленные заявки не возвращаются. Для технического поиска можно передать includeDeleted=true.
|
||||
Полная geometry не возвращается в списке по умолчанию; для полной заявки используйте GET /v1/requests/{id}.
|
||||
Полная geometry не возвращается в списке по умолчанию; для списка с geometry используйте GET /v1/requests/map,
|
||||
для полной заявки используйте GET /v1/requests/{id}.
|
||||
operationId: listRequests
|
||||
parameters:
|
||||
- name: status
|
||||
@@ -415,7 +418,127 @@ paths:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
/v1/requests/{requestId}/with-cells:
|
||||
/v1/requests/map:
|
||||
get:
|
||||
tags:
|
||||
- Requests
|
||||
summary: Получить список заявок с геометрией для карты
|
||||
description: |
|
||||
Возвращает постраничный список заявок с полной geometry в WKT.
|
||||
|
||||
Endpoint использует те же фильтры и сортировку, что GET /v1/requests, но возвращает расширенную read-модель.
|
||||
Используйте его только там, где клиенту действительно нужна геометрия списка (например, для отображения на карте).
|
||||
operationId: listRequestsForMap
|
||||
parameters:
|
||||
- name: status
|
||||
in: query
|
||||
required: false
|
||||
description: Фильтр по статусу заявки
|
||||
schema:
|
||||
$ref: '#/components/schemas/RequestStatus'
|
||||
- name: surveyType
|
||||
in: query
|
||||
required: false
|
||||
description: Фильтр по вычисленному типу заявки
|
||||
schema:
|
||||
$ref: '#/components/schemas/SurveyType'
|
||||
- name: kpp
|
||||
in: query
|
||||
required: false
|
||||
description: Фильтр по номеру КПП. Возвращает заявки, содержащие указанный КПП.
|
||||
schema:
|
||||
type: integer
|
||||
example: 1
|
||||
- name: highPriorityTransmit
|
||||
in: query
|
||||
required: false
|
||||
description: Фильтр по признаку высокоприоритетной передачи
|
||||
schema:
|
||||
type: boolean
|
||||
- name: beginFrom
|
||||
in: query
|
||||
required: false
|
||||
description: Нижняя граница beginDateTime, включительно
|
||||
schema:
|
||||
type: string
|
||||
format: date-time
|
||||
- name: beginTo
|
||||
in: query
|
||||
required: false
|
||||
description: Верхняя граница beginDateTime, включительно
|
||||
schema:
|
||||
type: string
|
||||
format: date-time
|
||||
- name: endFrom
|
||||
in: query
|
||||
required: false
|
||||
description: Нижняя граница endDateTime, включительно
|
||||
schema:
|
||||
type: string
|
||||
format: date-time
|
||||
- name: endTo
|
||||
in: query
|
||||
required: false
|
||||
description: Верхняя граница endDateTime, включительно
|
||||
schema:
|
||||
type: string
|
||||
format: date-time
|
||||
- name: includeDeleted
|
||||
in: query
|
||||
required: false
|
||||
description: Включать soft-deleted заявки в результат
|
||||
schema:
|
||||
type: boolean
|
||||
default: false
|
||||
- name: page
|
||||
in: query
|
||||
required: false
|
||||
description: Номер страницы, начиная с 0
|
||||
schema:
|
||||
type: integer
|
||||
minimum: 0
|
||||
default: 0
|
||||
- name: size
|
||||
in: query
|
||||
required: false
|
||||
description: Размер страницы
|
||||
schema:
|
||||
type: integer
|
||||
minimum: 1
|
||||
maximum: 500
|
||||
default: 50
|
||||
- name: sort
|
||||
in: query
|
||||
required: false
|
||||
description: Сортировка в формате field,direction. Разрешенные поля зависят от реализации.
|
||||
schema:
|
||||
type: string
|
||||
default: createdAt,desc
|
||||
examples:
|
||||
createdDesc:
|
||||
value: createdAt,desc
|
||||
beginAsc:
|
||||
value: beginDateTime,asc
|
||||
responses:
|
||||
'200':
|
||||
description: Список заявок с геометрией
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/RequestMapPageResponse'
|
||||
'400':
|
||||
description: Некорректные query parameters
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
'500':
|
||||
description: Внутренняя ошибка сервера
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
/v1/requests/{id}/cells:
|
||||
get:
|
||||
tags:
|
||||
- Cells
|
||||
@@ -425,7 +548,7 @@ paths:
|
||||
Возвращает заявку и проекцию ее пересечений с ячейками сетки.
|
||||
operationId: getRequestWithCells
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/RequestIdWithCellsPathParam'
|
||||
- $ref: '#/components/parameters/RequestIdPathParam'
|
||||
responses:
|
||||
'200':
|
||||
description: Заявка с привязанными ячейками
|
||||
@@ -500,7 +623,6 @@ paths:
|
||||
$ref: '#/components/schemas/DeleteRequestResponse'
|
||||
example:
|
||||
id: 3fa85f64-5717-4562-b3fc-2c963f66afa6
|
||||
status: DELETED
|
||||
deletedAt: '2026-05-19T13:00:00Z'
|
||||
'404':
|
||||
description: Заявка не найдена
|
||||
@@ -609,15 +731,6 @@ components:
|
||||
type: string
|
||||
format: uuid
|
||||
example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
|
||||
RequestIdWithCellsPathParam:
|
||||
name: requestId
|
||||
in: path
|
||||
required: true
|
||||
description: Идентификатор заявки
|
||||
schema:
|
||||
type: string
|
||||
format: uuid
|
||||
example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
|
||||
schemas:
|
||||
CreateRequestRequest:
|
||||
type: object
|
||||
@@ -921,12 +1034,125 @@ components:
|
||||
minimum: 0
|
||||
example: 1
|
||||
additionalProperties: false
|
||||
RequestMapItemResponse:
|
||||
type: object
|
||||
description: Краткая карточка заявки с полной геометрией для GET /v1/requests/map
|
||||
required:
|
||||
- id
|
||||
- name
|
||||
- status
|
||||
- surveyType
|
||||
- geometry
|
||||
- importance
|
||||
- beginDateTime
|
||||
- endDateTime
|
||||
- highPriorityTransmit
|
||||
- coveragePercent
|
||||
- createdAt
|
||||
- updatedAt
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
format: uuid
|
||||
description: Идентификатор заявки
|
||||
example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
|
||||
name:
|
||||
type: string
|
||||
minLength: 1
|
||||
maxLength: 255
|
||||
description: Наименование задания.
|
||||
example: Тест1
|
||||
status:
|
||||
$ref: '#/components/schemas/RequestStatus'
|
||||
surveyType:
|
||||
$ref: '#/components/schemas/SurveyType'
|
||||
geometry:
|
||||
type: string
|
||||
format: wkt
|
||||
description: Полная геометрия заявки в формате WKT
|
||||
example: POLYGON ((37.5 55.5, 37.7 55.5, 37.7 55.7, 37.5 55.7, 37.5 55.5))
|
||||
importance:
|
||||
type: number
|
||||
format: double
|
||||
minimum: 0
|
||||
description: Важность заявки, используемая при расчете важности ячеек сетки.
|
||||
example: 10.0
|
||||
beginDateTime:
|
||||
type: string
|
||||
format: date-time
|
||||
example: '2026-01-01T00:00:00Z'
|
||||
endDateTime:
|
||||
type: string
|
||||
format: date-time
|
||||
example: '2026-01-31T23:59:59Z'
|
||||
kpp:
|
||||
type: array
|
||||
items:
|
||||
type: integer
|
||||
description: Список номеров КПП для сброса
|
||||
example: [1, 2, 3]
|
||||
highPriorityTransmit:
|
||||
type: boolean
|
||||
example: false
|
||||
coveragePercent:
|
||||
type: number
|
||||
format: double
|
||||
minimum: 0
|
||||
maximum: 100
|
||||
description: Текущий процент покрытия заявки
|
||||
example: 35.5
|
||||
createdAt:
|
||||
type: string
|
||||
format: date-time
|
||||
example: '2026-05-19T12:00:00Z'
|
||||
updatedAt:
|
||||
type: string
|
||||
format: date-time
|
||||
example: '2026-05-19T12:30:00Z'
|
||||
deletedAt:
|
||||
type: string
|
||||
format: date-time
|
||||
nullable: true
|
||||
description: Дата-время soft delete. Обычно отсутствует/null при includeDeleted=false.
|
||||
example: null
|
||||
additionalProperties: false
|
||||
RequestMapPageResponse:
|
||||
type: object
|
||||
description: Постраничный список заявок с полной геометрией для GET /v1/requests/map
|
||||
required:
|
||||
- items
|
||||
- page
|
||||
- size
|
||||
- totalItems
|
||||
- totalPages
|
||||
properties:
|
||||
items:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/RequestMapItemResponse'
|
||||
page:
|
||||
type: integer
|
||||
minimum: 0
|
||||
example: 0
|
||||
size:
|
||||
type: integer
|
||||
minimum: 1
|
||||
example: 50
|
||||
totalItems:
|
||||
type: integer
|
||||
format: int64
|
||||
minimum: 0
|
||||
example: 1
|
||||
totalPages:
|
||||
type: integer
|
||||
minimum: 0
|
||||
example: 1
|
||||
additionalProperties: false
|
||||
DeleteRequestResponse:
|
||||
type: object
|
||||
description: Ответ на soft delete заявки
|
||||
required:
|
||||
- id
|
||||
- status
|
||||
- deletedAt
|
||||
properties:
|
||||
id:
|
||||
@@ -934,12 +1160,6 @@ components:
|
||||
format: uuid
|
||||
description: Идентификатор заявки
|
||||
example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
|
||||
status:
|
||||
type: string
|
||||
enum:
|
||||
- DELETED
|
||||
description: Итоговый статус после soft delete
|
||||
example: DELETED
|
||||
deletedAt:
|
||||
type: string
|
||||
format: date-time
|
||||
@@ -1091,9 +1311,9 @@ components:
|
||||
description: Важность заявки для расчета важности ячейки
|
||||
example: 10.0
|
||||
additionalProperties: false
|
||||
CellsWithRequestsResponse:
|
||||
CellPriorityMapResponse:
|
||||
type: object
|
||||
description: Список ячеек сетки с фрагментами заявок
|
||||
description: Список ячеек сетки с фрагментами заявок для GET /v1/cells/priority-map
|
||||
required:
|
||||
- items
|
||||
properties:
|
||||
|
||||
Reference in New Issue
Block a user