feat: full redy blog and admin panel

This commit is contained in:
d3m0k1d
2026-02-15 16:34:14 +03:00
parent 8d6225f136
commit 7f8d8373a9
18 changed files with 3236 additions and 39 deletions

View File

@@ -15,6 +15,67 @@ const docTemplate = `{
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
"/admin/posts": {
"get": {
"security": [
{
"Bearer": []
}
],
"description": "Get all posts",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"admin"
],
"summary": "Get all posts",
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/gitea_d3m0k1d_ru_d3m0k1d_d3m0k1d_ru_backend_internal_models.SuccessResponse"
},
{
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/gitea_d3m0k1d_ru_d3m0k1d_d3m0k1d_ru_backend_internal_storage.PostReq"
}
}
}
}
]
}
},
"400": {
"description": "Invalid ID format",
"schema": {
"$ref": "#/definitions/gitea_d3m0k1d_ru_d3m0k1d_d3m0k1d_ru_backend_internal_models.ErrorResponse"
}
},
"404": {
"description": "No Post found",
"schema": {
"$ref": "#/definitions/gitea_d3m0k1d_ru_d3m0k1d_d3m0k1d_ru_backend_internal_models.ErrorResponse"
}
},
"500": {
"description": "Internal server error",
"schema": {
"$ref": "#/definitions/gitea_d3m0k1d_ru_d3m0k1d_d3m0k1d_ru_backend_internal_models.ErrorResponse"
}
}
}
}
},
"/auth/github": {
"get": {
"description": "Redirects to GitHub authorization",
@@ -89,7 +150,7 @@ const docTemplate = `{
"tags": [
"posts"
],
"summary": "Get all posts",
"summary": "Get all published posts",
"responses": {
"200": {
"description": "OK",
@@ -565,6 +626,9 @@ const docTemplate = `{
"content": {
"type": "string"
},
"created_at": {
"type": "string"
},
"id": {
"type": "integer"
},

View File

@@ -4,6 +4,67 @@
"contact": {}
},
"paths": {
"/admin/posts": {
"get": {
"security": [
{
"Bearer": []
}
],
"description": "Get all posts",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"admin"
],
"summary": "Get all posts",
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/gitea_d3m0k1d_ru_d3m0k1d_d3m0k1d_ru_backend_internal_models.SuccessResponse"
},
{
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/gitea_d3m0k1d_ru_d3m0k1d_d3m0k1d_ru_backend_internal_storage.PostReq"
}
}
}
}
]
}
},
"400": {
"description": "Invalid ID format",
"schema": {
"$ref": "#/definitions/gitea_d3m0k1d_ru_d3m0k1d_d3m0k1d_ru_backend_internal_models.ErrorResponse"
}
},
"404": {
"description": "No Post found",
"schema": {
"$ref": "#/definitions/gitea_d3m0k1d_ru_d3m0k1d_d3m0k1d_ru_backend_internal_models.ErrorResponse"
}
},
"500": {
"description": "Internal server error",
"schema": {
"$ref": "#/definitions/gitea_d3m0k1d_ru_d3m0k1d_d3m0k1d_ru_backend_internal_models.ErrorResponse"
}
}
}
}
},
"/auth/github": {
"get": {
"description": "Redirects to GitHub authorization",
@@ -78,7 +139,7 @@
"tags": [
"posts"
],
"summary": "Get all posts",
"summary": "Get all published posts",
"responses": {
"200": {
"description": "OK",
@@ -554,6 +615,9 @@
"content": {
"type": "string"
},
"created_at": {
"type": "string"
},
"id": {
"type": "integer"
},

View File

@@ -43,6 +43,8 @@ definitions:
properties:
content:
type: string
created_at:
type: string
id:
type: integer
title:
@@ -51,6 +53,42 @@ definitions:
info:
contact: {}
paths:
/admin/posts:
get:
consumes:
- application/json
description: Get all posts
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_d3m0k1d_ru_backend_internal_models.SuccessResponse'
- properties:
data:
items:
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_d3m0k1d_ru_backend_internal_storage.PostReq'
type: array
type: object
"400":
description: Invalid ID format
schema:
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_d3m0k1d_ru_backend_internal_models.ErrorResponse'
"404":
description: No Post found
schema:
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_d3m0k1d_ru_backend_internal_models.ErrorResponse'
"500":
description: Internal server error
schema:
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_d3m0k1d_ru_backend_internal_models.ErrorResponse'
security:
- Bearer: []
summary: Get all posts
tags:
- admin
/auth/github:
get:
description: Redirects to GitHub authorization
@@ -123,7 +161,7 @@ paths:
description: Internal server error
schema:
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_d3m0k1d_ru_backend_internal_models.ErrorResponse'
summary: Get all posts
summary: Get all published posts
tags:
- posts
post: