definitions:
  gitea_d3m0k1d_ru_d3m0k1d_d3m0k1d_ru_backend_internal_models.ErrorDetail:
    properties:
      code:
        type: integer
      detail:
        type: string
      message:
        type: string
    type: object
  gitea_d3m0k1d_ru_d3m0k1d_d3m0k1d_ru_backend_internal_models.ErrorResponse:
    properties:
      error:
        $ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_d3m0k1d_ru_backend_internal_models.ErrorDetail'
    type: object
  gitea_d3m0k1d_ru_d3m0k1d_d3m0k1d_ru_backend_internal_models.SuccessResponse:
    properties:
      data: {}
    type: object
  gitea_d3m0k1d_ru_d3m0k1d_d3m0k1d_ru_backend_internal_storage.Post:
    properties:
      content:
        type: string
      created_at:
        type: string
      id:
        type: integer
      published:
        type: boolean
      title:
        type: string
    type: object
  gitea_d3m0k1d_ru_d3m0k1d_d3m0k1d_ru_backend_internal_storage.PostCreate:
    properties:
      content:
        type: string
      published:
        type: boolean
      title:
        type: string
    type: object
  gitea_d3m0k1d_ru_d3m0k1d_d3m0k1d_ru_backend_internal_storage.PostReq:
    properties:
      content:
        type: string
      created_at:
        type: string
      id:
        type: integer
      title:
        type: string
    type: object
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
      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:
            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'
      summary: Get all published 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:
            allOf:
            - $ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_d3m0k1d_ru_backend_internal_models.SuccessResponse'
            - properties:
                data:
                  $ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_d3m0k1d_ru_backend_internal_storage.Post'
              type: object
        "400":
          description: Invalid request
          schema:
            $ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_d3m0k1d_ru_backend_internal_models.ErrorResponse'
      security:
      - Bearer: []
      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:
            allOf:
            - $ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_d3m0k1d_ru_backend_internal_models.SuccessResponse'
            - properties:
                data:
                  $ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_d3m0k1d_ru_backend_internal_storage.Post'
              type: object
        "400":
          description: Invalid ID format
          schema:
            $ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_d3m0k1d_ru_backend_internal_models.ErrorResponse'
        "404":
          description: Post not 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: 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:
            allOf:
            - $ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_d3m0k1d_ru_backend_internal_models.SuccessResponse'
            - properties:
                data:
                  $ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_d3m0k1d_ru_backend_internal_storage.PostReq'
              type: object
        "400":
          description: Invalid ID format
          schema:
            $ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_d3m0k1d_ru_backend_internal_models.ErrorResponse'
        "404":
          description: Post not 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'
      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:
            allOf:
            - $ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_d3m0k1d_ru_backend_internal_models.SuccessResponse'
            - properties:
                data:
                  $ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_d3m0k1d_ru_backend_internal_storage.PostCreate'
              type: object
        "400":
          description: Invalid ID format
          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: Update post
      tags:
      - posts
  /session:
    get:
      description: Returns user session data
      produces:
      - application/json
      responses:
        "200":
          description: Session data
          schema:
            additionalProperties: true
            type: object
        "401":
          description: Unauthorized
          schema:
            additionalProperties:
              type: string
            type: object
      summary: Get user session
      tags:
      - auth
  /upload:
    post:
      description: Upload static content to the server
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_d3m0k1d_ru_backend_internal_models.SuccessResponse'
        "500":
          description: Internal server error
          schema:
            $ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_d3m0k1d_ru_backend_internal_models.ErrorResponse'
      summary: Upload static content
      tags:
      - static
  /upload/{file}:
    get:
      consumes:
      - application/json
      description: Get static content
      parameters:
      - description: File name
        in: path
        name: file
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: Static content
          schema:
            allOf:
            - $ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_d3m0k1d_ru_backend_internal_models.SuccessResponse'
            - properties:
                data:
                  type: string
              type: object
        "404":
          description: File not 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'
      summary: Get static content
      tags:
      - static
securityDefinitions:
  Bearer:
    description: Type "Bearer" followed by a space and the JWT token.
    in: header
    name: Authorization
    type: apiKey
swagger: "2.0"
