861 lines
20 KiB
YAML
861 lines
20 KiB
YAML
basePath: /api
|
|
definitions:
|
|
domain.ArticleAndSourceModel:
|
|
properties:
|
|
article:
|
|
$ref: '#/definitions/domain.ArticleDto'
|
|
source:
|
|
$ref: '#/definitions/domain.SourceDto'
|
|
type: object
|
|
domain.ArticleDetailedResponse:
|
|
properties:
|
|
message:
|
|
type: string
|
|
payload:
|
|
$ref: '#/definitions/domain.ArticleAndSourceModel'
|
|
type: object
|
|
domain.ArticleDto:
|
|
properties:
|
|
authorImage:
|
|
type: string
|
|
authorName:
|
|
type: string
|
|
description:
|
|
type: string
|
|
id:
|
|
type: integer
|
|
isVideo:
|
|
type: boolean
|
|
pubDate:
|
|
type: string
|
|
sourceId:
|
|
type: integer
|
|
tags:
|
|
type: string
|
|
thumbnail:
|
|
type: string
|
|
title:
|
|
type: string
|
|
url:
|
|
type: string
|
|
type: object
|
|
domain.ArticleResponse:
|
|
properties:
|
|
message:
|
|
type: string
|
|
payload:
|
|
items:
|
|
$ref: '#/definitions/domain.ArticleDto'
|
|
type: array
|
|
type: object
|
|
domain.BaseResponse:
|
|
properties:
|
|
message:
|
|
type: string
|
|
type: object
|
|
domain.DiscordWebHookDto:
|
|
properties:
|
|
channel:
|
|
type: string
|
|
enabled:
|
|
type: boolean
|
|
id:
|
|
type: integer
|
|
server:
|
|
type: string
|
|
url:
|
|
description: |-
|
|
Name string `json:"name"`
|
|
Key string `json:"key"`
|
|
type: string
|
|
type: object
|
|
domain.DiscordWebhookResponse:
|
|
properties:
|
|
message:
|
|
type: string
|
|
payload:
|
|
items:
|
|
$ref: '#/definitions/domain.DiscordWebHookDto'
|
|
type: array
|
|
type: object
|
|
domain.SourceDto:
|
|
properties:
|
|
enabled:
|
|
type: boolean
|
|
id:
|
|
type: integer
|
|
name:
|
|
type: string
|
|
source:
|
|
type: string
|
|
tags:
|
|
type: string
|
|
url:
|
|
type: string
|
|
type: object
|
|
models.ArticleDetailsDto:
|
|
properties:
|
|
authorImage:
|
|
type: string
|
|
authorName:
|
|
type: string
|
|
description:
|
|
type: string
|
|
id:
|
|
type: string
|
|
pubdate:
|
|
type: string
|
|
source:
|
|
$ref: '#/definitions/models.SourceDto'
|
|
tags:
|
|
items:
|
|
type: string
|
|
type: array
|
|
thumbnail:
|
|
type: string
|
|
title:
|
|
type: string
|
|
url:
|
|
type: string
|
|
video:
|
|
type: string
|
|
videoHeight:
|
|
type: integer
|
|
videoWidth:
|
|
type: integer
|
|
type: object
|
|
models.DiscordQueueDetailsDto:
|
|
properties:
|
|
article:
|
|
$ref: '#/definitions/models.ArticleDetailsDto'
|
|
id:
|
|
type: string
|
|
type: object
|
|
models.DiscordWebHooksDto:
|
|
properties:
|
|
ID:
|
|
type: string
|
|
channel:
|
|
type: string
|
|
enabled:
|
|
type: boolean
|
|
server:
|
|
type: string
|
|
url:
|
|
type: string
|
|
type: object
|
|
models.SourceDto:
|
|
properties:
|
|
deleted:
|
|
type: boolean
|
|
enabled:
|
|
type: boolean
|
|
id:
|
|
type: string
|
|
name:
|
|
type: string
|
|
site:
|
|
type: string
|
|
source:
|
|
type: string
|
|
tags:
|
|
items:
|
|
type: string
|
|
type: array
|
|
type:
|
|
type: string
|
|
url:
|
|
type: string
|
|
value:
|
|
type: string
|
|
type: object
|
|
models.SubscriptionDetailsDto:
|
|
properties:
|
|
discordwebhook:
|
|
$ref: '#/definitions/models.DiscordWebHooksDto'
|
|
id:
|
|
type: string
|
|
source:
|
|
$ref: '#/definitions/models.SourceDto'
|
|
type: object
|
|
models.SubscriptionDto:
|
|
properties:
|
|
discordwebhookid:
|
|
type: string
|
|
id:
|
|
type: string
|
|
sourceid:
|
|
type: string
|
|
type: object
|
|
v1.ApiError:
|
|
properties:
|
|
message:
|
|
type: string
|
|
status:
|
|
type: integer
|
|
type: object
|
|
v1.GetSource:
|
|
properties:
|
|
message:
|
|
type: string
|
|
payload:
|
|
$ref: '#/definitions/models.SourceDto'
|
|
status:
|
|
type: integer
|
|
type: object
|
|
v1.ListDiscordWebHooksQueueResults:
|
|
properties:
|
|
message:
|
|
type: string
|
|
payload:
|
|
items:
|
|
$ref: '#/definitions/models.DiscordQueueDetailsDto'
|
|
type: array
|
|
status:
|
|
type: integer
|
|
type: object
|
|
v1.ListSources:
|
|
properties:
|
|
message:
|
|
type: string
|
|
payload:
|
|
items:
|
|
$ref: '#/definitions/models.SourceDto'
|
|
type: array
|
|
status:
|
|
type: integer
|
|
type: object
|
|
v1.ListSubscriptionDetails:
|
|
properties:
|
|
message:
|
|
type: string
|
|
payload:
|
|
items:
|
|
$ref: '#/definitions/models.SubscriptionDetailsDto'
|
|
type: array
|
|
status:
|
|
type: integer
|
|
type: object
|
|
v1.ListSubscriptions:
|
|
properties:
|
|
message:
|
|
type: string
|
|
payload:
|
|
items:
|
|
$ref: '#/definitions/models.SubscriptionDto'
|
|
type: array
|
|
status:
|
|
type: integer
|
|
type: object
|
|
info:
|
|
contact: {}
|
|
title: NewsBot collector
|
|
version: "0.1"
|
|
paths:
|
|
/articles:
|
|
get:
|
|
parameters:
|
|
- description: page number
|
|
in: query
|
|
name: page
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.ArticleResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.BaseResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.BaseResponse'
|
|
summary: Lists the top 25 records ordering from newest to oldest.
|
|
tags:
|
|
- Articles
|
|
/articles/{ID}:
|
|
get:
|
|
parameters:
|
|
- description: int
|
|
in: path
|
|
name: ID
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.ArticleResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.BaseResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.BaseResponse'
|
|
summary: Returns an article based on defined ID.
|
|
tags:
|
|
- Articles
|
|
/articles/{ID}/details:
|
|
get:
|
|
parameters:
|
|
- description: int
|
|
in: path
|
|
name: ID
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.ArticleDetailedResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.BaseResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.BaseResponse'
|
|
summary: Returns an article and source based on defined ID.
|
|
tags:
|
|
- Articles
|
|
/articles/by/sourceid:
|
|
get:
|
|
parameters:
|
|
- description: source id
|
|
in: query
|
|
name: id
|
|
required: true
|
|
type: string
|
|
- description: Page to query
|
|
in: query
|
|
name: page
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.ArticleResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.BaseResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.BaseResponse'
|
|
summary: Finds the articles based on the SourceID provided. Returns the top
|
|
25.
|
|
tags:
|
|
- Articles
|
|
/discord/webhooks:
|
|
get:
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.DiscordWebhookResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.BaseResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.BaseResponse'
|
|
summary: Returns the top 100
|
|
tags:
|
|
- Discord
|
|
- Webhook
|
|
/discord/webhooks/{ID}:
|
|
delete:
|
|
parameters:
|
|
- description: id
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.DiscordWebhookResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.BaseResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.BaseResponse'
|
|
summary: Deletes a record by ID.
|
|
tags:
|
|
- Discord
|
|
- Webhook
|
|
/discord/webhooks/{ID}/disable:
|
|
post:
|
|
parameters:
|
|
- description: id
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.DiscordWebhookResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.BaseResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.BaseResponse'
|
|
summary: Disables a Webhook from being used.
|
|
tags:
|
|
- Discord
|
|
- Webhook
|
|
/discord/webhooks/{ID}/enable:
|
|
post:
|
|
parameters:
|
|
- description: id
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
responses: {}
|
|
summary: Enables a source to continue processing.
|
|
tags:
|
|
- Discord
|
|
- Webhook
|
|
/discord/webhooks/{id}:
|
|
get:
|
|
parameters:
|
|
- description: id
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.DiscordWebhookResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.BaseResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.BaseResponse'
|
|
summary: Returns the top 100 entries from the queue to be processed.
|
|
tags:
|
|
- Discord
|
|
- Webhook
|
|
/discord/webhooks/by/serverAndChannel:
|
|
get:
|
|
parameters:
|
|
- description: Fancy Server
|
|
in: query
|
|
name: server
|
|
required: true
|
|
type: string
|
|
- description: memes
|
|
in: query
|
|
name: channel
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.DiscordWebhookResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.BaseResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.BaseResponse'
|
|
summary: Returns all the known web hooks based on the Server and Channel given.
|
|
tags:
|
|
- Discord
|
|
- Webhook
|
|
/discord/webhooks/new:
|
|
post:
|
|
parameters:
|
|
- description: url
|
|
in: query
|
|
name: url
|
|
required: true
|
|
type: string
|
|
- description: Server name
|
|
in: query
|
|
name: server
|
|
required: true
|
|
type: string
|
|
- description: Channel name
|
|
in: query
|
|
name: channel
|
|
required: true
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.DiscordWebhookResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.BaseResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.BaseResponse'
|
|
summary: Creates a new record for a discord web hook to post data to.
|
|
tags:
|
|
- Discord
|
|
- Webhook
|
|
/queue/discord/webhooks:
|
|
get:
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: ok
|
|
schema:
|
|
$ref: '#/definitions/v1.ListDiscordWebHooksQueueResults'
|
|
summary: Returns the top 100 entries from the queue to be processed.
|
|
tags:
|
|
- Queue
|
|
/settings/{key}:
|
|
get:
|
|
parameters:
|
|
- description: Settings Key value
|
|
in: path
|
|
name: key
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses: {}
|
|
summary: Returns a object based on the Key that was given.
|
|
tags:
|
|
- Settings
|
|
/sources:
|
|
get:
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: ok
|
|
schema:
|
|
$ref: '#/definitions/v1.ListSources'
|
|
"400":
|
|
description: Unable to reach SQL or Data problems
|
|
schema:
|
|
$ref: '#/definitions/domain.BaseResponse'
|
|
summary: Lists the top 50 records
|
|
tags:
|
|
- Source
|
|
/sources/{id}:
|
|
get:
|
|
parameters:
|
|
- description: uuid
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: ok
|
|
schema:
|
|
$ref: '#/definitions/v1.GetSource'
|
|
"204":
|
|
description: No record found.
|
|
schema:
|
|
$ref: '#/definitions/v1.ApiError'
|
|
"400":
|
|
description: Unable to query SQL.
|
|
schema:
|
|
$ref: '#/definitions/v1.ApiError'
|
|
"500":
|
|
description: Failed to process data from SQL.
|
|
schema:
|
|
$ref: '#/definitions/v1.ApiError'
|
|
summary: Returns a single entity by ID
|
|
tags:
|
|
- Source
|
|
post:
|
|
parameters:
|
|
- description: id
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
responses: {}
|
|
summary: Marks a source as deleted based on its ID value.
|
|
tags:
|
|
- Source
|
|
/sources/{id}/disable:
|
|
post:
|
|
parameters:
|
|
- description: id
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
responses: {}
|
|
summary: Disables a source from processing.
|
|
tags:
|
|
- Source
|
|
/sources/{id}/enable:
|
|
post:
|
|
parameters:
|
|
- description: id
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
responses: {}
|
|
summary: Enables a source to continue processing.
|
|
tags:
|
|
- Source
|
|
/sources/by/source:
|
|
get:
|
|
parameters:
|
|
- description: Source Name
|
|
in: query
|
|
name: source
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: ok
|
|
schema:
|
|
$ref: '#/definitions/v1.ListSources'
|
|
"400":
|
|
description: Unable to query SQL.
|
|
schema:
|
|
$ref: '#/definitions/v1.ApiError'
|
|
"500":
|
|
description: Problems with data.
|
|
schema:
|
|
$ref: '#/definitions/v1.ApiError'
|
|
summary: 'Lists the top 50 records based on the name given. Example: reddit'
|
|
tags:
|
|
- Source
|
|
/sources/by/sourceAndName:
|
|
get:
|
|
parameters:
|
|
- description: dadjokes
|
|
in: query
|
|
name: name
|
|
required: true
|
|
type: string
|
|
- description: reddit
|
|
in: query
|
|
name: source
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: ok
|
|
schema:
|
|
$ref: '#/definitions/v1.GetSource'
|
|
"204":
|
|
description: No record found.
|
|
schema:
|
|
$ref: '#/definitions/v1.ApiError'
|
|
"400":
|
|
description: Unable to query SQL.
|
|
schema:
|
|
$ref: '#/definitions/v1.ApiError'
|
|
"500":
|
|
description: Failed to process data from SQL.
|
|
schema:
|
|
$ref: '#/definitions/v1.ApiError'
|
|
summary: Returns a single entity by ID
|
|
tags:
|
|
- Source
|
|
/sources/new/reddit:
|
|
post:
|
|
parameters:
|
|
- description: name
|
|
in: query
|
|
name: name
|
|
required: true
|
|
type: string
|
|
- description: url
|
|
in: query
|
|
name: url
|
|
required: true
|
|
type: string
|
|
responses: {}
|
|
summary: Creates a new reddit source to monitor.
|
|
tags:
|
|
- Source
|
|
/sources/new/twitch:
|
|
post:
|
|
parameters:
|
|
- description: name
|
|
in: query
|
|
name: name
|
|
required: true
|
|
type: string
|
|
responses: {}
|
|
summary: Creates a new twitch source to monitor.
|
|
tags:
|
|
- Source
|
|
/sources/new/youtube:
|
|
post:
|
|
parameters:
|
|
- description: name
|
|
in: query
|
|
name: name
|
|
required: true
|
|
type: string
|
|
- description: url
|
|
in: query
|
|
name: url
|
|
required: true
|
|
type: string
|
|
responses: {}
|
|
summary: Creates a new youtube source to monitor.
|
|
tags:
|
|
- Source
|
|
/subscriptions:
|
|
get:
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: ok
|
|
schema:
|
|
$ref: '#/definitions/v1.ListSubscriptions'
|
|
"400":
|
|
description: Unable to reach SQL.
|
|
schema:
|
|
$ref: '#/definitions/v1.ApiError'
|
|
"500":
|
|
description: Failed to process data from SQL.
|
|
schema:
|
|
$ref: '#/definitions/v1.ApiError'
|
|
summary: Returns the top 100 entries from the queue to be processed.
|
|
tags:
|
|
- Subscription
|
|
/subscriptions/by/SourceId:
|
|
get:
|
|
parameters:
|
|
- description: id
|
|
in: query
|
|
name: id
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: ok
|
|
schema:
|
|
$ref: '#/definitions/v1.ListSubscriptions'
|
|
summary: Returns the top 100 entries from the queue to be processed.
|
|
tags:
|
|
- Subscription
|
|
/subscriptions/by/discordId:
|
|
get:
|
|
parameters:
|
|
- description: id
|
|
in: query
|
|
name: id
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: ok
|
|
schema:
|
|
$ref: '#/definitions/v1.ListSubscriptions'
|
|
"400":
|
|
description: Unable to reach SQL or Data problems
|
|
schema:
|
|
$ref: '#/definitions/v1.ApiError'
|
|
"500":
|
|
description: Data problems
|
|
schema:
|
|
$ref: '#/definitions/v1.ApiError'
|
|
summary: Returns the top 100 entries from the queue to be processed.
|
|
tags:
|
|
- Subscription
|
|
/subscriptions/details:
|
|
get:
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: ok
|
|
schema:
|
|
$ref: '#/definitions/v1.ListSubscriptionDetails'
|
|
summary: Returns the top 50 entries with full deatils on the source and output.
|
|
tags:
|
|
- Subscription
|
|
/subscriptions/discord/webhook/delete:
|
|
delete:
|
|
parameters:
|
|
- description: id
|
|
in: query
|
|
name: id
|
|
required: true
|
|
type: string
|
|
responses: {}
|
|
summary: Removes a Discord WebHook Subscription based on the Subscription ID.
|
|
tags:
|
|
- Subscription
|
|
/subscriptions/discord/webhook/new:
|
|
post:
|
|
parameters:
|
|
- description: discordWebHookId
|
|
in: query
|
|
name: discordWebHookId
|
|
required: true
|
|
type: string
|
|
- description: sourceId
|
|
in: query
|
|
name: sourceId
|
|
required: true
|
|
type: string
|
|
responses: {}
|
|
summary: Creates a new subscription to link a post from a Source to a DiscordWebHook.
|
|
tags:
|
|
- Subscription
|
|
swagger: "2.0"
|