diff --git a/docs/docs.go b/docs/docs.go index f11e9a5..c161a7a 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -1661,6 +1661,61 @@ const docTemplate = `{ } } }, + "/projects/commits/{commitId}": { + "get": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "Retrieve a specific commit by its ID", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Commits" + ], + "summary": "Get commit by ID", + "parameters": [ + { + "type": "string", + "description": "Commit ID", + "name": "commitId", + "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" + } + }, + "404": { + "description": "Not Found", + "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}": { "get": { "security": [ @@ -2450,6 +2505,166 @@ const docTemplate = `{ } } }, + "/statistics": { + "get": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "Fetch daily system statistics with optional date range filtering", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Statistics" + ], + "summary": "Search system statistics", + "parameters": [ + { + "type": "string", + "description": "Start date in YYYY-MM-DD format", + "name": "start_date", + "in": "query" + }, + { + "type": "string", + "description": "End date in YYYY-MM-DD format", + "name": "end_date", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/history-api_internal_dtos_response.StatisticResponse" + } + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse" + } + }, + "401": { + "description": "Unauthorized", + "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" + } + } + } + } + }, + "/statistics/{date}": { + "get": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "Fetch system statistics for a specific date", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Statistics" + ], + "summary": "Get system statistics by date", + "parameters": [ + { + "type": "string", + "description": "Date in YYYY-MM-DD format", + "name": "date", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/history-api_internal_dtos_response.StatisticResponse" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse" + } + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse" + } + } + } + } + }, "/submissions": { "get": { "security": [ @@ -3311,6 +3526,62 @@ const docTemplate = `{ } } }, + "put": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "Update the profile details of any user", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Update user profile (Admin/Mod only)", + "parameters": [ + { + "type": "string", + "description": "User ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "Update Profile request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/history-api_internal_dtos_request.UpdateProfileDto" + } + } + ], + "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" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse" + } + } + } + }, "delete": { "security": [ { @@ -3429,6 +3700,64 @@ const docTemplate = `{ } } }, + "/users/{id}/password": { + "patch": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "Reset the password for any user without requiring the old password", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Reset user password (Admin/Mod only)", + "parameters": [ + { + "type": "string", + "description": "User ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "Reset Password request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/history-api_internal_dtos_request.ResetPasswordDto" + } + } + ], + "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" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse" + } + } + } + } + }, "/users/{id}/project": { "get": { "description": "Retrieve project list by specific user ID", @@ -4343,6 +4672,22 @@ const docTemplate = `{ } } }, + "history-api_internal_dtos_request.ResetPasswordDto": { + "type": "object", + "required": [ + "new_password" + ], + "properties": { + "is_send_email": { + "type": "boolean" + }, + "new_password": { + "type": "string", + "maxLength": 64, + "minLength": 8 + } + } + }, "history-api_internal_dtos_request.RestoreCommitDto": { "type": "object", "required": [ @@ -4627,6 +4972,74 @@ const docTemplate = `{ } } }, + "history-api_internal_dtos_response.StatisticResponse": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "date": { + "type": "string" + }, + "id": { + "type": "string" + }, + "new_commits": { + "type": "integer" + }, + "new_entities": { + "type": "integer" + }, + "new_geometries": { + "type": "integer" + }, + "new_medias": { + "type": "integer" + }, + "new_projects": { + "type": "integer" + }, + "new_storage_bytes": { + "type": "integer" + }, + "new_submissions": { + "type": "integer" + }, + "new_users": { + "type": "integer" + }, + "new_wikis": { + "type": "integer" + }, + "total_commits": { + "type": "integer" + }, + "total_entities": { + "type": "integer" + }, + "total_geometries": { + "type": "integer" + }, + "total_medias": { + "type": "integer" + }, + "total_projects": { + "type": "integer" + }, + "total_storage_bytes": { + "type": "integer" + }, + "total_submissions": { + "type": "integer" + }, + "total_users": { + "type": "integer" + }, + "total_wikis": { + "type": "integer" + } + } + }, "history-api_pkg_constants.TokenType": { "type": "integer", "format": "int32", diff --git a/docs/swagger.json b/docs/swagger.json index 2fa9b0d..e08b35b 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -1654,6 +1654,61 @@ } } }, + "/projects/commits/{commitId}": { + "get": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "Retrieve a specific commit by its ID", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Commits" + ], + "summary": "Get commit by ID", + "parameters": [ + { + "type": "string", + "description": "Commit ID", + "name": "commitId", + "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" + } + }, + "404": { + "description": "Not Found", + "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}": { "get": { "security": [ @@ -2443,6 +2498,166 @@ } } }, + "/statistics": { + "get": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "Fetch daily system statistics with optional date range filtering", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Statistics" + ], + "summary": "Search system statistics", + "parameters": [ + { + "type": "string", + "description": "Start date in YYYY-MM-DD format", + "name": "start_date", + "in": "query" + }, + { + "type": "string", + "description": "End date in YYYY-MM-DD format", + "name": "end_date", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/history-api_internal_dtos_response.StatisticResponse" + } + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse" + } + }, + "401": { + "description": "Unauthorized", + "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" + } + } + } + } + }, + "/statistics/{date}": { + "get": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "Fetch system statistics for a specific date", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Statistics" + ], + "summary": "Get system statistics by date", + "parameters": [ + { + "type": "string", + "description": "Date in YYYY-MM-DD format", + "name": "date", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/history-api_internal_dtos_response.StatisticResponse" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse" + } + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse" + } + } + } + } + }, "/submissions": { "get": { "security": [ @@ -3304,6 +3519,62 @@ } } }, + "put": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "Update the profile details of any user", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Update user profile (Admin/Mod only)", + "parameters": [ + { + "type": "string", + "description": "User ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "Update Profile request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/history-api_internal_dtos_request.UpdateProfileDto" + } + } + ], + "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" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse" + } + } + } + }, "delete": { "security": [ { @@ -3422,6 +3693,64 @@ } } }, + "/users/{id}/password": { + "patch": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "Reset the password for any user without requiring the old password", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Reset user password (Admin/Mod only)", + "parameters": [ + { + "type": "string", + "description": "User ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "Reset Password request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/history-api_internal_dtos_request.ResetPasswordDto" + } + } + ], + "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" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse" + } + } + } + } + }, "/users/{id}/project": { "get": { "description": "Retrieve project list by specific user ID", @@ -4336,6 +4665,22 @@ } } }, + "history-api_internal_dtos_request.ResetPasswordDto": { + "type": "object", + "required": [ + "new_password" + ], + "properties": { + "is_send_email": { + "type": "boolean" + }, + "new_password": { + "type": "string", + "maxLength": 64, + "minLength": 8 + } + } + }, "history-api_internal_dtos_request.RestoreCommitDto": { "type": "object", "required": [ @@ -4620,6 +4965,74 @@ } } }, + "history-api_internal_dtos_response.StatisticResponse": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "date": { + "type": "string" + }, + "id": { + "type": "string" + }, + "new_commits": { + "type": "integer" + }, + "new_entities": { + "type": "integer" + }, + "new_geometries": { + "type": "integer" + }, + "new_medias": { + "type": "integer" + }, + "new_projects": { + "type": "integer" + }, + "new_storage_bytes": { + "type": "integer" + }, + "new_submissions": { + "type": "integer" + }, + "new_users": { + "type": "integer" + }, + "new_wikis": { + "type": "integer" + }, + "total_commits": { + "type": "integer" + }, + "total_entities": { + "type": "integer" + }, + "total_geometries": { + "type": "integer" + }, + "total_medias": { + "type": "integer" + }, + "total_projects": { + "type": "integer" + }, + "total_storage_bytes": { + "type": "integer" + }, + "total_submissions": { + "type": "integer" + }, + "total_users": { + "type": "integer" + }, + "total_wikis": { + "type": "integer" + } + } + }, "history-api_pkg_constants.TokenType": { "type": "integer", "format": "int32", diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 658a9eb..e68ae20 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -398,6 +398,17 @@ definitions: required: - token_id type: object + history-api_internal_dtos_request.ResetPasswordDto: + properties: + is_send_email: + type: boolean + new_password: + maxLength: 64 + minLength: 8 + type: string + required: + - new_password + type: object history-api_internal_dtos_request.RestoreCommitDto: properties: commit_id: @@ -597,6 +608,51 @@ definitions: total_records: type: integer type: object + history-api_internal_dtos_response.StatisticResponse: + properties: + created_at: + type: string + date: + type: string + id: + type: string + new_commits: + type: integer + new_entities: + type: integer + new_geometries: + type: integer + new_medias: + type: integer + new_projects: + type: integer + new_storage_bytes: + type: integer + new_submissions: + type: integer + new_users: + type: integer + new_wikis: + type: integer + total_commits: + type: integer + total_entities: + type: integer + total_geometries: + type: integer + total_medias: + type: integer + total_projects: + type: integer + total_storage_bytes: + type: integer + total_submissions: + type: integer + total_users: + type: integer + total_wikis: + type: integer + type: object history-api_pkg_constants.TokenType: enum: - 1 @@ -2093,6 +2149,41 @@ paths: summary: Update member role tags: - Projects + /projects/commits/{commitId}: + get: + consumes: + - application/json + description: Retrieve a specific commit by its ID + parameters: + - description: Commit ID + in: path + name: commitId + 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' + "404": + description: Not Found + 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: Get commit by ID + tags: + - Commits /raster-tiles/{z}/{x}/{y}: get: description: Fetch vector or raster map tile data by Z, X, Y coordinates @@ -2197,6 +2288,103 @@ paths: summary: Get role by ID tags: - Roles + /statistics: + get: + consumes: + - application/json + description: Fetch daily system statistics with optional date range filtering + parameters: + - description: Start date in YYYY-MM-DD format + in: query + name: start_date + type: string + - description: End date in YYYY-MM-DD format + in: query + name: end_date + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/history-api_internal_dtos_response.CommonResponse' + - properties: + data: + items: + $ref: '#/definitions/history-api_internal_dtos_response.StatisticResponse' + type: array + type: object + "400": + description: Bad Request + schema: + $ref: '#/definitions/history-api_internal_dtos_response.CommonResponse' + "401": + description: Unauthorized + 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: Search system statistics + tags: + - Statistics + /statistics/{date}: + get: + consumes: + - application/json + description: Fetch system statistics for a specific date + parameters: + - description: Date in YYYY-MM-DD format + in: path + name: date + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/history-api_internal_dtos_response.CommonResponse' + - properties: + data: + $ref: '#/definitions/history-api_internal_dtos_response.StatisticResponse' + type: object + "400": + description: Bad Request + schema: + $ref: '#/definitions/history-api_internal_dtos_response.CommonResponse' + "401": + description: Unauthorized + schema: + $ref: '#/definitions/history-api_internal_dtos_response.CommonResponse' + "403": + description: Forbidden + schema: + $ref: '#/definitions/history-api_internal_dtos_response.CommonResponse' + "404": + description: Not Found + 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: Get system statistics by date + tags: + - Statistics /submissions: get: consumes: @@ -2615,6 +2803,42 @@ paths: summary: Get user by ID tags: - Users + put: + consumes: + - application/json + description: Update the profile details of any user + parameters: + - description: User ID + in: path + name: id + required: true + type: string + - description: Update Profile request + in: body + name: request + required: true + schema: + $ref: '#/definitions/history-api_internal_dtos_request.UpdateProfileDto' + 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' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/history-api_internal_dtos_response.CommonResponse' + security: + - BearerAuth: [] + summary: Update user profile (Admin/Mod only) + tags: + - Users /users/{id}/application: get: consumes: @@ -2665,6 +2889,43 @@ paths: summary: Get user's media by user ID tags: - Users + /users/{id}/password: + patch: + consumes: + - application/json + description: Reset the password for any user without requiring the old password + parameters: + - description: User ID + in: path + name: id + required: true + type: string + - description: Reset Password request + in: body + name: request + required: true + schema: + $ref: '#/definitions/history-api_internal_dtos_request.ResetPasswordDto' + 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' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/history-api_internal_dtos_response.CommonResponse' + security: + - BearerAuth: [] + summary: Reset user password (Admin/Mod only) + tags: + - Users /users/{id}/project: get: consumes: