Added GetAllOffset. Post controller completed.

This commit is contained in:
KamilM1205 2025-09-20 19:34:17 +04:00
parent 5b18009658
commit 41944884b4
12 changed files with 229 additions and 71 deletions

View file

@ -21,6 +21,15 @@ definitions:
- title
- userId
type: object
requests.PutPostRequest:
properties:
content:
type: string
description:
type: string
title:
type: string
type: object
responses.ErrorResponse:
properties:
error_code:
@ -70,7 +79,7 @@ info:
paths:
/images/{path}:
get:
description: get image by path
description: Creates new user in system
parameters:
- description: Path to image
in: query
@ -78,12 +87,11 @@ paths:
required: true
type: string
produces:
- image/png
- image/jpeg
- application/json
responses:
"200":
description: OK
summary: Get an image by path
summary: Create new user
/post:
get:
description: Return first 5 posts
@ -96,6 +104,10 @@ paths:
items:
$ref: '#/definitions/responses.GetListPostResponseItem'
type: array
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/responses.ErrorResponse'
summary: Get all posts
tags:
- post
@ -121,15 +133,39 @@ paths:
description: Bad Request
schema:
$ref: '#/definitions/responses.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/responses.ErrorResponse'
summary: Create new post
tags:
- post
/post/{id}:
delete:
description: Delete post by id
parameters:
- description: Id of post
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
"400":
description: Bad Request
schema:
$ref: '#/definitions/responses.ErrorResponse'
summary: Delete post
tags:
- post
get:
description: get post by id
parameters:
- description: Id of post
in: query
in: path
name: id
required: true
type: string
@ -142,6 +178,10 @@ paths:
items:
$ref: '#/definitions/responses.PostResponse'
type: array
"400":
description: Bad Request
schema:
$ref: '#/definitions/responses.ErrorResponse'
summary: Get post by id
tags:
- post
@ -149,10 +189,16 @@ paths:
description: update post content
parameters:
- description: Id of post
in: query
in: path
name: id
required: true
type: string
- description: Post data
in: body
name: request
required: true
schema:
$ref: '#/definitions/requests.PutPostRequest'
produces:
- application/json
responses:
@ -160,15 +206,19 @@ paths:
description: OK
schema:
$ref: '#/definitions/responses.PostResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/responses.ErrorResponse'
summary: Update post content
tags:
- post
/post/{offset}:
/post/offset/{offset}:
get:
description: return 5 posts after first offset posts
parameters:
- description: Offset of posts
in: query
in: path
name: offset
required: true
type: integer
@ -181,6 +231,10 @@ paths:
items:
$ref: '#/definitions/responses.GetListPostResponseItem'
type: array
"400":
description: Bad Request
schema:
$ref: '#/definitions/responses.ErrorResponse'
summary: Get posts after offset
tags:
- post