204 lines
4.9 KiB
YAML
204 lines
4.9 KiB
YAML
definitions:
|
|
gin.H:
|
|
additionalProperties: {}
|
|
type: object
|
|
gitea_d3m0k1d_ru_d3m0k1d_d3m0k1d_ru_backend_internal_storage.Post:
|
|
properties:
|
|
content:
|
|
type: string
|
|
created_at:
|
|
type: string
|
|
id:
|
|
type: integer
|
|
title:
|
|
type: string
|
|
type: object
|
|
gitea_d3m0k1d_ru_d3m0k1d_d3m0k1d_ru_backend_internal_storage.PostCreate:
|
|
properties:
|
|
content:
|
|
type: string
|
|
title:
|
|
type: string
|
|
type: object
|
|
gitea_d3m0k1d_ru_d3m0k1d_d3m0k1d_ru_backend_internal_storage.PostReq:
|
|
properties:
|
|
content:
|
|
type: string
|
|
id:
|
|
type: integer
|
|
title:
|
|
type: string
|
|
type: object
|
|
info:
|
|
contact: {}
|
|
paths:
|
|
/auth/github:
|
|
get:
|
|
description: Redirects to GitHub authorization
|
|
responses:
|
|
"302":
|
|
description: Found
|
|
summary: Start GitHub OAuth login
|
|
tags:
|
|
- auth
|
|
/callback/github:
|
|
get:
|
|
description: Exchanges authorization code for access token
|
|
parameters:
|
|
- description: Authorization code
|
|
in: query
|
|
name: code
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: Access token
|
|
schema:
|
|
additionalProperties: true
|
|
type: object
|
|
"400":
|
|
description: Missing code
|
|
schema:
|
|
additionalProperties:
|
|
type: string
|
|
type: object
|
|
"500":
|
|
description: Exchange failed
|
|
schema:
|
|
additionalProperties:
|
|
type: string
|
|
type: object
|
|
summary: GitHub OAuth callback
|
|
tags:
|
|
- auth
|
|
/posts:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Get all posts
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
items:
|
|
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_d3m0k1d_ru_backend_internal_storage.PostReq'
|
|
type: array
|
|
summary: Get all posts
|
|
tags:
|
|
- posts
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Create new post
|
|
parameters:
|
|
- description: Post data
|
|
in: body
|
|
name: post
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_d3m0k1d_ru_backend_internal_storage.PostCreate'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_d3m0k1d_ru_backend_internal_storage.PostReq'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/gin.H'
|
|
summary: Create post
|
|
tags:
|
|
- posts
|
|
/posts/{id}:
|
|
delete:
|
|
consumes:
|
|
- application/json
|
|
description: Delete post
|
|
parameters:
|
|
- description: Post ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_d3m0k1d_ru_backend_internal_storage.Post'
|
|
summary: Delete post
|
|
tags:
|
|
- posts
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Get post by id
|
|
parameters:
|
|
- description: Post ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_d3m0k1d_ru_backend_internal_storage.PostReq'
|
|
"400":
|
|
description: Invalid ID format
|
|
schema:
|
|
additionalProperties:
|
|
type: string
|
|
type: object
|
|
"404":
|
|
description: Post not found
|
|
schema:
|
|
additionalProperties:
|
|
type: string
|
|
type: object
|
|
"500":
|
|
description: Internal server error
|
|
schema:
|
|
additionalProperties:
|
|
type: string
|
|
type: object
|
|
summary: Get post by id
|
|
tags:
|
|
- posts
|
|
put:
|
|
consumes:
|
|
- application/json
|
|
description: Update post
|
|
parameters:
|
|
- description: Post ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
- description: Post data
|
|
in: body
|
|
name: post
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_d3m0k1d_ru_backend_internal_storage.PostCreate'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_d3m0k1d_ru_backend_internal_storage.PostCreate'
|
|
summary: Update post
|
|
tags:
|
|
- posts
|
|
swagger: "2.0"
|