From de084cbd214213a1c909f019f619a11e7940d89a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9A=D0=BE=D0=B1=D0=B5=D0=BB=D0=B5=D0=B2=20=D0=90=D0=BD?= =?UTF-8?q?=D0=B4=D1=80=D0=B5=D0=B9=20=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B5?= =?UTF-8?q?=D0=B2=D0=B8=D1=87?= Date: Mon, 6 Jun 2022 13:51:38 +0300 Subject: [PATCH] swag doc --- map.go | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/map.go b/map.go index cf9eebc..25d6413 100644 --- a/map.go +++ b/map.go @@ -21,6 +21,14 @@ func NewMap(Log *service.LoggerService) *Bots { } } +// Get godoc +// @Summary Получение бота +// @Description Получение бота по username +// @ID bots/get +// @Tags Боты +// @Param name path string true "Username бота" +// @Router /bot/{name} [get] +// @Success 200 {object} telebot.User func (b *Bots) Get(c *fiber.Ctx) error { name := c.Params("name") if name != "" { @@ -47,7 +55,14 @@ func (b *Bots) Get(c *fiber.Ctx) error { return c.Status(404).SendString("not found") } -func (b *Bots) GetAll(c *fiber.Ctx) error { +// Get godoc +// @Summary Получение списка ботов +// @Description Получение списка ботов +// @ID bots/list +// @Tags Боты +// @Router /bot/list [get] +// @Success 200 {array} telebot.User +func (b *Bots) List(c *fiber.Ctx) error { bots := []*telebot.User{} b.I.Range(func(key string, value *Bot) bool { bot := value