added documentation comments to methods

This commit is contained in:
Fran Jurmanovic
2021-08-02 10:19:58 -07:00
parent 05a13112f1
commit 0195528428
31 changed files with 175 additions and 33 deletions

View File

@@ -12,6 +12,7 @@ type TransactionTypeController struct {
TransactionTypeService *services.TransactionTypeService
}
// Initializes TransactionTypeController.
func NewTransactionTypeController(as *services.TransactionTypeService, s *gin.RouterGroup) *TransactionTypeController {
wc := new(TransactionTypeController)
wc.TransactionTypeService = as
@@ -22,6 +23,7 @@ func NewTransactionTypeController(as *services.TransactionTypeService, s *gin.Ro
return wc
}
// ROUTE (POST /transaction-types)
func (wc *TransactionTypeController) New(c *gin.Context) {
body := new(models.NewTransactionTypeBody)
if err := c.ShouldBind(body); err != nil {
@@ -33,6 +35,7 @@ func (wc *TransactionTypeController) New(c *gin.Context) {
c.JSON(200, wm)
}
// ROUTE (GET /transaction-types)
func (wc *TransactionTypeController) GetAll(c *gin.Context) {
embed, _ := c.GetQuery("embed")