Skip to content

Commit

Permalink
feat: Added router /send-video-storie
Browse files Browse the repository at this point in the history
  • Loading branch information
icleitoncosta committed Jul 19, 2022
1 parent 8c97537 commit 4ba72a1
Show file tree
Hide file tree
Showing 2 changed files with 126 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/controller/messageController.js
Expand Up @@ -298,7 +298,7 @@ export async function sendImageStorie(req, res) {
}

export async function sendVideoStorie(req, res) {
const { path, filename = 'video', caption } = req.body;
const { path } = req.body;

if (!path && !req.file)
return res.status(401).send({
Expand All @@ -310,7 +310,7 @@ export async function sendVideoStorie(req, res) {
try {
let results = [];

results.push(await req.client.sendFile('status@broadcast', pathFile, filename, caption));
results.push(await req.client.sendVideoStatus(pathFile));

if (results.length === 0) return res.status(400).json('Error sending message');
if (req.file) await unlinkAsync(pathFile);
Expand Down
124 changes: 124 additions & 0 deletions src/swagger.json
Expand Up @@ -6569,6 +6569,117 @@
"deprecated": false
}
},
"/send-video-storie": {
"post": {
"tags": ["Profile"],
"summary": "Send Video Storie ",
"description": "Send Video Storie",
"operationId": "SendVideoStorie",
"parameters": [],
"requestBody": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SendVideoStorieRequest"
},
"example": {
"path": "https://file-examples.com/storage/fe21590a2962d597a9a51ad/2017/04/file_example_MP4_480_1_5MG.mp4"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "OK",
"headers": {
"X-Powered-By": {
"content": {
"text/plain": {
"schema": {
"type": "string"
},
"example": "Express"
}
}
},
"Access-Control-Allow-Origin": {
"content": {
"text/plain": {
"schema": {
"type": "string"
},
"example": "*"
}
}
},
"Content-Length": {
"content": {
"text/plain": {
"schema": {
"type": "string"
},
"example": "20"
}
}
},
"ETag": {
"content": {
"text/plain": {
"schema": {
"type": "string"
},
"example": "W/\"14-Aecwmfr5xTp+PReMihhLNM3Z9mY\""
}
}
},
"Date": {
"content": {
"text/plain": {
"schema": {
"type": "string"
},
"example": "Thu, 13 May 2021 18:12:58 GMT"
}
}
},
"Connection": {
"content": {
"text/plain": {
"schema": {
"type": "string"
},
"example": "keep-alive"
}
}
},
"Keep-Alive": {
"content": {
"text/plain": {
"schema": {
"type": "string"
},
"example": "timeout=5"
}
}
}
},
"content": {
"application/json; charset=utf-8": {
"schema": {
"$ref": "#/components/schemas/ChangeProfileStatus"
},
"example": {
"status": "Success"
}
}
}
}
},
"deprecated": false
}
},
"/send-text-storie": {
"post": {
"tags": ["Profile"],
Expand Down Expand Up @@ -17072,6 +17183,19 @@
"path": "https://pbs.twimg.com/profile_images/549882655932948480/LCZWmFyW_400x400.jpeg"
}
},
"SendVideoStorieRequest": {
"title": "SendVideoStorieRequest",
"required": ["path"],
"type": "object",
"properties": {
"path": {
"type": "string"
}
},
"example": {
"path": "https://file-examples.com/storage/fe21590a2962d597a9a51ad/2017/04/file_example_MP4_480_1_5MG.mp4"
}
},
"SendTextStorieRequest": {
"title": "SendTextStorieRequest",
"required": ["text", "options"],
Expand Down

0 comments on commit 4ba72a1

Please sign in to comment.