mirror of
https://codeberg.org/aryak/mozhi
synced 2024-11-08 18:52:26 +05:30
swag fmt + clarify translate engine all
This commit is contained in:
parent
2210bcfd11
commit
5d02d7b5af
27
pages/api.go
27
pages/api.go
@ -9,7 +9,7 @@ import (
|
||||
// @Summary Show list of available source languages for engine
|
||||
// @Param engine query string true "Engine name"
|
||||
// @Success 200 {object} utils.List
|
||||
// @Router /api/source_languages [get]
|
||||
// @Router /api/source_languages [get]
|
||||
func HandleSourceLanguages(c *fiber.Ctx) error {
|
||||
engine := utils.Sanitize(c.Query("engine"), "alpha")
|
||||
if engine == "" {
|
||||
@ -26,7 +26,7 @@ func HandleSourceLanguages(c *fiber.Ctx) error {
|
||||
// @Summary Show list of available target languages for engine
|
||||
// @Param engine query string true "Engine name"
|
||||
// @Success 200 {object} utils.List
|
||||
// @Router /api/target_languages [get]
|
||||
// @Router /api/target_languages [get]
|
||||
func HandleTargetLanguages(c *fiber.Ctx) error {
|
||||
engine := utils.Sanitize(c.Query("engine"), "alpha")
|
||||
if engine == "" {
|
||||
@ -41,10 +41,10 @@ func HandleTargetLanguages(c *fiber.Ctx) error {
|
||||
|
||||
// HandleTTS godoc
|
||||
// @Summary Get Text-To-Speech for specified language using specified engine
|
||||
// @Param engine query string true "Engine name"
|
||||
// @Param lang query string true "Language being TTS'd"
|
||||
// @Param text query string true "Text being TTS'd"
|
||||
// @Router /api/tts [get]
|
||||
// @Param engine query string true "Engine name"
|
||||
// @Param lang query string true "Language being TTS'd"
|
||||
// @Param text query string true "Text being TTS'd"
|
||||
// @Router /api/tts [get]
|
||||
func HandleTTS(c *fiber.Ctx) error {
|
||||
engine := utils.Sanitize(c.Query("engine"), "alpha")
|
||||
lang := utils.Sanitize(c.Query("lang"), "alpha")
|
||||
@ -61,13 +61,14 @@ func HandleTTS(c *fiber.Ctx) error {
|
||||
}
|
||||
|
||||
// HandleTranslate godoc
|
||||
// @Summary Translate text
|
||||
// @Param engine query string true "Engine name"
|
||||
// @Param from query string true "Source language"
|
||||
// @Param to query string true "Target language"
|
||||
// @Param text query string true "Text being translated"
|
||||
// @Success 200 {object} utils.LangOut
|
||||
// @Router /api/translate [get]
|
||||
// @Summary Translate text
|
||||
// @Description When engine is set to all, it will return an array of utils.LangOut.
|
||||
// @Param engine query string true "Engine name"
|
||||
// @Param from query string true "Source language"
|
||||
// @Param to query string true "Target language"
|
||||
// @Param text query string true "Text being translated"
|
||||
// @Success 200 {object} utils.LangOut
|
||||
// @Router /api/translate [get]
|
||||
func HandleTranslate(c *fiber.Ctx) error {
|
||||
engine := utils.Sanitize(c.Query("engine"), "alpha")
|
||||
from := utils.Sanitize(c.Query("from"), "alpha")
|
||||
|
Loading…
Reference in New Issue
Block a user