Appearance
Update AOI API
API Information
- Request Path:
/aoi/update/aoi - Request Method:
POST - Content-Type:
application/json
Request Headers
| Parameter | Type | Required | Description |
|---|---|---|---|
| Authorization | String | Yes | User authentication token |
| Content-Type | String | Yes | Must be set to application/json |
Request Body Structure
UpdateAoiReq Object
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| id | Long | Yes | AOI ID | Must be valid AOI ID |
| aoiName | String | No | AOI name | Optional |
| geoAoi | String | No | Geometry in WKT format | Optional valid WKT geometry |
| area | String | No | Area value | Optional |
| lngLat | String | No | Longitude and latitude coordinates | Optional coordinate string |
| geometry | Geometry | No | PostGIS geometry object | Optional PostGIS geometry |
Request Body Example
json
{
"id": 12345,
"aoiName": "Updated Shanghai Coastal Area",
"geoAoi": "POLYGON((121.2 30.6, 121.8 30.6, 121.8 31.4, 121.2 31.4, 121.2 30.6))",
"area": "11000.50",
"lngLat": "121.5,31.0"
}Response Body Structure
CommonResponse Object
| Field | Type | Description |
|---|---|---|
| code | Integer | Response status code |
| message | String | Response message |
| data | Boolean | Update result, true indicates success |
Response Examples
Success Response
json
{
"code": 200,
"message": "success",
"data": true
}Failure Response
json
{
"code": 404,
"message": "AOI not found",
"data": false
}Error Code Description
| Error Code | Description |
|---|---|
| 200 | Success |
| 400 | Request parameter error |
| 401 | Unauthorized |
| 404 | AOI not found |
| 500 | Server internal error |
Usage Instructions
- This API is used to update an existing Area of Interest (AOI)
- User authentication is required
- AOI ID is required to identify which AOI to update
- Only AOI owners can update their AOIs
- Returns boolean indicating update success
Notes
- AOI ID is required and cannot be null
- Only fields that are provided will be updated
- Geometry must be in valid WKT format if provided
- User authentication token must be included in request headers