swag fmt + clarify translate engine all

This commit is contained in:
Arya 2023-08-27 21:29:14 +05:30
parent 2210bcfd11
commit 5d02d7b5af
Signed by: arya
GPG Key ID: 842D12BDA50DF120

View File

@ -9,7 +9,7 @@ import (
// @Summary Show list of available source languages for engine // @Summary Show list of available source languages for engine
// @Param engine query string true "Engine name" // @Param engine query string true "Engine name"
// @Success 200 {object} utils.List // @Success 200 {object} utils.List
// @Router /api/source_languages [get] // @Router /api/source_languages [get]
func HandleSourceLanguages(c *fiber.Ctx) error { func HandleSourceLanguages(c *fiber.Ctx) error {
engine := utils.Sanitize(c.Query("engine"), "alpha") engine := utils.Sanitize(c.Query("engine"), "alpha")
if engine == "" { if engine == "" {
@ -26,7 +26,7 @@ func HandleSourceLanguages(c *fiber.Ctx) error {
// @Summary Show list of available target languages for engine // @Summary Show list of available target languages for engine
// @Param engine query string true "Engine name" // @Param engine query string true "Engine name"
// @Success 200 {object} utils.List // @Success 200 {object} utils.List
// @Router /api/target_languages [get] // @Router /api/target_languages [get]
func HandleTargetLanguages(c *fiber.Ctx) error { func HandleTargetLanguages(c *fiber.Ctx) error {
engine := utils.Sanitize(c.Query("engine"), "alpha") engine := utils.Sanitize(c.Query("engine"), "alpha")
if engine == "" { if engine == "" {
@ -41,10 +41,10 @@ func HandleTargetLanguages(c *fiber.Ctx) error {
// HandleTTS godoc // HandleTTS godoc
// @Summary Get Text-To-Speech for specified language using specified engine // @Summary Get Text-To-Speech for specified language using specified engine
// @Param engine query string true "Engine name" // @Param engine query string true "Engine name"
// @Param lang query string true "Language being TTS'd" // @Param lang query string true "Language being TTS'd"
// @Param text query string true "Text being TTS'd" // @Param text query string true "Text being TTS'd"
// @Router /api/tts [get] // @Router /api/tts [get]
func HandleTTS(c *fiber.Ctx) error { func HandleTTS(c *fiber.Ctx) error {
engine := utils.Sanitize(c.Query("engine"), "alpha") engine := utils.Sanitize(c.Query("engine"), "alpha")
lang := utils.Sanitize(c.Query("lang"), "alpha") lang := utils.Sanitize(c.Query("lang"), "alpha")
@ -61,13 +61,14 @@ func HandleTTS(c *fiber.Ctx) error {
} }
// HandleTranslate godoc // HandleTranslate godoc
// @Summary Translate text // @Summary Translate text
// @Param engine query string true "Engine name" // @Description When engine is set to all, it will return an array of utils.LangOut.
// @Param from query string true "Source language" // @Param engine query string true "Engine name"
// @Param to query string true "Target language" // @Param from query string true "Source language"
// @Param text query string true "Text being translated" // @Param to query string true "Target language"
// @Success 200 {object} utils.LangOut // @Param text query string true "Text being translated"
// @Router /api/translate [get] // @Success 200 {object} utils.LangOut
// @Router /api/translate [get]
func HandleTranslate(c *fiber.Ctx) error { func HandleTranslate(c *fiber.Ctx) error {
engine := utils.Sanitize(c.Query("engine"), "alpha") engine := utils.Sanitize(c.Query("engine"), "alpha")
from := utils.Sanitize(c.Query("from"), "alpha") from := utils.Sanitize(c.Query("from"), "alpha")