init
Some checks failed
Build and Release / release (push) Failing after 51s

This commit is contained in:
2026-03-25 22:29:07 +07:00
parent eedd300861
commit 79199f627d
65 changed files with 3215 additions and 689 deletions

322
docs/docs.go Normal file
View File

@@ -0,0 +1,322 @@
// Package docs Code generated by swaggo/swag. DO NOT EDIT
package docs
import "github.com/swaggo/swag"
const docTemplate = `{
"schemes": {{ marshal .Schemes }},
"swagger": "2.0",
"info": {
"description": "{{escape .Description}}",
"title": "{{.Title}}",
"termsOfService": "http://swagger.io/terms/",
"contact": {
"name": "API Support",
"url": "http://www.swagger.io/support",
"email": "support@swagger.io"
},
"license": {
"name": "Apache 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
},
"version": "{{.Version}}"
},
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
"/auth/refresh": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get a new access token using the user's current session/refresh token",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Auth"
],
"summary": "Refresh access token",
"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"
}
}
}
}
},
"/auth/signin": {
"post": {
"description": "Authenticate user and return token data",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Auth"
],
"summary": "Sign in an existing user",
"parameters": [
{
"description": "Sign In request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_request.SignInDto"
}
}
],
"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"
}
}
}
}
},
"/auth/signup": {
"post": {
"description": "Create a new user account",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Auth"
],
"summary": "Sign up a new user",
"parameters": [
{
"description": "Sign Up request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_request.SignUpDto"
}
}
],
"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"
}
}
}
}
},
"/tiles/metadata": {
"get": {
"description": "Retrieve map metadata",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Tile"
],
"summary": "Get tile metadata",
"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"
}
}
}
}
},
"/tiles/{z}/{x}/{y}": {
"get": {
"description": "Fetch vector or raster map tile data by Z, X, Y coordinates",
"produces": [
"application/octet-stream"
],
"tags": [
"Tile"
],
"summary": "Get a map tile",
"parameters": [
{
"type": "integer",
"description": "Zoom level (0-22)",
"name": "z",
"in": "path",
"required": true
},
{
"type": "integer",
"description": "X coordinate",
"name": "x",
"in": "path",
"required": true
},
{
"type": "integer",
"description": "Y coordinate",
"name": "y",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "file"
}
},
"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"
}
}
}
}
}
},
"definitions": {
"history-api_internal_dtos_request.SignInDto": {
"type": "object",
"required": [
"email",
"password"
],
"properties": {
"email": {
"type": "string",
"maxLength": 255,
"minLength": 5
},
"password": {
"type": "string",
"maxLength": 64,
"minLength": 8
}
}
},
"history-api_internal_dtos_request.SignUpDto": {
"type": "object",
"required": [
"display_name",
"email",
"password"
],
"properties": {
"display_name": {
"type": "string",
"maxLength": 50,
"minLength": 2
},
"email": {
"type": "string",
"maxLength": 255,
"minLength": 5
},
"password": {
"type": "string",
"maxLength": 64,
"minLength": 8
}
}
},
"history-api_internal_dtos_response.CommonResponse": {
"type": "object",
"properties": {
"data": {},
"message": {
"type": "string"
},
"status": {
"type": "boolean"
}
}
}
},
"securityDefinitions": {
"BearerAuth": {
"description": "Type \"Bearer \" followed by a space and JWT token.",
"type": "apiKey",
"name": "Authorization",
"in": "header"
}
}
}`
// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = &swag.Spec{
Version: "1.0",
Host: "localhost:3344",
BasePath: "/",
Schemes: []string{},
Title: "History API",
Description: "This is a sample server for History API.",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
LeftDelim: "{{",
RightDelim: "}}",
}
func init() {
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
}

6
docs/embed.go Normal file
View File

@@ -0,0 +1,6 @@
package docs
import _ "embed"
//go:embed swagger.json
var SwaggerJSON []byte

298
docs/swagger.json Normal file
View File

@@ -0,0 +1,298 @@
{
"swagger": "2.0",
"info": {
"description": "This is a sample server for History API.",
"title": "History API",
"termsOfService": "http://swagger.io/terms/",
"contact": {
"name": "API Support",
"url": "http://www.swagger.io/support",
"email": "support@swagger.io"
},
"license": {
"name": "Apache 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
},
"version": "1.0"
},
"host": "localhost:3344",
"basePath": "/",
"paths": {
"/auth/refresh": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get a new access token using the user's current session/refresh token",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Auth"
],
"summary": "Refresh access token",
"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"
}
}
}
}
},
"/auth/signin": {
"post": {
"description": "Authenticate user and return token data",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Auth"
],
"summary": "Sign in an existing user",
"parameters": [
{
"description": "Sign In request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_request.SignInDto"
}
}
],
"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"
}
}
}
}
},
"/auth/signup": {
"post": {
"description": "Create a new user account",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Auth"
],
"summary": "Sign up a new user",
"parameters": [
{
"description": "Sign Up request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_request.SignUpDto"
}
}
],
"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"
}
}
}
}
},
"/tiles/metadata": {
"get": {
"description": "Retrieve map metadata",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Tile"
],
"summary": "Get tile metadata",
"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"
}
}
}
}
},
"/tiles/{z}/{x}/{y}": {
"get": {
"description": "Fetch vector or raster map tile data by Z, X, Y coordinates",
"produces": [
"application/octet-stream"
],
"tags": [
"Tile"
],
"summary": "Get a map tile",
"parameters": [
{
"type": "integer",
"description": "Zoom level (0-22)",
"name": "z",
"in": "path",
"required": true
},
{
"type": "integer",
"description": "X coordinate",
"name": "x",
"in": "path",
"required": true
},
{
"type": "integer",
"description": "Y coordinate",
"name": "y",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "file"
}
},
"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"
}
}
}
}
}
},
"definitions": {
"history-api_internal_dtos_request.SignInDto": {
"type": "object",
"required": [
"email",
"password"
],
"properties": {
"email": {
"type": "string",
"maxLength": 255,
"minLength": 5
},
"password": {
"type": "string",
"maxLength": 64,
"minLength": 8
}
}
},
"history-api_internal_dtos_request.SignUpDto": {
"type": "object",
"required": [
"display_name",
"email",
"password"
],
"properties": {
"display_name": {
"type": "string",
"maxLength": 50,
"minLength": 2
},
"email": {
"type": "string",
"maxLength": 255,
"minLength": 5
},
"password": {
"type": "string",
"maxLength": 64,
"minLength": 8
}
}
},
"history-api_internal_dtos_response.CommonResponse": {
"type": "object",
"properties": {
"data": {},
"message": {
"type": "string"
},
"status": {
"type": "boolean"
}
}
}
},
"securityDefinitions": {
"BearerAuth": {
"description": "Type \"Bearer \" followed by a space and JWT token.",
"type": "apiKey",
"name": "Authorization",
"in": "header"
}
}
}

202
docs/swagger.yaml Normal file
View File

@@ -0,0 +1,202 @@
basePath: /
definitions:
history-api_internal_dtos_request.SignInDto:
properties:
email:
maxLength: 255
minLength: 5
type: string
password:
maxLength: 64
minLength: 8
type: string
required:
- email
- password
type: object
history-api_internal_dtos_request.SignUpDto:
properties:
display_name:
maxLength: 50
minLength: 2
type: string
email:
maxLength: 255
minLength: 5
type: string
password:
maxLength: 64
minLength: 8
type: string
required:
- display_name
- email
- password
type: object
history-api_internal_dtos_response.CommonResponse:
properties:
data: {}
message:
type: string
status:
type: boolean
type: object
host: localhost:3344
info:
contact:
email: support@swagger.io
name: API Support
url: http://www.swagger.io/support
description: This is a sample server for History API.
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
termsOfService: http://swagger.io/terms/
title: History API
version: "1.0"
paths:
/auth/refresh:
post:
consumes:
- application/json
description: Get a new access token using the user's current session/refresh
token
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'
security:
- BearerAuth: []
summary: Refresh access token
tags:
- Auth
/auth/signin:
post:
consumes:
- application/json
description: Authenticate user and return token data
parameters:
- description: Sign In request
in: body
name: request
required: true
schema:
$ref: '#/definitions/history-api_internal_dtos_request.SignInDto'
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'
summary: Sign in an existing user
tags:
- Auth
/auth/signup:
post:
consumes:
- application/json
description: Create a new user account
parameters:
- description: Sign Up request
in: body
name: request
required: true
schema:
$ref: '#/definitions/history-api_internal_dtos_request.SignUpDto'
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'
summary: Sign up a new user
tags:
- Auth
/tiles/{z}/{x}/{y}:
get:
description: Fetch vector or raster map tile data by Z, X, Y coordinates
parameters:
- description: Zoom level (0-22)
in: path
name: z
required: true
type: integer
- description: X coordinate
in: path
name: x
required: true
type: integer
- description: Y coordinate
in: path
name: "y"
required: true
type: integer
produces:
- application/octet-stream
responses:
"200":
description: OK
schema:
type: file
"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'
summary: Get a map tile
tags:
- Tile
/tiles/metadata:
get:
consumes:
- application/json
description: Retrieve map metadata
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 tile metadata
tags:
- Tile
securityDefinitions:
BearerAuth:
description: Type "Bearer " followed by a space and JWT token.
in: header
name: Authorization
type: apiKey
swagger: "2.0"