Skip to content

Commit

Permalink
project optimized
Browse files Browse the repository at this point in the history
  • Loading branch information
mstgnz committed Jan 18, 2023
1 parent b130966 commit af65927
Show file tree
Hide file tree
Showing 7 changed files with 675 additions and 97 deletions.
15 changes: 12 additions & 3 deletions controller/awsController.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import (
)

type IAwsController interface {
GetVaultList(c *fiber.Ctx) error
GlacierVaultList(c *fiber.Ctx) error
BucketList(c *fiber.Ctx) error
}

type myAwsController struct {
Expand All @@ -17,9 +18,17 @@ func MyAwsController(awsService service.IAwsService) IAwsController {
return &myAwsController{awsService: awsService}
}

func (ac myAwsController) GetVaultList(c *fiber.Ctx) error {
func (ac myAwsController) BucketList(c *fiber.Ctx) error {
buckets, _ := ac.awsService.ListBuckets()
return c.JSON(fiber.Map{
"error": false,
"status": true,
"result": buckets,
})
}

func (ac myAwsController) GlacierVaultList(c *fiber.Ctx) error {
return c.JSON(fiber.Map{
"status": true,
"result": ac.awsService.GlacierVaultList(),
})
}
Loading

0 comments on commit af65927

Please sign in to comment.