From d1848174efc703b5175383e44aceeb321b2f2dbe Mon Sep 17 00:00:00 2001 From: AzenKain Date: Sun, 24 May 2026 19:39:00 +0700 Subject: [PATCH] feat: initialize Swagger documentation and API schemas --- docs/docs.go | 203 ++++++++++++++++++++++++++++++++++++++++++++++ docs/swagger.json | 203 ++++++++++++++++++++++++++++++++++++++++++++++ docs/swagger.yaml | 132 ++++++++++++++++++++++++++++++ 3 files changed, 538 insertions(+) diff --git a/docs/docs.go b/docs/docs.go index 220ed67..d83fb6f 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -860,6 +860,44 @@ const docTemplate = `{ } } }, + "/geometries/bound-with/{bound_with}": { + "get": { + "description": "Get a list of geometries that are bound to the specified geometry ID", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Geometries" + ], + "summary": "Get geometries by bound_with ID", + "parameters": [ + { + "type": "string", + "description": "Bound-with Geometry ID", + "name": "bound_with", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse" + } + } + } + } + }, "/geometries/entity": { "get": { "description": "Search entities by name (cursor pagination) and return their linked geometries", @@ -2283,6 +2321,116 @@ const docTemplate = `{ } } }, + "/projects/{id}/heartbeat": { + "post": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "Refresh the TTL of the exclusive editing lock on a project for another 15 minutes", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Projects" + ], + "summary": "Heartbeat to refresh project lock", + "parameters": [ + { + "type": "string", + "description": "Project ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse" + } + }, + "409": { + "description": "Conflict", + "schema": { + "$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse" + } + } + } + } + }, + "/projects/{id}/lock": { + "post": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "Acquire an exclusive editing lock on a project for 15 minutes", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Projects" + ], + "summary": "Lock a project", + "parameters": [ + { + "type": "string", + "description": "Project ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse" + } + }, + "409": { + "description": "Conflict", + "schema": { + "$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse" + } + } + } + } + }, "/projects/{id}/members": { "post": { "security": [ @@ -2496,6 +2644,61 @@ const docTemplate = `{ } } }, + "/projects/{id}/unlock": { + "post": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "Release the exclusive editing lock on a project", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Projects" + ], + "summary": "Unlock a project", + "parameters": [ + { + "type": "string", + "description": "Project ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse" + } + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse" + } + } + } + } + }, "/proxy/{path}": { "get": { "description": "Transparent proxy for Goong APIs to forward body, params, headers and inject API key automatically.", diff --git a/docs/swagger.json b/docs/swagger.json index d077aeb..a56317c 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -853,6 +853,44 @@ } } }, + "/geometries/bound-with/{bound_with}": { + "get": { + "description": "Get a list of geometries that are bound to the specified geometry ID", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Geometries" + ], + "summary": "Get geometries by bound_with ID", + "parameters": [ + { + "type": "string", + "description": "Bound-with Geometry ID", + "name": "bound_with", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse" + } + } + } + } + }, "/geometries/entity": { "get": { "description": "Search entities by name (cursor pagination) and return their linked geometries", @@ -2276,6 +2314,116 @@ } } }, + "/projects/{id}/heartbeat": { + "post": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "Refresh the TTL of the exclusive editing lock on a project for another 15 minutes", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Projects" + ], + "summary": "Heartbeat to refresh project lock", + "parameters": [ + { + "type": "string", + "description": "Project ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse" + } + }, + "409": { + "description": "Conflict", + "schema": { + "$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse" + } + } + } + } + }, + "/projects/{id}/lock": { + "post": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "Acquire an exclusive editing lock on a project for 15 minutes", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Projects" + ], + "summary": "Lock a project", + "parameters": [ + { + "type": "string", + "description": "Project ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse" + } + }, + "409": { + "description": "Conflict", + "schema": { + "$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse" + } + } + } + } + }, "/projects/{id}/members": { "post": { "security": [ @@ -2489,6 +2637,61 @@ } } }, + "/projects/{id}/unlock": { + "post": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "Release the exclusive editing lock on a project", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Projects" + ], + "summary": "Unlock a project", + "parameters": [ + { + "type": "string", + "description": "Project ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse" + } + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse" + } + } + } + } + }, "/proxy/{path}": { "get": { "description": "Transparent proxy for Goong APIs to forward body, params, headers and inject API key automatically.", diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 1ba75b8..7000f2a 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -1287,6 +1287,32 @@ paths: summary: Get geometry by ID tags: - Geometries + /geometries/bound-with/{bound_with}: + get: + consumes: + - application/json + description: Get a list of geometries that are bound to the specified geometry + ID + parameters: + - description: Bound-with Geometry ID + in: path + name: bound_with + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/history-api_internal_dtos_response.CommonResponse' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/history-api_internal_dtos_response.CommonResponse' + summary: Get geometries by bound_with ID + tags: + - Geometries /geometries/entity: get: consumes: @@ -2145,6 +2171,77 @@ paths: summary: Restore project to a commit tags: - Commits + /projects/{id}/heartbeat: + post: + consumes: + - application/json + description: Refresh the TTL of the exclusive editing lock on a project for + another 15 minutes + parameters: + - description: Project ID + in: path + name: id + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/history-api_internal_dtos_response.CommonResponse' + "400": + description: Bad Request + schema: + $ref: '#/definitions/history-api_internal_dtos_response.CommonResponse' + "409": + description: Conflict + schema: + $ref: '#/definitions/history-api_internal_dtos_response.CommonResponse' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/history-api_internal_dtos_response.CommonResponse' + security: + - BearerAuth: [] + summary: Heartbeat to refresh project lock + tags: + - Projects + /projects/{id}/lock: + post: + consumes: + - application/json + description: Acquire an exclusive editing lock on a project for 15 minutes + parameters: + - description: Project ID + in: path + name: id + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/history-api_internal_dtos_response.CommonResponse' + "400": + description: Bad Request + schema: + $ref: '#/definitions/history-api_internal_dtos_response.CommonResponse' + "409": + description: Conflict + schema: + $ref: '#/definitions/history-api_internal_dtos_response.CommonResponse' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/history-api_internal_dtos_response.CommonResponse' + security: + - BearerAuth: [] + summary: Lock a project + tags: + - Projects /projects/{id}/members: post: consumes: @@ -2285,6 +2382,41 @@ paths: summary: Update member role tags: - Projects + /projects/{id}/unlock: + post: + consumes: + - application/json + description: Release the exclusive editing lock on a project + parameters: + - description: Project ID + in: path + name: id + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/history-api_internal_dtos_response.CommonResponse' + "400": + description: Bad Request + schema: + $ref: '#/definitions/history-api_internal_dtos_response.CommonResponse' + "403": + description: Forbidden + schema: + $ref: '#/definitions/history-api_internal_dtos_response.CommonResponse' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/history-api_internal_dtos_response.CommonResponse' + security: + - BearerAuth: [] + summary: Unlock a project + tags: + - Projects /projects/commits/{commitId}: get: consumes: