mirror of
https://github.com/FJurmanovic/wallet-go-api.git
synced 2026-11-11 07:41:10 +00:00
fixed code documentation
This commit is contained in:
@@ -11,7 +11,16 @@ type ApiController struct {
|
||||
ApiService *services.ApiService
|
||||
}
|
||||
|
||||
// Initializes ApiController.
|
||||
/*
|
||||
NewApiController
|
||||
|
||||
Initializes ApiController.
|
||||
Args:
|
||||
*services.ApiService: API service
|
||||
*gin.RouterGroup: Gin Router Group
|
||||
Returns:
|
||||
*ApiController: Controller for "api" interactions
|
||||
*/
|
||||
func NewApiController(as *services.ApiService, s *gin.RouterGroup) *ApiController {
|
||||
ac := new(ApiController)
|
||||
ac.ApiService = as
|
||||
@@ -22,15 +31,25 @@ func NewApiController(as *services.ApiService, s *gin.RouterGroup) *ApiControlle
|
||||
return ac
|
||||
}
|
||||
|
||||
/*
|
||||
getFirst
|
||||
Args:
|
||||
*gin.Context: Gin Application Context
|
||||
*/
|
||||
// ROUTE (GET /api).
|
||||
func (ac *ApiController) getFirst(c *gin.Context) {
|
||||
apiModel := ac.ApiService.GetFirst(c)
|
||||
c.JSON(200, apiModel)
|
||||
}
|
||||
|
||||
/*
|
||||
postMigrate
|
||||
|
||||
Requires "SECRET_CODE", "VERSION" (optional) from body.
|
||||
Args:
|
||||
*gin.Context: Gin Application Context
|
||||
*/
|
||||
// ROUTE (POST /api/migrate).
|
||||
//
|
||||
// Requires "SECRET_CODE", "VERSION" (optional) from body.
|
||||
func (ac *ApiController) postMigrate(c *gin.Context) {
|
||||
migrateModel := c.MustGet("migrate")
|
||||
version := migrateModel.(middleware.SecretCodeModel).Version
|
||||
|
||||
Reference in New Issue
Block a user