update api.go, auth.go, docs.go, handler.go, service.go, swagger.json, swagger.yaml

This commit is contained in:
redtea committed 2024-10-25 12:00:00 +03:00
1 parent 4c8b4e9fce
commit 362a6d1041
7 files changed
+1564

No files matched your search

+255
View File
@@ -0,0 +1,255 @@
basePath: /api
definitions:
esauth.User:
properties:
access:
type: string
email:
type: string
first_name:
type: string
google_id:
type: string
id:
type: integer
last_name:
type: string
picture_url:
type: string
telegram_id:
type: string
username:
type: string
type: object
handler.countResponse:
properties:
count:
type: integer
type: object
handler.editInput:
properties:
email:
type: string
first_name:
type: string
last_name:
type: string
picture_url:
type: string
username:
type: string
type: object
handler.infinityTokenResponce:
type: object
host: auth.easystartup.su
info:
contact:
email: red.tea.dev@gmail.com
name: API Support
description: Auth server for EasyStartup.
title: EasyStartup Auth
version: "1.0"
paths:
/api/user:
put:
parameters:
- description: User data in JSON
in: body
name: user
required: true
schema:
$ref: '#/definitions/esauth.User'
- description: JWT Bearer token (authorization)
in: header
name: Authorization
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/esauth.User'
summary: Create new user
tags:
- user
/api/user/{user}:
delete:
parameters:
- description: id of user
in: path
name: id
required: true
type: integer
- description: JWT Bearer token (authorization)
in: header
name: Authorization
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
summary: Delete user by id
tags:
- user
get:
parameters:
- description: search user by id
in: path
name: user
required: true
type: integer
- description: JWT Bearer token (authorization)
in: header
name: Authorization
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/esauth.User'
summary: Get user by id
tags:
- user
post:
parameters:
- description: edit user by id
in: path
name: user
required: true
type: integer
- description: User data in JSON
in: body
name: user
required: true
schema:
$ref: '#/definitions/esauth.User'
- description: JWT Bearer token (authorization)
in: header
name: Authorization
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/esauth.User'
summary: Edit user by id
tags:
- user
/api/user/all:
get:
parameters:
- description: limit of users size
in: query
name: limit
required: true
type: integer
- description: select offset
in: query
name: start
required: true
type: integer
- description: JWT Bearer token (authorization)
in: header
name: Authorization
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
type: integer
type: array
summary: Get ids of users
tags:
- user
/api/user/count:
get:
parameters:
- description: JWT Bearer token (authorization)
in: header
name: Authorization
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.countResponse'
summary: Get count of users
tags:
- user
/api/user/infinity-token:
get:
parameters:
- description: JWT Bearer token (authorization)
in: header
name: Authorization
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.infinityTokenResponce'
summary: Create infinity token (only for admin)
tags:
- user
/api/user/self:
get:
parameters:
- description: JWT Bearer token (authorization)
in: header
name: Authorization
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/esauth.User'
summary: Get current user
tags:
- user
post:
parameters:
- description: User description JSON
in: body
name: user
required: true
schema:
$ref: '#/definitions/handler.editInput'
- description: JWT Bearer token (authorization)
in: header
name: Authorization
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/esauth.User'
summary: Edit user
tags:
- user
swagger: "2.0"