Feat: add swagger notes
This commit is contained in:
@@ -1,5 +1,12 @@
|
||||
basePath: /
|
||||
definitions:
|
||||
api.getAliasesOutputAlias:
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
name:
|
||||
type: string
|
||||
type: object
|
||||
api.getImagesOutputImage:
|
||||
properties:
|
||||
aliases:
|
||||
@@ -8,9 +15,19 @@ definitions:
|
||||
type: array
|
||||
id:
|
||||
type: integer
|
||||
uploaded_at:
|
||||
uploadedAt:
|
||||
type: integer
|
||||
uploaded_user_id:
|
||||
uploadedUserId:
|
||||
type: string
|
||||
type: object
|
||||
auth.postGenLoginUrlInput:
|
||||
properties:
|
||||
userId:
|
||||
type: string
|
||||
type: object
|
||||
auth.postGenLoginUrlOutput:
|
||||
properties:
|
||||
loginUrl:
|
||||
type: string
|
||||
type: object
|
||||
info:
|
||||
@@ -21,15 +38,142 @@ info:
|
||||
title: Golang 2025 Final Project
|
||||
version: 0.0.1
|
||||
paths:
|
||||
/api/images:
|
||||
/api/alias-update:
|
||||
get:
|
||||
description: get update notification using websocket
|
||||
responses: {}
|
||||
summary: Get notification when alias update
|
||||
/api/alias/{id}:
|
||||
delete:
|
||||
description: delete alias along with the links
|
||||
parameters:
|
||||
- description: Alias Id
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: integer
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
"401":
|
||||
description: Unauthorized
|
||||
"404":
|
||||
description: Not Found
|
||||
summary: Delete alias
|
||||
/api/aliases:
|
||||
get:
|
||||
description: get alias ids and names
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/api.getImagesOutputImage'
|
||||
items:
|
||||
$ref: '#/definitions/api.getAliasesOutputAlias'
|
||||
type: array
|
||||
"400":
|
||||
description: Bad Request
|
||||
"401":
|
||||
description: Unauthorized
|
||||
summary: Get aliases
|
||||
/api/image:
|
||||
post:
|
||||
consumes:
|
||||
- image/png
|
||||
- image/jpeg
|
||||
- image/gif
|
||||
parameters:
|
||||
- description: userinfo from /auth/gen-login-url
|
||||
in: header
|
||||
name: userinfo
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
"401":
|
||||
description: Unauthorized
|
||||
/api/image/{id}:
|
||||
delete:
|
||||
description: delete image along with the links
|
||||
parameters:
|
||||
- description: Image Id
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: integer
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
"401":
|
||||
description: Unauthorized
|
||||
"404":
|
||||
description: Not Found
|
||||
summary: Delete image
|
||||
/api/image/{id}/aliases:
|
||||
put:
|
||||
parameters:
|
||||
- description: Image Id
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: integer
|
||||
- description: Payload
|
||||
in: body
|
||||
name: payload
|
||||
required: true
|
||||
schema:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
"401":
|
||||
description: Unauthorized
|
||||
"404":
|
||||
description: Not Found
|
||||
/api/images:
|
||||
get:
|
||||
parameters:
|
||||
- collectionFormat: csv
|
||||
description: Image Ids
|
||||
in: query
|
||||
items:
|
||||
type: integer
|
||||
name: images
|
||||
type: array
|
||||
- collectionFormat: csv
|
||||
description: Alias Ids
|
||||
in: query
|
||||
items:
|
||||
type: integer
|
||||
name: aliases
|
||||
type: array
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
items:
|
||||
$ref: '#/definitions/api.getImagesOutputImage'
|
||||
type: array
|
||||
"400":
|
||||
description: Bad Request
|
||||
"401":
|
||||
description: Unauthorized
|
||||
/auth/gen-login-url:
|
||||
post:
|
||||
parameters:
|
||||
- description: Payload
|
||||
in: body
|
||||
name: payload
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/auth.postGenLoginUrlInput'
|
||||
responses:
|
||||
"200":
|
||||
description: Payload
|
||||
schema:
|
||||
$ref: '#/definitions/auth.postGenLoginUrlOutput'
|
||||
"400":
|
||||
description: Bad Request
|
||||
swagger: "2.0"
|
||||
|
||||
Reference in New Issue
Block a user