docs #12

Merged
vivy-agent merged 3 commits from docs into main 2026-02-06 22:30:23 +07:00
2 changed files with 36 additions and 1 deletions
Showing only changes of commit 7f129a1b55 - Show all commits

View File

@ -3,6 +3,41 @@ import { mainErrorHandler } from "../../../helpers/error/handler";
import { returnWriteResponse } from "../../../helpers/callback/httpResponse"; import { returnWriteResponse } from "../../../helpers/callback/httpResponse";
import { updateAllEpisodeThumbnailService } from "../services/http/updateAllEpisodeThumbnail.service"; import { updateAllEpisodeThumbnailService } from "../services/http/updateAllEpisodeThumbnail.service";
/**
* @function updateAllEpisodeThumbnailController
* @description Controller to handle the bulk updating of episode thumbnails for all episodes associated with a specific service reference ID.
*
* @param {Context & { body: { service_reference_id: string } }} ctx
* The context object containing the request body.
* The body must include:
* - service_reference_id: string - The ID of the service to which the episodes belong.
*
* @example
* Request route: PUT /internal/episode/update-thumbnails
* Request body:
* {
* "service_reference_id": "019c0df6-f8fe-7565-82cd-9c29b20232ab"
* },
*
* @returns {Promise<Object>}
* A response object indicating success or failure.
* Return example:
* {
* success: true,
* status: 204,
* message: "Updating {newEpisodeThumbnailsCount} episode thumbnails successfully.",
* }
*
* @throws {Object}
* An error response object if validation fails or an error occurs during bulk insert operation.
* Return example:
* {
* success: false,
* status: <Status Code>,
* message: "<Error Message>",
* error: { ...errorDetails } // Additional error details if available and the env run on development mode
* }
*/
export const updateAllEpisodeThumbnailController = async ( export const updateAllEpisodeThumbnailController = async (
ctx: Context & { body: { service_reference_id: string } }, ctx: Context & { body: { service_reference_id: string } },
) => { ) => {

View File

@ -8,6 +8,6 @@ import { updateAllEpisodeThumbnailController } from "./controllers/updateAllEpis
export const internalModule = new Elysia({ prefix: "/internal" }) export const internalModule = new Elysia({ prefix: "/internal" })
.post("/media/bulk-insert", bulkInsertMediaController) .post("/media/bulk-insert", bulkInsertMediaController)
.post("/episode/bulk-insert", bulkInsertEpisodeController) .post("/episode/bulk-insert", bulkInsertEpisodeController)
.post("/episode/update-thumbnails", updateAllEpisodeThumbnailController) .put("/episode/update-thumbnails", updateAllEpisodeThumbnailController)
.post("/video/bulk-insert", bulkInsertVideoController) .post("/video/bulk-insert", bulkInsertVideoController)
.post("/video-service", createVideoServiceInternalController); .post("/video-service", createVideoServiceInternalController);