fixed code documentation

This commit is contained in:
Fran Jurmanović
2021-08-29 10:51:29 +02:00
parent 655f136008
commit 72b086b2ff
35 changed files with 674 additions and 70 deletions

View File

@@ -12,7 +12,16 @@ type SubscriptionTypeService struct {
Db *pg.DB
}
// Inserts new row to subscription type table.
/*
New
Inserts new row to subscription type table.
Args:
context.Context: Application context
*models.NewSubscriptionTypeBody: Values to create new row
Returns:
*models.SubscriptionType: Created row from database.
*/
func (as *SubscriptionTypeService) New(ctx context.Context, body *models.NewSubscriptionTypeBody) *models.SubscriptionType {
db := as.Db.WithContext(ctx)
@@ -27,7 +36,16 @@ func (as *SubscriptionTypeService) New(ctx context.Context, body *models.NewSubs
return tm
}
// Gets all rows from subscription type table.
/*
GetAll
Gets all rows from subscription type table.
Args:
context.Context: Application context
string: Relations to embed
Returns:
*[]models.SubscriptionType: List of subscription type objects.
*/
func (as *SubscriptionTypeService) GetAll(ctx context.Context, embed string) *[]models.SubscriptionType {
db := as.Db.WithContext(ctx)