Skip to content

Commit

Permalink
61 Add put to fields and seasons api (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
asavershin authored Oct 28, 2024
1 parent b61e673 commit 0f55528
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import agroscience.fields.v2.mappers.FieldMapperV2;
import agroscience.fields.v2.services.FieldsService;
import generated.agroscience.fields.api.FieldsApi;
import generated.agroscience.fields.api.model.FieldBaseDTO;
import generated.agroscience.fields.api.model.FieldDTO;
import generated.agroscience.fields.api.model.FieldWithContoursAndCropRotationsDTO;
import generated.agroscience.fields.api.model.IdDTO;
Expand All @@ -20,6 +21,11 @@ public class FieldsController implements FieldsApi {
private final FieldMapperV2 fieldMapperV2;
private final FieldsService fieldService;

@Override
public void changeField(UUID fieldId, FieldBaseDTO fieldBaseDTO) {
// TODO обновлять
}

@Override
public void deleteField(UUID fieldId) {
// TODO По факту не удаляем, а просто ставим флажок, что архивировано. С вложенными объектами также
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ public class SeasonsController implements SeasonsApi, SecurityController {
private final SeasonsService seasonsService;
private final SeasonMapper seasonsMapper;

@Override
public void changeSeason(UUID seasonId, SeasonBaseDTO seasonBaseDTO) {
// TODO обновлять
}

@Override
public void deleteSeason(UUID seasonId) {
// TODO Не удаляем, архивируем
Expand Down
45 changes: 45 additions & 0 deletions src/main/resources/openapi/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,28 @@ paths:
schema:
$ref: '#/components/schemas/IdDTO'

put:
tags:
- Seasons
operationId: changeSeason
summary: Change season
parameters:
- name: seasonId
in: query
required: true
schema:
type: string
format: uuid
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/SeasonBaseDTO'
responses:
'200':
description: Changed

delete:
tags:
- Seasons
Expand Down Expand Up @@ -230,6 +252,28 @@ paths:
'200':
description: Field deleted

put:
tags:
- Fields
operationId: changeField
summary: Change field
parameters:
- name: fieldId
in: query
required: true
schema:
type: string
format: uuid
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/FieldBaseDTO'
responses:
'200':
description: Changed

/api/v2/fields-service/contours/{contourId}/crop-rotation:
post:
tags:
Expand Down Expand Up @@ -428,6 +472,7 @@ components:
type: string
format: date
required:
- name
- startDate
- endDate

Expand Down

0 comments on commit 0f55528

Please sign in to comment.