From 81b1089041b07c5f66877460a64afa399f4e1f7e Mon Sep 17 00:00:00 2001 From: Marcelo Jorge Vieira Date: Sun, 26 Jul 2020 19:07:34 -0300 Subject: [PATCH] Initial docs (swagger) --- Makefile | 3 + README.md | 4 + api/brokers.go | 35 + api/certificates_of_deposit_purchases.go | 21 + api/certificates_of_deposit_sales.go | 21 + api/ficfi_purchases.go | 21 + api/ficfi_sales.go | 21 + api/fiis_purchases.go | 21 + api/fiis_sales.go | 21 + api/portfolios.go | 37 + api/purchases.go | 13 + api/sales.go | 13 + api/server.go | 3 + api/stocks_funds_purchases.go | 21 + api/stocks_funds_sales.go | 21 + api/stocks_purchases.go | 21 + api/stocks_sales.go | 21 + api/treasuries_direct_purchases.go | 21 + api/treasuries_direct_sales.go | 21 + docs/docs.go | 1466 ++++++++++++++++++++++ docs/swagger.json | 1404 +++++++++++++++++++++ docs/swagger.yaml | 948 ++++++++++++++ go.mod | 13 + go.sum | 133 ++ main.go | 12 + 25 files changed, 4336 insertions(+) create mode 100644 docs/docs.go create mode 100644 docs/swagger.json create mode 100644 docs/swagger.yaml diff --git a/Makefile b/Makefile index e4e923f..56f1378 100644 --- a/Makefile +++ b/Makefile @@ -10,3 +10,6 @@ run: clean: @find . -name "*.swp" -delete + +docs-update: + @swag init diff --git a/README.md b/README.md index 06f1b5d..0311f74 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,10 @@ make setup make run ``` +## Docs + +http://localhost:8889/swagger/index.html + ## Examples: * Adding portfolio: diff --git a/api/brokers.go b/api/brokers.go index 2a3acca..bc2e640 100644 --- a/api/brokers.go +++ b/api/brokers.go @@ -12,6 +12,14 @@ import ( log "github.com/sirupsen/logrus" ) +// broker godoc +// @Summary Get a broker +// @Description get all broker data +// @Accept json +// @Produce json +// @Success 200 {object} wallet.Broker +// @Router /brokers/{id} [get] +// @Param id path string true "Broker id" func (s *server) broker(c echo.Context) error { id := c.Param("id") log.Debugf("[API] Retrieving broker id: %s", id) @@ -25,6 +33,13 @@ func (s *server) broker(c echo.Context) error { return c.JSON(http.StatusOK, result) } +// brokers godoc +// @Summary List all brokers +// @Description get all brokers data +// @Accept json +// @Produce json +// @Success 200 {array} wallet.Broker +// @Router /brokers [get] func (s *server) brokers(c echo.Context) error { log.Debug("Retrieving all brokers") @@ -36,6 +51,12 @@ func (s *server) brokers(c echo.Context) error { return c.JSON(http.StatusOK, result) } +// brokersAdd godoc +// @Summary Insert some broker +// @Description insert new broker +// @Accept json +// @Produce json +// @Router /brokers [post] func (s *server) brokersAdd(c echo.Context) error { log.Debug("Insert brokers data") @@ -58,6 +79,13 @@ func (s *server) brokersAdd(c echo.Context) error { return c.JSON(http.StatusOK, result) } +// brokersDelete godoc +// @Summary Delete broker by ID +// @Description delete some broker by id +// @Accept json +// @Produce json +// @Router /brokers/{id} [delete] +// @Param id path string true "Broker id" func (s *server) brokersDelete(c echo.Context) error { id := c.Param("id") log.Debugf("Deleting %s data", id) @@ -68,6 +96,13 @@ func (s *server) brokersDelete(c echo.Context) error { return c.JSON(http.StatusOK, result) } +// brokersUpdate godoc +// @Summary Update broker data by ID +// @Description Update some broker by id +// @Accept json +// @Produce json +// @Router /brokers/{id} [put] +// @Param id path string true "Broker id" func (s *server) brokersUpdate(c echo.Context) error { id := c.Param("id") log.Debugf("Updating %s data", id) diff --git a/api/certificates_of_deposit_purchases.go b/api/certificates_of_deposit_purchases.go index 75bda56..4b894c3 100644 --- a/api/certificates_of_deposit_purchases.go +++ b/api/certificates_of_deposit_purchases.go @@ -21,6 +21,14 @@ func (s *server) getAllCertificatesOfDepositPurchases(c echo.Context) error { return c.JSON(http.StatusOK, result) } +// getCertificateOfDepositPurchaseByID godoc +// @Summary Get get certificate of deposit purchase by ID +// @Description get certificate of deposi purchase data +// @Accept json +// @Produce json +// @Success 200 {object} wallet.CertificateOfDeposit +// @Router /certificate-of-deposit/purchases/{id} [get] +// @Param id path string true "Purchase id" func (s *server) getCertificateOfDepositPurchaseByID(c echo.Context) error { id := c.Param("id") log.Debugf("[API] Retrieving certificate of deposit purchase with id: %s", id) @@ -35,6 +43,12 @@ func (s *server) getCertificateOfDepositPurchaseByID(c echo.Context) error { return c.JSON(http.StatusOK, result) } +// insertCertificateOfDepositPurchase godoc +// @Summary Insert some certificate of deposit purchase +// @Description insert new certificate of deposit purchase +// @Accept json +// @Produce json +// @Router /certificate-of-deposit/purchases [post] func (s *server) insertCertificateOfDepositPurchase(c echo.Context) error { log.Debugf("[API] Inserting certificate of deposit purchase") @@ -59,6 +73,13 @@ func (s *server) insertCertificateOfDepositPurchase(c echo.Context) error { return c.JSON(http.StatusOK, result) } +// updateCertificateOfDepositPurchaseByID godoc +// @Summary Update some certificate of deposit purchase +// @Description update new certificate of deposit purchase +// @Accept json +// @Produce json +// @Router /certificate-of-deposit/purchases/{id} [put] +// @Param id path string true "Purchase id" func (s *server) updateCertificateOfDepositPurchaseByID(c echo.Context) error { id := c.Param("id") log.Debugf("[API] Updating certificate of deposit purchase with id %s", id) diff --git a/api/certificates_of_deposit_sales.go b/api/certificates_of_deposit_sales.go index bbc4c81..51199dd 100644 --- a/api/certificates_of_deposit_sales.go +++ b/api/certificates_of_deposit_sales.go @@ -21,6 +21,14 @@ func (s *server) getAllCertificatesOfDepositSales(c echo.Context) error { return c.JSON(http.StatusOK, result) } +// getCertificateOfDepositSaleByID godoc +// @Summary Get get certificate of deposit sale by ID +// @Description get certificate of deposit sale data +// @Accept json +// @Produce json +// @Success 200 {object} wallet.CertificateOfDeposit +// @Router /certificates-of-deposit/sales/{id} [get] +// @Param id path string true "Sale id" func (s *server) getCertificateOfDepositSaleByID(c echo.Context) error { id := c.Param("id") log.Debugf("[API] Retrieving certificate of deposit sale with id: %s", id) @@ -35,6 +43,12 @@ func (s *server) getCertificateOfDepositSaleByID(c echo.Context) error { return c.JSON(http.StatusOK, result) } +// insertCertificateOfDepositSale godoc +// @Summary Insert some certificate of deposit sale +// @Description insert new certificate of deposit sale +// @Accept json +// @Produce json +// @Router /certificates-of-deposit/sales [post] func (s *server) insertCertificateOfDepositSale(c echo.Context) error { log.Debugf("[API] Inserting certificate of deposit sale") @@ -59,6 +73,13 @@ func (s *server) insertCertificateOfDepositSale(c echo.Context) error { return c.JSON(http.StatusOK, result) } +// updateCertificateOfDepositSaleByID godoc +// @Summary Update some certificate of deposit sale +// @Description update new certificate of deposit sale +// @Accept json +// @Produce json +// @Router /certificates-of-deposit/sales/{id} [put] +// @Param id path string true "Sale id" func (s *server) updateCertificateOfDepositSaleByID(c echo.Context) error { id := c.Param("id") log.Debugf("[API] Updating certificate of deposit sale with id %s", id) diff --git a/api/ficfi_purchases.go b/api/ficfi_purchases.go index 979a14f..9570782 100644 --- a/api/ficfi_purchases.go +++ b/api/ficfi_purchases.go @@ -21,6 +21,14 @@ func (s *server) getAllFICFIPurchases(c echo.Context) error { return c.JSON(http.StatusOK, result) } +// getFICFIPurchaseByID godoc +// @Summary Get FICFI purchase by ID +// @Description get FIFCI purchase data +// @Accept json +// @Produce json +// @Success 200 {object} wallet.FICFI +// @Router /ficfi/purchases/{id} [get] +// @Param id path string true "Purchase id" func (s *server) getFICFIPurchaseByID(c echo.Context) error { id := c.Param("id") log.Debugf("[API] Retrieving FICFI purchase with id: %s", id) @@ -35,6 +43,12 @@ func (s *server) getFICFIPurchaseByID(c echo.Context) error { return c.JSON(http.StatusOK, result) } +// insertFICFIPurchase godoc +// @Summary Insert some FICFI purchase +// @Description insert new FICFI purchase +// @Accept json +// @Produce json +// @Router /ficfi/purchases [post] func (s *server) insertFICFIPurchase(c echo.Context) error { log.Debugf("[API] Inserting FICFI purchase") @@ -59,6 +73,13 @@ func (s *server) insertFICFIPurchase(c echo.Context) error { return c.JSON(http.StatusOK, result) } +// updateFICFIPurchaseByID godoc +// @Summary Update some FICFI purchase +// @Description update new FICFI purchase +// @Accept json +// @Produce json +// @Router /ficfi/purchases/{id} [put] +// @Param id path string true "Purchase id" func (s *server) updateFICFIPurchaseByID(c echo.Context) error { id := c.Param("id") log.Debugf("[API] Updating FICFI purchase with id %s", id) diff --git a/api/ficfi_sales.go b/api/ficfi_sales.go index ed271f7..968f7ab 100644 --- a/api/ficfi_sales.go +++ b/api/ficfi_sales.go @@ -21,6 +21,14 @@ func (s *server) getAllFICFISales(c echo.Context) error { return c.JSON(http.StatusOK, result) } +// getFICFISaleByID godoc +// @Summary Get FICFI sale by ID +// @Description get FICFI sale data +// @Accept json +// @Produce json +// @Success 200 {object} wallet.FICFI +// @Router /ficfi/sales/{id} [get] +// @Param id path string true "Sale id" func (s *server) getFICFISaleByID(c echo.Context) error { id := c.Param("id") log.Debugf("[API] Retrieving FICFI sale with id: %s", id) @@ -35,6 +43,12 @@ func (s *server) getFICFISaleByID(c echo.Context) error { return c.JSON(http.StatusOK, result) } +// insertFICFISale godoc +// @Summary Insert some FICFI sale +// @Description insert new FICFI sale +// @Accept json +// @Produce json +// @Router /ficfi/sales [post] func (s *server) insertFICFISale(c echo.Context) error { log.Debugf("[API] Inserting FICFI sale") @@ -59,6 +73,13 @@ func (s *server) insertFICFISale(c echo.Context) error { return c.JSON(http.StatusOK, result) } +// updateFICFISaleByID godoc +// @Summary Update some FICFI sale +// @Description update new FICFI sale +// @Accept json +// @Produce json +// @Router /ficfi/sales/{id} [put] +// @Param id path string true "Sale id" func (s *server) updateFICFISaleByID(c echo.Context) error { id := c.Param("id") log.Debugf("[API] Updating FICFI sale with id %s", id) diff --git a/api/fiis_purchases.go b/api/fiis_purchases.go index 937e3af..d9cd5b5 100644 --- a/api/fiis_purchases.go +++ b/api/fiis_purchases.go @@ -21,6 +21,14 @@ func (s *server) getAllFIIsPurchases(c echo.Context) error { return c.JSON(http.StatusOK, result) } +// getFIIPurchaseByID godoc +// @Summary Get FII purchase by ID +// @Description get FII purchase data +// @Accept json +// @Produce json +// @Success 200 {object} wallet.FII +// @Router /fiis/purchases/{id} [get] +// @Param id path string true "Purchase id" func (s *server) getFIIPurchaseByID(c echo.Context) error { id := c.Param("id") log.Debugf("[API] Retrieving stock purchase with id: %s", id) @@ -35,6 +43,12 @@ func (s *server) getFIIPurchaseByID(c echo.Context) error { return c.JSON(http.StatusOK, result) } +// insertFIIPurchase godoc +// @Summary Insert some FII purchase +// @Description insert new FII purchase +// @Accept json +// @Produce json +// @Router /fiis/purchases [post] func (s *server) insertFIIPurchase(c echo.Context) error { log.Debugf("[API] Inserting stock purchase") @@ -59,6 +73,13 @@ func (s *server) insertFIIPurchase(c echo.Context) error { return c.JSON(http.StatusOK, result) } +// updateFIIPurchaseByID godoc +// @Summary Update some FII purchase +// @Description update new FII purchase +// @Accept json +// @Produce json +// @Router /fiis/purchases/{id} [put] +// @Param id path string true "Purchase id" func (s *server) updateFIIPurchaseByID(c echo.Context) error { id := c.Param("id") log.Debugf("[API] Updating stock purchase with id %s", id) diff --git a/api/fiis_sales.go b/api/fiis_sales.go index 9af6c84..5b044e9 100644 --- a/api/fiis_sales.go +++ b/api/fiis_sales.go @@ -21,6 +21,14 @@ func (s *server) getAllFIISales(c echo.Context) error { return c.JSON(http.StatusOK, result) } +// getFIISaleByID godoc +// @Summary Get FII sale by ID +// @Description get FII sale data +// @Accept json +// @Produce json +// @Success 200 {object} wallet.FII +// @Router /fiis/sales/{id} [get] +// @Param id path string true "Sale id" func (s *server) getFIISaleByID(c echo.Context) error { id := c.Param("id") log.Debugf("[API] Retrieving stock sale with id: %s", id) @@ -35,6 +43,12 @@ func (s *server) getFIISaleByID(c echo.Context) error { return c.JSON(http.StatusOK, result) } +// insertFIISale godoc +// @Summary Insert some FII sale +// @Description insert new FII sale +// @Accept json +// @Produce json +// @Router /fiis/sales [post] func (s *server) insertFIISale(c echo.Context) error { log.Debugf("[API] Inserting stock sale") @@ -59,6 +73,13 @@ func (s *server) insertFIISale(c echo.Context) error { return c.JSON(http.StatusOK, result) } +// updateFIISaleByID godoc +// @Summary Update some FII sale +// @Description update new FII sale +// @Accept json +// @Produce json +// @Router /fiis/sales/{id} [put] +// @Param id path string true "Sale id" func (s *server) updateFIISaleByID(c echo.Context) error { id := c.Param("id") log.Debugf("[API] Updating stock sale with id %s", id) diff --git a/api/portfolios.go b/api/portfolios.go index 3577ff7..117cb4b 100644 --- a/api/portfolios.go +++ b/api/portfolios.go @@ -13,6 +13,15 @@ import ( log "github.com/sirupsen/logrus" ) +// portfolio godoc +// @Summary Get a portfolio +// @Description get all portfolio data +// @Accept json +// @Produce json +// @Success 200 {object} wallet.Portfolio +// @Router /portfolios/{id} [get] +// @Param id path string true "Broker id" +// @Param year query string false "filter by year" func (s *server) portfolio(c echo.Context) error { id := c.Param("id") log.Debugf("Retrieving %s data...", id) @@ -46,6 +55,14 @@ func (s *server) portfolio(c echo.Context) error { return c.JSON(http.StatusOK, result) } +// portfolios godoc +// @Summary List all portfolios +// @Description get all portfolio data +// @Accept json +// @Produce json +// @Success 200 {array} wallet.Portfolio +// @Router /portfolios [get] +// @Param year query string false "filter by year" func (s *server) portfolios(c echo.Context) error { log.Debug("Retrieving all portfolios") @@ -76,6 +93,12 @@ func (s *server) portfolios(c echo.Context) error { return c.JSON(http.StatusOK, portfolios) } +// portfoliosAdd godoc +// @Summary Insert some portfolio +// @Description insert new portfolio +// @Accept json +// @Produce json +// @Router /portfolios [post] func (s *server) portfoliosAdd(c echo.Context) error { log.Debug("Insert portfolio data") @@ -98,6 +121,13 @@ func (s *server) portfoliosAdd(c echo.Context) error { return c.JSON(http.StatusOK, result) } +// portfoliosDelete godoc +// @Summary Delete portfolio by ID +// @Description delete some portfolio by id +// @Accept json +// @Produce json +// @Router /portfolios/{id} [delete] +// @Param id path string true "Portfolio id" func (s *server) portfoliosDelete(c echo.Context) error { id := c.Param("id") log.Debugf("Deleting %s data", id) @@ -108,6 +138,13 @@ func (s *server) portfoliosDelete(c echo.Context) error { return c.JSON(http.StatusOK, result) } +// portfoliosUpdate godoc +// @Summary Update portfolio data by ID +// @Description Update some portfolio by id +// @Accept json +// @Produce json +// @Router /portfolios/{id} [put] +// @Param id path string true "Portfolio id" func (s *server) portfoliosUpdate(c echo.Context) error { id := c.Param("id") log.Debugf("Updating %s data", id) diff --git a/api/purchases.go b/api/purchases.go index 78d44c8..b1ccdd1 100644 --- a/api/purchases.go +++ b/api/purchases.go @@ -10,6 +10,12 @@ import ( log "github.com/sirupsen/logrus" ) +// getAllPurchases godoc +// @Summary List all purchases +// @Description get all purchases data +// @Accept json +// @Produce json +// @Router /purchases [get] func (s *server) getAllPurchases(c echo.Context) error { log.Debug("[API] Retrieving all purchases") result, err := s.db.GetAllPurchases() @@ -19,6 +25,13 @@ func (s *server) getAllPurchases(c echo.Context) error { return c.JSON(http.StatusOK, result) } +// deletePurchaseByID godoc +// @Summary Delete purchase by ID +// @Description delete some purchase by id +// @Accept json +// @Produce json +// @Router /purchases/{id} [delete] +// @Param id path string true "Sale id" func (s *server) deletePurchaseByID(c echo.Context) error { id := c.Param("id") log.Debugf("Deleting %s data", id) diff --git a/api/sales.go b/api/sales.go index f067ec3..b7f6a4c 100644 --- a/api/sales.go +++ b/api/sales.go @@ -10,6 +10,12 @@ import ( log "github.com/sirupsen/logrus" ) +// getAllSales godoc +// @Summary List all sales +// @Description get all sales data +// @Accept json +// @Produce json +// @Router /sales [get] func (s *server) getAllSales(c echo.Context) error { log.Debug("[API] Retrieving all sales") result, err := s.db.GetAllSales() @@ -19,6 +25,13 @@ func (s *server) getAllSales(c echo.Context) error { return c.JSON(http.StatusOK, result) } +// deleteSaleByID godoc +// @Summary Delete sale by ID +// @Description delete some sale by id +// @Accept json +// @Produce json +// @Router /sales/{id} [delete] +// @Param id path string true "Sale id" func (s *server) deleteSaleByID(c echo.Context) error { id := c.Param("id") log.Debugf("Deleting %s data", id) diff --git a/api/server.go b/api/server.go index bfb1879..f1988b1 100644 --- a/api/server.go +++ b/api/server.go @@ -12,6 +12,8 @@ import ( "github.com/mfinancecombr/finance-wallet-api/db" "github.com/spf13/viper" "gopkg.in/go-playground/validator.v9" + echoSwagger "github.com/swaggo/echo-swagger" + _ "github.com/mfinancecombr/finance-wallet-api/docs" // docs is generated by Swag CLI ) const Version = "0.1.0" @@ -79,6 +81,7 @@ func NewServerFromDB() (Server, error) { echoInstance.File("/favicon.ico", "images/favicon.ico") echoInstance.GET("/", server.index) echoInstance.GET("/healthcheck", server.healthcheck) + echoInstance.GET("/swagger/*", echoSwagger.WrapHandler) echoInstance.Static("/static/icons", "images/icons") echoInstance.DELETE("/api/v1/purchases/:id", server.deletePurchaseByID) diff --git a/api/stocks_funds_purchases.go b/api/stocks_funds_purchases.go index 7cc1786..7febeff 100644 --- a/api/stocks_funds_purchases.go +++ b/api/stocks_funds_purchases.go @@ -21,6 +21,14 @@ func (s *server) getAllStockFundsPurchases(c echo.Context) error { return c.JSON(http.StatusOK, result) } +// getStockFundPurchaseByID godoc +// @Summary Get stocks fund purchase by ID +// @Description get stocks fund purchase data +// @Accept json +// @Produce json +// @Success 200 {object} wallet.StockFund +// @Router /stocks-funds/purchases/{id} [get] +// @Param id path string true "Purchase id" func (s *server) getStockFundPurchaseByID(c echo.Context) error { id := c.Param("id") log.Debugf("[API] Retrieving stock fund purchase with id: %s", id) @@ -35,6 +43,12 @@ func (s *server) getStockFundPurchaseByID(c echo.Context) error { return c.JSON(http.StatusOK, result) } +// insertStockFundPurchase godoc +// @Summary Insert some stocks fund purchase +// @Description insert new stocks fund purchase +// @Accept json +// @Produce json +// @Router /stocks-funds/purchases [post] func (s *server) insertStockFundPurchase(c echo.Context) error { log.Debugf("[API] Inserting stock fund purchase") @@ -59,6 +73,13 @@ func (s *server) insertStockFundPurchase(c echo.Context) error { return c.JSON(http.StatusOK, result) } +// updateStockFundPurchaseByID godoc +// @Summary Update some stocks fund purchase +// @Description update new stocks fund purchase +// @Accept json +// @Produce json +// @Router /stocks-funds/purchases/{id} [put] +// @Param id path string true "Purchase id" func (s *server) updateStockFundPurchaseByID(c echo.Context) error { id := c.Param("id") log.Debugf("[API] Updating stock fund purchase with id %s", id) diff --git a/api/stocks_funds_sales.go b/api/stocks_funds_sales.go index a209f9d..50cc3dc 100644 --- a/api/stocks_funds_sales.go +++ b/api/stocks_funds_sales.go @@ -21,6 +21,14 @@ func (s *server) getAllStockFundsSales(c echo.Context) error { return c.JSON(http.StatusOK, result) } +// getStockFundSaleByID godoc +// @Summary Get stocks fund sale by ID +// @Description get stocks fund sale data +// @Accept json +// @Produce json +// @Success 200 {object} wallet.StockFund +// @Router /stocks-funds/sales/{id} [get] +// @Param id path string true "Sale id" func (s *server) getStockFundSaleByID(c echo.Context) error { id := c.Param("id") log.Debugf("[API] Retrieving stock fund sale with id: %s", id) @@ -35,6 +43,12 @@ func (s *server) getStockFundSaleByID(c echo.Context) error { return c.JSON(http.StatusOK, result) } +// insertStockFundSale godoc +// @Summary Insert some stocks fund sale +// @Description insert new stocks fund sale +// @Accept json +// @Produce json +// @Router /stocks-funds/sales [post] func (s *server) insertStockFundSale(c echo.Context) error { log.Debugf("[API] Inserting stock fund sale") @@ -59,6 +73,13 @@ func (s *server) insertStockFundSale(c echo.Context) error { return c.JSON(http.StatusOK, result) } +// updateStockFundSaleByID godoc +// @Summary Update some stocks fund sale +// @Description update new stocks fund sale +// @Accept json +// @Produce json +// @Router /stocks-funds/sales/{id} [put] +// @Param id path string true "Sale id" func (s *server) updateStockFundSaleByID(c echo.Context) error { id := c.Param("id") log.Debugf("[API] Updating stock fund sale with id %s", id) diff --git a/api/stocks_purchases.go b/api/stocks_purchases.go index e025768..a4257ae 100644 --- a/api/stocks_purchases.go +++ b/api/stocks_purchases.go @@ -21,6 +21,14 @@ func (s *server) getAllStockPurchases(c echo.Context) error { return c.JSON(http.StatusOK, result) } +// getStockPurchaseByID godoc +// @Summary Get stocks purchase by ID +// @Description get stocks purchase data +// @Accept json +// @Produce json +// @Success 200 {object} wallet.Stock +// @Router /stocks/purchases/{id} [get] +// @Param id path string true "Purchase id" func (s *server) getStockPurchaseByID(c echo.Context) error { id := c.Param("id") log.Debugf("[API] Retrieving stock purchase with id: %s", id) @@ -35,6 +43,12 @@ func (s *server) getStockPurchaseByID(c echo.Context) error { return c.JSON(http.StatusOK, result) } +// insertStockPurchase godoc +// @Summary Insert some stocks purchase +// @Description insert new stocksFII purchase +// @Accept json +// @Produce json +// @Router /stocks/purchases [post] func (s *server) insertStockPurchase(c echo.Context) error { log.Debugf("[API] Inserting stock purchase") @@ -59,6 +73,13 @@ func (s *server) insertStockPurchase(c echo.Context) error { return c.JSON(http.StatusOK, result) } +// updateStockPurchaseByID godoc +// @Summary Update some stocks purchase +// @Description update new stocksFII purchase +// @Accept json +// @Produce json +// @Router /stocks/purchases/{id} [put] +// @Param id path string true "Purchase id" func (s *server) updateStockPurchaseByID(c echo.Context) error { id := c.Param("id") log.Debugf("[API] Updating stock purchase with id %s", id) diff --git a/api/stocks_sales.go b/api/stocks_sales.go index 009811c..5914043 100644 --- a/api/stocks_sales.go +++ b/api/stocks_sales.go @@ -21,6 +21,14 @@ func (s *server) getAllStockSales(c echo.Context) error { return c.JSON(http.StatusOK, result) } +// getStockSaleByID godoc +// @Summary Get stocks sale by ID +// @Description get stocks sale data +// @Accept json +// @Produce json +// @Router /stocks/sales/{id} [get] +// @Success 200 {object} wallet.Stock +// @Param id path string true "Sale id" func (s *server) getStockSaleByID(c echo.Context) error { id := c.Param("id") log.Debugf("[API] Retrieving stock sale with id: %s", id) @@ -35,6 +43,12 @@ func (s *server) getStockSaleByID(c echo.Context) error { return c.JSON(http.StatusOK, result) } +// insertStockSale godoc +// @Summary Insert some stocks sale +// @Description insert new stocks sale +// @Accept json +// @Produce json +// @Router /stocks/sales [post] func (s *server) insertStockSale(c echo.Context) error { log.Debugf("[API] Inserting stock sale") @@ -59,6 +73,13 @@ func (s *server) insertStockSale(c echo.Context) error { return c.JSON(http.StatusOK, result) } +// updateStockSaleByID godoc +// @Summary Update some stocks sale +// @Description update new stocks sale +// @Accept json +// @Produce json +// @Router /stocks/sales/{id} [put] +// @Param id path string true "Sale id" func (s *server) updateStockSaleByID(c echo.Context) error { id := c.Param("id") log.Debugf("[API] Updating stock sale with id %s", id) diff --git a/api/treasuries_direct_purchases.go b/api/treasuries_direct_purchases.go index ef63a52..cc7a1a9 100644 --- a/api/treasuries_direct_purchases.go +++ b/api/treasuries_direct_purchases.go @@ -21,6 +21,14 @@ func (s *server) getAllTreasuriesDirectPurchases(c echo.Context) error { return c.JSON(http.StatusOK, result) } +// getTreasuryDirectPurchaseByID godoc +// @Summary Get treasury direct purchase by ID +// @Description get treasury direct purchase data +// @Accept json +// @Produce json +// @Success 200 {object} wallet.TreasuryDirect +// @Router /treasuries-direct/purchases/{id} [get] +// @Param id path string true "Purchase id" func (s *server) getTreasuryDirectPurchaseByID(c echo.Context) error { id := c.Param("id") log.Debugf("[API] Retrieving treasury direct purchase with id: %s", id) @@ -35,6 +43,12 @@ func (s *server) getTreasuryDirectPurchaseByID(c echo.Context) error { return c.JSON(http.StatusOK, result) } +// insertTreasuryDirectPurchase godoc +// @Summary Insert some treasury direct purchase +// @Description insert new treasury direct purchase +// @Accept json +// @Produce json +// @Router /treasuries-direct/purchases [post] func (s *server) insertTreasuryDirectPurchase(c echo.Context) error { log.Debugf("[API] Inserting treasury direct purchase") @@ -59,6 +73,13 @@ func (s *server) insertTreasuryDirectPurchase(c echo.Context) error { return c.JSON(http.StatusOK, result) } +// updateTreasuryDirectPurchaseByID godoc +// @Summary Update some treasury direct purchase +// @Description update new treasury direct purchase +// @Accept json +// @Produce json +// @Router /treasuries-direct/purchases/{id} [put] +// @Param id path string true "Purchase id" func (s *server) updateTreasuryDirectPurchaseByID(c echo.Context) error { id := c.Param("id") log.Debugf("[API] Updating treasury direct purchase with id %s", id) diff --git a/api/treasuries_direct_sales.go b/api/treasuries_direct_sales.go index 64d2087..8cbc74a 100644 --- a/api/treasuries_direct_sales.go +++ b/api/treasuries_direct_sales.go @@ -21,6 +21,14 @@ func (s *server) getAllTreasuriesDirectSales(c echo.Context) error { return c.JSON(http.StatusOK, result) } +// getTreasuryDirectSaleByID godoc +// @Summary Get treasury direct sale by ID +// @Description get treasury direct sale data +// @Accept json +// @Produce json +// @Success 200 {object} wallet.TreasuryDirect +// @Router /treasuries-direct/sales/{id} [get] +// @Param id path string true "Sale id" func (s *server) getTreasuryDirectSaleByID(c echo.Context) error { id := c.Param("id") log.Debugf("[API] Retrieving treasury direct sale with id: %s", id) @@ -35,6 +43,12 @@ func (s *server) getTreasuryDirectSaleByID(c echo.Context) error { return c.JSON(http.StatusOK, result) } +// insertTreasuryDirectSale godoc +// @Summary Insert some treasury direct sale +// @Description insert new treasury direct sale +// @Accept json +// @Produce json +// @Router /treasuries-direct/sales [post] func (s *server) insertTreasuryDirectSale(c echo.Context) error { log.Debugf("[API] Inserting treasury direct sale") @@ -59,6 +73,13 @@ func (s *server) insertTreasuryDirectSale(c echo.Context) error { return c.JSON(http.StatusOK, result) } +// updateTreasuryDirectSaleByID godoc +// @Summary Update some treasury direct sale +// @Description update new treasury direct sale +// @Accept json +// @Produce json +// @Router /treasuries-direct/sales/{id} [put] +// @Param id path string true "Sale id" func (s *server) updateTreasuryDirectSaleByID(c echo.Context) error { id := c.Param("id") log.Debugf("[API] Updating treasury direct sale with id %s", id) diff --git a/docs/docs.go b/docs/docs.go new file mode 100644 index 0000000..0a2b5bd --- /dev/null +++ b/docs/docs.go @@ -0,0 +1,1466 @@ +// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT +// This file was generated by swaggo/swag + +package docs + +import ( + "bytes" + "encoding/json" + "strings" + + "github.com/alecthomas/template" + "github.com/swaggo/swag" +) + +var doc = `{ + "schemes": {{ marshal .Schemes }}, + "swagger": "2.0", + "info": { + "description": "{{.Description}}", + "title": "{{.Title}}", + "contact": { + "name": "API Support", + "url": "https://github.com/mfinancecombr/finance-wallet-api" + }, + "license": { + "name": "BSD 3-Clause", + "url": "https://opensource.org/licenses/BSD-3-Clause" + }, + "version": "{{.Version}}" + }, + "host": "{{.Host}}", + "basePath": "{{.BasePath}}", + "paths": { + "/brokers": { + "get": { + "description": "get all brokers data", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "List all brokers", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/wallet.Broker" + } + } + } + } + }, + "post": { + "description": "insert new broker", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Insert some broker" + } + }, + "/brokers/{id}": { + "get": { + "description": "get all broker data", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Get a broker", + "parameters": [ + { + "type": "string", + "description": "Broker id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/wallet.Broker" + } + } + } + }, + "put": { + "description": "Update some broker by id", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Update broker data by ID", + "parameters": [ + { + "type": "string", + "description": "Broker id", + "name": "id", + "in": "path", + "required": true + } + ] + }, + "delete": { + "description": "delete some broker by id", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Delete broker by ID", + "parameters": [ + { + "type": "string", + "description": "Broker id", + "name": "id", + "in": "path", + "required": true + } + ] + } + }, + "/certificate-of-deposit/purchases": { + "post": { + "description": "insert new certificate of deposit purchase", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Insert some certificate of deposit purchase" + } + }, + "/certificate-of-deposit/purchases/{id}": { + "get": { + "description": "get certificate of deposi purchase data", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Get get certificate of deposit purchase by ID", + "parameters": [ + { + "type": "string", + "description": "Purchase id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/wallet.CertificateOfDeposit" + } + } + } + }, + "put": { + "description": "update new certificate of deposit purchase", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Update some certificate of deposit purchase", + "parameters": [ + { + "type": "string", + "description": "Purchase id", + "name": "id", + "in": "path", + "required": true + } + ] + } + }, + "/certificates-of-deposit/sales": { + "post": { + "description": "insert new certificate of deposit sale", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Insert some certificate of deposit sale" + } + }, + "/certificates-of-deposit/sales/{id}": { + "get": { + "description": "get certificate of deposit sale data", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Get get certificate of deposit sale by ID", + "parameters": [ + { + "type": "string", + "description": "Sale id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/wallet.CertificateOfDeposit" + } + } + } + }, + "put": { + "description": "update new certificate of deposit sale", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Update some certificate of deposit sale", + "parameters": [ + { + "type": "string", + "description": "Sale id", + "name": "id", + "in": "path", + "required": true + } + ] + } + }, + "/ficfi/purchases": { + "post": { + "description": "insert new FICFI purchase", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Insert some FICFI purchase" + } + }, + "/ficfi/purchases/{id}": { + "get": { + "description": "get FIFCI purchase data", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Get FICFI purchase by ID", + "parameters": [ + { + "type": "string", + "description": "Purchase id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/wallet.FICFI" + } + } + } + }, + "put": { + "description": "update new FICFI purchase", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Update some FICFI purchase", + "parameters": [ + { + "type": "string", + "description": "Purchase id", + "name": "id", + "in": "path", + "required": true + } + ] + } + }, + "/ficfi/sales": { + "post": { + "description": "insert new FICFI sale", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Insert some FICFI sale" + } + }, + "/ficfi/sales/{id}": { + "get": { + "description": "get FICFI sale data", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Get FICFI sale by ID", + "parameters": [ + { + "type": "string", + "description": "Sale id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/wallet.FICFI" + } + } + } + }, + "put": { + "description": "update new FICFI sale", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Update some FICFI sale", + "parameters": [ + { + "type": "string", + "description": "Sale id", + "name": "id", + "in": "path", + "required": true + } + ] + } + }, + "/fiis/purchases": { + "post": { + "description": "insert new FII purchase", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Insert some FII purchase" + } + }, + "/fiis/purchases/{id}": { + "get": { + "description": "get FII purchase data", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Get FII purchase by ID", + "parameters": [ + { + "type": "string", + "description": "Purchase id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/wallet.FII" + } + } + } + }, + "put": { + "description": "update new FII purchase", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Update some FII purchase", + "parameters": [ + { + "type": "string", + "description": "Purchase id", + "name": "id", + "in": "path", + "required": true + } + ] + } + }, + "/fiis/sales": { + "post": { + "description": "insert new FII sale", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Insert some FII sale" + } + }, + "/fiis/sales/{id}": { + "get": { + "description": "get FII sale data", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Get FII sale by ID", + "parameters": [ + { + "type": "string", + "description": "Sale id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/wallet.FII" + } + } + } + }, + "put": { + "description": "update new FII sale", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Update some FII sale", + "parameters": [ + { + "type": "string", + "description": "Sale id", + "name": "id", + "in": "path", + "required": true + } + ] + } + }, + "/portfolios": { + "get": { + "description": "get all portfolio data", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "List all portfolios", + "parameters": [ + { + "type": "string", + "description": "filter by year", + "name": "year", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/wallet.Portfolio" + } + } + } + } + } + }, + "/portfolios/{id}": { + "get": { + "description": "get all portfolio data", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Get a portfolio", + "parameters": [ + { + "type": "string", + "description": "Broker id", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "filter by year", + "name": "year", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/wallet.Portfolio" + } + } + } + }, + "put": { + "description": "Update some portfolio by id", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Update portfolio data by ID", + "parameters": [ + { + "type": "string", + "description": "Portfolio id", + "name": "id", + "in": "path", + "required": true + } + ] + }, + "delete": { + "description": "delete some portfolio by id", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Delete portfolio by ID", + "parameters": [ + { + "type": "string", + "description": "Portfolio id", + "name": "id", + "in": "path", + "required": true + } + ] + } + }, + "/portfolioss": { + "post": { + "description": "insert new portfolio", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Insert some portfolio" + } + }, + "/purchases": { + "get": { + "description": "get all purchases data", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "List all purchases" + } + }, + "/purchases/{id}": { + "delete": { + "description": "delete some purchase by id", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Delete purchase by ID", + "parameters": [ + { + "type": "string", + "description": "Sale id", + "name": "id", + "in": "path", + "required": true + } + ] + } + }, + "/sales": { + "get": { + "description": "get all sales data", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "List all sales" + } + }, + "/sales/{id}": { + "delete": { + "description": "delete some sale by id", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Delete sale by ID", + "parameters": [ + { + "type": "string", + "description": "Sale id", + "name": "id", + "in": "path", + "required": true + } + ] + } + }, + "/stocks-funds/purchases": { + "post": { + "description": "insert new stocks fund purchase", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Insert some stocks fund purchase" + } + }, + "/stocks-funds/purchases/{id}": { + "get": { + "description": "get stocks fund purchase data", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Get stocks fund purchase by ID", + "parameters": [ + { + "type": "string", + "description": "Purchase id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/wallet.StockFund" + } + } + } + }, + "put": { + "description": "update new stocks fund purchase", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Update some stocks fund purchase", + "parameters": [ + { + "type": "string", + "description": "Purchase id", + "name": "id", + "in": "path", + "required": true + } + ] + } + }, + "/stocks-funds/sales": { + "post": { + "description": "insert new stocks fund sale", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Insert some stocks fund sale" + } + }, + "/stocks-funds/sales/{id}": { + "get": { + "description": "get stocks fund sale data", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Get stocks fund sale by ID", + "parameters": [ + { + "type": "string", + "description": "Sale id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/wallet.StockFund" + } + } + } + }, + "put": { + "description": "update new stocks fund sale", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Update some stocks fund sale", + "parameters": [ + { + "type": "string", + "description": "Sale id", + "name": "id", + "in": "path", + "required": true + } + ] + } + }, + "/stocks/purchases": { + "post": { + "description": "insert new stocksFII purchase", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Insert some stocks purchase" + } + }, + "/stocks/purchases/{id}": { + "get": { + "description": "get stocks purchase data", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Get stocks purchase by ID", + "parameters": [ + { + "type": "string", + "description": "Purchase id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/wallet.Stock" + } + } + } + }, + "put": { + "description": "update new stocksFII purchase", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Update some stocks purchase", + "parameters": [ + { + "type": "string", + "description": "Purchase id", + "name": "id", + "in": "path", + "required": true + } + ] + } + }, + "/stocks/sales": { + "post": { + "description": "insert new stocks sale", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Insert some stocks sale" + } + }, + "/stocks/sales/{id}": { + "get": { + "description": "get stocks sale data", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Get stocks sale by ID", + "parameters": [ + { + "type": "string", + "description": "Sale id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/wallet.Stock" + } + } + } + }, + "put": { + "description": "update new stocks sale", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Update some stocks sale", + "parameters": [ + { + "type": "string", + "description": "Sale id", + "name": "id", + "in": "path", + "required": true + } + ] + } + }, + "/treasuries-direct/purchases": { + "post": { + "description": "insert new treasury direct purchase", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Insert some treasury direct purchase" + } + }, + "/treasuries-direct/purchases/{id}": { + "get": { + "description": "get treasury direct purchase data", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Get treasury direct purchase by ID", + "parameters": [ + { + "type": "string", + "description": "Purchase id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/wallet.TreasuryDirect" + } + } + } + }, + "put": { + "description": "update new treasury direct purchase", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Update some treasury direct purchase", + "parameters": [ + { + "type": "string", + "description": "Purchase id", + "name": "id", + "in": "path", + "required": true + } + ] + } + }, + "/treasuries-direct/sales": { + "post": { + "description": "insert new treasury direct sale", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Insert some treasury direct sale" + } + }, + "/treasuries-direct/sales/{id}": { + "get": { + "description": "get treasury direct sale data", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Get treasury direct sale by ID", + "parameters": [ + { + "type": "string", + "description": "Sale id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/wallet.TreasuryDirect" + } + } + } + }, + "put": { + "description": "update new treasury direct sale", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Update some treasury direct sale", + "parameters": [ + { + "type": "string", + "description": "Sale id", + "name": "id", + "in": "path", + "required": true + } + ] + } + } + }, + "definitions": { + "wallet.Broker": { + "type": "object", + "required": [ + "id", + "name" + ], + "properties": { + "CNPJ": { + "type": "string" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, + "wallet.CertificateOfDeposit": { + "type": "object", + "required": [ + "brokerId", + "date", + "dueDate", + "fixedInterestRate", + "itemType", + "portfolioId", + "price", + "shares", + "symbol" + ], + "properties": { + "brokerId": { + "type": "string" + }, + "commission": { + "type": "number" + }, + "date": { + "type": "string" + }, + "dueDate": { + "type": "string" + }, + "fixedInterestRate": { + "type": "number" + }, + "id": { + "type": "string" + }, + "itemType": { + "type": "string" + }, + "portfolioId": { + "type": "string" + }, + "price": { + "type": "number" + }, + "shares": { + "type": "number" + }, + "symbol": { + "type": "string" + } + } + }, + "wallet.FICFI": { + "type": "object", + "required": [ + "brokerId", + "date", + "itemType", + "portfolioId", + "price", + "shares", + "symbol" + ], + "properties": { + "brokerId": { + "type": "string" + }, + "commission": { + "type": "number" + }, + "date": { + "type": "string" + }, + "id": { + "type": "string" + }, + "itemType": { + "type": "string" + }, + "portfolioId": { + "type": "string" + }, + "price": { + "type": "number" + }, + "shares": { + "type": "number" + }, + "symbol": { + "type": "string" + } + } + }, + "wallet.FII": { + "type": "object", + "required": [ + "brokerId", + "date", + "itemType", + "portfolioId", + "price", + "shares", + "symbol" + ], + "properties": { + "brokerId": { + "type": "string" + }, + "commission": { + "type": "number" + }, + "date": { + "type": "string" + }, + "id": { + "type": "string" + }, + "itemType": { + "type": "string" + }, + "portfolioId": { + "type": "string" + }, + "price": { + "type": "number" + }, + "shares": { + "type": "number" + }, + "symbol": { + "type": "string" + } + } + }, + "wallet.Portfolio": { + "type": "object", + "required": [ + "id", + "name" + ], + "properties": { + "costBasics": { + "type": "number" + }, + "gain": { + "type": "number" + }, + "id": { + "type": "string" + }, + "items": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/wallet.PortfolioItem" + } + }, + "name": { + "type": "string" + }, + "overallReturn": { + "type": "number" + } + } + }, + "wallet.PortfolioItem": { + "type": "object", + "properties": { + "averagePrice": { + "type": "number" + }, + "brokerId": { + "type": "string" + }, + "change": { + "type": "number" + }, + "closingPrice": { + "type": "number" + }, + "commission": { + "type": "number" + }, + "costBasics": { + "type": "number" + }, + "gain": { + "type": "number" + }, + "itemType": { + "type": "string" + }, + "lastPrice": { + "type": "number" + }, + "lastYearHigh": { + "type": "number" + }, + "lastYearLow": { + "type": "number" + }, + "name": { + "type": "string" + }, + "purchases": { + "type": "object", + "$ref": "#/definitions/wallet.PurchasesList" + }, + "sales": { + "type": "object", + "$ref": "#/definitions/wallet.SalesList" + }, + "sector": { + "type": "string" + }, + "segment": { + "type": "string" + }, + "shares": { + "type": "number" + }, + "subSector": { + "type": "string" + } + } + }, + "wallet.PurchasesList": { + "type": "array", + "items": { + "type": "object" + } + }, + "wallet.SalesList": { + "type": "array", + "items": { + "type": "object" + } + }, + "wallet.Stock": { + "type": "object", + "required": [ + "brokerId", + "date", + "itemType", + "portfolioId", + "price", + "shares", + "symbol" + ], + "properties": { + "brokerId": { + "type": "string" + }, + "commission": { + "type": "number" + }, + "date": { + "type": "string" + }, + "id": { + "type": "string" + }, + "itemType": { + "type": "string" + }, + "portfolioId": { + "type": "string" + }, + "price": { + "type": "number" + }, + "shares": { + "type": "number" + }, + "symbol": { + "type": "string" + } + } + }, + "wallet.StockFund": { + "type": "object", + "required": [ + "brokerId", + "date", + "itemType", + "portfolioId", + "price", + "shares", + "symbol" + ], + "properties": { + "brokerId": { + "type": "string" + }, + "commission": { + "type": "number" + }, + "date": { + "type": "string" + }, + "id": { + "type": "string" + }, + "itemType": { + "type": "string" + }, + "portfolioId": { + "type": "string" + }, + "price": { + "type": "number" + }, + "shares": { + "type": "number" + }, + "symbol": { + "type": "string" + } + } + }, + "wallet.TreasuryDirect": { + "type": "object", + "required": [ + "brokerId", + "date", + "fixedInterestRate", + "itemType", + "portfolioId", + "price", + "shares", + "symbol" + ], + "properties": { + "brokerId": { + "type": "string" + }, + "commission": { + "type": "number" + }, + "date": { + "type": "string" + }, + "fixedInterestRate": { + "description": "DueDate *time.Time ` + "`" + `json:\"dueDate\" bson:\"dueDate\" validate:\"required\"` + "`" + `", + "type": "number" + }, + "id": { + "type": "string" + }, + "itemType": { + "type": "string" + }, + "portfolioId": { + "type": "string" + }, + "price": { + "type": "number" + }, + "shares": { + "type": "number" + }, + "symbol": { + "type": "string" + } + } + } + } +}` + +type swaggerInfo struct { + Version string + Host string + BasePath string + Schemes []string + Title string + Description string +} + +// SwaggerInfo holds exported Swagger Info so clients can modify it +var SwaggerInfo = swaggerInfo{ + Version: "0.1.0", + Host: "localhost:8889", + BasePath: "/api/v1", + Schemes: []string{}, + Title: "MFinance Wallet API", + Description: "mfinance Wallet API data.", +} + +type s struct{} + +func (s *s) ReadDoc() string { + sInfo := SwaggerInfo + sInfo.Description = strings.Replace(sInfo.Description, "\n", "\\n", -1) + + t, err := template.New("swagger_info").Funcs(template.FuncMap{ + "marshal": func(v interface{}) string { + a, _ := json.Marshal(v) + return string(a) + }, + }).Parse(doc) + if err != nil { + return doc + } + + var tpl bytes.Buffer + if err := t.Execute(&tpl, sInfo); err != nil { + return doc + } + + return tpl.String() +} + +func init() { + swag.Register(swag.Name, &s{}) +} diff --git a/docs/swagger.json b/docs/swagger.json new file mode 100644 index 0000000..b1d299c --- /dev/null +++ b/docs/swagger.json @@ -0,0 +1,1404 @@ +{ + "swagger": "2.0", + "info": { + "description": "mfinance Wallet API data.", + "title": "MFinance Wallet API", + "contact": { + "name": "API Support", + "url": "https://github.com/mfinancecombr/finance-wallet-api" + }, + "license": { + "name": "BSD 3-Clause", + "url": "https://opensource.org/licenses/BSD-3-Clause" + }, + "version": "0.1.0" + }, + "host": "localhost:8889", + "basePath": "/api/v1", + "paths": { + "/brokers": { + "get": { + "description": "get all brokers data", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "List all brokers", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/wallet.Broker" + } + } + } + } + }, + "post": { + "description": "insert new broker", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Insert some broker" + } + }, + "/brokers/{id}": { + "get": { + "description": "get all broker data", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Get a broker", + "parameters": [ + { + "type": "string", + "description": "Broker id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/wallet.Broker" + } + } + } + }, + "put": { + "description": "Update some broker by id", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Update broker data by ID", + "parameters": [ + { + "type": "string", + "description": "Broker id", + "name": "id", + "in": "path", + "required": true + } + ] + }, + "delete": { + "description": "delete some broker by id", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Delete broker by ID", + "parameters": [ + { + "type": "string", + "description": "Broker id", + "name": "id", + "in": "path", + "required": true + } + ] + } + }, + "/certificate-of-deposit/purchases": { + "post": { + "description": "insert new certificate of deposit purchase", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Insert some certificate of deposit purchase" + } + }, + "/certificate-of-deposit/purchases/{id}": { + "get": { + "description": "get certificate of deposi purchase data", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Get get certificate of deposit purchase by ID", + "parameters": [ + { + "type": "string", + "description": "Purchase id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/wallet.CertificateOfDeposit" + } + } + } + }, + "put": { + "description": "update new certificate of deposit purchase", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Update some certificate of deposit purchase", + "parameters": [ + { + "type": "string", + "description": "Purchase id", + "name": "id", + "in": "path", + "required": true + } + ] + } + }, + "/certificates-of-deposit/sales": { + "post": { + "description": "insert new certificate of deposit sale", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Insert some certificate of deposit sale" + } + }, + "/certificates-of-deposit/sales/{id}": { + "get": { + "description": "get certificate of deposit sale data", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Get get certificate of deposit sale by ID", + "parameters": [ + { + "type": "string", + "description": "Sale id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/wallet.CertificateOfDeposit" + } + } + } + }, + "put": { + "description": "update new certificate of deposit sale", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Update some certificate of deposit sale", + "parameters": [ + { + "type": "string", + "description": "Sale id", + "name": "id", + "in": "path", + "required": true + } + ] + } + }, + "/ficfi/purchases": { + "post": { + "description": "insert new FICFI purchase", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Insert some FICFI purchase" + } + }, + "/ficfi/purchases/{id}": { + "get": { + "description": "get FIFCI purchase data", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Get FICFI purchase by ID", + "parameters": [ + { + "type": "string", + "description": "Purchase id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/wallet.FICFI" + } + } + } + }, + "put": { + "description": "update new FICFI purchase", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Update some FICFI purchase", + "parameters": [ + { + "type": "string", + "description": "Purchase id", + "name": "id", + "in": "path", + "required": true + } + ] + } + }, + "/ficfi/sales": { + "post": { + "description": "insert new FICFI sale", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Insert some FICFI sale" + } + }, + "/ficfi/sales/{id}": { + "get": { + "description": "get FICFI sale data", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Get FICFI sale by ID", + "parameters": [ + { + "type": "string", + "description": "Sale id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/wallet.FICFI" + } + } + } + }, + "put": { + "description": "update new FICFI sale", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Update some FICFI sale", + "parameters": [ + { + "type": "string", + "description": "Sale id", + "name": "id", + "in": "path", + "required": true + } + ] + } + }, + "/fiis/purchases": { + "post": { + "description": "insert new FII purchase", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Insert some FII purchase" + } + }, + "/fiis/purchases/{id}": { + "get": { + "description": "get FII purchase data", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Get FII purchase by ID", + "parameters": [ + { + "type": "string", + "description": "Purchase id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/wallet.FII" + } + } + } + }, + "put": { + "description": "update new FII purchase", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Update some FII purchase", + "parameters": [ + { + "type": "string", + "description": "Purchase id", + "name": "id", + "in": "path", + "required": true + } + ] + } + }, + "/fiis/sales": { + "post": { + "description": "insert new FII sale", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Insert some FII sale" + } + }, + "/fiis/sales/{id}": { + "get": { + "description": "get FII sale data", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Get FII sale by ID", + "parameters": [ + { + "type": "string", + "description": "Sale id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/wallet.FII" + } + } + } + }, + "put": { + "description": "update new FII sale", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Update some FII sale", + "parameters": [ + { + "type": "string", + "description": "Sale id", + "name": "id", + "in": "path", + "required": true + } + ] + } + }, + "/portfolios": { + "get": { + "description": "get all portfolio data", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "List all portfolios", + "parameters": [ + { + "type": "string", + "description": "filter by year", + "name": "year", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/wallet.Portfolio" + } + } + } + } + } + }, + "/portfolios/{id}": { + "get": { + "description": "get all portfolio data", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Get a portfolio", + "parameters": [ + { + "type": "string", + "description": "Broker id", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "filter by year", + "name": "year", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/wallet.Portfolio" + } + } + } + }, + "put": { + "description": "Update some portfolio by id", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Update portfolio data by ID", + "parameters": [ + { + "type": "string", + "description": "Portfolio id", + "name": "id", + "in": "path", + "required": true + } + ] + }, + "delete": { + "description": "delete some portfolio by id", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Delete portfolio by ID", + "parameters": [ + { + "type": "string", + "description": "Portfolio id", + "name": "id", + "in": "path", + "required": true + } + ] + } + }, + "/portfolioss": { + "post": { + "description": "insert new portfolio", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Insert some portfolio" + } + }, + "/purchases": { + "get": { + "description": "get all purchases data", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "List all purchases" + } + }, + "/purchases/{id}": { + "delete": { + "description": "delete some purchase by id", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Delete purchase by ID", + "parameters": [ + { + "type": "string", + "description": "Sale id", + "name": "id", + "in": "path", + "required": true + } + ] + } + }, + "/sales": { + "get": { + "description": "get all sales data", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "List all sales" + } + }, + "/sales/{id}": { + "delete": { + "description": "delete some sale by id", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Delete sale by ID", + "parameters": [ + { + "type": "string", + "description": "Sale id", + "name": "id", + "in": "path", + "required": true + } + ] + } + }, + "/stocks-funds/purchases": { + "post": { + "description": "insert new stocks fund purchase", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Insert some stocks fund purchase" + } + }, + "/stocks-funds/purchases/{id}": { + "get": { + "description": "get stocks fund purchase data", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Get stocks fund purchase by ID", + "parameters": [ + { + "type": "string", + "description": "Purchase id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/wallet.StockFund" + } + } + } + }, + "put": { + "description": "update new stocks fund purchase", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Update some stocks fund purchase", + "parameters": [ + { + "type": "string", + "description": "Purchase id", + "name": "id", + "in": "path", + "required": true + } + ] + } + }, + "/stocks-funds/sales": { + "post": { + "description": "insert new stocks fund sale", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Insert some stocks fund sale" + } + }, + "/stocks-funds/sales/{id}": { + "get": { + "description": "get stocks fund sale data", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Get stocks fund sale by ID", + "parameters": [ + { + "type": "string", + "description": "Sale id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/wallet.StockFund" + } + } + } + }, + "put": { + "description": "update new stocks fund sale", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Update some stocks fund sale", + "parameters": [ + { + "type": "string", + "description": "Sale id", + "name": "id", + "in": "path", + "required": true + } + ] + } + }, + "/stocks/purchases": { + "post": { + "description": "insert new stocksFII purchase", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Insert some stocks purchase" + } + }, + "/stocks/purchases/{id}": { + "get": { + "description": "get stocks purchase data", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Get stocks purchase by ID", + "parameters": [ + { + "type": "string", + "description": "Purchase id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/wallet.Stock" + } + } + } + }, + "put": { + "description": "update new stocksFII purchase", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Update some stocks purchase", + "parameters": [ + { + "type": "string", + "description": "Purchase id", + "name": "id", + "in": "path", + "required": true + } + ] + } + }, + "/stocks/sales": { + "post": { + "description": "insert new stocks sale", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Insert some stocks sale" + } + }, + "/stocks/sales/{id}": { + "get": { + "description": "get stocks sale data", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Get stocks sale by ID", + "parameters": [ + { + "type": "string", + "description": "Sale id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/wallet.Stock" + } + } + } + }, + "put": { + "description": "update new stocks sale", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Update some stocks sale", + "parameters": [ + { + "type": "string", + "description": "Sale id", + "name": "id", + "in": "path", + "required": true + } + ] + } + }, + "/treasuries-direct/purchases": { + "post": { + "description": "insert new treasury direct purchase", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Insert some treasury direct purchase" + } + }, + "/treasuries-direct/purchases/{id}": { + "get": { + "description": "get treasury direct purchase data", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Get treasury direct purchase by ID", + "parameters": [ + { + "type": "string", + "description": "Purchase id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/wallet.TreasuryDirect" + } + } + } + }, + "put": { + "description": "update new treasury direct purchase", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Update some treasury direct purchase", + "parameters": [ + { + "type": "string", + "description": "Purchase id", + "name": "id", + "in": "path", + "required": true + } + ] + } + }, + "/treasuries-direct/sales": { + "post": { + "description": "insert new treasury direct sale", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Insert some treasury direct sale" + } + }, + "/treasuries-direct/sales/{id}": { + "get": { + "description": "get treasury direct sale data", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Get treasury direct sale by ID", + "parameters": [ + { + "type": "string", + "description": "Sale id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/wallet.TreasuryDirect" + } + } + } + }, + "put": { + "description": "update new treasury direct sale", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Update some treasury direct sale", + "parameters": [ + { + "type": "string", + "description": "Sale id", + "name": "id", + "in": "path", + "required": true + } + ] + } + } + }, + "definitions": { + "wallet.Broker": { + "type": "object", + "required": [ + "id", + "name" + ], + "properties": { + "CNPJ": { + "type": "string" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, + "wallet.CertificateOfDeposit": { + "type": "object", + "required": [ + "brokerId", + "date", + "dueDate", + "fixedInterestRate", + "itemType", + "portfolioId", + "price", + "shares", + "symbol" + ], + "properties": { + "brokerId": { + "type": "string" + }, + "commission": { + "type": "number" + }, + "date": { + "type": "string" + }, + "dueDate": { + "type": "string" + }, + "fixedInterestRate": { + "type": "number" + }, + "id": { + "type": "string" + }, + "itemType": { + "type": "string" + }, + "portfolioId": { + "type": "string" + }, + "price": { + "type": "number" + }, + "shares": { + "type": "number" + }, + "symbol": { + "type": "string" + } + } + }, + "wallet.FICFI": { + "type": "object", + "required": [ + "brokerId", + "date", + "itemType", + "portfolioId", + "price", + "shares", + "symbol" + ], + "properties": { + "brokerId": { + "type": "string" + }, + "commission": { + "type": "number" + }, + "date": { + "type": "string" + }, + "id": { + "type": "string" + }, + "itemType": { + "type": "string" + }, + "portfolioId": { + "type": "string" + }, + "price": { + "type": "number" + }, + "shares": { + "type": "number" + }, + "symbol": { + "type": "string" + } + } + }, + "wallet.FII": { + "type": "object", + "required": [ + "brokerId", + "date", + "itemType", + "portfolioId", + "price", + "shares", + "symbol" + ], + "properties": { + "brokerId": { + "type": "string" + }, + "commission": { + "type": "number" + }, + "date": { + "type": "string" + }, + "id": { + "type": "string" + }, + "itemType": { + "type": "string" + }, + "portfolioId": { + "type": "string" + }, + "price": { + "type": "number" + }, + "shares": { + "type": "number" + }, + "symbol": { + "type": "string" + } + } + }, + "wallet.Portfolio": { + "type": "object", + "required": [ + "id", + "name" + ], + "properties": { + "costBasics": { + "type": "number" + }, + "gain": { + "type": "number" + }, + "id": { + "type": "string" + }, + "items": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/wallet.PortfolioItem" + } + }, + "name": { + "type": "string" + }, + "overallReturn": { + "type": "number" + } + } + }, + "wallet.PortfolioItem": { + "type": "object", + "properties": { + "averagePrice": { + "type": "number" + }, + "brokerId": { + "type": "string" + }, + "change": { + "type": "number" + }, + "closingPrice": { + "type": "number" + }, + "commission": { + "type": "number" + }, + "costBasics": { + "type": "number" + }, + "gain": { + "type": "number" + }, + "itemType": { + "type": "string" + }, + "lastPrice": { + "type": "number" + }, + "lastYearHigh": { + "type": "number" + }, + "lastYearLow": { + "type": "number" + }, + "name": { + "type": "string" + }, + "purchases": { + "type": "object", + "$ref": "#/definitions/wallet.PurchasesList" + }, + "sales": { + "type": "object", + "$ref": "#/definitions/wallet.SalesList" + }, + "sector": { + "type": "string" + }, + "segment": { + "type": "string" + }, + "shares": { + "type": "number" + }, + "subSector": { + "type": "string" + } + } + }, + "wallet.PurchasesList": { + "type": "array", + "items": { + "type": "object" + } + }, + "wallet.SalesList": { + "type": "array", + "items": { + "type": "object" + } + }, + "wallet.Stock": { + "type": "object", + "required": [ + "brokerId", + "date", + "itemType", + "portfolioId", + "price", + "shares", + "symbol" + ], + "properties": { + "brokerId": { + "type": "string" + }, + "commission": { + "type": "number" + }, + "date": { + "type": "string" + }, + "id": { + "type": "string" + }, + "itemType": { + "type": "string" + }, + "portfolioId": { + "type": "string" + }, + "price": { + "type": "number" + }, + "shares": { + "type": "number" + }, + "symbol": { + "type": "string" + } + } + }, + "wallet.StockFund": { + "type": "object", + "required": [ + "brokerId", + "date", + "itemType", + "portfolioId", + "price", + "shares", + "symbol" + ], + "properties": { + "brokerId": { + "type": "string" + }, + "commission": { + "type": "number" + }, + "date": { + "type": "string" + }, + "id": { + "type": "string" + }, + "itemType": { + "type": "string" + }, + "portfolioId": { + "type": "string" + }, + "price": { + "type": "number" + }, + "shares": { + "type": "number" + }, + "symbol": { + "type": "string" + } + } + }, + "wallet.TreasuryDirect": { + "type": "object", + "required": [ + "brokerId", + "date", + "fixedInterestRate", + "itemType", + "portfolioId", + "price", + "shares", + "symbol" + ], + "properties": { + "brokerId": { + "type": "string" + }, + "commission": { + "type": "number" + }, + "date": { + "type": "string" + }, + "fixedInterestRate": { + "description": "DueDate *time.Time `json:\"dueDate\" bson:\"dueDate\" validate:\"required\"`", + "type": "number" + }, + "id": { + "type": "string" + }, + "itemType": { + "type": "string" + }, + "portfolioId": { + "type": "string" + }, + "price": { + "type": "number" + }, + "shares": { + "type": "number" + }, + "symbol": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/docs/swagger.yaml b/docs/swagger.yaml new file mode 100644 index 0000000..3b4fa7d --- /dev/null +++ b/docs/swagger.yaml @@ -0,0 +1,948 @@ +basePath: /api/v1 +definitions: + wallet.Broker: + properties: + CNPJ: + type: string + id: + type: string + name: + type: string + required: + - id + - name + type: object + wallet.CertificateOfDeposit: + properties: + brokerId: + type: string + commission: + type: number + date: + type: string + dueDate: + type: string + fixedInterestRate: + type: number + id: + type: string + itemType: + type: string + portfolioId: + type: string + price: + type: number + shares: + type: number + symbol: + type: string + required: + - brokerId + - date + - dueDate + - fixedInterestRate + - itemType + - portfolioId + - price + - shares + - symbol + type: object + wallet.FICFI: + properties: + brokerId: + type: string + commission: + type: number + date: + type: string + id: + type: string + itemType: + type: string + portfolioId: + type: string + price: + type: number + shares: + type: number + symbol: + type: string + required: + - brokerId + - date + - itemType + - portfolioId + - price + - shares + - symbol + type: object + wallet.FII: + properties: + brokerId: + type: string + commission: + type: number + date: + type: string + id: + type: string + itemType: + type: string + portfolioId: + type: string + price: + type: number + shares: + type: number + symbol: + type: string + required: + - brokerId + - date + - itemType + - portfolioId + - price + - shares + - symbol + type: object + wallet.Portfolio: + properties: + costBasics: + type: number + gain: + type: number + id: + type: string + items: + additionalProperties: + $ref: '#/definitions/wallet.PortfolioItem' + type: object + name: + type: string + overallReturn: + type: number + required: + - id + - name + type: object + wallet.PortfolioItem: + properties: + averagePrice: + type: number + brokerId: + type: string + change: + type: number + closingPrice: + type: number + commission: + type: number + costBasics: + type: number + gain: + type: number + itemType: + type: string + lastPrice: + type: number + lastYearHigh: + type: number + lastYearLow: + type: number + name: + type: string + purchases: + $ref: '#/definitions/wallet.PurchasesList' + type: object + sales: + $ref: '#/definitions/wallet.SalesList' + type: object + sector: + type: string + segment: + type: string + shares: + type: number + subSector: + type: string + type: object + wallet.PurchasesList: + items: + type: object + type: array + wallet.SalesList: + items: + type: object + type: array + wallet.Stock: + properties: + brokerId: + type: string + commission: + type: number + date: + type: string + id: + type: string + itemType: + type: string + portfolioId: + type: string + price: + type: number + shares: + type: number + symbol: + type: string + required: + - brokerId + - date + - itemType + - portfolioId + - price + - shares + - symbol + type: object + wallet.StockFund: + properties: + brokerId: + type: string + commission: + type: number + date: + type: string + id: + type: string + itemType: + type: string + portfolioId: + type: string + price: + type: number + shares: + type: number + symbol: + type: string + required: + - brokerId + - date + - itemType + - portfolioId + - price + - shares + - symbol + type: object + wallet.TreasuryDirect: + properties: + brokerId: + type: string + commission: + type: number + date: + type: string + fixedInterestRate: + description: DueDate *time.Time `json:"dueDate" bson:"dueDate" validate:"required"` + type: number + id: + type: string + itemType: + type: string + portfolioId: + type: string + price: + type: number + shares: + type: number + symbol: + type: string + required: + - brokerId + - date + - fixedInterestRate + - itemType + - portfolioId + - price + - shares + - symbol + type: object +host: localhost:8889 +info: + contact: + name: API Support + url: https://github.com/mfinancecombr/finance-wallet-api + description: mfinance Wallet API data. + license: + name: BSD 3-Clause + url: https://opensource.org/licenses/BSD-3-Clause + title: MFinance Wallet API + version: 0.1.0 +paths: + /brokers: + get: + consumes: + - application/json + description: get all brokers data + produces: + - application/json + responses: + "200": + description: OK + schema: + items: + $ref: '#/definitions/wallet.Broker' + type: array + summary: List all brokers + post: + consumes: + - application/json + description: insert new broker + produces: + - application/json + summary: Insert some broker + /brokers/{id}: + delete: + consumes: + - application/json + description: delete some broker by id + parameters: + - description: Broker id + in: path + name: id + required: true + type: string + produces: + - application/json + summary: Delete broker by ID + get: + consumes: + - application/json + description: get all broker data + parameters: + - description: Broker id + in: path + name: id + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/wallet.Broker' + summary: Get a broker + put: + consumes: + - application/json + description: Update some broker by id + parameters: + - description: Broker id + in: path + name: id + required: true + type: string + produces: + - application/json + summary: Update broker data by ID + /certificate-of-deposit/purchases: + post: + consumes: + - application/json + description: insert new certificate of deposit purchase + produces: + - application/json + summary: Insert some certificate of deposit purchase + /certificate-of-deposit/purchases/{id}: + get: + consumes: + - application/json + description: get certificate of deposi purchase data + parameters: + - description: Purchase id + in: path + name: id + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/wallet.CertificateOfDeposit' + summary: Get get certificate of deposit purchase by ID + put: + consumes: + - application/json + description: update new certificate of deposit purchase + parameters: + - description: Purchase id + in: path + name: id + required: true + type: string + produces: + - application/json + summary: Update some certificate of deposit purchase + /certificates-of-deposit/sales: + post: + consumes: + - application/json + description: insert new certificate of deposit sale + produces: + - application/json + summary: Insert some certificate of deposit sale + /certificates-of-deposit/sales/{id}: + get: + consumes: + - application/json + description: get certificate of deposit sale data + parameters: + - description: Sale id + in: path + name: id + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/wallet.CertificateOfDeposit' + summary: Get get certificate of deposit sale by ID + put: + consumes: + - application/json + description: update new certificate of deposit sale + parameters: + - description: Sale id + in: path + name: id + required: true + type: string + produces: + - application/json + summary: Update some certificate of deposit sale + /ficfi/purchases: + post: + consumes: + - application/json + description: insert new FICFI purchase + produces: + - application/json + summary: Insert some FICFI purchase + /ficfi/purchases/{id}: + get: + consumes: + - application/json + description: get FIFCI purchase data + parameters: + - description: Purchase id + in: path + name: id + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/wallet.FICFI' + summary: Get FICFI purchase by ID + put: + consumes: + - application/json + description: update new FICFI purchase + parameters: + - description: Purchase id + in: path + name: id + required: true + type: string + produces: + - application/json + summary: Update some FICFI purchase + /ficfi/sales: + post: + consumes: + - application/json + description: insert new FICFI sale + produces: + - application/json + summary: Insert some FICFI sale + /ficfi/sales/{id}: + get: + consumes: + - application/json + description: get FICFI sale data + parameters: + - description: Sale id + in: path + name: id + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/wallet.FICFI' + summary: Get FICFI sale by ID + put: + consumes: + - application/json + description: update new FICFI sale + parameters: + - description: Sale id + in: path + name: id + required: true + type: string + produces: + - application/json + summary: Update some FICFI sale + /fiis/purchases: + post: + consumes: + - application/json + description: insert new FII purchase + produces: + - application/json + summary: Insert some FII purchase + /fiis/purchases/{id}: + get: + consumes: + - application/json + description: get FII purchase data + parameters: + - description: Purchase id + in: path + name: id + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/wallet.FII' + summary: Get FII purchase by ID + put: + consumes: + - application/json + description: update new FII purchase + parameters: + - description: Purchase id + in: path + name: id + required: true + type: string + produces: + - application/json + summary: Update some FII purchase + /fiis/sales: + post: + consumes: + - application/json + description: insert new FII sale + produces: + - application/json + summary: Insert some FII sale + /fiis/sales/{id}: + get: + consumes: + - application/json + description: get FII sale data + parameters: + - description: Sale id + in: path + name: id + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/wallet.FII' + summary: Get FII sale by ID + put: + consumes: + - application/json + description: update new FII sale + parameters: + - description: Sale id + in: path + name: id + required: true + type: string + produces: + - application/json + summary: Update some FII sale + /portfolios: + get: + consumes: + - application/json + description: get all portfolio data + parameters: + - description: filter by year + in: query + name: year + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + items: + $ref: '#/definitions/wallet.Portfolio' + type: array + summary: List all portfolios + /portfolios/{id}: + delete: + consumes: + - application/json + description: delete some portfolio by id + parameters: + - description: Portfolio id + in: path + name: id + required: true + type: string + produces: + - application/json + summary: Delete portfolio by ID + get: + consumes: + - application/json + description: get all portfolio data + parameters: + - description: Broker id + in: path + name: id + required: true + type: string + - description: filter by year + in: query + name: year + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/wallet.Portfolio' + summary: Get a portfolio + put: + consumes: + - application/json + description: Update some portfolio by id + parameters: + - description: Portfolio id + in: path + name: id + required: true + type: string + produces: + - application/json + summary: Update portfolio data by ID + /portfolioss: + post: + consumes: + - application/json + description: insert new portfolio + produces: + - application/json + summary: Insert some portfolio + /purchases: + get: + consumes: + - application/json + description: get all purchases data + produces: + - application/json + summary: List all purchases + /purchases/{id}: + delete: + consumes: + - application/json + description: delete some purchase by id + parameters: + - description: Sale id + in: path + name: id + required: true + type: string + produces: + - application/json + summary: Delete purchase by ID + /sales: + get: + consumes: + - application/json + description: get all sales data + produces: + - application/json + summary: List all sales + /sales/{id}: + delete: + consumes: + - application/json + description: delete some sale by id + parameters: + - description: Sale id + in: path + name: id + required: true + type: string + produces: + - application/json + summary: Delete sale by ID + /stocks-funds/purchases: + post: + consumes: + - application/json + description: insert new stocks fund purchase + produces: + - application/json + summary: Insert some stocks fund purchase + /stocks-funds/purchases/{id}: + get: + consumes: + - application/json + description: get stocks fund purchase data + parameters: + - description: Purchase id + in: path + name: id + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/wallet.StockFund' + summary: Get stocks fund purchase by ID + put: + consumes: + - application/json + description: update new stocks fund purchase + parameters: + - description: Purchase id + in: path + name: id + required: true + type: string + produces: + - application/json + summary: Update some stocks fund purchase + /stocks-funds/sales: + post: + consumes: + - application/json + description: insert new stocks fund sale + produces: + - application/json + summary: Insert some stocks fund sale + /stocks-funds/sales/{id}: + get: + consumes: + - application/json + description: get stocks fund sale data + parameters: + - description: Sale id + in: path + name: id + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/wallet.StockFund' + summary: Get stocks fund sale by ID + put: + consumes: + - application/json + description: update new stocks fund sale + parameters: + - description: Sale id + in: path + name: id + required: true + type: string + produces: + - application/json + summary: Update some stocks fund sale + /stocks/purchases: + post: + consumes: + - application/json + description: insert new stocksFII purchase + produces: + - application/json + summary: Insert some stocks purchase + /stocks/purchases/{id}: + get: + consumes: + - application/json + description: get stocks purchase data + parameters: + - description: Purchase id + in: path + name: id + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/wallet.Stock' + summary: Get stocks purchase by ID + put: + consumes: + - application/json + description: update new stocksFII purchase + parameters: + - description: Purchase id + in: path + name: id + required: true + type: string + produces: + - application/json + summary: Update some stocks purchase + /stocks/sales: + post: + consumes: + - application/json + description: insert new stocks sale + produces: + - application/json + summary: Insert some stocks sale + /stocks/sales/{id}: + get: + consumes: + - application/json + description: get stocks sale data + parameters: + - description: Sale id + in: path + name: id + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/wallet.Stock' + summary: Get stocks sale by ID + put: + consumes: + - application/json + description: update new stocks sale + parameters: + - description: Sale id + in: path + name: id + required: true + type: string + produces: + - application/json + summary: Update some stocks sale + /treasuries-direct/purchases: + post: + consumes: + - application/json + description: insert new treasury direct purchase + produces: + - application/json + summary: Insert some treasury direct purchase + /treasuries-direct/purchases/{id}: + get: + consumes: + - application/json + description: get treasury direct purchase data + parameters: + - description: Purchase id + in: path + name: id + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/wallet.TreasuryDirect' + summary: Get treasury direct purchase by ID + put: + consumes: + - application/json + description: update new treasury direct purchase + parameters: + - description: Purchase id + in: path + name: id + required: true + type: string + produces: + - application/json + summary: Update some treasury direct purchase + /treasuries-direct/sales: + post: + consumes: + - application/json + description: insert new treasury direct sale + produces: + - application/json + summary: Insert some treasury direct sale + /treasuries-direct/sales/{id}: + get: + consumes: + - application/json + description: get treasury direct sale data + parameters: + - description: Sale id + in: path + name: id + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/wallet.TreasuryDirect' + summary: Get treasury direct sale by ID + put: + consumes: + - application/json + description: update new treasury direct sale + parameters: + - description: Sale id + in: path + name: id + required: true + type: string + produces: + - application/json + summary: Update some treasury direct sale +swagger: "2.0" diff --git a/go.mod b/go.mod index b7687a8..84dc272 100644 --- a/go.mod +++ b/go.mod @@ -4,13 +4,26 @@ go 1.14 require ( github.com/alecthomas/repr v0.0.0-20200325044227-4184120f674c + github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 + github.com/go-openapi/spec v0.19.9 // indirect + github.com/go-openapi/swag v0.19.9 // indirect github.com/go-playground/universal-translator v0.17.0 // indirect github.com/gosimple/slug v1.9.0 github.com/labstack/echo/v4 v4.1.16 github.com/leodido/go-urn v1.2.0 // indirect + github.com/mailru/easyjson v0.7.1 // indirect + github.com/mattn/go-colorable v0.1.7 // indirect github.com/sirupsen/logrus v1.5.0 github.com/spf13/viper v1.6.3 + github.com/swaggo/echo-swagger v1.0.0 + github.com/swaggo/swag v1.6.7 + github.com/valyala/fasttemplate v1.2.0 // indirect go.mongodb.org/mongo-driver v1.3.2 + golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899 // indirect + golang.org/x/net v0.0.0-20200707034311-ab3426394381 // indirect + golang.org/x/sys v0.0.0-20200724161237-0e2f3a69832c // indirect + golang.org/x/tools v0.0.0-20200725200936-102e7d357031 // indirect google.golang.org/appengine v1.1.0 gopkg.in/go-playground/validator.v9 v9.31.0 + gopkg.in/yaml.v2 v2.3.0 // indirect ) diff --git a/go.sum b/go.sum index 35a7954..6979f26 100644 --- a/go.sum +++ b/go.sum @@ -1,9 +1,18 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc= +github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= +github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/alecthomas/repr v0.0.0-20200325044227-4184120f674c h1:MVVbswUlqicyj8P/JljoocA7AyCo62gzD0O7jfvrhtE= github.com/alecthomas/repr v0.0.0-20200325044227-4184120f674c/go.mod h1:xTS7Pm1pD1mvyM075QCDSRqH6qRLXylzS24ZTpRiSzQ= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= @@ -15,6 +24,8 @@ github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= @@ -22,10 +33,39 @@ github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZm github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/gin-contrib/gzip v0.0.1/go.mod h1:fGBJBCdt6qCZuCAOwWuFhBB4OOq9EFqlo5dEaFhhu5w= +github.com/gin-contrib/sse v0.0.0-20170109093832-22d885f9ecc7/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= +github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= +github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= +github.com/gin-gonic/gin v1.3.0/go.mod h1:7cKuhb5qV2ggCFctp2fJQ+ErvciLZrIeoOSOm6mUr7Y= +github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= +github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= +github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w= +github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= +github.com/go-openapi/jsonreference v0.19.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= +github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= +github.com/go-openapi/jsonreference v0.19.3 h1:5cxNfTy0UVC3X8JL5ymxzyoUZmo8iZb+jeTWn7tUa8o= +github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= +github.com/go-openapi/jsonreference v0.19.4 h1:3Vw+rh13uq2JFNxgnMTGE1rnoieU9FmyE1gvnyylsYg= +github.com/go-openapi/jsonreference v0.19.4/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= +github.com/go-openapi/spec v0.19.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= +github.com/go-openapi/spec v0.19.4 h1:ixzUSnHTd6hCemgtAJgluaTSGYpLNpJY4mA2DIkdOAo= +github.com/go-openapi/spec v0.19.4/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= +github.com/go-openapi/spec v0.19.9 h1:9z9cbFuZJ7AcvOHKIY+f6Aevb4vObNDkTEyoMfO7rAc= +github.com/go-openapi/spec v0.19.9/go.mod h1:vqK/dIdLGCosfvYsQV3WfC7N3TiZSnGY2RZKoFK7X28= +github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= +github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY= +github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/swag v0.19.9 h1:1IxuqvBUU3S2Bi4YC7tlP9SJF1gVpCvqN0T2Qof4azE= +github.com/go-openapi/swag v0.19.9/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY= github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= @@ -81,6 +121,8 @@ github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= @@ -97,22 +139,39 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxv github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/labstack/echo v1.4.4 h1:1bEiBNeGSUKxcPDGfZ/7IgdhJJZx8wV/pICJh4W2NJI= github.com/labstack/echo v3.3.10+incompatible h1:pGRcYk231ExFAyoAjAfD85kQzRJCRI8bbnE7CX5OEgg= +github.com/labstack/echo/v4 v4.0.0/go.mod h1:tZv7nai5buKSg5h/8E6zz4LsD/Dqh9/91Mvs7Z5Zyno= github.com/labstack/echo/v4 v4.1.16 h1:8swiwjE5Jkai3RPfZoahp8kjVCRNq+y7Q0hPji2Kz0o= github.com/labstack/echo/v4 v4.1.16/go.mod h1:awO+5TzAjvL8XpibdsfXxPgHr+orhtXZJZIQCVjogKI= +github.com/labstack/gommon v0.2.8/go.mod h1:/tj9csK2iPSBvn+3NLM9e52usepMtrd5ilFYA+wQNJ4= github.com/labstack/gommon v0.3.0 h1:JEeO0bvc78PKdyHxloTKiF8BD5iGrH8T6MSeGvSgob0= github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e h1:hB2xlXdHp/pmPZq0y3QnmWAArdw9PqbmotexnWx/FU8= +github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.7.0 h1:aizVhC/NAAcKWb+5QsU1iNOZb4Yws5UO2I+aIprQITM= +github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= +github.com/mailru/easyjson v0.7.1 h1:mdxE1MF9o53iCb2Ghj1VfWvh7ZOwHpnVG/xwXrV90U8= +github.com/mailru/easyjson v0.7.1/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.0/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6 h1:6Su7aK7lXmJ/U79bYtBjLNaha4Fs1Rg9plHpcH+vvnE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.7 h1:bQGKb3vps/j0E9GfJQ03JyhRuxsvdAanXlT9BTw3mdw= +github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= @@ -121,6 +180,7 @@ github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5 github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/mongodb/mongo-go-driver v1.3.2 h1:ESw7Zz8oFY6nuuDsXoneOhNgns0MPPkBPI2WOvnXVmA= @@ -149,6 +209,11 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= +github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= @@ -172,24 +237,46 @@ github.com/spf13/viper v1.6.3 h1:pDDu1OyEDTKzpJwdq4TiuLyMsUgRa/BT5cn5O62NoHs= github.com/spf13/viper v1.6.3/go.mod h1:jUMtyi0/lB5yZH/FjyGAoH7IMNrIhlBf6pXZmbMDvzw= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= +github.com/swaggo/echo-swagger v1.0.0 h1:ppQFt6Am3/MHIUmTpZOwi4gggMZ/W9zmKP4Z9ahTe5c= +github.com/swaggo/echo-swagger v1.0.0/go.mod h1:Vnz3c2TGeFpoZPSV3CkWCrvyfU0016Gq/S0j4JspQnM= +github.com/swaggo/files v0.0.0-20190704085106-630677cd5c14 h1:PyYN9JH5jY9j6av01SpfRMb+1DWg/i3MbGOKPxJ2wjM= +github.com/swaggo/files v0.0.0-20190704085106-630677cd5c14/go.mod h1:gxQT6pBGRuIGunNf/+tSOB5OHvguWi8Tbt82WOkf35E= +github.com/swaggo/gin-swagger v1.2.0/go.mod h1:qlH2+W7zXGZkczuL+r2nEBR2JTT+/lX05Nn6vPhc7OI= +github.com/swaggo/swag v1.5.1/go.mod h1:1Bl9F/ZBpVWh22nY0zmYyASPO1lI/zIwRDrpZU+tv8Y= +github.com/swaggo/swag v1.6.3/go.mod h1:wcc83tB4Mb2aNiL/HP4MFeQdpHUrca+Rp/DRNgWAUio= +github.com/swaggo/swag v1.6.7 h1:e8GC2xDllJZr3omJkm9YfmK0Y56+rMO3cg0JBKNz09s= +github.com/swaggo/swag v1.6.7/go.mod h1:xDhTyuFIujYiN3DKWC/H/83xcfHp+UE/IzWWampG7Zc= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= +github.com/ugorji/go v1.1.5-pre/go.mod h1:FwP/aQVg39TXzItUBMwnWp9T9gPQnXw4Poh4/oBQZ/0= +github.com/ugorji/go/codec v0.0.0-20181022190402-e5e69e061d4f/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= +github.com/ugorji/go/codec v1.1.5-pre/go.mod h1:tULtS6Gy1AE1yCENaw4Vb//HLH5njI2tfCQDUqRd8fI= +github.com/urfave/cli v1.20.0 h1:fDqGv3UG/4jbVl/QkFwEdddtEDjh/5Ov6X+0B/3bPaw= +github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= +github.com/urfave/cli/v2 v2.1.1 h1:Qt8FeAtxE/vfdrLmR3rxR6JRE0RoVmbXu8+6kZtYU4k= +github.com/urfave/cli/v2 v2.1.1/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= +github.com/valyala/fasttemplate v0.0.0-20170224212429-dcecefd839c4/go.mod h1:50wTf68f99/Zt14pr046Tgt3Lp2vLyFZKzbFXTOabXw= github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= github.com/valyala/fasttemplate v1.1.0 h1:RZqt0yGBsps8NGvLSGW804QQqCUYYLsaOjTVHy1Ocw4= github.com/valyala/fasttemplate v1.1.0/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= +github.com/valyala/fasttemplate v1.2.0 h1:y3yXRCoDvC2HTtIHvL2cc7Zd+bqA+zqDO6oQzsJO07E= +github.com/valyala/fasttemplate v1.2.0/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c h1:u40Z8hqBAAQyv+vATcGgV0YCnDjqSL7/q/JyPhhJSPk= github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc h1:n+nNi93yXLkJvKwXNP9d55HC7lGK4H/SRcwB5IaUZLo= github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.mongodb.org/mongo-driver v1.3.2 h1:IYppNjEV/C+/3VPbhHVxQ4t04eVW0cLp0/pNdW++6Ug= go.mongodb.org/mongo-driver v1.3.2/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= @@ -197,21 +284,38 @@ go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190130090550-b01c7a725664/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d h1:1ZiEyfaQIg3Qh0EoqpwAakHVhecoE5wlSg5GjnafJGw= golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899 h1:DZhuSZLsGlFL4CmhA8BcRA0mnthyA/nZ00AqCUo7vHg= +golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190611141213-3f473d35a33a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191204025024-5ee1b9f4859a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b h1:0mm1VjtFUOIlE1SbDlwjYaDxZVDP2S5ou6y0gSgXHu8= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381 h1:VXak5I6aEWmAXeQjA+QSZzlgNrpq9mjcfDemuexIKsU= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -220,10 +324,14 @@ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208 h1:qwRHBd0NqMbJxfbotnDhm2ByMI1Shq4Y6oRJo21SGJA= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181228144115-9a3f9b0469bb/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -231,13 +339,20 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190419153524-e8e3143a4f4a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190610200419-93c9922d18ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae h1:/WDfKMnPU+m5M4xB+6x4kaepxRw6jWvR5iDRdvjHgy8= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200724161237-0e2f3a69832c h1:UIcGWL6/wpCfyGuJnRFJRurA+yj8RrW7Q6x2YMCXt6c= +golang.org/x/sys v0.0.0-20200724161237-0e2f3a69832c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -249,6 +364,18 @@ golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3 golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190420181800-aa740d480789/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190606050223-4d9ae51c2468/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190611222205-d73e1c7e250b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59 h1:QjA/9ArTfVTLfEhClDCG7SGrZkZixxWpwNCDiwJfh88= +golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191205060818-73c7173a9f7d h1:HjXQhd1u/svlhQb0V71w0I7RKZAI5Vd1lp/4FscZcJ4= +golang.org/x/tools v0.0.0-20191205060818-73c7173a9f7d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200725200936-102e7d357031 h1:VtIxiVHWPhnny2ZTi4f9/2diZKqyLaq3FUTuud5+khA= +golang.org/x/tools v0.0.0-20200725200936-102e7d357031/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0 h1:igQkv0AAhEIvTEpD5LIpAfav2eeVO9HBTjvKHVJPRSs= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= @@ -258,6 +385,8 @@ gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLks gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= +gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y= gopkg.in/go-playground/validator.v9 v9.31.0 h1:bmXmP2RSNtFES+bn4uYuHT7iJFJv7Vj+an+ZQdDaD1M= gopkg.in/go-playground/validator.v9 v9.31.0/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno= @@ -268,4 +397,8 @@ gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.7 h1:VUgggvou5XRW9mHwD/yXxIYSMtY0zoKQf/v226p2nyo= +gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/main.go b/main.go index c6f04c2..fbb1f3d 100644 --- a/main.go +++ b/main.go @@ -10,6 +10,18 @@ import ( _ "github.com/mfinancecombr/finance-wallet-api/config" ) +// @title MFinance Wallet API +// @version 0.1.0 +// @description mfinance Wallet API data. + +// @contact.name API Support +// @contact.url https://github.com/mfinancecombr/finance-wallet-api + +// @license.name BSD 3-Clause +// @license.url https://opensource.org/licenses/BSD-3-Clause + +// @host localhost:8889 +// @BasePath /api/v1 func main() { server, err := api.NewServerFromDB() if err != nil {