diff --git a/src/main/java/agroscience/fields/v2/controllers/MeteoSlaveController.java b/src/main/java/agroscience/fields/v2/controllers/MeteoSlaveController.java new file mode 100644 index 0000000..26731be --- /dev/null +++ b/src/main/java/agroscience/fields/v2/controllers/MeteoSlaveController.java @@ -0,0 +1,18 @@ +package agroscience.fields.v2.controllers; + +import generated.agroscience.fields.api.MeteoSlaveApi; +import generated.agroscience.fields.api.model.MeteoResponse; +import java.util.List; +import java.util.UUID; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class MeteoSlaveController implements MeteoSlaveApi { + + @Override + public List coordinatesForMeteoService() { + return List.of(); + // TODO Отдавать координаты всех полей, нужно использовать JdbcTemplate. В сервисе можно использовать MeteoResponse + } + +} \ No newline at end of file diff --git a/src/main/java/agroscience/fields/v2/security/Constants.java b/src/main/java/agroscience/fields/v2/security/Constants.java index 9468544..73ae230 100644 --- a/src/main/java/agroscience/fields/v2/security/Constants.java +++ b/src/main/java/agroscience/fields/v2/security/Constants.java @@ -18,7 +18,8 @@ public class Constants { "/swagger-ui/**", "/webjars/**", "/swagger-ui.html", - "/docs" + "/docs", + "/api/internal/**" }; } \ No newline at end of file diff --git a/src/main/resources/openapi/openapi.yaml b/src/main/resources/openapi/openapi.yaml index 146c137..181b131 100644 --- a/src/main/resources/openapi/openapi.yaml +++ b/src/main/resources/openapi/openapi.yaml @@ -326,6 +326,27 @@ paths: '500': $ref: '#/components/responses/InternalError' + /api/internal/fields-service/fields/all-coordinates: + get: + tags: + - MeteoSlave + operationId: coordinatesForMeteoService + summary: Get coordinates for meteo service + responses: + '200': + description: List of fields by season with one element list with last crop rotation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/MeteoResponse' + '400': + $ref: '#/components/responses/BadRequest' + '500': + $ref: '#/components/responses/InternalError' + + /api/v2/fields-service/contours/{id}/crop-rotation: post: tags: @@ -638,6 +659,17 @@ components: - longitude - latitude + MeteoResponse: + allOf: + - $ref: '#/components/schemas/CoordinatesDTO' + - type: object + properties: + id: + type: string + format: uuid + required: + - id + UpdateContourDTO: discriminator: propertyName: contour